Quellcode durchsuchen

更新温升速率报错

qingfeng vor 2 Jahren
Ursprung
Commit
e0a5311d58

+ 4 - 1
LIB/MIDDLE/CellStateEstimation/BatSafetyAlarm/V1_0_1/CBMSSafetyAlarm.py

@@ -110,7 +110,10 @@ class SafetyAlarm:
                     
                     #温升判断.............................................................................................................................
                     delttime=(time2-time1).total_seconds()
-                    celltemp_rate=(max(temp2-temp1)*60)/delttime    #计算最大温升速率
+                    if delttime>1:
+                        celltemp_rate=(max(temp2-temp1)*60)/delttime    #计算最大温升速率
+                    else:
+                        celltemp_rate=0
                     if celltemp_rate>self.param.TrwTempRate and self.param.CellTempLwLmt<min(temp1) and max(temp1)<self.param.CellTempUpLmt:
                         celltemprise=celltemprise+1
                     else: