Przeglądaj źródła

更改end_time时间戳形式

Eric412V 3 lat temu
rodzic
commit
d980bf404f

+ 7 - 5
LIB/MIDDLE/SaftyCenter/CellValueDiag/V1_0_0/SC_SamplingSafty.py

@@ -306,12 +306,14 @@ class SamplingSafty:
         minOtherTempt=91
         ErrorFlg=0
         TotalOtherTemp=0
+        MaxOtherBatNo=0
+        MinOtherBatNo=0
         if param.OtherTempNums>0:
             for t in range(0,param.OtherTempNums):
                 BatNo=['其他温度'+str(t+1)]
                 maxOtherTemp=max(maxOtherTempt,float(bms_infoN[BatNo]))
                 if maxOtherTemp>maxOtherTempt:
-                    MaxBatNo=t+1
+                    MaxOtherBatNo=t+1
                     maxOtherTempt=maxOtherTemp
                 if float(bms_infoN[BatNo])>param.OtherOTlmt:
                     InVMaxOtherTempBatNo.append(t+1)                   
@@ -319,7 +321,7 @@ class SamplingSafty:
                     pass
                 minOtherTemp=min(minOtherTempt,float(bms_infoN[BatNo]))
                 if minOtherTemp<minOtherTempt:
-                    MinBatNo=t+1
+                    MinOtherBatNo=t+1
                     minOtherTempt=minOtherTemp
                 if float(bms_infoN[BatNo])<param.OtherUTlmt:
                     InVMinOtherTempBatNo.append(t+1)                   
@@ -335,7 +337,7 @@ class SamplingSafty:
                 if minOtherTemp<param.OtherUTlmt:
                     QuitErrCount[54]=0
                     if not 54 in df_Diag_Ram['code'].values.tolist():#如果故障发生当前故障中没有该故障,则压入该故障
-                        df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,54,3,'其他温度采样断线,最高温度为{}℃,传感器编号为{},最低温度为{}℃,传感器编号为{}'.format(maxOtherTemp,MaxBatNo,minOtherTemp,MinBatNo),'返厂维修']
+                        df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,54,3,'其他温度采样断线,最高温度为{}℃,传感器编号为{},最低温度为{}℃,传感器编号为{}'.format(maxOtherTemp,MaxOtherBatNo,minOtherTemp,MinOtherBatNo),'返厂维修']
                         
                         ErrorFlg=1            
                     else:#如果故障发生当前故障中有该故障,则不进行操作
@@ -354,7 +356,7 @@ class SamplingSafty:
                     else:
                         pass
                     if not 55 in df_Diag_Ram['code'].values.tolist():
-                        df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,55,3,str(InVMaxBatNo)+'号传感器温度大于{}℃,采样无效'.format(param.OtherOTlmt),'联系用户核实电池情况,并返厂维修']
+                        df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,55,3,str(InVMaxOtherTempBatNo)+'号传感器温度大于{}℃,采样无效'.format(param.OtherOTlmt),'联系用户核实电池情况,并返厂维修']
                         
                         ErrorFlg=1
                     else:
@@ -362,7 +364,7 @@ class SamplingSafty:
             elif minOtherTemp<param.OtherUTlmt:
                 QuitErrCount[55]=0
                 if not 55 in df_Diag_Ram['code'].values.tolist():
-                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,55,3,str(InVMinBatNo)+'号传感器温度小于{}℃,采样无效'.format(param.OtherUTlmt),'返厂维修']
+                    df_Diag_Ram.loc[len(df_Diag_Ram)]=[bms_infoN['时间戳'],'0000-00-00 00:00:00',sn,55,3,str(InVMinOtherTempBatNo)+'号传感器温度小于{}℃,采样无效'.format(param.OtherUTlmt),'返厂维修']
                     
                     ErrorFlg=1
                 else: