public SolenoidControlWidget(SolenoidComponent component, SolenoidCallback callback)
        {
            this.Build();

            VisibleWindow = false;
            AboveChild    = false;

            _callback  = callback;
            _component = component;

            VBox  container = new VBox(false, 5);
            Label name      = new Label
            {
                Text   = component.Name,
                Xalign = 0
            };

            name.ModifyFg(StateType.Normal, new Gdk.Color(255, 255, 255));

            _toggle          = new DToggleButton(40, 40, OPEN, CLOSED, DToggleButton.ToggleState.Inactive);
            _toggle.Pressed += Toggle_Pressed;

            container.PackStart(name, false, false, 0);
            container.PackStart(_toggle, true, true, 0);

            Add(container);
            ShowAll();
        }
Exemplo n.º 2
0
        public TestStandMapping()
        {
            PT_N2   = new PressureComponent(16, "PT_N2", "PT-N2", 400);
            PT_IPA  = new PressureComponent(17, "PT_IPA", "PT-IPA", 50);
            PT_N2O  = new PressureComponent(18, "PT_N2O", "PT-N2O", 50);
            PT_FUEL = new PressureComponent(19, "PT_FUEL", "PT-FUEL", 50);
            PT_OX   = new PressureComponent(20, "PT_OX", "PT-OX", 50);
            PT_CHAM = new PressureComponent(21, "PT_CHAM", "PT-CHAM", 50);

            TC_IPA = new TemperatureComponent(8, "TC_IPA", "TC-IPA", x => x);
            TC_N2O = new TemperatureComponent(9, "TC_N2O", "TC-N2O", x => x);
            TC_1   = new TemperatureComponent(10, "TC_1", "TC-1", x => x);
            TC_2   = new TemperatureComponent(11, "TC_2", "TC-2", x => x);
            TC_3   = new TemperatureComponent(12, "TC_3", "TC-3", x => x);
            TC_4   = new TemperatureComponent(13, "TC_4", "TC-4", x => x);
            TC_5   = new TemperatureComponent(14, "TC_5", "TC-5", x => x);
            TC_6   = new TemperatureComponent(15, "TC_6", "TC-6", x => x);

            LOAD = new LoadComponent(0, "LOAD", "Load cell");

            SV_IPA = new SolenoidComponent(4, "SV_IPA", "SV-IPA", "SV_IPA_SYMBOL");
            SV_N2O = new SolenoidComponent(5, "SV_N2O", "SV-N2O", "SV_N2O_SYMBOL");
            MV_IPA = new ServoComponent(6, "MV_IPA", "MV-IPA", "MV_IPA_SYMBOL");
            MV_N2O = new ServoComponent(7, "MV_N2O", "MV-N2O", "MV_N2O_SYMBOL");

            TARGET_MV_IPA = new SimpleComponent(25, 2, false, "TARGET-MV-IPA", "TARGET-MV-IPA [%]", x => ((float)x) / ushort.MaxValue * 100.0f);
            TARGET_MV_N2O = new SimpleComponent(26, 2, false, "TARGET-MV-N20", "TARGET-MV-N20 [%]", x => ((float)x) / ushort.MaxValue * 100.0f);

            SN_N2O_FILL = new SolenoidComponent(2, "SN_N2O_FILL", "SN-N2O-FILL", "SN_N2O_FILL_SYMBOL");
            SN_FLUSH    = new SolenoidComponent(3, "SN_FLUSH", "SN-FLUSH", "SN_FLUSH_SYMBOL");

            BATTERY = new VoltageComponent(22, "BATTERY", "BATTERY", 12.0f, 14.8f);

            FLO_IPA = new FlowComponent(100, "FLO_IPA", "FLO-IPA", ref PT_FUEL, ref PT_CHAM, () => PreferenceManager.Manager.Preferences.Fluid.Fuel);
            FLO_N2O = new FlowComponent(101, "FLO_N2O", "FLO-N2O", ref PT_N2O, ref PT_CHAM, () => PreferenceManager.Manager.Preferences.Fluid.Oxid);

            T_IPA = new TankComponent(24, "FUEL", "FUEL", "FUEL_GRADIENT", ref FLO_IPA, "Fuel");
            T_N2O = new LevelComponent(1, "OXID", "OXID", "OXID_GRADIENT", 20);

            STACK_HEALTH = new StackHealthComponent(23, "STACK_MAIN", "STACK_ACTUATOR", "STACK_SENSOR", "STACK-HEALTH");
            _states      = new List <State>
            {
                new State(0, "Idle"),
                new State(1, "Ignition"),
                new State(2, "Pre-Stage 1"),
                new State(3, "Pre-Stage 2"),
                new State(4, "Ramp up"),
                new State(5, "Regulated"),
                new State(6, "Shutdown 1"),
                new State(7, "Shutdown 2"),
                new State(8, "Flush")
            };
            EmergencyState = _states[6];

            PreferenceManager.Manager.Preferences.AutoSequenceComponentIDs.ChamberPressureID      = PT_CHAM.BoardID;
            PreferenceManager.Manager.Preferences.AutoSequenceComponentIDs.FuelLinePressureID     = PT_FUEL.BoardID;
            PreferenceManager.Manager.Preferences.AutoSequenceComponentIDs.OxidizerLinePressureID = PT_OX.BoardID;
        }
Exemplo n.º 3
0
 public void OnSolenoidPressed(SolenoidComponent solenoid, bool open)
 {
     _listener.OnSolenoidPressed(solenoid, open);
 }
Exemplo n.º 4
0
        public void OnSolenoidPressed(SolenoidComponent solenoid, bool open)
        {
            SolenoidCommand command = new SolenoidCommand(solenoid.BoardID, open);

            _listener.OnCommand(command);
        }