private void SendFrequencyToDCSBIOS(RadioPanelKnobAV8BNA knob) { if (IgnoreSwitchButtonOnce() && (knob.RadioPanelPZ69Knob == RadioPanelPZ69KnobsAV8BNA.UPPER_FREQ_SWITCH || knob.RadioPanelPZ69Knob == RadioPanelPZ69KnobsAV8BNA.LOWER_FREQ_SWITCH)) { //Don't do anything on the very first button press as the panel sends ALL //switches when it is manipulated the first time //This would cause unintended sync. return; } if (!DataHasBeenReceivedFromDCSBIOS) { //Don't start communication with DCS-BIOS before we have had a first contact from "them" return; } switch (knob.RadioPanelPZ69Knob) { case RadioPanelPZ69KnobsAV8BNA.UPPER_FREQ_SWITCH: { switch (_currentUpperRadioMode) { case CurrentAV8BNARadioMode.COMM1: { DCSBIOS.Send(knob.IsOn ? COMM1_PULL_PRESS : COMM1_PULL_RELEASE); ShowFrequenciesOnPanel(); break; } case CurrentAV8BNARadioMode.COMM2: { DCSBIOS.Send(knob.IsOn ? COMM2_PULL_PRESS : COMM2_PULL_RELEASE); ShowFrequenciesOnPanel(); break; } } break; } case RadioPanelPZ69KnobsAV8BNA.LOWER_FREQ_SWITCH: { switch (_currentLowerRadioMode) { case CurrentAV8BNARadioMode.COMM1: { DCSBIOS.Send(knob.IsOn ? COMM1_PULL_PRESS : COMM1_PULL_RELEASE); ShowFrequenciesOnPanel(); break; } case CurrentAV8BNARadioMode.COMM2: { DCSBIOS.Send(knob.IsOn ? COMM2_PULL_PRESS : COMM2_PULL_RELEASE); ShowFrequenciesOnPanel(); break; } } break; } } }
private void CreateRadioKnobs() { SaitekPanelKnobs = RadioPanelKnobAV8BNA.GetRadioPanelKnobs(); }