diff --git a/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml b/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml
index 8e8e959e65..6b36b86a23 100644
--- a/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml
+++ b/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml
@@ -20,9 +20,14 @@
+
+
+
+
+
@@ -39,30 +44,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs b/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs
index 3d77db0914..3e1bf5a614 100644
--- a/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs
+++ b/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs
@@ -58,15 +58,6 @@ namespace Content.Client.Atmos.Monitor.UI
AirAlarmModeChanged!.Invoke((AirAlarmMode) args.Id);
};
- /*
- foreach (var gas in Enum.GetValues())
- {
- var gasLabel = new Label();
- _gasReadout.AddChild(gasLabel);
- _gasLabels.Add(gas, gasLabel);
- }
- */
-
_tabContainer.SetTabTitle(0, Loc.GetString("air-alarm-ui-window-tab-vents"));
_tabContainer.SetTabTitle(1, Loc.GetString("air-alarm-ui-window-tab-scrubbers"));
_tabContainer.SetTabTitle(2, Loc.GetString("air-alarm-ui-window-tab-sensors"));
@@ -82,12 +73,16 @@ namespace Content.Client.Atmos.Monitor.UI
_pumps.Clear();
_scrubberDevices.RemoveAllChildren();
_scrubbers.Clear();
+ CSensorContainer.RemoveAllChildren();
+ _sensors.Clear();
ResyncAllRequested!.Invoke();
};
}
public void UpdateState(AirAlarmUIState state)
{
+ _address.Text = state.Address;
+ _deviceTotal.Text = $"{state.DeviceCount}";
_pressure.SetMarkup(Loc.GetString("air-alarm-ui-window-pressure", ("pressure", $"{state.PressureAverage:0.##}")));
_temperature.SetMarkup(Loc.GetString("air-alarm-ui-window-temperature", ("tempC", $"{TemperatureHelpers.KelvinToCelsius(state.TemperatureAverage):0.#}"), ("temperature", $"{state.TemperatureAverage:0.##}")));
_alarmState.SetMarkup(Loc.GetString("air-alarm-ui-window-alarm-state", ("state", $"{state.AlarmType}")));
@@ -100,24 +95,6 @@ namespace Content.Client.Atmos.Monitor.UI
_tabContainer.CurrentTab = (int) state.Tab;
}
- public void SetAddress(string address)
- {
- _address.Text = address;
- }
-
- /*
- public void UpdateGasData(ref AirAlarmAirData state)
- {
- _pressure.SetMarkup(Loc.GetString("air-alarm-ui-window-pressure", ("pressure", $"{state.Pressure:0.##}")));
- _temperature.SetMarkup(Loc.GetString("air-alarm-ui-window-temperature", ("tempC", $"{TemperatureHelpers.KelvinToCelsius(state.Temperature ?? 0):0.#}"), ("temperature", $"{state.Temperature:0.##}")));
- _alarmState.SetMarkup(Loc.GetString("air-alarm-ui-window-alarm-state", ("state", $"{state.AlarmState}")));
-
- if (state.Gases != null)
- foreach (var (gas, amount) in state.Gases)
- _gasLabels[gas].Text = Loc.GetString("air-alarm-ui-gases", ("gas", $"{gas}"), ("amount", $"{amount:0.####}"), ("percentage", $"{(amount / state.TotalMoles):0.##}"));
- }
- */
-
public void UpdateModeSelector(AirAlarmMode mode)
{
_modes.SelectId((int) mode);
@@ -170,56 +147,6 @@ namespace Content.Client.Atmos.Monitor.UI
break;
}
-
- _deviceTotal.Text = $"{_pumps.Count + _scrubbers.Count}";
}
-
- /*
- public void UpdateThreshold(ref AirAlarmUpdateAlarmThresholdMessage message)
- {
- switch (message.Type)
- {
- case AtmosMonitorThresholdType.Pressure:
- if (_pressureThresholdControl == null)
- {
- _pressureThresholdControl = new ThresholdControl(Loc.GetString("air-alarm-ui-thresholds-pressure-title"), message.Threshold, message.Type);
- _pressureThresholdControl.ThresholdDataChanged += AtmosAlarmThresholdChanged!.Invoke;
- _pressureThreshold.AddChild(_pressureThresholdControl);
- }
- else
- {
- _pressureThresholdControl.UpdateThresholdData(message.Threshold);
- }
-
- break;
- case AtmosMonitorThresholdType.Temperature:
- if (_temperatureThresholdControl == null)
- {
- _temperatureThresholdControl = new ThresholdControl(Loc.GetString("air-alarm-ui-thresholds-temperature-title"), message.Threshold, message.Type);
- _temperatureThresholdControl.ThresholdDataChanged += AtmosAlarmThresholdChanged!.Invoke;
- _temperatureThreshold.AddChild(_temperatureThresholdControl);
- }
- else
- {
- _temperatureThresholdControl.UpdateThresholdData(message.Threshold);
- }
-
- break;
- case AtmosMonitorThresholdType.Gas:
- if (_gasThresholdControls.TryGetValue((Gas) message.Gas!, out var control))
- {
- control.UpdateThresholdData(message.Threshold);
- break;
- }
-
- var gasThreshold = new ThresholdControl(Loc.GetString($"air-alarm-ui-thresholds-gas-title", ("gas", $"{(Gas) message.Gas!}")), message.Threshold, AtmosMonitorThresholdType.Gas, (Gas) message.Gas!, 100);
- gasThreshold.ThresholdDataChanged += AtmosAlarmThresholdChanged!.Invoke;
- _gasThresholdControls.Add((Gas) message.Gas!, gasThreshold);
- _gasThreshold.AddChild(gasThreshold);
-
- break;
- }
- }
- */
}
}
diff --git a/Content.Client/Atmos/Monitor/UI/Widgets/SensorInfo.xaml b/Content.Client/Atmos/Monitor/UI/Widgets/SensorInfo.xaml
index de8cbd6785..f1c9fbf8ec 100644
--- a/Content.Client/Atmos/Monitor/UI/Widgets/SensorInfo.xaml
+++ b/Content.Client/Atmos/Monitor/UI/Widgets/SensorInfo.xaml
@@ -1,27 +1,33 @@
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
-
-
-
+
+
+
+
+
+
+
+
diff --git a/Content.Client/Atmos/Monitor/UI/Widgets/SensorInfo.xaml.cs b/Content.Client/Atmos/Monitor/UI/Widgets/SensorInfo.xaml.cs
index de2b2c1a40..c465a7b148 100644
--- a/Content.Client/Atmos/Monitor/UI/Widgets/SensorInfo.xaml.cs
+++ b/Content.Client/Atmos/Monitor/UI/Widgets/SensorInfo.xaml.cs
@@ -25,7 +25,7 @@ public sealed partial class SensorInfo : BoxContainer
_address = address;
- SensorAddress.Title = address;
+ SensorAddress.Title = $"{address} : {data.AlarmState}";
PressureLabel.SetMarkup(Loc.GetString("air-alarm-ui-window-pressure", ("pressure", $"{data.Pressure:0.##}")));
TemperatureLabel.SetMarkup(Loc.GetString("air-alarm-ui-window-temperature", ("tempC", $"{TemperatureHelpers.KelvinToCelsius(data.Temperature):0.#}"), ("temperature", $"{data.Temperature:0.##}")));
diff --git a/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs b/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs
index d43c93fcbb..eb8753882d 100644
--- a/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs
+++ b/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs
@@ -133,7 +133,7 @@ namespace Content.Server.Atmos.Monitor.Systems
///
private void SyncAllSensors(EntityUid uid, AirAlarmComponent? monitor = null)
{
- if (!Resolve(uid, ref monitor) || monitor.CurrentTab != AirAlarmTab.Sensors)
+ if (!Resolve(uid, ref monitor))
{
return;
}
@@ -528,9 +528,9 @@ namespace Content.Server.Atmos.Monitor.Systems
: 0f;
}
- public void UpdateUI(EntityUid uid, AirAlarmComponent? alarm = null, AtmosAlarmableComponent? alarmable = null)
+ public void UpdateUI(EntityUid uid, AirAlarmComponent? alarm = null, DeviceNetworkComponent? devNet = null, AtmosAlarmableComponent? alarmable = null)
{
- if (!Resolve(uid, ref alarm, ref alarmable))
+ if (!Resolve(uid, ref alarm, ref devNet, ref alarmable))
{
return;
}
@@ -567,10 +567,12 @@ namespace Content.Server.Atmos.Monitor.Systems
}
}
+ var deviceCount = alarm.VentData.Count + alarm.ScrubberData.Count + alarm.SensorData.Count;
+
_uiSystem.TrySetUiState(
uid,
SharedAirAlarmInterfaceKey.Key,
- new AirAlarmUIState(pressure, temperature, dataToSend, alarm.CurrentMode, alarm.CurrentTab, alarmable.HighestNetworkState));
+ new AirAlarmUIState(devNet.Address, deviceCount, pressure, temperature, dataToSend, alarm.CurrentMode, alarm.CurrentTab, alarmable.HighestNetworkState));
}
private const float _delay = 8f;
diff --git a/Content.Shared/Atmos/Monitor/Components/SharedAirAlarmComponent.cs b/Content.Shared/Atmos/Monitor/Components/SharedAirAlarmComponent.cs
index 3e9e21ffe8..19076227a2 100644
--- a/Content.Shared/Atmos/Monitor/Components/SharedAirAlarmComponent.cs
+++ b/Content.Shared/Atmos/Monitor/Components/SharedAirAlarmComponent.cs
@@ -37,8 +37,10 @@ namespace Content.Shared.Atmos.Monitor.Components
[Serializable, NetSerializable]
public sealed class AirAlarmUIState : BoundUserInterfaceState
{
- public AirAlarmUIState(float pressureAverage, float temperatureAverage, Dictionary deviceData, AirAlarmMode mode, AirAlarmTab tab, AtmosMonitorAlarmType alarmType)
+ public AirAlarmUIState(string address, int deviceCount, float pressureAverage, float temperatureAverage, Dictionary deviceData, AirAlarmMode mode, AirAlarmTab tab, AtmosMonitorAlarmType alarmType)
{
+ Address = address;
+ DeviceCount = deviceCount;
PressureAverage = pressureAverage;
TemperatureAverage = temperatureAverage;
DeviceData = deviceData;
@@ -47,6 +49,8 @@ namespace Content.Shared.Atmos.Monitor.Components
AlarmType = alarmType;
}
+ public string Address { get; }
+ public int DeviceCount { get; }
public float PressureAverage { get; }
public float TemperatureAverage { get; }
///
diff --git a/Resources/Locale/en-US/atmos/air-alarm-ui.ftl b/Resources/Locale/en-US/atmos/air-alarm-ui.ftl
index 45eda887ef..871a16eace 100644
--- a/Resources/Locale/en-US/atmos/air-alarm-ui.ftl
+++ b/Resources/Locale/en-US/atmos/air-alarm-ui.ftl
@@ -18,10 +18,9 @@ air-alarm-ui-window-pressure = {$pressure} kPa
air-alarm-ui-window-temperature = {$tempC} C ({$temperature} K)
air-alarm-ui-window-alarm-state = {$state}
-air-alarm-ui-window-tab-gas = Gases
air-alarm-ui-window-tab-vents = Vents
air-alarm-ui-window-tab-scrubbers = Scrubbers
-air-alarm-ui-sensor-thresholds = Thresholds
+air-alarm-ui-window-tab-sensors = Sensors
air-alarm-ui-gases = {$gas}: {$amount} mol ({$percentage}%)
@@ -48,6 +47,8 @@ air-alarm-ui-scrubber-wide-net-label = WideNet
### Thresholds
+air-alarm-ui-sensor-gases = Gases
+air-alarm-ui-sensor-thresholds = Thresholds
air-alarm-ui-thresholds-pressure-title = Pressure (kPa)
air-alarm-ui-thresholds-temperature-title = Temperature (K)
air-alarm-ui-thresholds-gas-title = {$gas} (%)