main.py 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import CBMSBatUniform
  2. import datetime
  3. import pandas as pd
  4. import datetime
  5. from USER.alibaba.Common import DBDownload
  6. from USER.alibaba.Common import log
  7. if __name__ == "__main__":
  8. SNnums= ['HUATING01']
  9. end_time=datetime.datetime.now()-datetime.timedelta(seconds=10)
  10. start_time=end_time-datetime.timedelta(seconds=12000)
  11. start_time=start_time.strftime('%Y-%m-%d %H:%M:%S')
  12. end_time=end_time.strftime('%Y-%m-%d %H:%M:%S')
  13. #log信息配置............................................................................................................................................................................
  14. mylog=log.Mylog('log_uniform.txt','error')
  15. mylog.logcfg()
  16. for sn in SNnums:
  17. try:
  18. # if 'PK500' in sn:
  19. # celltype=1 #6040三元电芯
  20. # elif 'PK502' in sn:
  21. # celltype=2 #4840三元电芯
  22. # elif 'PK504' in sn:
  23. # celltype=99 #60ah林磷酸铁锂电芯
  24. # elif 'MGMLXN750' in sn:
  25. # celltype=3 #力信50ah三元电芯
  26. # elif 'MGMCLN750' in sn:
  27. # celltype=4 #CATL 50ah三元电芯
  28. # else:
  29. # print('未找到对应电池编号!!!\n',sn)
  30. # # sys.exit()
  31. celltype=2
  32. #............................................................读取原始数据库数据...........................................................................
  33. df_bms= pd.read_excel(r'D:\00WorkSpace\01Python\data_analyze_platform\USER\alibaba\98Download\18650-SOH原始数据.xlsx')
  34. #..............................................................计算一致性..............................................................................
  35. BatUniform=CBMSBatUniform.BatUniform(sn,celltype,df_bms)
  36. df_res=BatUniform.batuniform()
  37. df_res.to_excel(r'D:\00WorkSpace\01Python\data_analyze_platform\USER\alibaba\99Result\\'+'CBMS_Uniform'+sn+'_1.xlsx')
  38. # print('done!!!')
  39. except IndexError as e:
  40. print(repr(e))
  41. mylog.logopt(sn,e)
  42. pass