Commit 1286c3b0 刘韬

单双面灯塔配置

1 个父辈 48c1a495
正在显示 50 个修改的文件 包含 50 行增加19 行删除
...@@ -297,6 +297,9 @@ def get_towerstate(): ...@@ -297,6 +297,9 @@ def get_towerstate():
'1@4':{'action':False,'status':'off'}, '1@4':{'action':False,'status':'off'},
'2@5':{'action':False,'status':'off'}, '2@5':{'action':False,'status':'off'},
'3@6':{'action':True,'status':'on'}, '3@6':{'action':True,'status':'on'},
'1@1':{'action':False,'status':'off'},
'2@2':{'action':False,'status':'off'},
'3@3':{'action':True,'status':'on'},
'1':{'action':False,'status':'off'}, '1':{'action':False,'status':'off'},
'2':{'action':False,'status':'off'}, '2':{'action':False,'status':'off'},
'3':{'action':True,'status':'on'}, '3':{'action':True,'status':'on'},
......
...@@ -443,7 +443,7 @@ def compare_detail(cur_dict): ...@@ -443,7 +443,7 @@ def compare_detail(cur_dict):
logging.warning("{} blink no opetion ".format(locnumber)) logging.warning("{} blink no opetion ".format(locnumber))
else: else:
#库位无料,且与服务器一致,关灯 #库位无料,且与服务器一致,关灯
if not locations[locnumber]['color'] == 'off': if not locations[locnumber]['color'] == 'off' or locations[locnumber]['inloc_ng']:
locations[locnumber]['outloc_ng'] = False locations[locnumber]['outloc_ng'] = False
locations[locnumber]['inloc_ng'] = False locations[locnumber]['inloc_ng'] = False
locations[locnumber]['color'] = 'off' locations[locnumber]['color'] = 'off'
...@@ -801,9 +801,14 @@ def send_tower_status_light(): ...@@ -801,9 +801,14 @@ def send_tower_status_light():
#1@4 红色 #1@4 红色
#3@6 绿色 #3@6 绿色
#2@5 黄色 #2@5 黄色
RedTWLed = '1@4' if shelfconfig.single_side_tower:
YellowTWLed = '2@5' RedTWLed = '1@1'
GreenTWLed = '3@6' YellowTWLed = '2@2'
GreenTWLed = '3@3'
else:
RedTWLed = '1@4'
YellowTWLed = '2@5'
GreenTWLed = '3@6'
def update_tower(blink_status,ng_status): def update_tower(blink_status,ng_status):
global tower_state global tower_state
global ServerErrorTimes global ServerErrorTimes
......
...@@ -11,7 +11,7 @@ basepath = os.path.dirname(__file__) ...@@ -11,7 +11,7 @@ basepath = os.path.dirname(__file__)
shelfconfigfile = basepath+"/../" + Config.STATE_PATH+'shelfconfig.pkl' shelfconfigfile = basepath+"/../" + Config.STATE_PATH+'shelfconfig.pkl'
def ver(): def ver():
return "1.876" return "1.9"
class _shelfconfig: class _shelfconfig:
def __init__(self): def __init__(self):
...@@ -25,6 +25,7 @@ class _shelfconfig: ...@@ -25,6 +25,7 @@ class _shelfconfig:
self.comport_carsh_reboot=False self.comport_carsh_reboot=False
self.after_induction_preshow_color='white' self.after_induction_preshow_color='white'
self.inok_blink_times=4; self.inok_blink_times=4;
self.single_side_tower=False;
def Save(self): def Save(self):
with open(shelfconfigfile, 'wb') as f: with open(shelfconfigfile, 'wb') as f:
pickle.dump(self, f) pickle.dump(self, f)
......
...@@ -18163,3 +18163,7 @@ KeyError: 'code' ...@@ -18163,3 +18163,7 @@ KeyError: 'code'
2023-08-18 11:22:47,454 - WARNING : ('---异常---:', SerialException("could not open port '1': FileNotFoundError(2, '系统找不到指定的文件。', None, 2)")) 2023-08-18 11:22:47,454 - WARNING : ('---异常---:', SerialException("could not open port '1': FileNotFoundError(2, '系统找不到指定的文件。', None, 2)"))
2024-01-10 11:45:48,511 - WARNING : config:D:\rick\python\induction_shelf\smartshelf\app/state/, ip&cid...:{'post': 'wait', 'ip': 'http://192.168.1.243/smf-core', 'cid': 'S10392'} 2024-01-10 11:45:48,511 - WARNING : config:D:\rick\python\induction_shelf\smartshelf\app/state/, ip&cid...:{'post': 'wait', 'ip': 'http://192.168.1.243/smf-core', 'cid': 'S10392'}
2024-01-10 11:46:49,513 - WARNING : config:D:\rick\python\induction_shelf\smartshelf\app/state/, ip&cid...:{'post': 'wait', 'ip': 'http://192.168.1.243/smf-core', 'cid': 'S10392'} 2024-01-10 11:46:49,513 - WARNING : config:D:\rick\python\induction_shelf\smartshelf\app/state/, ip&cid...:{'post': 'wait', 'ip': 'http://192.168.1.243/smf-core', 'cid': 'S10392'}
2024-04-26 09:10:10,048 - WARNING : config:D:\rick\python\induction_shelf\smartshelf\app/state/, ip&cid...:{'post': 'wait', 'ip': 'http://192.168.1.243/smf-core', 'cid': 'S10392'}
2024-04-26 09:10:29,959 - WARNING : ('---异常---:', SerialException("could not open port '1': FileNotFoundError(2, '系统找不到指定的文件。', None, 2)"))
2024-04-26 09:10:49,427 - WARNING : config:D:\rick\python\induction_shelf\smartshelf\app/state/, ip&cid...:{'post': 'wait', 'ip': 'http://192.168.1.243/smf-core', 'cid': 'S10392'}
2024-04-26 09:10:51,072 - WARNING : ('---异常---:', SerialException("could not open port '1': FileNotFoundError(2, '系统找不到指定的文件。', None, 2)"))
此文件类型无法预览
...@@ -57,6 +57,17 @@ ...@@ -57,6 +57,17 @@
the contents of this method with the code editor. the contents of this method with the code editor.
</summary> </summary>
</member> </member>
<member name="P:ConfigHelper.CheckedListBoxEx.DataSource">
<summary>
绑定数据源
</summary>
<param name="data"></param>
</member>
<member name="T:ConfigHelper.CheckItem">
<summary>
Represents an item in the checklistbox
</summary>
</member>
<member name="T:ConfigHelper.Config"> <member name="T:ConfigHelper.Config">
<summary> <summary>
自定义配置存取 自定义配置存取
......
...@@ -20,7 +20,6 @@ from app.utils.serial_communication import SerialCommunication ...@@ -20,7 +20,6 @@ from app.utils.serial_communication import SerialCommunication
from app.induction_config import read_addrs,ip_config,testCidExists from app.induction_config import read_addrs,ip_config,testCidExists
#from serial_config import ReadConfig #from serial_config import ReadConfig
from app.utils.location import Location from app.utils.location import Location
config_dict,convert_dict = Location().read_location_file() config_dict,convert_dict = Location().read_location_file()
sensorindex={} sensorindex={}
print('convert_dict',convert_dict) print('convert_dict',convert_dict)
...@@ -328,6 +327,7 @@ def ProcessLastSensor(cur_dict,last_sensor_dict): ...@@ -328,6 +327,7 @@ def ProcessLastSensor(cur_dict,last_sensor_dict):
if len(list)>0: if len(list)>0:
command = '{{"ADDR":{},"color":{}}}\n'.format(k[1:],list) command = '{{"ADDR":{},"color":{}}}\n'.format(k[1:],list)
print("ProcessLastSensor",command,len(list)) print("ProcessLastSensor",command,len(list))
gg.sensorChangeFirstRun=True
ser.send_data(command,False) ser.send_data(command,False)
return True return True
else: else:
......
...@@ -297,6 +297,9 @@ def get_towerstate(): ...@@ -297,6 +297,9 @@ def get_towerstate():
'1@4':{'action':False,'status':'off'}, '1@4':{'action':False,'status':'off'},
'2@5':{'action':False,'status':'off'}, '2@5':{'action':False,'status':'off'},
'3@6':{'action':True,'status':'on'}, '3@6':{'action':True,'status':'on'},
'1@1':{'action':False,'status':'off'},
'2@2':{'action':False,'status':'off'},
'3@3':{'action':True,'status':'on'},
'1':{'action':False,'status':'off'}, '1':{'action':False,'status':'off'},
'2':{'action':False,'status':'off'}, '2':{'action':False,'status':'off'},
'3':{'action':True,'status':'on'}, '3':{'action':True,'status':'on'},
......
...@@ -235,8 +235,7 @@ def serverboard(): ...@@ -235,8 +235,7 @@ def serverboard():
global last_sensor_dict global last_sensor_dict
global lastupdatetime global lastupdatetime
global ServerAliveTime global ServerAliveTime
global sensorChangeFirstRun gg.sensorChangeFirstRun = True
sensorChangeFirstRun = True
# serial_cf = ReadConfig() # serial_cf = ReadConfig()
command = "" command = ""
# addrs = serial_cf.get_serial("addrs") # addrs = serial_cf.get_serial("addrs")
...@@ -444,7 +443,7 @@ def compare_detail(cur_dict): ...@@ -444,7 +443,7 @@ def compare_detail(cur_dict):
logging.warning("{} blink no opetion ".format(locnumber)) logging.warning("{} blink no opetion ".format(locnumber))
else: else:
#库位无料,且与服务器一致,关灯 #库位无料,且与服务器一致,关灯
if not locations[locnumber]['color'] == 'off': if not locations[locnumber]['color'] == 'off' or locations[locnumber]['inloc_ng']:
locations[locnumber]['outloc_ng'] = False locations[locnumber]['outloc_ng'] = False
locations[locnumber]['inloc_ng'] = False locations[locnumber]['inloc_ng'] = False
locations[locnumber]['color'] = 'off' locations[locnumber]['color'] = 'off'
...@@ -475,7 +474,6 @@ def filter_ng(in_loc,out_loc): ...@@ -475,7 +474,6 @@ def filter_ng(in_loc,out_loc):
logging.warning('入库ng恢复:{}'.format(out)) logging.warning('入库ng恢复:{}'.format(out))
return in_loc,out_loc return in_loc,out_loc
sensorChangeFirstRun=True
# 发送入库/出库库位到服务器 # 发送入库/出库库位到服务器
def send_loc_server(in_loc,out_loc): def send_loc_server(in_loc,out_loc):
# http://ip/smdbox/service/store/sensorShelf/sensorChange # http://ip/smdbox/service/store/sensorShelf/sensorChange
...@@ -484,7 +482,6 @@ def send_loc_server(in_loc,out_loc): ...@@ -484,7 +482,6 @@ def send_loc_server(in_loc,out_loc):
# print ('--------------------origin_out_loc',out_loc) # print ('--------------------origin_out_loc',out_loc)
global locations global locations
global ServerErrorTimes global ServerErrorTimes
global sensorChangeFirstRun
in_ng_loc = [] in_ng_loc = []
out_ng_loc = [] out_ng_loc = []
for locnum, locvalue in locations.items(): for locnum, locvalue in locations.items():
...@@ -493,11 +490,11 @@ def send_loc_server(in_loc,out_loc): ...@@ -493,11 +490,11 @@ def send_loc_server(in_loc,out_loc):
if locvalue['outloc_ng']: if locvalue['outloc_ng']:
out_ng_loc.append(locnum) out_ng_loc.append(locnum)
if not sensorChangeFirstRun and len(in_loc)==0 and len(out_loc)==0 and len(in_ng_loc)==0 and len(out_ng_loc)==0 : if not gg.sensorChangeFirstRun and len(in_loc)==0 and len(out_loc)==0 and len(in_ng_loc)==0 and len(out_ng_loc)==0 :
print("send_loc_server,nochange") print("send_loc_server,nochange")
return return
sensorChangeFirstRun=False gg.sensorChangeFirstRun=False
headers = {'content-type': "application/x-www-form-urlencoded"} headers = {'content-type': "application/x-www-form-urlencoded"}
url = ip_config['ip'] + '/service/store/sensorShelf/sensorChange' url = ip_config['ip'] + '/service/store/sensorShelf/sensorChange'
data = {"cid":ip_config['cid'],"hasReelPosList":in_loc,"hasReelPosErrorList": in_ng_loc,"noReelPosList":out_loc,"noReelPosErrorList":out_ng_loc} data = {"cid":ip_config['cid'],"hasReelPosList":in_loc,"hasReelPosErrorList": in_ng_loc,"noReelPosList":out_loc,"noReelPosErrorList":out_ng_loc}
...@@ -744,6 +741,7 @@ def blink_convert(blink_leds): ...@@ -744,6 +741,7 @@ def blink_convert(blink_leds):
#ser.read_alldata() #ser.read_alldata()
print("blink_convert",timeit.default_timer(),line) print("blink_convert",timeit.default_timer(),line)
#time.sleep(0.005) #time.sleep(0.005)
gg.sensorChangeFirstRun=True
# return texts # return texts
#blink_leds={} #blink_leds={}
...@@ -798,13 +796,19 @@ def send_tower_status_light(): ...@@ -798,13 +796,19 @@ def send_tower_status_light():
command_dicts = {"ADDR":"0","lighton":lightons,"lightoff":lightoffs} command_dicts = {"ADDR":"0","lighton":lightons,"lightoff":lightoffs}
maincommand = str(json.dumps(command_dicts)) + '\n' maincommand = str(json.dumps(command_dicts)) + '\n'
# print ('------------------maincommand',maincommand) # print ('------------------maincommand',maincommand)
gg.sensorChangeFirstRun=True
ser.send_data(maincommand) ser.send_data(maincommand)
#1@4 红色 #1@4 红色
#3@6 绿色 #3@6 绿色
#2@5 黄色 #2@5 黄色
RedTWLed = '1@4' if shelfconfig.single_side_tower:
YellowTWLed = '2@5' RedTWLed = '1@1'
GreenTWLed = '3@6' YellowTWLed = '2@2'
GreenTWLed = '3@3'
else:
RedTWLed = '1@4'
YellowTWLed = '2@5'
GreenTWLed = '3@6'
def update_tower(blink_status,ng_status): def update_tower(blink_status,ng_status):
global tower_state global tower_state
global ServerErrorTimes global ServerErrorTimes
......
...@@ -5,14 +5,13 @@ from config import Config ...@@ -5,14 +5,13 @@ from config import Config
current_state: string current_state: string
current_state='off' current_state='off'
sensorChangeFirstRun=True
Serl = None Serl = None
basepath = os.path.dirname(__file__) basepath = os.path.dirname(__file__)
shelfconfigfile = basepath+"/../" + Config.STATE_PATH+'shelfconfig.pkl' shelfconfigfile = basepath+"/../" + Config.STATE_PATH+'shelfconfig.pkl'
def ver(): def ver():
return "1.874" return "1.9"
class _shelfconfig: class _shelfconfig:
def __init__(self): def __init__(self):
...@@ -26,6 +25,7 @@ class _shelfconfig: ...@@ -26,6 +25,7 @@ class _shelfconfig:
self.comport_carsh_reboot=False self.comport_carsh_reboot=False
self.after_induction_preshow_color='white' self.after_induction_preshow_color='white'
self.inok_blink_times=4; self.inok_blink_times=4;
self.single_side_tower=False;
def Save(self): def Save(self):
with open(shelfconfigfile, 'wb') as f: with open(shelfconfigfile, 'wb') as f:
pickle.dump(self, f) pickle.dump(self, f)
......
此文件太大,无法显示。
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!