Beispiel #1
0
        public void AddOrUpdateLCDBinding(DCSBIOSOutputFormula dcsbiosOutputFormula, PZ69LCDPosition pz69LCDPosition)
        {
            var found            = false;
            var pz69DialPosition = _pz69UpperDialPosition;

            if (pz69LCDPosition == PZ69LCDPosition.LOWER_STBY_RIGHT || pz69LCDPosition == PZ69LCDPosition.LOWER_ACTIVE_LEFT)
            {
                pz69DialPosition = _pz69LowerDialPosition;
            }
            foreach (var dcsBiosBindingLCD in _dcsBiosLcdBindings)
            {
                if (dcsBiosBindingLCD.DialPosition == pz69DialPosition && dcsBiosBindingLCD.PZ69LcdPosition == pz69LCDPosition)
                {
                    dcsBiosBindingLCD.DCSBIOSOutputFormulaObject = dcsbiosOutputFormula;
                    Debug.Print("3 found");
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                var dcsBiosBindingLCD = new DCSBIOSBindingLCDPZ69();
                dcsBiosBindingLCD.DialPosition = pz69DialPosition;
                dcsBiosBindingLCD.DCSBIOSOutputFormulaObject = dcsbiosOutputFormula;
                dcsBiosBindingLCD.PZ69LcdPosition            = pz69LCDPosition;
                _dcsBiosLcdBindings.Add(dcsBiosBindingLCD);
            }
            IsDirtyMethod();
        }
Beispiel #2
0
 public override void ImportSettings(List <string> settings)
 {
     //Clear current bindings
     ClearSettings();
     if (settings == null || settings.Count == 0)
     {
         return;
     }
     foreach (var setting in settings)
     {
         if (!setting.StartsWith("#") && setting.Length > 2 && setting.Contains(InstanceId))
         {
             if (setting.StartsWith("RadioPanelKeyDialPos{"))
             {
                 var keyBinding = new KeyBindingPZ69DialPosition();
                 keyBinding.ImportSettings(setting);
                 _keyBindings.Add(keyBinding);
             }
             else if (setting.StartsWith("PZ69DisplayValue{"))
             {
                 var radioPanelPZ69DisplayValue = new RadioPanelPZ69DisplayValue();
                 radioPanelPZ69DisplayValue.ImportSettings(setting);
                 _displayValues.Add(radioPanelPZ69DisplayValue);
             }
             else if (setting.StartsWith("RadioPanelBIPLink{"))
             {
                 var bipLinkPZ69 = new BIPLinkPZ69();
                 bipLinkPZ69.ImportSettings(setting);
                 _bipLinks.Add(bipLinkPZ69);
             }
             else if (setting.StartsWith("RadioPanelDCSBIOSLCD{"))
             {
                 var dcsbiosBindingLCDPZ69 = new DCSBIOSBindingLCDPZ69();
                 dcsbiosBindingLCDPZ69.ImportSettings(setting);
                 _dcsBiosLcdBindings.Add(dcsbiosBindingLCDPZ69);
             }
             else if (setting.StartsWith("RadioPanelDCSBIOSControl{"))
             {
                 var dcsbiosBindingPZ69 = new DCSBIOSBindingPZ69();
                 dcsbiosBindingPZ69.ImportSettings(setting);
                 _dcsBiosBindings.Add(dcsbiosBindingPZ69);
             }
         }
     }
     OnSettingsApplied();
 }