public void PZ69KnobChanged(bool isFirstReport, IEnumerable <object> hashSet)
        {
            lock (LockLCDUpdateObject)
            {
                Interlocked.Add(ref _doUpdatePanelLCD, 1);
                foreach (var radioPanelKnobObject in hashSet)
                {
                    var radioPanelKnob = (RadioPanelKnobMiG21Bis)radioPanelKnobObject;

                    switch (radioPanelKnob.RadioPanelPZ69Knob)
                    {
                    case RadioPanelPZ69KnobsMiG21Bis.UpperRadio:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            _currentUpperRadioMode = CurrentMiG21BisRadioMode.Radio;
                        }
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperRsbn:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            _currentUpperRadioMode = CurrentMiG21BisRadioMode.RSBN;
                        }
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperArc:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            _currentUpperRadioMode = CurrentMiG21BisRadioMode.ARC;
                        }
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperCom2:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperNav2:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperDme:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperXpdr:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerRadio:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            _currentLowerRadioMode = CurrentMiG21BisRadioMode.Radio;
                        }
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerRsbn:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            _currentLowerRadioMode = CurrentMiG21BisRadioMode.RSBN;
                        }
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerArc:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            _currentLowerRadioMode = CurrentMiG21BisRadioMode.ARC;
                        }
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerCom2:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerNav2:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerDme:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerXpdr:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperLargeFreqWheelInc:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperLargeFreqWheelDec:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperSmallFreqWheelInc:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperSmallFreqWheelDec:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerLargeFreqWheelInc:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerLargeFreqWheelDec:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerSmallFreqWheelInc:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerSmallFreqWheelDec:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperFreqSwitch:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            SendFrequencyToDCSBIOS(RadioPanelPZ69KnobsMiG21Bis.UpperFreqSwitch);
                        }
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerFreqSwitch:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            SendFrequencyToDCSBIOS(RadioPanelPZ69KnobsMiG21Bis.LowerFreqSwitch);
                        }
                        break;
                    }
                    }
                }
                AdjustFrequency(hashSet);
            }
        }
Exemplo n.º 2
0
        public void PZ69KnobChanged(bool isFirstReport, IEnumerable <object> hashSet)
        {
            if (isFirstReport)
            {
                return;
            }

            lock (LockLCDUpdateObject)
            {
                Interlocked.Increment(ref _doUpdatePanelLCD);
                foreach (var radioPanelKnobObject in hashSet)
                {
                    var radioPanelKnob = (RadioPanelKnobMiG21Bis)radioPanelKnobObject;

                    switch (radioPanelKnob.RadioPanelPZ69Knob)
                    {
                    case RadioPanelPZ69KnobsMiG21Bis.UpperRadio:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            _currentUpperRadioMode = CurrentMiG21BisRadioMode.Radio;
                        }

                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperRsbn:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            _currentUpperRadioMode = CurrentMiG21BisRadioMode.RSBN;
                        }

                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperArc:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            _currentUpperRadioMode = CurrentMiG21BisRadioMode.ARC;
                        }

                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperCom2:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperNav2:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperDme:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperXpdr:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerRadio:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            _currentLowerRadioMode = CurrentMiG21BisRadioMode.Radio;
                        }

                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerRsbn:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            _currentLowerRadioMode = CurrentMiG21BisRadioMode.RSBN;
                        }

                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerArc:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            _currentLowerRadioMode = CurrentMiG21BisRadioMode.ARC;
                        }

                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerCom2:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerNav2:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerDme:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerXpdr:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperLargeFreqWheelInc:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperLargeFreqWheelDec:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperSmallFreqWheelInc:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperSmallFreqWheelDec:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerLargeFreqWheelInc:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerLargeFreqWheelDec:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerSmallFreqWheelInc:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerSmallFreqWheelDec:
                    {
                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.UpperFreqSwitch:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            SendFrequencyToDCSBIOS(RadioPanelPZ69KnobsMiG21Bis.UpperFreqSwitch);
                        }

                        break;
                    }

                    case RadioPanelPZ69KnobsMiG21Bis.LowerFreqSwitch:
                    {
                        if (radioPanelKnob.IsOn)
                        {
                            SendFrequencyToDCSBIOS(RadioPanelPZ69KnobsMiG21Bis.LowerFreqSwitch);
                        }

                        break;
                    }
                    }

                    if (PluginManager.PlugSupportActivated && PluginManager.HasPlugin())
                    {
                        PluginManager.DoEvent(DCSFPProfile.SelectedProfile.Description, HIDInstance, PluginGamingPanelEnum.PZ69RadioPanel_PreProg_MIG21BIS, (int)radioPanelKnob.RadioPanelPZ69Knob, radioPanelKnob.IsOn, null);
                    }
                }

                AdjustFrequency(hashSet);
            }
        }