equipment.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # -*- coding: utf-8 -*-
  2. from enum import Enum
  3. import numpy as np
  4. from pydantic import BaseModel
  5. from app.schemas.space import Space
  6. class AirValveSpeed(float, Enum):
  7. off = 0.0
  8. low = 1.0
  9. medium = 2.0
  10. high = 3.0
  11. class VRFMode(str, Enum):
  12. cooling = "cooling"
  13. heating = "heating"
  14. ventilation = "ventilation"
  15. unknown = "unknown"
  16. class BaseEquipment(BaseModel):
  17. id: str | None
  18. running_status: bool | None
  19. in_cloud_status: bool | None
  20. on_time: str | None
  21. off_time: str | None
  22. equip_switch_set: bool | None
  23. acc_run_time: float | None
  24. class FCU(BaseEquipment):
  25. work_mode: int | None
  26. air_valve_speed: AirValveSpeed | None = AirValveSpeed.off
  27. air_valve_speed_set: AirValveSpeed | None = AirValveSpeed.off
  28. recommended_speed: AirValveSpeed | None = AirValveSpeed.off
  29. space: Space | None
  30. setting_temperature: float | None
  31. supply_air_temperature: float | None
  32. water_out_temperature: float | None
  33. water_in_temperature: float | None
  34. speed_limit: AirValveSpeed | None = AirValveSpeed.high
  35. class VAVBox(BaseEquipment):
  36. spaces: list[Space] | None
  37. supply_air_temperature: float | None = np.NAN
  38. supply_air_flow: float | None = np.NAN
  39. supply_air_flow_set: float | None = np.NAN
  40. supply_air_flow_lower_limit: float | None = np.NAN
  41. supply_air_flow_upper_limit: float | None = np.NAN
  42. recommended_supply_air_flow: float | None = np.NAN
  43. valve_opening: float | None = np.NAN
  44. setting_temperature: float | None = 0.0
  45. virtual_realtime_temperature: float | None = np.NAN
  46. virtual_target_temperature: float | None = np.NAN
  47. class AHU(BaseEquipment):
  48. supply_air_temperature: float | None
  49. supply_air_temperature_set: float | None
  50. return_air_temperature: float | None
  51. return_air_temperature_set: float | None
  52. freq: float | None
  53. freq_set: float | None
  54. fan_freq_upper_limit_set: float | None
  55. fan_freq_lower_limit_set: float | None
  56. class VentilationFan(BaseEquipment):
  57. pass
  58. class PAU(BaseEquipment):
  59. pass
  60. class VRF(BaseEquipment):
  61. equip_switch_set: str | None
  62. work_mode: VRFMode | None
  63. speed: str | None
  64. speed_set: str | None
  65. current_temperature_set: float | None
  66. temperature_set: float | None
  67. mode_set: str | None
  68. return_air_temp: float | None
  69. class ASHP(BaseEquipment):
  70. out_temp_15min: list[float]
  71. out_temp_set_15min: list[float]
  72. out_temp_30min: list[float]
  73. out_temp_set_30min: list[float]
  74. out_temp_set: float | None
  75. out_temp: float | None
  76. in_temp: float | None
  77. iplr_15min: list[float]
  78. iplr_30min: list[float]
  79. class FeedWaterPump(BaseEquipment):
  80. work_freq: float | None
  81. work_freq_set: float | None