Explorar o código

SOC跳变报警软件debug

Eric412V %!s(int64=3) %!d(string=hai) anos
pai
achega
1209eda12e
Modificáronse 1 ficheiros con 10 adicións e 10 borrados
  1. 10 10
      LIB/MIDDLE/SaftyCenter/DataDiag_Static/CBMSBatDiag.py

+ 10 - 10
LIB/MIDDLE/SaftyCenter/DataDiag_Static/CBMSBatDiag.py

@@ -346,10 +346,10 @@ class BatDiag:
                 pass
 
             #SOC跳变....................................................................................................................
-            if step<30: 
-                bmssoc_last=float(self.bms_soc[i-1])
-                bmssoc_now=float(self.bms_soc[i])
-                if not 28 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+            if not 28 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障
+                if step<30: 
+                    bmssoc_last=float(self.bms_soc[i-1])
+                    bmssoc_now=float(self.bms_soc[i])
                     if abs(bmssoc_now-bmssoc_last)>self.param.SocJump:  #SOC跳变进入
                         time=self.bmstime[i]
                         code=28
@@ -360,13 +360,13 @@ class BatDiag:
                     else:
                         pass
                 else:   
-                    if abs(bmssoc_now-bmssoc_st)<self.param.SocJump:    #SOC跳变故障退出
-                        time=self.bmstime[i]
-                        self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==28].index, 'end_time'] = time
-                    else:
-                        pass
+                    pass
             else:
-                pass
+                if abs(bmssoc_now-bmssoc_st)<self.param.SocJump:    #SOC跳变故障退出
+                    time=self.bmstime[i]
+                    self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==28].index, 'end_time'] = time
+                else:
+                    pass
 
             # #SOC过低故障报警............................................................................................................
             # if not 26 in list(self.df_diag_ram['code']):  #当前故障中没有该故障,则判断是否发生该故障