GasThermoMachineComponent.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using Content.Shared.Atmos;
  2. using Content.Shared.Guidebook;
  3. namespace Content.Server.Atmos.Piping.Unary.Components
  4. {
  5. [RegisterComponent]
  6. public sealed partial class GasThermoMachineComponent : Component
  7. {
  8. [DataField("inlet")]
  9. public string InletName = "pipe";
  10. /// <summary>
  11. /// Current electrical power consumption, in watts. Increasing power increases the ability of the
  12. /// thermomachine to heat or cool air.
  13. /// </summary>
  14. [DataField, ViewVariables(VVAccess.ReadWrite)]
  15. [GuidebookData]
  16. public float HeatCapacity = 5000;
  17. [DataField, ViewVariables(VVAccess.ReadWrite)]
  18. public float TargetTemperature = Atmospherics.T20C;
  19. /// <summary>
  20. /// Tolerance for temperature setpoint hysteresis.
  21. /// </summary>
  22. [GuidebookData]
  23. [DataField, ViewVariables(VVAccess.ReadOnly)]
  24. public float TemperatureTolerance = 2f;
  25. /// <summary>
  26. /// Implements setpoint hysteresis to prevent heater from rapidly cycling on and off at setpoint.
  27. /// If true, add Sign(Cp)*TemperatureTolerance to the temperature setpoint.
  28. /// </summary>
  29. [ViewVariables(VVAccess.ReadOnly)]
  30. public bool HysteresisState;
  31. /// <summary>
  32. /// Coefficient of performance. Output power / input power.
  33. /// Positive for heaters, negative for freezers.
  34. /// </summary>
  35. [DataField("coefficientOfPerformance")]
  36. [ViewVariables(VVAccess.ReadWrite)]
  37. public float Cp = 0.9f; // output power / input power, positive is heat
  38. /// <summary>
  39. /// Current minimum temperature
  40. /// Ignored if heater.
  41. /// </summary>
  42. [DataField, ViewVariables(VVAccess.ReadWrite)]
  43. [GuidebookData]
  44. public float MinTemperature = 73.15f;
  45. /// <summary>
  46. /// Current maximum temperature
  47. /// Ignored if freezer.
  48. /// </summary>
  49. [DataField, ViewVariables(VVAccess.ReadWrite)]
  50. [GuidebookData]
  51. public float MaxTemperature = 593.15f;
  52. /// <summary>
  53. /// Last amount of energy added/removed from the attached pipe network
  54. /// </summary>
  55. [DataField, ViewVariables(VVAccess.ReadWrite)]
  56. public float LastEnergyDelta;
  57. /// <summary>
  58. /// An percentage of the energy change that is leaked into the surrounding environment rather than the inlet pipe.
  59. /// </summary>
  60. [DataField, ViewVariables(VVAccess.ReadWrite)]
  61. [GuidebookData]
  62. public float EnergyLeakPercentage;
  63. /// <summary>
  64. /// If true, heat is exclusively exchanged with the local atmosphere instead of the inlet pipe air
  65. /// </summary>
  66. [DataField, ViewVariables(VVAccess.ReadWrite)]
  67. public bool Atmospheric = false;
  68. }
  69. }