瀏覽代碼

更新common文件

qingfeng 3 年之前
父節點
當前提交
686ad43ccc

+ 1 - 1
LIB/MIDDLE/CellStateEstimation/Common/V2/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/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/log.py → LIB/MIDDLE/CellStateEstimation/Common/V1_0_1/log.py