public override void ImportSettings(string settings)
        {
            if (string.IsNullOrEmpty(settings))
            {
                return;
            }
            var color = "";

            if (settings.Contains("SwitchPanelLedUp"))
            {
                SaitekLEDPosition = new SaitekPanelLEDPosition(SwitchPanelPZ55LEDPosition.UP);
            }
            else if (settings.Contains("SwitchPanelLedLeft"))
            {
                SaitekLEDPosition = new SaitekPanelLEDPosition(SwitchPanelPZ55LEDPosition.LEFT);
            }
            else if (settings.Contains("SwitchPanelLedRight"))
            {
                SaitekLEDPosition = new SaitekPanelLEDPosition(SwitchPanelPZ55LEDPosition.RIGHT);
            }
            //SwitchPanelLedUp{DARK|DCSBiosOutput{INTEGER_TYPE|Equals|0x0000|0x0000|0|0}}\o/\\?\hid#vid_06a3&pid_0d67#9&231fd360&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
            settings = settings.Split(Separator, StringSplitOptions.RemoveEmptyEntries)[0];
            //SwitchPanelLedUp{DARK|DCSBiosOutput{INTEGER_TYPE|Equals|0x0000|0x0000|0|0}}
            settings         = settings.Substring(settings.IndexOf("{", StringComparison.InvariantCulture) + 1);
            settings         = settings.Substring(0, settings.Length - 1);
            color            = settings.Substring(0, settings.IndexOf('|'));
            settings         = settings.Substring(settings.IndexOf('|') + 1);
            DCSBiosOutputLED = new DCSBIOSOutput();
            DCSBiosOutputLED.ImportString(settings);
            LEDColor = (PanelLEDColor)Enum.Parse(typeof(PanelLEDColor), color);
        }
        public override void ImportSettings(string settings)
        {
            if (string.IsNullOrEmpty(settings))
            {
                return;
            }
            //PanelBIP{Position_1_4|GREEN|DCSBiosOutput{INTEGER_TYPE|Equals|0x14be|0x4000|14|1}}\o/\\?\hid#vid_06a3&pid_0b4e#9&1f079469&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
            settings = settings.Split(Separator, StringSplitOptions.RemoveEmptyEntries)[0];
            //PanelBIP{Position_1_4|GREEN|DCSBiosOutput{INTEGER_TYPE|Equals|0x14be|0x4000|14|1}}
            settings = settings.Substring(settings.IndexOf("{", StringComparison.InvariantCulture) + 1);
            //Position_1_4|GREEN|DCSBiosOutput{INTEGER_TYPE|Equals|0x14be|0x4000|14|1}}
            settings = settings.Substring(0, settings.Length - 1);
            //Position_1_4|GREEN|DCSBiosOutput{INTEGER_TYPE|Equals|0x14be|0x4000|14|1}
            var dcsBiosOutputString = settings.Substring(settings.IndexOf("DCSBiosOutput{", StringComparison.InvariantCulture));

            //DCSBiosOutput{INTEGER_TYPE|Equals|0x14be|0x4000|14|1}

            settings = settings.Remove(settings.IndexOf("DCSBiosOutput{", StringComparison.InvariantCulture));
            //Position_1_4|GREEN|

            var settingsArray = settings.Split(new [] { '|' }, StringSplitOptions.RemoveEmptyEntries);

            SaitekLEDPosition = new SaitekPanelLEDPosition((BIPLedPositionEnum)Enum.Parse(typeof(BIPLedPositionEnum), settingsArray[0]));
            LEDColor          = (PanelLEDColor)Enum.Parse(typeof(PanelLEDColor), settingsArray[1]);
            DCSBiosOutputLED  = new DCSBIOSOutput();
            DCSBiosOutputLED.ImportString(dcsBiosOutputString);
        }
