1
0

AirAlarmComponent.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using Content.Server.DeviceLinking.Components;
  2. using Content.Shared.Atmos.Monitor;
  3. using Content.Shared.Atmos.Monitor.Components;
  4. using Content.Shared.Atmos.Piping.Unary.Components;
  5. using Content.Shared.DeviceLinking;
  6. using Robust.Shared.Network;
  7. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  8. namespace Content.Server.Atmos.Monitor.Components;
  9. [RegisterComponent]
  10. public sealed partial class AirAlarmComponent : Component
  11. {
  12. [DataField] public AirAlarmMode CurrentMode { get; set; } = AirAlarmMode.Filtering;
  13. [DataField] public bool AutoMode { get; set; } = true;
  14. // Remember to null this afterwards.
  15. [ViewVariables] public IAirAlarmModeUpdate? CurrentModeUpdater { get; set; }
  16. public readonly HashSet<string> KnownDevices = new();
  17. public readonly Dictionary<string, GasVentPumpData> VentData = new();
  18. public readonly Dictionary<string, GasVentScrubberData> ScrubberData = new();
  19. public readonly Dictionary<string, AtmosSensorData> SensorData = new();
  20. public bool CanSync = true;
  21. /// <summary>
  22. /// Previous alarm state for use with output ports.
  23. /// </summary>
  24. [DataField("state")]
  25. public AtmosAlarmType State = AtmosAlarmType.Normal;
  26. /// <summary>
  27. /// The port that gets set to high while the alarm is in the danger state, and low when not.
  28. /// </summary>
  29. [DataField("dangerPort", customTypeSerializer: typeof(PrototypeIdSerializer<SourcePortPrototype>))]
  30. public string DangerPort = "AirDanger";
  31. /// <summary>
  32. /// The port that gets set to high while the alarm is in the warning state, and low when not.
  33. /// </summary>
  34. [DataField("warningPort", customTypeSerializer: typeof(PrototypeIdSerializer<SourcePortPrototype>))]
  35. public string WarningPort = "AirWarning";
  36. /// <summary>
  37. /// The port that gets set to high while the alarm is in the normal state, and low when not.
  38. /// </summary>
  39. [DataField("normalPort", customTypeSerializer: typeof(PrototypeIdSerializer<SourcePortPrototype>))]
  40. public string NormalPort = "AirNormal";
  41. }