1
0

SpaceHeaterComponent.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using Content.Shared.Atmos;
  2. using Content.Shared.Atmos.Piping.Portable.Components;
  3. using Content.Shared.Atmos.Visuals;
  4. using Content.Shared.Guidebook;
  5. namespace Content.Server.Atmos.Portable;
  6. [RegisterComponent]
  7. public sealed partial class SpaceHeaterComponent : Component
  8. {
  9. /// <summary>
  10. /// Current mode the space heater is in. Possible values : Auto, Heat and Cool
  11. /// </summary>
  12. [DataField, ViewVariables(VVAccess.ReadWrite)]
  13. public SpaceHeaterMode Mode = SpaceHeaterMode.Auto;
  14. /// <summary>
  15. /// The power level the space heater is currently set to. Possible values : Low, Medium, High
  16. /// </summary>
  17. [DataField, ViewVariables(VVAccess.ReadWrite)]
  18. public SpaceHeaterPowerLevel PowerLevel = SpaceHeaterPowerLevel.Medium;
  19. /// <summary>
  20. /// Maximum target temperature the device can be set to
  21. /// </summary>
  22. [DataField, ViewVariables(VVAccess.ReadWrite)]
  23. [GuidebookData]
  24. public float MaxTemperature = Atmospherics.T20C + 20;
  25. /// <summary>
  26. /// Minimal target temperature the device can be set to
  27. /// </summary>
  28. [DataField, ViewVariables(VVAccess.ReadWrite)]
  29. [GuidebookData]
  30. public float MinTemperature = Atmospherics.T0C - 10;
  31. /// <summary>
  32. /// Coefficient of performance. Output power / input power.
  33. /// Positive for heaters, negative for freezers.
  34. /// </summary>
  35. [DataField("heatingCoefficientOfPerformance")]
  36. [ViewVariables(VVAccess.ReadWrite)]
  37. public float HeatingCp = 1f;
  38. [DataField("coolingCoefficientOfPerformance")]
  39. [ViewVariables(VVAccess.ReadWrite)]
  40. public float CoolingCp = -0.9f;
  41. /// <summary>
  42. /// The delta from the target temperature after which the space heater switch mode while in Auto. Value should account for the thermomachine temperature tolerance.
  43. /// </summary>
  44. [DataField]
  45. [ViewVariables(VVAccess.ReadWrite)]
  46. public float AutoModeSwitchThreshold = 0.8f;
  47. /// <summary>
  48. /// Current electrical power consumption, in watts, of the space heater at medium power level. Passed to the thermomachine component.
  49. /// </summary>
  50. [DataField, ViewVariables(VVAccess.ReadWrite)]
  51. public float PowerConsumption = 3500f;
  52. }