示例#1
0
 //Used by descendants that wants to raise the event
 protected virtual void OnLedLightChanged(SaitekPanelLEDPosition saitekPanelLEDPosition, PanelLEDColor panelLEDColor)
 {
     if (OnLedLightChangedA != null)
     {
         OnLedLightChangedA(InstanceId, saitekPanelLEDPosition, panelLEDColor);
     }
 }
示例#2
0
 //Used by descendants that wants to raise the event
 protected virtual void OnLedLightChanged(SaitekPanelLEDPosition saitekPanelLEDPosition, PanelLEDColor panelLEDColor)
 {
     OnLedLightChangedA?.Invoke(this, new LedLightChangeEventArgs()
     {
         UniqueId = InstanceId, LEDPosition = saitekPanelLEDPosition, LEDColor = panelLEDColor
     });
 }
        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);
        }
示例#5
0
        public override DcsOutputAndColorBinding CreateDcsOutputAndColorBinding(SaitekPanelLEDPosition saitekPanelLEDPosition, PanelLEDColor panelLEDColor, DCSBIOSOutput dcsBiosOutput)
        {
            var dcsOutputAndColorBinding = new DcsOutputAndColorBindingPZ55();

            dcsOutputAndColorBinding.DCSBiosOutputLED  = dcsBiosOutput;
            dcsOutputAndColorBinding.LEDColor          = panelLEDColor;
            dcsOutputAndColorBinding.SaitekLEDPosition = saitekPanelLEDPosition;
            return(dcsOutputAndColorBinding);
        }
示例#6
0
        public override DcsOutputAndColorBinding CreateDcsOutputAndColorBinding(SaitekPanelLEDPosition saitekPanelLEDPosition, PanelLEDColor panelLEDColor, DCSBIOSOutput dcsBiosOutput)
        {
            var dcsOutputAndColorBinding = new DcsOutputAndColorBindingBIP
            {
                DCSBiosOutputLED  = dcsBiosOutput,
                LEDColor          = panelLEDColor,
                SaitekLEDPosition = saitekPanelLEDPosition
            };

            return(dcsOutputAndColorBinding);
        }
示例#7
0
 public override DcsOutputAndColorBinding CreateDcsOutputAndColorBinding(SaitekPanelLEDPosition saitekPanelLEDPosition, PanelLEDColor panelLEDColor, DCSBIOSOutput dcsBiosOutput)
 {
     return(null);
 }
示例#8
0
 public abstract DcsOutputAndColorBinding CreateDcsOutputAndColorBinding(SaitekPanelLEDPosition saitekPanelLEDPosition, PanelLEDColor panelLEDColor, DCSBIOSOutput dcsBiosOutput);