Przeglądaj źródła

Merge remote-tracking branch 'origin/dev' into pro

lmstack 3 lat temu
rodzic
commit
aef2fed7fa

+ 1 - 1
LIB/MIDDLE/CellStateEstimation/Common/V2.0.0/BatParam.py → LIB/MIDDLE/CellStateEstimation/Common/V1_0_1/BatParam.py

@@ -166,7 +166,7 @@ class BatParam:
             self.PackFullChrgVolt=69.99
             self.CellFullChrgVolt=3.5
             self.CellFullChrgCrnt=-20
-            self.OcvInflexionBelow=3.285
+            self.OcvInflexionBelow=3.281
             self.OcvInflexion2=3.296
             self.OcvInflexion3=3.328
             self.OcvInflexionAbove=3.4

+ 4 - 12
LIB/MIDDLE/CellStateEstimation/Common/V2.0.0/DBDownload.py → LIB/MIDDLE/CellStateEstimation/Common/V1_0_1/DBDownload.py

@@ -34,22 +34,14 @@ class DBDownload:
                 print('数据库连接成功!')
                 self.cursor = self.conn.cursor()
 
-    def getdata(self,*param,tablename,sn,timename,st,sp):
+    def getdata(self,param,tablename,sn,timename,st,sp):
         print('数据获取中......')
-        param=list(param)
-        str=''
-        for i in range(len(param)):
-            if i<1:
-                str=str+param[i]
-            else:
-                str=str+','+param[i]
         if self.mode==1:
-            self.cursor.execute("select %s from %s where sn='%s' order by id desc limit 1" %(str,tablename,sn))
+            self.cursor.execute("select %s from %s where sn='%s' order by id desc limit 1" %(param,tablename,sn))
         else:
-            self.cursor.execute("select %s from %s where sn='%s' and %s between '%s' and '%s'" %(str,tablename,sn,timename,st,sp))
+            self.cursor.execute("select %s from %s where sn='%s' and %s between '%s' and '%s'" %(param,tablename,sn,timename,st,sp))
         res = self.cursor.fetchall()
-        df_res = pd.DataFrame(res, columns=param)
-        df_res = df_res.reset_index(drop=True)
+        df_res = pd.DataFrame(res, columns=param.split(','))
         return(df_res)
 
     def close(self):

+ 0 - 0
LIB/MIDDLE/CellStateEstimation/Common/V2.0.0/log.py → LIB/MIDDLE/CellStateEstimation/Common/V1_0_1/log.py


+ 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: