some backend stuff for air alarms
finally, some UI states!!!
This commit is contained in:
37
Content.Shared/Atmos/Monitor/AtmosSensorData.cs
Normal file
37
Content.Shared/Atmos/Monitor/AtmosSensorData.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Content.Shared.Atmos.Monitor.Components;
|
||||
|
||||
namespace Content.Shared.Atmos.Monitor;
|
||||
|
||||
public sealed class AtmosSensorData : IAtmosDeviceData
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
public bool Dirty { get; set; }
|
||||
public bool IgnoreAlarms { get; set; }
|
||||
|
||||
/// Most fields are readonly, because it's data that's meant to be transmitted.
|
||||
|
||||
/// <summary>
|
||||
/// Current pressure detected by this sensor.
|
||||
/// </summary>
|
||||
public float? Pressure { get; }
|
||||
/// <summary>
|
||||
/// Current temperature detected by this sensor.
|
||||
/// </summary>
|
||||
public float? Temperature { get; }
|
||||
/// <summary>
|
||||
/// Current amount of moles detected by this sensor.
|
||||
/// </summary>
|
||||
public float? TotalMoles { get; }
|
||||
/// <summary>
|
||||
/// Current alarm state of this sensor. Does not reflect the highest alarm state on the network.
|
||||
/// </summary>
|
||||
public AtmosMonitorAlarmType AlarmState { get; }
|
||||
/// <summary>
|
||||
/// Current number of gases on this sensor.
|
||||
/// </summary>
|
||||
public Dictionary<Gas, float> Gases { get; }
|
||||
/// <summary>
|
||||
/// If this sensor is currently detecting a fire.
|
||||
/// </summary>
|
||||
public bool OnFire { get; }
|
||||
}
|
||||
@@ -55,11 +55,34 @@ namespace Content.Shared.Atmos.Monitor.Components
|
||||
public bool IgnoreAlarms { get; set; }
|
||||
}
|
||||
|
||||
// would be nice to include the entire state here
|
||||
// but it's already handled by messages
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AirAlarmUIState : BoundUserInterfaceState
|
||||
{}
|
||||
{
|
||||
public AirAlarmUIState(Dictionary<string, IAtmosDeviceData> deviceData, AirAlarmMode mode, AirAlarmTab tab, AtmosMonitorAlarmType alarmType)
|
||||
{
|
||||
DeviceData = deviceData;
|
||||
Mode = mode;
|
||||
Tab = tab;
|
||||
AlarmType = alarmType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Every single device data that can be seen from this
|
||||
/// air alarm. This includes vents, scrubbers, and sensors.
|
||||
/// The device data you get, however, depends on the current
|
||||
/// selected tab.
|
||||
/// </summary>
|
||||
public Dictionary<string, IAtmosDeviceData> DeviceData { get; }
|
||||
public AirAlarmMode Mode { get; }
|
||||
public AirAlarmTab Tab { get; }
|
||||
public AtmosMonitorAlarmType AlarmType { get; }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AirAlarmTabSetMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public AirAlarmTab Tab { get; }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AirAlarmResyncAllDevicesMessage : BoundUserInterfaceMessage
|
||||
@@ -126,5 +149,11 @@ namespace Content.Shared.Atmos.Monitor.Components
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public enum AirAlarmTab
|
||||
{
|
||||
Vent,
|
||||
Scrubber,
|
||||
Sensors,
|
||||
Settings
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user