|
@@ -13,7 +13,7 @@ from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import DBDownload as DBDownloa
|
|
from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import log
|
|
from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import log
|
|
from pandas.core.frame import DataFrame
|
|
from pandas.core.frame import DataFrame
|
|
import datacompy
|
|
import datacompy
|
|
-from LIB.MIDDLE.SaftyCenter.Common import QX_BatteryParam
|
|
|
|
|
|
+from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import BatParam as QX_BatteryParam
|
|
from LIB.MIDDLE.SaftyCenter.Common import DBDownload as DBDw
|
|
from LIB.MIDDLE.SaftyCenter.Common import DBDownload as DBDw
|
|
|
|
|
|
#...................................电池包电芯安全诊断函数......................................................................................................................
|
|
#...................................电池包电芯安全诊断函数......................................................................................................................
|
|
@@ -61,7 +61,7 @@ def diag_cal():
|
|
print('SN:{},未找到对应电池类型!!!'.format(sn))
|
|
print('SN:{},未找到对应电池类型!!!'.format(sn))
|
|
continue
|
|
continue
|
|
# sys.exit()
|
|
# sys.exit()
|
|
- param=QX_BatteryParam.BatteryInfo(celltype)
|
|
|
|
|
|
+ param=QX_BatteryParam.BatParam(celltype)
|
|
#读取原始数据库数据........................................................................................................................................................
|
|
#读取原始数据库数据........................................................................................................................................................
|
|
dbManager = DBManager.DBManager()
|
|
dbManager = DBManager.DBManager()
|
|
df_data = dbManager.get_data(sn=sn, start_time=start_time, end_time=end_time, data_groups=['bms'])
|
|
df_data = dbManager.get_data(sn=sn, start_time=start_time, end_time=end_time, data_groups=['bms'])
|
|
@@ -123,20 +123,25 @@ def DaTa_Sta_Week_Task():
|
|
task_on=1
|
|
task_on=1
|
|
factory_info=['骑享','金茂换电']
|
|
factory_info=['骑享','金茂换电']
|
|
all_period_fault_info=DataFrame(columns=['factory','week','level1_count','level2_count','level3_count','level4_count','level5_count','solve_rate'])
|
|
all_period_fault_info=DataFrame(columns=['factory','week','level1_count','level2_count','level3_count','level4_count','level5_count','solve_rate'])
|
|
- toweek='Week'+time.strftime('%W')
|
|
|
|
- host='rm-bp10j10qy42bzy0q77o.mysql.rds.aliyuncs.com'
|
|
|
|
- port=3306
|
|
|
|
- db='safety_platform'
|
|
|
|
- user='qx_algo_readonly'
|
|
|
|
- password='qx@123456'
|
|
|
|
- mode=2
|
|
|
|
- tablename1='all_fault_info'
|
|
|
|
- DBRead=DBDw.DBDownload(host, port, db, user, password,mode)
|
|
|
|
- with DBRead as DBRead:
|
|
|
|
- df_fltinfo=DBRead.getdata('product_id','level','code','start_time','end_time','batpos','factory',tablename=tablename1,factory='',sn='',timename='',st='',sp='')#dbdownload经过了改编
|
|
|
|
|
|
+ df_fltinfopt=DataFrame(columns=['product_id','level','code','start_time','end_time','batpos','factory'])
|
|
|
|
+ for i in range (0,len(factory_info)):
|
|
|
|
+ host='rm-bp10j10qy42bzy0q77o.mysql.rds.aliyuncs.com'
|
|
|
|
+ port=3306
|
|
|
|
+ db='safety_platform'
|
|
|
|
+ user='qx_algo_readonly'
|
|
|
|
+ password='qx@123456'
|
|
|
|
+ mode=2
|
|
|
|
+ tablename1='all_fault_info'
|
|
|
|
+ DBRead=DBDw.DBDownload(host, port, db, user, password,mode)
|
|
|
|
+ with DBRead as DBRead:
|
|
|
|
+ df_fltinfo=DBRead.getdata('product_id','level','code','start_time','end_time','batpos','factory',tablename=tablename1,factory=factory_info[i],sn='',timename='',st='',sp='')#dbdownload经过了改编
|
|
|
|
+ df_fltinfopt=df_fltinfopt.append(df_fltinfo)
|
|
|
|
+ df_fltinfopt=df_fltinfopt.reset_index(drop=True)
|
|
|
|
+ print(df_fltinfopt)
|
|
#............................获取数据................................
|
|
#............................获取数据................................
|
|
for j in range(0,len(factory_info)):
|
|
for j in range(0,len(factory_info)):
|
|
- df_fltinfo=df_fltinfo[df_fltinfo['factory']==factory_info[j]]
|
|
|
|
|
|
+ toweek='Week'+time.strftime('%W')
|
|
|
|
+ df_fltinfo=df_fltinfopt[df_fltinfopt['factory']==factory_info[j]]
|
|
#............................获取时间................................
|
|
#............................获取时间................................
|
|
end_time=datetime.datetime.now()
|
|
end_time=datetime.datetime.now()
|
|
# end_time=datetime.datetime.strptime(end_time,'%Y-%m-%d')
|
|
# end_time=datetime.datetime.strptime(end_time,'%Y-%m-%d')
|
|
@@ -154,7 +159,7 @@ def DaTa_Sta_Week_Task():
|
|
all_period_fault_info.loc[j,'week']=toweek
|
|
all_period_fault_info.loc[j,'week']=toweek
|
|
all_period_fault_info.loc[j,'solve_rate']=FltAlarmInfo.loc[0,'OprationManageRate']
|
|
all_period_fault_info.loc[j,'solve_rate']=FltAlarmInfo.loc[0,'OprationManageRate']
|
|
all_period_fault_info.fillna(0,inplace=False)
|
|
all_period_fault_info.fillna(0,inplace=False)
|
|
-
|
|
|
|
|
|
+ print(all_period_fault_info)
|
|
task_on=0
|
|
task_on=0
|
|
def DaTa_Sta_Minutes_Task():
|
|
def DaTa_Sta_Minutes_Task():
|
|
task_on=1
|
|
task_on=1
|