Browse Source

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

lmstack 3 years ago
parent
commit
ae99549657
2 changed files with 5 additions and 5 deletions
  1. 3 3
      LIB/BACKEND/DBManager.py
  2. 2 2
      LIB/MIDDLE/SaftyCenter/DataDiag_Static/CBMSBatDiag.py

+ 3 - 3
LIB/BACKEND/DBManager.py

@@ -172,9 +172,9 @@ class DBManager():
     def _convert_to_dataframe_gps(data, mode=0):
         if mode == 0:
             if data['info']['subType'] == 1:
-                data_block = np.array([data['info']['obdTime'],data['ffGps']['locationType'], data['ffGps']['satellites'],
-                                       data['ffGps']['latitude'],data['ffGps']['longitude'],data['ffGps']['speed'], 
-                                       data['ffGps']['altitude'], data['ffGps']['direction'], data['ffGps']['mileage']]).reshape(1,9)
+                data_block = np.array([data['info'].get('obdTime',None),data['ffGps'].get('locationType',None), data['ffGps'].get('satellites',None),
+                                       data['ffGps'].get('latitude',None),data['ffGps'].get('longitude',None),data['ffGps'].get('speed',None), 
+                                       data['ffGps'].get('altitude',None), data['ffGps'].get('direction', None), data['ffGps'].get('mileage',None)]).reshape(1,9)
                 df = pd.DataFrame(
                     columns=['时间戳','定位类型', '卫星数','纬度','经度','速度[km/h]','海拔','航向', '里程/m'],data=data_block)
             elif data['info']['subType'] == 2:

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

@@ -227,7 +227,7 @@ class BatDiag:
                     else:
                         pass
                 else:
-                    if (cellvoltmax0-cellvoltmin0)<self.param.CellVoltDiffLv1-0.05 and (cellvoltmax1-cellvoltmin1)>self.param.CellVoltDiffLv1-0.05: #二级欠压恢复
+                    if (cellvoltmax0-cellvoltmin0)<self.param.CellVoltDiffLv1-0.05 and (cellvoltmax1-cellvoltmin1)<self.param.CellVoltDiffLv1-0.05: #二级欠压恢复
                         time=self.bmstime[i]
                         self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==16].index, 'end_time'] = time
                     else:
@@ -311,7 +311,7 @@ class BatDiag:
             else:
                 if self.packcrnt[i]>self.param.PackChgOc+10:
                     time=self.bmstime[i]
-                    self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==22].index, 'end_time'] = time
+                    self.df_diag_ram.loc[self.df_diag_ram[self.df_diag_ram['code']==21].index, 'end_time'] = time
                 else:
                     pass