Beispiel #3
0
        internal void ImportSettings(string settings)
        {
            if (string.IsNullOrEmpty(settings))
            {
                throw new ArgumentException("Import string empty. (DCSBIOSBindingPZ69)");
            }
            if (settings.StartsWith("RadioPanelDCSBIOSLCD{") && settings.Contains("DCSBiosOutput{"))
            {
                //RadioPanelDCSBIOSLCD{COM1}\o/{LowerLCD}\o/DCSBiosOutput{ANT_EGIHQTOD|Equals|0}
                var parameters = settings.Split(new[] { Constants.SEPARATOR_SYMBOL }, StringSplitOptions.RemoveEmptyEntries);

                //[0]
                //RadioPanelDCSBIOSLCD{COM1}
                var param0 = parameters[0].Replace("RadioPanelDCSBIOSLCD{", "").Replace("}", "");
                _pz69DialPosition = (PZ69DialPosition)Enum.Parse(typeof(PZ69DialPosition), param0);

                //[1]
                //{LowerLCD}
                var param1 = parameters[1].Replace("{", "").Replace("}", "").Trim();
                _pz69LCDPosition = (PZ69LCDPosition)Enum.Parse(typeof(PZ69LCDPosition), param1);

                //[2]
                //DCSBiosOutput{ANT_EGIHQTOD|Equals|0}
                _dcsbiosOutput = new DCSBIOSOutput();
                _dcsbiosOutput.ImportString(parameters[2]);
            }
            if (settings.StartsWith("RadioPanelDCSBIOSLCD{") && settings.Contains("DCSBiosOutputFormula{"))
            {
                //RadioPanelDCSBIOSLCD{COM1}\o/{UpperLCD}\o/DCSBiosOutputFormula{ANT_EGIHQTOD+10}
                var parameters = settings.Split(new[] { Constants.SEPARATOR_SYMBOL }, StringSplitOptions.RemoveEmptyEntries);

                //[0]
                //MultiPanelDCSBIOSFormulaLCD{COM1}
                var param0 = parameters[0].Replace("RadioPanelDCSBIOSLCD{", "").Replace("}", "").Trim();
                _pz69DialPosition = (PZ69DialPosition)Enum.Parse(typeof(PZ69DialPosition), param0);

                //[1]
                //{UpperLCD}
                var param1 = parameters[1].Replace("{", "").Replace("}", "").Trim();
                _pz69LCDPosition = (PZ69LCDPosition)Enum.Parse(typeof(PZ69LCDPosition), param1);

                //[2]
                //DCSBiosOutputFormula{ANT_EGIHQTOD+10}
                _dcsbiosOutputFormula = new DCSBIOSOutputFormula();
                _dcsbiosOutputFormula.ImportString(parameters[2]);
            }
        }
Beispiel #4
0
        internal void ImportSettings(string settings)
        {
            if (string.IsNullOrEmpty(settings))
            {
                throw new ArgumentException("Import string empty. (DCSBIOSBindingPZ70)");
            }
            if (settings.StartsWith("MultiPanelDCSBIOSControlLCD{") && settings.Contains("DCSBiosOutput{"))
            {
                //MultiPanelDCSBIOSControlLCD{KNOB_ALT|UpperALT}\o/DCSBiosOutput{AAP_EGIPWR|Equals|0}\o/\\?\hid#vid_06a3&pid_0d67#9&231fd360&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
                var parameters = settings.Split(new[] { SeparatorChars }, StringSplitOptions.RemoveEmptyEntries);

                //MultiPanelDCSBIOSControlLCD{KNOB_ALT|UpperALT}
                var param0 = parameters[0].Substring(parameters[0].IndexOf("{", StringComparison.InvariantCulture) + 1);
                //KNOB_ALT|UpperALT}
                param0 = param0.Remove(param0.Length - 1, 1);
                //KNOB_ALT|UpperALT
                var knobAndLcd = param0.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                _multiPanelPZ70Knob = (MultiPanelPZ70Knobs)Enum.Parse(typeof(MultiPanelPZ70Knobs), knobAndLcd[0]);
                _pz70LCDPosition    = (PZ70LCDPosition)Enum.Parse(typeof(PZ70LCDPosition), knobAndLcd[1]);

                //DCSBiosOutput{AAP_EGIPWR|Equals|0}
                _dcsbiosOutput = new DCSBIOSOutput();
                _dcsbiosOutput.ImportString(parameters[1]);
            }
            if (settings.StartsWith("MultiPanelDCSBIOSControlLCD{") && settings.Contains("DCSBiosOutputFormula{"))
            {
                //MultiPanelDCSBIOSFormulaLCD{KNOB_ALT|UpperALT}\o/DCSBiosOutputFormula{(AAP_EGIPWR+1)/2}\o/\\?\hid#vid_06a3&pid_0d67#9&231fd360&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
                var parameters = settings.Split(new[] { SeparatorChars }, StringSplitOptions.RemoveEmptyEntries);

                //MultiPanelDCSBIOSFormulaLCD{KNOB_ALT|UpperALT}
                var param0 = parameters[0].Substring(parameters[0].IndexOf("{", StringComparison.InvariantCulture) + 1);
                //KNOB_ALT|UpperALT}
                param0 = param0.Remove(param0.Length - 1, 1);
                //KNOB_ALT|UpperALT
                var knobAndLcd = param0.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
                _multiPanelPZ70Knob = (MultiPanelPZ70Knobs)Enum.Parse(typeof(MultiPanelPZ70Knobs), knobAndLcd[0]);
                _pz70LCDPosition    = (PZ70LCDPosition)Enum.Parse(typeof(PZ70LCDPosition), knobAndLcd[1]);

                //DCSBiosOutputFormula{(AAP_EGIPWR+1)/2}
                _dcsbiosOutputFormula = new DCSBIOSOutputFormula();
                _dcsbiosOutputFormula.ImportString(parameters[1]);
            }
        }