ui updates (no sensors yet)

This commit is contained in:
vulppine
2022-08-18 07:03:37 -07:00
parent 10e10b4bae
commit 531f0cb0e5
3 changed files with 27 additions and 27 deletions

View File

@@ -47,34 +47,21 @@ namespace Content.Client.Atmos.Monitor.UI
SendMessage(new AirAlarmUpdateAlarmModeMessage(mode));
}
private void OnThresholdChanged(AtmosMonitorThresholdType type, AtmosAlarmThreshold threshold, Gas? gas = null)
private void OnThresholdChanged(string address, AtmosMonitorThresholdType type, AtmosAlarmThreshold threshold, Gas? gas = null)
{
SendMessage(new AirAlarmUpdateAlarmThresholdMessage(type, threshold, gas));
SendMessage(new AirAlarmUpdateAlarmThresholdMessage(address, type, threshold, gas));
}
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
protected override void UpdateState(BoundUserInterfaceState state)
{
if (_window == null)
return;
base.UpdateState(state);
switch (message)
if (state is not AirAlarmUIState cast || _window == null)
{
case AirAlarmSetAddressMessage addrMsg:
_window.SetAddress(addrMsg.Address);
break;
case AirAlarmUpdateDeviceDataMessage deviceMsg:
_window.UpdateDeviceData(deviceMsg.Address, deviceMsg.Data);
break;
case AirAlarmUpdateAlarmModeMessage alarmMsg:
_window.UpdateModeSelector(alarmMsg.Mode);
break;
case AirAlarmUpdateAlarmThresholdMessage thresholdMsg:
_window.UpdateThreshold(ref thresholdMsg);
break;
case AirAlarmUpdateAirDataMessage airDataMsg:
_window.UpdateGasData(ref airDataMsg.AirData);
break;
return;
}
_window.UpdateState(cast);
}
protected override void Dispose(bool disposing)