2023-08-21 22:18:30 +01:00
|
|
|
using Content.Server.DeviceLinking.Components;
|
2022-08-17 23:46:15 -07:00
|
|
|
using Content.Shared.Atmos.Monitor;
|
2022-01-01 20:56:24 -08:00
|
|
|
using Content.Shared.Atmos.Monitor.Components;
|
2022-08-17 23:46:15 -07:00
|
|
|
using Content.Shared.Atmos.Piping.Unary.Components;
|
2023-08-21 22:18:30 +01:00
|
|
|
using Content.Shared.DeviceLinking;
|
2022-01-01 20:56:24 -08:00
|
|
|
using Robust.Shared.Network;
|
2023-08-21 22:18:30 +01:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
2022-01-01 20:56:24 -08:00
|
|
|
|
2022-08-23 10:55:46 -07:00
|
|
|
namespace Content.Server.Atmos.Monitor.Components;
|
|
|
|
|
|
|
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class AirAlarmComponent : Component
|
2022-01-01 20:56:24 -08:00
|
|
|
{
|
2024-08-22 16:38:58 +01:00
|
|
|
[DataField] public AirAlarmMode CurrentMode { get; set; } = AirAlarmMode.Filtering;
|
|
|
|
|
[DataField] public bool AutoMode { get; set; } = true;
|
2022-01-01 20:56:24 -08:00
|
|
|
|
2022-08-23 10:55:46 -07:00
|
|
|
// Remember to null this afterwards.
|
|
|
|
|
[ViewVariables] public IAirAlarmModeUpdate? CurrentModeUpdater { get; set; }
|
2022-01-01 20:56:24 -08:00
|
|
|
|
2022-08-23 12:04:45 -07:00
|
|
|
public readonly HashSet<string> KnownDevices = new();
|
|
|
|
|
public readonly Dictionary<string, GasVentPumpData> VentData = new();
|
|
|
|
|
public readonly Dictionary<string, GasVentScrubberData> ScrubberData = new();
|
|
|
|
|
public readonly Dictionary<string, AtmosSensorData> SensorData = new();
|
2022-01-01 20:56:24 -08:00
|
|
|
|
2022-08-23 10:55:46 -07:00
|
|
|
public bool CanSync = true;
|
2023-08-21 22:18:30 +01:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Previous alarm state for use with output ports.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("state")]
|
|
|
|
|
public AtmosAlarmType State = AtmosAlarmType.Normal;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The port that gets set to high while the alarm is in the danger state, and low when not.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("dangerPort", customTypeSerializer: typeof(PrototypeIdSerializer<SourcePortPrototype>))]
|
|
|
|
|
public string DangerPort = "AirDanger";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The port that gets set to high while the alarm is in the warning state, and low when not.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("warningPort", customTypeSerializer: typeof(PrototypeIdSerializer<SourcePortPrototype>))]
|
|
|
|
|
public string WarningPort = "AirWarning";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The port that gets set to high while the alarm is in the normal state, and low when not.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("normalPort", customTypeSerializer: typeof(PrototypeIdSerializer<SourcePortPrototype>))]
|
|
|
|
|
public string NormalPort = "AirNormal";
|
2022-01-01 20:56:24 -08:00
|
|
|
}
|