Example #1
0
        private void joystickToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (__Elements.OfType <JoystickDesignPanel>().Any())
            {
                return;
            }

            var panel = new JoystickDesignPanel();

            panel.InitializePanels(fmMain.JoyInfo);
            LinkPanel(panel);
        }
Example #2
0
        public void JoystickUpdated()
        {
            var panel = __Elements.OfType <JoystickDesignPanel>().FirstOrDefault();

            if (panel == null)
            {
                return;
            }

            var pos = panel.Location;

            panel.Dispose();

            panel          = new JoystickDesignPanel();
            panel.Location = pos;
            panel.InitializePanels(fmMain.JoyInfo);
            LinkPanel(panel, true);

            Link();
        }
Example #3
0
        private void joystickToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (__Elements.OfType <JoystickDesignPanel>().Any())
            {
                MessageBox.Show(Parent, "Joystick block is already present for this model", "Unable to create block",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            var id = (Guid)((ToolStripItem)sender).Tag;

            var jinfo = fmMain.JoyInfos.FirstOrDefault(j => j.ID == id);

            if (jinfo == null)
            {
                return;
            }

            var panel = new JoystickDesignPanel();

            panel.InitializePanels(jinfo);
            LinkPanel(panel);
        }
Example #4
0
        private void CreatePanel(XName panelName, XElement xElement)
        {
            switch (panelName.ToString())
            {
            case "Joystick":
            {
                var panel = new JoystickDesignPanel();
                panel.InitializePanels(fmMain.JoyInfo);
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "PPMOut":
            {
                var panel = new PPMOutDesignPanel();
                panel.InitializePanels(__Model);
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "FMPPMOut":
            {
                var panel = new FMPPMOutDesignPanel();
                panel.InitializePanels(__Model, -1);
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "DeltaMixer":
            {
                var panel = new DeltaMixerDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "VTAilMixer":
            {
                var panel = new VTailMixerDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "AilRudderMixer":
            {
                var panel = new AilronToRudderMixerDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "FlaperonsMixer":
            {
                var panel = new FlaperonMixerDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "ThRudderMixer":
            {
                var panel = new ThrottleToElevMixerDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "Exponent":
            {
                var panel = new ExponentDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "Invertor":
            {
                var panel = new InvertorDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "LogicalButton":
            {
                var panel = new LogicalButtonDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "Variable":
            {
                var panel = new VariableDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "EEPVariable":
            {
                var panel = new EEPVariableDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "Trimmer":
            {
                var panel = new TrimmerDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "TrimmerEx":
            {
                var panel = new TrimmerDesignPanelEx();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "ValueMapper":
            {
                var panel = new ValueMapperDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }


            case "ValueAxisModifier":
            {
                var panel = new ValueAxisModifierDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "ValueSwitcher":
            {
                var panel = new ValueSwitcherDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "SelectModel":
            {
                var panel = new ModelSelectorDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "PPMMapper":
            {
                var panel = new PPMMaperDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "PPMMapperEx":
            {
                var panel = new PPMMapperExDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "ButtonHoldSwitcher":
            {
                var panel = new ButtonHoldDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "HatToButtonMapper":
            {
                var panel = new HatToButtonMapperDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "EnterMenu":
            {
                var panel = new MenuEnterDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "MenuActions":
            {
                var panel = new MenuActionsDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "Constant":
            {
                var panel = new ConstantDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "ModeTrimmer":
            {
                var panel = new ModeTrimmerMixerDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }

            case "TrimmerEmulator":
            {
                var panel = new TrimmerEmulatorDesignPanel();
                panel.Deserialize(xElement);
                LinkPanel(panel, true);
                break;
            }
            }
        }