TegGeneratorComponent.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. namespace Content.Server.Power.Generation.Teg;
  2. /// <summary>
  3. /// The centerpiece for the thermo-electric generator (TEG).
  4. /// </summary>
  5. /// <seealso cref="TegSystem"/>
  6. [RegisterComponent]
  7. [Access(typeof(TegSystem))]
  8. public sealed partial class TegGeneratorComponent : Component
  9. {
  10. /// <summary>
  11. /// When transferring energy from the hot to cold side,
  12. /// determines how much of that energy can be extracted as electricity.
  13. /// </summary>
  14. /// <remarks>
  15. /// A value of 0.9 means that 90% of energy transferred goes to electricity.
  16. /// </remarks>
  17. [ViewVariables(VVAccess.ReadWrite)]
  18. [DataField("thermalEfficiency")]
  19. public float ThermalEfficiency = 0.65f;
  20. /// <summary>
  21. /// Simple factor that scales effective electricity generation.
  22. /// </summary>
  23. [ViewVariables(VVAccess.ReadWrite)]
  24. [DataField("powerFactor")]
  25. public float PowerFactor = 1;
  26. /// <summary>
  27. /// Amount of energy (Joules) generated by the TEG last atmos tick.
  28. /// </summary>
  29. [ViewVariables(VVAccess.ReadWrite)]
  30. [DataField("lastGeneration")]
  31. public float LastGeneration;
  32. /// <summary>
  33. /// The current target for TEG power generation.
  34. /// Drifts towards actual power draw of the network with <see cref="PowerFactor"/>.
  35. /// </summary>
  36. [ViewVariables(VVAccess.ReadWrite)]
  37. [DataField("rampPosition")]
  38. public float RampPosition;
  39. /// <summary>
  40. /// Factor by which TEG power generation scales, both up and down.
  41. /// </summary>
  42. [ViewVariables(VVAccess.ReadWrite)]
  43. [DataField("rampFactor")]
  44. public float RampFactor = 1.05f;
  45. /// <summary>
  46. /// Minimum position for the ramp. Avoids TEG taking too long to start.
  47. /// </summary>
  48. [ViewVariables(VVAccess.ReadWrite)]
  49. [DataField("rampMinimum")]
  50. public float RampMinimum = 5000;
  51. /// <summary>
  52. /// Power output value at which the sprite appearance and sound volume should cap out.
  53. /// </summary>
  54. [ViewVariables(VVAccess.ReadWrite)]
  55. [DataField("maxVisualPower")]
  56. public float MaxVisualPower = 200_000;
  57. /// <summary>
  58. /// Minimum ambient sound volume, when we're producing just barely any power at all.
  59. /// </summary>
  60. [ViewVariables(VVAccess.ReadWrite)]
  61. [DataField("volumeMin")]
  62. public float VolumeMin = -9;
  63. /// <summary>
  64. /// Maximum ambient sound volume, when we're producing &gt;= <see cref="MaxVisualPower"/> power.
  65. /// </summary>
  66. [ViewVariables(VVAccess.ReadWrite)]
  67. [DataField("volumeMax")]
  68. public float VolumeMax = -4;
  69. }