예제 #1
0
        public override void ImportSettings(string settings)
        {
            if (string.IsNullOrEmpty(settings))
            {
                throw new ArgumentException("Import string empty. (BIPLinkPZ69)");
            }
            if (settings.StartsWith("RadioPanelBIPLink{"))
            {
                //RadioPanelBIPLink{1UpperCOM1}\o/BIPLight{Position_1_4|GREEN|FourSec|f5fe6e63e0c05a20f519d4b9e46fab3e}\o/BIPLight{Position_1_4|GREEN|FourSec|f5fe6e63e0c05a20f519d4b9e46fab3e}\o/Description["Set Engines On"]\o/\\?\hid#vid_06a3&pid_0d67#9&231fd360&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
                // 0 1 2 3
                var parameters = settings.Split(new[] { SeparatorChars }, StringSplitOptions.RemoveEmptyEntries);

                //RadioPanelBIPLink{1UpperCOM1}
                var param0 = parameters[0].Replace("RadioPanelBIPLink{", "").Replace("}", "").Trim();
                //1UpperCOM1
                _whenOnTurnedOn = param0.Substring(0, 1) == "1";
                param0          = param0.Substring(1);
                _panelPZ69Knob  = (RadioPanelPZ69KnobsEmulator)Enum.Parse(typeof(RadioPanelPZ69KnobsEmulator), param0);

                for (int i = 1; i < parameters.Length - 1; i++)
                {
                    if (parameters[i].StartsWith("BIPLight"))
                    {
                        var tmpBipLight = new BIPLight();
                        _bipLights.Add(GetNewKeyValue(), tmpBipLight);
                        tmpBipLight.ImportSettings(parameters[i]);
                    }
                    if (parameters[i].StartsWith("Description["))
                    {
                        var tmp = parameters[i].Replace("Description[", "").Replace("]", "");
                        _description = tmp;
                    }
                }
            }
        }
예제 #2
0
 public void ShowLight(BIPLight bipLight)
 {
     foreach (var backlitPanelBIP in _backlitPanels)
     {
         if (bipLight.Hash == backlitPanelBIP.Hash)
         {
             backlitPanelBIP.SetLED(bipLight.BIPLedPosition, bipLight.LEDColor);
         }
     }
 }
예제 #3
0
 public static void ShowLight(BIPLight bipLight)
 {
     BIPEventHandlerManager.ShowLight(bipLight);
 }