test.py 742 B

1234567891011121314151617181920212223242526272829
  1. <<<<<<< HEAD
  2. import time,datetime
  3. import dateutil.relativedelta
  4. now_time = datetime.datetime.now()
  5. pre_time = now_time + dateutil.relativedelta.relativedelta(weeks=-2)
  6. print(now_time, pre_time)
  7. =======
  8. # 获取数据
  9. import sys
  10. from LIB.BACKEND import DBManager
  11. from LIB.BACKEND import DataPreProcess
  12. dataPrePro = DataPreProcess.DataPreProcess()
  13. sn = "MGMCLN750N215N097"
  14. st = '2022-01-01 00:00:00'
  15. et = '2022-03-01 00:00:00'
  16. dbManager = DBManager.DBManager()
  17. df_data = dbManager.get_data(sn=sn, start_time=st, end_time=et, data_groups=['bms', 'gps', 'accum', 'system'])
  18. #
  19. df_bms = df_data['bms']
  20. df_gps = df_data['gps']
  21. df_accum = df_data['accum']
  22. df_system = df_data['system']
  23. df_bms = dataPrePro.data_fault_tag(sn,df_bms)
  24. >>>>>>> dev