update one2n.py
This commit is contained in:
@ -321,6 +321,8 @@ def read_process(filePath):
|
||||
|
||||
|
||||
def read_similar(filePath):
|
||||
'''1:n时 Dict['type']字段提取和非全实时不一致,无 "=" 字符 '''
|
||||
|
||||
SimiDict = {}
|
||||
SimiDict['one2one'] = []
|
||||
SimiDict['one2SN'] = []
|
||||
@ -386,7 +388,7 @@ def read_similar(filePath):
|
||||
Dict['event'] = label
|
||||
Dict['barcode'] = bcd
|
||||
Dict['similar'] = float(value.split(',')[0])
|
||||
Dict['type'] = value.split('=')[-1]
|
||||
Dict['type'] = value.split(',')[1]
|
||||
one2n_list.append(Dict)
|
||||
|
||||
if len(one2one_list): SimiDict['one2one'] = one2one_list
|
||||
@ -403,8 +405,6 @@ def read_weight_sensor(filepath):
|
||||
for i, line in enumerate(clean_lines):
|
||||
line = line.strip()
|
||||
|
||||
line = line.strip()
|
||||
|
||||
if line.find(':') < 0: continue
|
||||
if line.find("Weight") >= 0:
|
||||
label = "Weight"
|
||||
@ -415,7 +415,7 @@ def read_weight_sensor(filepath):
|
||||
value = line.split(':')[1]
|
||||
|
||||
if label == "Weight":
|
||||
vdata = [float(s) for s in value.split(',') if len(s)]
|
||||
vdata = [float(s) for s in value.split(',') if len(s) and s.isdigit()]
|
||||
WeightDict[keyword] = vdata[-1]
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user