Eric412V 2 rokov pred
rodič
commit
c8a1b7a08f

+ 3 - 4
LIB/MIDDLE/SaftyCenter/DataDiag_Static/SC_BMSUploadError.py

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