|
@@ -52,10 +52,8 @@ class BMSReportError:
|
|
nCode=int(math.pow(2,power))
|
|
nCode=int(math.pow(2,power))
|
|
newCode.append(nCode)
|
|
newCode.append(nCode)
|
|
code=code-nCode
|
|
code=code-nCode
|
|
- newCode_total.append(nCode)
|
|
|
|
elif code>0:
|
|
elif code>0:
|
|
newCode=newCode.append(code)
|
|
newCode=newCode.append(code)
|
|
- newCode_total.append(code)
|
|
|
|
else:
|
|
else:
|
|
newCode=[]
|
|
newCode=[]
|
|
else:
|
|
else:
|
|
@@ -63,7 +61,6 @@ class BMSReportError:
|
|
else:
|
|
else:
|
|
newCode=df_bms.loc[i,'故障代码']
|
|
newCode=df_bms.loc[i,'故障代码']
|
|
if not pd.isnull(newCode) and newCode!=0:
|
|
if not pd.isnull(newCode) and newCode!=0:
|
|
- newCode_total.append(newCode)
|
|
|
|
newCode=[newCode]
|
|
newCode=[newCode]
|
|
else:
|
|
else:
|
|
newCode=[]
|
|
newCode=[]
|
|
@@ -92,10 +89,12 @@ class BMSReportError:
|
|
|
|
|
|
code = newCode[j] # 终端故障码
|
|
code = newCode[j] # 终端故障码
|
|
platform_code = errorcode_map[(errorcode_map['protocol']==FactoryType)&(errorcode_map['end_errorcode']==str(code))]['platform_errorcode']
|
|
platform_code = errorcode_map[(errorcode_map['protocol']==FactoryType)&(errorcode_map['end_errorcode']==str(code))]['platform_errorcode']
|
|
|
|
+
|
|
# db_engine.dispose()
|
|
# db_engine.dispose()
|
|
if len(platform_code) == 0:
|
|
if len(platform_code) == 0:
|
|
pass
|
|
pass
|
|
- else:
|
|
|
|
|
|
+ else:
|
|
|
|
+ newCode_total.append(platform_code.values[0])
|
|
newCode[j]=platform_code.values[0]
|
|
newCode[j]=platform_code.values[0]
|
|
if not platform_code.values[0] in df_Diag_Ram_BMS['code'].values.tolist():
|
|
if not platform_code.values[0] in df_Diag_Ram_BMS['code'].values.tolist():
|
|
df_Diag_Ram_BMS.loc[len(df_Diag_Ram_BMS)]=[df_bms.loc[i,'时间戳'],'0000-00-00 00:00:00',sn,platform_code.values[0],df_bms.loc[i,'故障等级'],'','']
|
|
df_Diag_Ram_BMS.loc[len(df_Diag_Ram_BMS)]=[df_bms.loc[i,'时间戳'],'0000-00-00 00:00:00',sn,platform_code.values[0],df_bms.loc[i,'故障等级'],'','']
|