copy-settings-to-all-similar for scrubbers and vents in air alarms (#18363)

This commit is contained in:
Ilya246
2023-08-09 22:20:19 +04:00
committed by GitHub
parent aee88e1721
commit d3244b6049
9 changed files with 71 additions and 2 deletions

View File

@@ -20,12 +20,14 @@ public sealed partial class ScrubberControl : BoxContainer
private string _address;
public event Action<string, IAtmosDeviceData>? ScrubberDataChanged;
public event Action<IAtmosDeviceData>? ScrubberDataCopied;
private CheckBox _enabled => CEnableDevice;
private CollapsibleHeading _addressLabel => CAddress;
private OptionButton _pumpDirection => CPumpDirection;
private FloatSpinBox _volumeRate => CVolumeRate;
private CheckBox _wideNet => CWideNet;
private Button _copySettings => CCopySettings;
private GridContainer _gases => CGasContainer;
private Dictionary<Gas, Button> _gasControls = new();
@@ -75,6 +77,11 @@ public sealed partial class ScrubberControl : BoxContainer
_data.PumpDirection = (ScrubberPumpDirection) args.Id;
ScrubberDataChanged?.Invoke(_address, _data);
};
_copySettings.OnPressed += _ =>
{
ScrubberDataCopied?.Invoke(_data);
};
foreach (var value in Enum.GetValues<Gas>())
{