|
@@ -3,6 +3,7 @@ from SC_SamplingSafty import SamplingSafty
|
|
from DataStatistics import DataSta
|
|
from DataStatistics import DataSta
|
|
from DiagDataMerge import DiagDataMerge
|
|
from DiagDataMerge import DiagDataMerge
|
|
from SC_CtrlSafty import CtrlSafty
|
|
from SC_CtrlSafty import CtrlSafty
|
|
|
|
+from SC_BMSUploadError import BMSReportError
|
|
import datetime
|
|
import datetime
|
|
import pandas as pd
|
|
import pandas as pd
|
|
from LIB.BACKEND import DBManager, Log
|
|
from LIB.BACKEND import DBManager, Log
|
|
@@ -47,16 +48,22 @@ def diag_cal():
|
|
print(sn)
|
|
print(sn)
|
|
if 'PK500' in sn:
|
|
if 'PK500' in sn:
|
|
celltype=1 #6040三元电芯
|
|
celltype=1 #6040三元电芯
|
|
|
|
+ FactoryType=1
|
|
elif 'PK502' in sn:
|
|
elif 'PK502' in sn:
|
|
celltype=2 #4840三元电芯
|
|
celltype=2 #4840三元电芯
|
|
|
|
+ FactoryType=1
|
|
elif 'K504B' in sn:
|
|
elif 'K504B' in sn:
|
|
celltype=99 #60ah林磷酸铁锂电芯
|
|
celltype=99 #60ah林磷酸铁锂电芯
|
|
|
|
+ FactoryType=1
|
|
elif 'MGMLXN750' in sn:
|
|
elif 'MGMLXN750' in sn:
|
|
celltype=3 #力信50ah三元电芯
|
|
celltype=3 #力信50ah三元电芯
|
|
|
|
+ FactoryType=3
|
|
elif ('MGMCLN750' or 'UD') in sn:
|
|
elif ('MGMCLN750' or 'UD') in sn:
|
|
celltype=4 #CATL 50ah三元电芯
|
|
celltype=4 #CATL 50ah三元电芯
|
|
|
|
+ FactoryType=2
|
|
elif 'TJMCL'in sn:
|
|
elif 'TJMCL'in sn:
|
|
celltype=100 #CATL 50ah三元电芯
|
|
celltype=100 #CATL 50ah三元电芯
|
|
|
|
+ FactoryType=0
|
|
else:
|
|
else:
|
|
print('SN:{},未找到对应电池类型!!!'.format(sn))
|
|
print('SN:{},未找到对应电池类型!!!'.format(sn))
|
|
continue
|
|
continue
|
|
@@ -94,7 +101,7 @@ def diag_cal():
|
|
DBRead=DBDw.DBDownload(host, port, db, user, password,mode)
|
|
DBRead=DBDw.DBDownload(host, port, db, user, password,mode)
|
|
with DBRead as DBRead:
|
|
with DBRead as DBRead:
|
|
df_OprtnSta=DBRead.getdata('qrcode','status', tablename=tablename1, sn=sn, timename='', st='', sp='',factory='')#取最后一条运营状态
|
|
df_OprtnSta=DBRead.getdata('qrcode','status', tablename=tablename1, sn=sn, timename='', st='', sp='',factory='')#取最后一条运营状态
|
|
-
|
|
|
|
|
|
+ errorcode_map=DataFrame()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -109,7 +116,8 @@ def diag_cal():
|
|
if not df_bms.empty:
|
|
if not df_bms.empty:
|
|
df_Diag_Batdiag_update_xq=SamplingSafty.main(sn,param,df_bms,CellFltInfo)#采样安全
|
|
df_Diag_Batdiag_update_xq=SamplingSafty.main(sn,param,df_bms,CellFltInfo)#采样安全
|
|
df_Diag_Batdiag_update_xq2=CtrlSafty.main(sn,param,df_bms,df_Diag_Batdiag_update_xq)#控制安全
|
|
df_Diag_Batdiag_update_xq2=CtrlSafty.main(sn,param,df_bms,df_Diag_Batdiag_update_xq)#控制安全
|
|
- batDiag=CBMSBatDiag.BatDiag(sn,celltype,df_bms, df_soh, df_uniform, df_Diag_Batdiag_update_xq2)#鹏飞计算
|
|
|
|
|
|
+ batDiag2=CBMSBatDiag.BatDiag(sn,celltype,df_bms, df_soh, df_uniform, df_Diag_Batdiag_update_xq2)#鹏飞计算
|
|
|
|
+ batDiag=BMSReportError.main(sn,df_bms,batDiag2,FactoryType,errorcode_map)
|
|
df_Diag_Batdiag_update=batDiag.diag()
|
|
df_Diag_Batdiag_update=batDiag.diag()
|
|
# df_Diag_Batdiag_update=BatDiag.diag()
|
|
# df_Diag_Batdiag_update=BatDiag.diag()
|
|
else:
|
|
else:
|