Commit 0d11a2d5 刘韬

启动后首次执行sensorChange

1 个父辈 766a51a0
...@@ -235,6 +235,8 @@ def serverboard(): ...@@ -235,6 +235,8 @@ def serverboard():
global last_sensor_dict global last_sensor_dict
global lastupdatetime global lastupdatetime
global ServerAliveTime global ServerAliveTime
global sensorChangeFirstRun
sensorChangeFirstRun = True
# serial_cf = ReadConfig() # serial_cf = ReadConfig()
command = "" command = ""
# addrs = serial_cf.get_serial("addrs") # addrs = serial_cf.get_serial("addrs")
...@@ -473,7 +475,7 @@ def filter_ng(in_loc,out_loc): ...@@ -473,7 +475,7 @@ 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
...@@ -482,6 +484,7 @@ def send_loc_server(in_loc,out_loc): ...@@ -482,6 +484,7 @@ 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():
...@@ -490,11 +493,11 @@ def send_loc_server(in_loc,out_loc): ...@@ -490,11 +493,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 len(in_loc)==0 and len(out_loc)==0 and len(in_ng_loc)==0 and len(out_ng_loc)==0 : 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 :
print("send_loc_server,nochange") print("send_loc_server,nochange")
return return
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}
......
...@@ -10,7 +10,7 @@ basepath = os.path.dirname(__file__) ...@@ -10,7 +10,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.873" return "1.874"
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!