ソースを参照

更改项:修改调度周期,由2min修改为5min

shangguanlie23 3 年 前
コミット
9bbea25335
1 ファイル変更7 行追加7 行削除
  1. 7 7
      LIB/MIDDLE/SaftyCenter/diagfault/main.py

+ 7 - 7
LIB/MIDDLE/SaftyCenter/diagfault/main.py

@@ -10,8 +10,8 @@ from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import DBDownload
 from LIB.MIDDLE.CellStateEstimation.Common.V1_0_1 import log
 from pandas.core.frame import DataFrame
 import datacompy
-from SaftyCenter.Common import FeiShuData
-from SaftyCenter.Common import QX_BatteryParam
+from LIB.MIDDLE.SaftyCenter.Common import FeiShuData
+from LIB.MIDDLE.SaftyCenter.SaftyCenter.Common import QX_BatteryParam
 
 #...................................电池包电芯安全诊断函数......................................................................................................................
 def diag_cal():
@@ -20,7 +20,7 @@ def diag_cal():
   
     start=time.time()
     end_time=datetime.datetime.now()
-    start_time=end_time-datetime.timedelta(seconds=130)
+    start_time=end_time-datetime.timedelta(seconds=300)
     start_time=start_time.strftime('%Y-%m-%d %H:%M:%S')
     end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
     df_read_Yunw = FeiShuData.getFeiShuDATA()#运维表格数据
@@ -125,11 +125,11 @@ def diag_cal():
             df_Diag_Ram = df_temp4
             df_Diag_Ram_fix = df_Diag_Ram.loc[df_Diag_Ram['Batpos'] == 1]
             df_Diag_Ram_unfix = df_Diag_Ram.loc[df_Diag_Ram['Batpos'] == 0]
-        if len(df_Diag_Ram) > 0:
+        if len(df_Diag_Ram) > 0:#历史及现有故障
             df_Diag_Ram.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\01Screen_Problem\result.csv',index=False,encoding='GB18030')
-        if len(df_Diag_Ram_fix) > 0:
+        if len(df_Diag_Ram_fix) > 0:#故障车辆已返仓
             df_Diag_Ram_fix.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\01Screen_Problem\result_fix.csv',index=False,encoding='GB18030')
-        if len(df_Diag_Ram_unfix) > 0:
+        if len(df_Diag_Ram_unfix) > 0:#故障车辆未返仓
             df_Diag_Ram_unfix.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\01Screen_Problemm\result_unfix.csv',index=False,encoding='GB18030')
         end=time.time()
         print(end-start)
@@ -167,7 +167,7 @@ if __name__ == "__main__":
     print('-------计算中-----------')
     #定时任务.......................................................................................................................................................................
     scheduler = BlockingScheduler()
-    scheduler.add_job(diag_cal, 'interval', seconds=120, id='diag_job')
+    scheduler.add_job(diag_cal, 'interval', seconds=300, id='diag_job')
 
     try:  
         scheduler.start()