constant.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. def DictResultsAbnormal(dict_input, results_depict):
  2. dict_results = {
  3. "triggerTime": dict_input['triggerTime'],
  4. "userName": dict_input['userName'],
  5. "coolingStationName": dict_input['coolingStationName'],
  6. "deviceName": dict_input['deviceName'],
  7. "deviceId": dict_input['deviceId'],
  8. "coolingCapacity": '',
  9. "COP": '',
  10. "coolingWaterFlow": '',
  11. "chilledWaterFlow": '',
  12. "resultsDepict": results_depict,
  13. "dischargeTempMod": '',
  14. "powerTheory": '',
  15. "etaMotor": '',
  16. "etaRoller": '',
  17. "etaIse": ''}
  18. return dict_results
  19. def DictResultsNormal(dict_results, results_depict):
  20. dict_results = {
  21. "triggerTime": dict_results['triggerTime'],
  22. "userName": dict_results['userName'],
  23. "coolingStationName": dict_results['coolingStationName'],
  24. "deviceName": dict_results['deviceName'],
  25. "deviceId": dict_results['deviceId'],
  26. "coolingCapacity": round(dict_results['coolingCapacity'], 1),
  27. "COP": round(dict_results['COP'], 2),
  28. "coolingWaterFlow": round(dict_results['coolingWaterFlow'],1) if dict_results['coolingWaterFlow'] else '',
  29. "chilledWaterFlow": round(dict_results['chilledWaterFlow'], 1) if dict_results['chilledWaterFlow'] else '',
  30. "resultsDepict": results_depict,
  31. "dischargeTempMod": round(dict_results['dischargeTemp'], 1),
  32. "powerTheory": round(dict_results['powerTheory'], 1),
  33. "etaMotor": round(dict_results['etaMotor'], 3),
  34. "etaRoller": round(dict_results['etaRoller'], 3),
  35. "etaIse": round(dict_results['etaIseCal'], 2)}
  36. return dict_results