Commit 0d11a2d5 刘韬

启动后首次执行sensorChange

1 个父辈 766a51a0
......@@ -235,6 +235,8 @@ def serverboard():
global last_sensor_dict
global lastupdatetime
global ServerAliveTime
global sensorChangeFirstRun
sensorChangeFirstRun = True
# serial_cf = ReadConfig()
command = ""
# addrs = serial_cf.get_serial("addrs")
......@@ -473,7 +475,7 @@ def filter_ng(in_loc,out_loc):
logging.warning('入库ng恢复:{}'.format(out))
return in_loc,out_loc
sensorChangeFirstRun=True
# 发送入库/出库库位到服务器
def send_loc_server(in_loc,out_loc):
# http://ip/smdbox/service/store/sensorShelf/sensorChange
......@@ -482,6 +484,7 @@ def send_loc_server(in_loc,out_loc):
# print ('--------------------origin_out_loc',out_loc)
global locations
global ServerErrorTimes
global sensorChangeFirstRun
in_ng_loc = []
out_ng_loc = []
for locnum, locvalue in locations.items():
......@@ -490,11 +493,11 @@ def send_loc_server(in_loc,out_loc):
if locvalue['outloc_ng']:
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")
return
sensorChangeFirstRun=False
headers = {'content-type': "application/x-www-form-urlencoded"}
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}
......
......@@ -10,7 +10,7 @@ basepath = os.path.dirname(__file__)
shelfconfigfile = basepath+"/../" + Config.STATE_PATH+'shelfconfig.pkl'
def ver():
return "1.873"
return "1.874"
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!