Beispiel #1
0
        public GasPressurePumpWindow()
        {
            RobustXamlLoader.Load(this);

            ToggleStatusButton.OnPressed += _ => SetPumpStatus(!PumpStatus);
            ToggleStatusButton.OnPressed += _ => ToggleStatusButtonPressed?.Invoke();

            PumpPressureOutputInput.OnTextChanged += _ => SetOutputPressureButton.Disabled = false;
            SetOutputPressureButton.OnPressed     += _ =>
            {
                PumpOutputPressureChanged?.Invoke(PumpPressureOutputInput.Text ??= "");
                SetOutputPressureButton.Disabled = true;
            };

            SetMaxPressureButton.OnPressed += _ =>
            {
                PumpPressureOutputInput.Text     = Atmospherics.MaxOutputPressure.ToString(CultureInfo.InvariantCulture);
                SetOutputPressureButton.Disabled = false;
            };
        }
        public GasVolumePumpWindow()
        {
            RobustXamlLoader.Load(this);

            ToggleStatusButton.OnPressed += _ => SetPumpStatus(!PumpStatus);
            ToggleStatusButton.OnPressed += _ => ToggleStatusButtonPressed?.Invoke();

            PumpTransferRateInput.OnTextChanged += _ => SetTransferRateButton.Disabled = false;
            SetTransferRateButton.OnPressed     += _ =>
            {
                PumpTransferRateChanged?.Invoke(PumpTransferRateInput.Text ??= "");
                SetTransferRateButton.Disabled = true;
            };

            SetMaxRateButton.OnPressed += _ =>
            {
                PumpTransferRateInput.Text     = Atmospherics.MaxTransferRate.ToString(CultureInfo.InvariantCulture);
                SetTransferRateButton.Disabled = false;
            };
        }
Beispiel #3
0
        public GasMixerWindow()
        {
            RobustXamlLoader.Load(this);

            ToggleStatusButton.OnPressed += _ => SetMixerStatus(!MixerStatus);
            ToggleStatusButton.OnPressed += _ => ToggleStatusButtonPressed?.Invoke();

            MixerPressureOutputInput.OnTextChanged += _ => SetOutputPressureButton.Disabled = false;
            SetOutputPressureButton.OnPressed      += _ =>
            {
                MixerOutputPressureChanged?.Invoke(MixerPressureOutputInput.Text ??= "");
                SetOutputPressureButton.Disabled = true;
            };

            SetMaxPressureButton.OnPressed += _ =>
            {
                MixerPressureOutputInput.Text    = Atmospherics.MaxOutputPressure.ToString(CultureInfo.InvariantCulture);
                SetOutputPressureButton.Disabled = false;
            };

            MixerNodeOneInput.OnTextChanged += _ =>
            {
                SetMixerPercentageButton.Disabled = false;
                NodeOneLastEdited = true;
            };
            MixerNodeTwoInput.OnTextChanged += _ =>
            {
                SetMixerPercentageButton.Disabled = false;
                NodeOneLastEdited = false;
            };

            SetMixerPercentageButton.OnPressed += _ =>
            {
                MixerNodePercentageChanged?.Invoke(NodeOneLastEdited ? MixerNodeOneInput.Text ??= "" : MixerNodeTwoInput.Text ??= "");
                SetMixerPercentageButton.Disabled = true;
            };
        }