public DCSBiosInputWindow(DCSAirframe dcsAirframe, string description)
 {
     InitializeComponent();
     _dcsAirframe     = dcsAirframe;
     _description     = description;
     _dcsbiosControls = DCSBIOSControlLocator.GetInputControls();
 }
        public sealed override void Startup()
        {
            try
            {
                StartupBase("Fw 190");

                //COM1
                _fug16ZyPresetDcsbiosOutputPresetDial = DCSBIOSControlLocator.GetDCSBIOSOutput("RADIO_MODE");
                _fug16ZyFineTuneDcsbiosOutputDial     = DCSBIOSControlLocator.GetDCSBIOSOutput("FUG16_TUNING");

                //COM2
                _fug25AIFFDcsbiosOutputDial = DCSBIOSControlLocator.GetDCSBIOSOutput("FUG25_MODE");

                //NAV1
                _homingDcsbiosOutputPresetDial = DCSBIOSControlLocator.GetDCSBIOSOutput("FT_ZF_SWITCH");


                StartListeningForPanelChanges();
                //IsAttached = true;
            }
            catch (Exception ex)
            {
                Common.LogError(ex);
            }
        }
 private void CopyValues()
 {
     try
     {
         //This is were DCSBiosOutput (subset of DCSBIOSControl) get populated from DCSBIOSControl
         if (string.IsNullOrEmpty(TextBoxTriggerValue.Text))
         {
             throw new Exception("Value cannot be empty");
         }
         if (ComboBoxComparisonCriteria.SelectedValue == null)
         {
             throw new Exception("Comparison criteria cannot be empty");
         }
         if (_dcsbiosControl == null)
         {
             _dcsbiosControl = DCSBIOSControlLocator.GetControl(TextBoxControlId.Text);
         }
         _dcsBiosOutput.Consume(_dcsbiosControl);
         if (!_showCriteria)
         {
             //Value isn't used anyways
             _dcsBiosOutput.DCSBiosOutputComparison = DCSBiosOutputComparison.Equals;
         }
         else
         {
             _dcsBiosOutput.DCSBiosOutputComparison = EnumEx.GetValueFromDescription <DCSBiosOutputComparison>(ComboBoxComparisonCriteria.SelectedValue.ToString());
         }
         try
         {
             if (_showCriteria)
             {
                 //Assume only Integer trigger values can be used. That is how it should be!!
                 try
                 {
                     var f = int.Parse(TextBoxTriggerValue.Text);
                 }
                 catch (Exception e)
                 {
                     throw new Exception("Error while checking Trigger value. Only integers are allowed : " + e.Message);
                 }
                 if (_dcsBiosOutput.DCSBiosOutputType == DCSBiosOutputType.INTEGER_TYPE)
                 {
                     _dcsBiosOutput.SpecifiedValueInt = (uint)Convert.ToInt32(TextBoxTriggerValue.Text);
                 }
                 else
                 {
                     throw new Exception("Error, DCSBIOSOutput can only have a Integer type output. This has String : " + _dcsBiosOutput.ControlId);
                 }
             }
         }
         catch (Exception e)
         {
             throw new Exception("Error while checking Value format : " + e.Message);
         }
     }
     catch (Exception e)
     {
         Common.ShowErrorMessageBox(e, "Error in CopyValues() : ");
     }
 }
示例#4
0
        public sealed override void Startup()
        {
            try
            {
                StartupBase("AJS-37");

                //COM1


                //COM2


                //NAV1
                _tilsChannelSelectorDcsbiosOutput      = DCSBIOSControlLocator.GetDCSBIOSOutput("TILS_CHANNEL_SELECT");
                _tilsChannelLayerSelectorDcsbiosOutput = DCSBIOSControlLocator.GetDCSBIOSOutput("TILS_CHANNEL_LAYER");
                _masterModeSelectorDcsbiosOutput       = DCSBIOSControlLocator.GetDCSBIOSOutput("MASTER_MODE_SELECT");

                //NAV2


                //ADF


                //XPDR

                StartListeningForPanelChanges();
                //IsAttached = true;
            }
            catch (Exception ex)
            {
                Common.LogError(ex);
            }
        }
        public override sealed void Startup()
        {
            try
            {
                StartupBase("Fw 190");

                //COM1
                _fug16ZyPresetDcsbiosOutputPresetDial = DCSBIOSControlLocator.GetDCSBIOSOutput("RADIO_MODE");
                _fug16ZyFineTuneDcsbiosOutputDial     = DCSBIOSControlLocator.GetDCSBIOSOutput("FUG16_TUNING");

                //COM2
                _fug25aIFFDcsbiosOutputDial = DCSBIOSControlLocator.GetDCSBIOSOutput("FUG25_MODE");

                //NAV1
                _homingDcsbiosOutputPresetDial = DCSBIOSControlLocator.GetDCSBIOSOutput("FT_ZF_SWITCH");


                if (HIDSkeletonBase.HIDReadDevice != null && !Closed)
                {
                    HIDSkeletonBase.HIDReadDevice.ReadReport(OnReport);
                }
                //IsAttached = true;
            }
            catch (Exception ex)
            {
                Common.DebugP("RadioPanelPZ69Fw190.StartUp() : " + ex.Message);
                Common.LogError(321654, ex);
            }
        }
        public sealed override void Startup()
        {
            try
            {
                StartupBase("MiG21-Bis");


                //Radio
                _radioDcsbiosOutputFreqSelectorPosition = DCSBIOSControlLocator.GetDCSBIOSOutput("RAD_CHAN");

                //RSBN
                _rsbnNavChannelCockpitOutput = DCSBIOSControlLocator.GetDCSBIOSOutput("RSBN_CHAN");
                _rsbnILSChannelCockpitOutput = DCSBIOSControlLocator.GetDCSBIOSOutput("PRMG_CHAN");

                //ARC
                _arcSectorCockpitOutput        = DCSBIOSControlLocator.GetDCSBIOSOutput("ARC_ZONE");
                _arcPresetChannelCockpitOutput = DCSBIOSControlLocator.GetDCSBIOSOutput("ARC_CHAN");

                StartListeningForPanelChanges();
                //IsAttached = true;
            }
            catch (Exception ex)
            {
                Common.LogError(ex);
            }
        }
        public override sealed void Startup()
        {
            try
            {
                StartupBase("MiG21-Bis");


                //Radio
                _radioDcsbiosOutputFreqSelectorPosition = DCSBIOSControlLocator.GetDCSBIOSOutput("RAD_CHAN");

                //RSBN
                _rsbnNavChannelCockpitOutput = DCSBIOSControlLocator.GetDCSBIOSOutput("RSBN_CHAN");
                _rsbnILSChannelCockpitOutput = DCSBIOSControlLocator.GetDCSBIOSOutput("PRMG_CHAN");

                //ARC
                _arcSectorCockpitOutput        = DCSBIOSControlLocator.GetDCSBIOSOutput("ARC_ZONE");
                _arcPresetChannelCockpitOutput = DCSBIOSControlLocator.GetDCSBIOSOutput("ARC_CHAN");

                if (HIDSkeletonBase.HIDReadDevice != null && !Closed)
                {
                    HIDSkeletonBase.HIDReadDevice.ReadReport(OnReport);
                }
                //IsAttached = true;
            }
            catch (Exception ex)
            {
                Common.DebugP("RadioPanelPZ69MiG21bis.StartUp() : " + ex.Message);
                Common.LogError(321654, ex);
            }
        }
        public override sealed void Startup()
        {
            try
            {
                StartupBase("P-51D");

                //VHF
                _vhf1DcsbiosOutputPresetButton0 = DCSBIOSControlLocator.GetDCSBIOSOutput("VHF_RADIO_ON_OFF");
                _vhf1DcsbiosOutputPresetButton1 = DCSBIOSControlLocator.GetDCSBIOSOutput("VHF_RADIO_CHAN_A");
                _vhf1DcsbiosOutputPresetButton2 = DCSBIOSControlLocator.GetDCSBIOSOutput("VHF_RADIO_CHAN_B");
                _vhf1DcsbiosOutputPresetButton3 = DCSBIOSControlLocator.GetDCSBIOSOutput("VHF_RADIO_CHAN_C");
                _vhf1DcsbiosOutputPresetButton4 = DCSBIOSControlLocator.GetDCSBIOSOutput("VHF_RADIO_CHAN_D");


                if (HIDSkeletonBase.HIDReadDevice != null && !Closed)
                {
                    HIDSkeletonBase.HIDReadDevice.ReadReport(OnReport);
                }
                //IsAttached = true;
            }
            catch (Exception ex)
            {
                Common.DebugP("RadioPanelPZ69P51D.StartUp() : " + ex.Message);
                Common.LogError(321654, ex);
            }
        }
示例#9
0
        public override sealed void Startup()
        {
            try
            {
                StartupBase("Bf 109");

                //COM1
                _fug16ZyPresetDcsbiosOutputPresetDial = DCSBIOSControlLocator.GetDCSBIOSOutput("RADIO_MODE");
                _fug16ZyFineTuneDcsbiosOutputDial     = DCSBIOSControlLocator.GetDCSBIOSOutput("FUG16_TUNING");

                //COM2
                _fug25aIFFDcsbiosOutputDial = DCSBIOSControlLocator.GetDCSBIOSOutput("FUG25_MODE");

                //NAV1
                _homingDcsbiosOutputPresetDial = DCSBIOSControlLocator.GetDCSBIOSOutput("FT_ZF_SWITCH");


                StartListeningForPanelChanges();
                //IsAttached = true;
            }
            catch (Exception ex)
            {
                Common.DebugP("RadioPanelPZ69Bf109.StartUp() : " + ex.Message);
                Common.LogError(321654, ex);
            }
        }
示例#10
0
 private void CopyValues()
 {
     if (CheckBoxUseFormula.IsChecked.HasValue && CheckBoxUseFormula.IsChecked.Value)
     {
         //Use formula
         try
         {
             _dcsbiosOutputFormula = new DCSBIOSOutputFormula(TextBoxFormula.Text);
         }
         catch (Exception e)
         {
             throw new Exception("Error while creating formula object : " + e.Message);
         }
     }
     else
     {
         //Use single DCSBIOSOutput
         //This is were DCSBiosOutput (subset of DCSBIOSControl) get populated from DCSBIOSControl
         try
         {
             if (_dcsbiosControl == null && !string.IsNullOrWhiteSpace(TextBoxControlId.Text))
             {
                 _dcsbiosControl = DCSBIOSControlLocator.GetControl(TextBoxControlId.Text);
                 _dcsBiosOutput.Consume(_dcsbiosControl);
             }
         }
         catch (Exception e)
         {
             throw new Exception("Error while creating DCSBIOSOutput object : " + e.Message);
         }
     }
 }
        public override sealed void Startup()
        {
            try
            {
                StartupBase("AJS-37");

                //COM1


                //COM2


                //NAV1
                _tilsChannelSelectorDcsbiosOutput      = DCSBIOSControlLocator.GetDCSBIOSOutput("TILS_CHANNEL_SELECT");
                _tilsChannelLayerSelectorDcsbiosOutput = DCSBIOSControlLocator.GetDCSBIOSOutput("TILS_CHANNEL_LAYER");
                _masterModeSelectorDcsbiosOutput       = DCSBIOSControlLocator.GetDCSBIOSOutput("MASTER_MODE_SELECT");

                //NAV2


                //ADF
                //TODO


                //XPDR

                StartListeningForPanelChanges();
                //IsAttached = true;
            }
            catch (Exception ex)
            {
                Common.DebugP("RadioPanelPZ69AJS37.StartUp() : " + ex.Message);
                Common.LogError(321654, ex);
            }
        }
示例#12
0
        public sealed override void Startup()
        {
            try
            {
                StartupBase("Spitfire LF Mk. IX");

                //COM1
                _hfRadioOffDcsbiosOutput             = DCSBIOSControlLocator.GetDCSBIOSOutput("RCTRL_OFF");
                _hfRadioChannelAPresetDcsbiosOutput  = DCSBIOSControlLocator.GetDCSBIOSOutput("RCTRL_A");
                _hfRadioChannelBPresetDcsbiosOutput  = DCSBIOSControlLocator.GetDCSBIOSOutput("RCTRL_B");
                _hfRadioChannelCPresetDcsbiosOutput  = DCSBIOSControlLocator.GetDCSBIOSOutput("RCTRL_C");
                _hfRadioChannelDPresetDcsbiosOutput  = DCSBIOSControlLocator.GetDCSBIOSOutput("RCTRL_D");
                _hfRadioMode1DialPresetDcsbiosOutput = DCSBIOSControlLocator.GetDCSBIOSOutput("RCTRL_T_MODE1");
                _hfRadioMode2DialPresetDcsbiosOutput = DCSBIOSControlLocator.GetDCSBIOSOutput("RCTRL_T_MODE2");
                //COM2
                _iffBiffDcsbiosOutputDial = DCSBIOSControlLocator.GetDCSBIOSOutput("IFF_B");
                _iffDiffDcsbiosOutputDial = DCSBIOSControlLocator.GetDCSBIOSOutput("IFF_D");


                StartListeningForPanelChanges();
                //IsAttached = true;
            }
            catch (Exception ex)
            {
                Common.LogError(ex);
            }
        }
 public DCSBiosOutputTriggerWindow(string description, bool showCriteria = true)
 {
     InitializeComponent();
     _showCriteria  = showCriteria;
     _description   = description;
     _dcsBiosOutput = new DCSBIOSOutput();
     DCSBIOSControlLocator.LoadControls();
     _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
 }
 public DCSBiosOutputWindow(string description, bool userEditsDescription = false)
 {
     InitializeComponent();
     _description          = description;
     _userEditsDescription = userEditsDescription;
     _dcsBiosOutput        = new DCSBIOSOutput();
     DCSBIOSControlLocator.LoadControls();
     _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
 }
 public DCSBiosInputWindow(string description, DCSBIOSInput dcsBiosInput)
 {
     InitializeComponent();
     _description     = description;
     _dcsBiosInput    = dcsBiosInput;
     _dcsbiosControl  = DCSBIOSControlLocator.GetControl(_dcsBiosInput.ControlId);
     _dcsbiosControls = DCSBIOSControlLocator.GetInputControls();
     PopulateComboBoxInterfaceType(_dcsBiosInput);
 }
示例#16
0
 public DCSBiosOutputFormulaWindow(DCSAirframe dcsAirframe, string description, DCSBIOSOutputFormula dcsBiosOutputFormula)
 {
     InitializeComponent();
     _dcsAirframe          = dcsAirframe;
     _description          = description;
     _dcsbiosOutputFormula = dcsBiosOutputFormula;
     DCSBIOSControlLocator.LoadControls();
     _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
 }
示例#17
0
        public StreamDeckDCSBIOSDecoderWindow(DCSBIOSDecoder dcsbiosDecoder, StreamDeckPanel streamDeckPanel)
        {
            InitializeComponent();
            _dcsbiosDecoder = dcsbiosDecoder;
            DCSBIOSControlLocator.LoadControls();
            _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
            _streamDeckPanel = streamDeckPanel;

            BIOSEventHandler.AttachDataListener(this);
        }
        public JaceSandboxWindow()
        {
            BIOSEventHandler.AttachDataListener(this);
            DCSBIOSControlLocator.LoadControls();
            _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
            var thread = new Thread(ThreadLoop);

            thread.Start();
            InitializeComponent();
        }
示例#19
0
 public DCSBiosInputWindow()
 {
     InitializeComponent();
     DCSBIOSControlLocator.LoadControls();
     _dcsbiosControls = DCSBIOSControlLocator.GetInputControls();
     foreach (var dcsbiosControl in _dcsbiosControls)
     {
         Debug.Print(dcsbiosControl.identifier);
     }
 }
        public StreamDeckDCSBIOSDecoderWindow(DCSBIOSDecoder dcsbiosDecoder, StreamDeckPanel streamDeckPanel)
        {
            InitializeComponent();
            _dcsbiosDecoder = dcsbiosDecoder;
            DCSBIOSControlLocator.LoadControls();
            _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
            _streamDeckPanel = streamDeckPanel;
            var thread = new Thread(ThreadLoop);

            thread.Start();
        }
 public DCSBiosOutputFormulaWindow(string description, bool userEditsDescription = false, bool showDecimalSetting = false)
 {
     InitializeComponent();
     _description          = description;
     _userEditsDescription = userEditsDescription;
     _showDecimalSetting   = showDecimalSetting;
     _dcsBiosOutput        = new DCSBIOSOutput();
     DCSBIOSControlLocator.LoadControls();
     _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
     BIOSEventHandler.AttachDataListener(this);
 }
 public DCSBiosOutputFormulaWindow(DCSAirframe dcsAirframe, string description, DCSBIOSOutput dcsBiosOutput, bool userEditsDescription = false)
 {
     InitializeComponent();
     _dcsAirframe          = dcsAirframe;
     _description          = description;
     _userEditsDescription = userEditsDescription;
     _dcsBiosOutput        = dcsBiosOutput;
     DCSBIOSControlLocator.LoadControls();
     _dcsbiosControl  = DCSBIOSControlLocator.GetControl(_dcsBiosOutput.ControlId);
     _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
 }
        public JaceSandboxWindow(DCSBIOS dcsbios)
        {
            _dcsbios = dcsbios;
            _dcsbios.AttachDataReceivedListener(this);
            DCSBIOSControlLocator.LoadControls();
            _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
            var thread = new Thread(ThreadLoop);

            thread.Start();
            InitializeComponent();
        }
 private void Control_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         if (_dataGridValues.SelectedItems.Count == 1)
         {
             var dcsbiosControl = (DCSBIOSControl)_dataGridValues.SelectedItem;
             var dcsBiosOutput  = DCSBIOSControlLocator.GetDCSBIOSOutput(dcsbiosControl.identifier);
             var textBox        = (TextBox)_dataGridValues.Tag;
             if (Equals(textBox, TextBoxSearch1))
             {
                 _dcsbiosOutput1     = dcsBiosOutput;
                 _dcsbiosControl1    = dcsbiosControl;
                 TextBoxId1.Text     = _dcsbiosControl1.identifier;
                 TextBoxSearch1.Text = _typeToSearch;
             }
             if (Equals(textBox, TextBoxSearch2))
             {
                 _dcsbiosOutput2     = dcsBiosOutput;
                 _dcsbiosControl2    = dcsbiosControl;
                 TextBoxId2.Text     = _dcsbiosControl2.identifier;
                 TextBoxSearch2.Text = _typeToSearch;
             }
             if (Equals(textBox, TextBoxSearch3))
             {
                 _dcsbiosOutput3     = dcsBiosOutput;
                 _dcsbiosControl3    = dcsbiosControl;
                 TextBoxId3.Text     = _dcsbiosControl3.identifier;
                 TextBoxSearch3.Text = _typeToSearch;
             }
             if (Equals(textBox, TextBoxSearch4))
             {
                 _dcsbiosOutput4     = dcsBiosOutput;
                 _dcsbiosControl4    = dcsbiosControl;
                 TextBoxId4.Text     = _dcsbiosControl4.identifier;
                 TextBoxSearch4.Text = _typeToSearch;
             }
             if (Equals(textBox, TextBoxSearch5))
             {
                 _dcsbiosOutput5     = dcsBiosOutput;
                 _dcsbiosControl5    = dcsbiosControl;
                 TextBoxId5.Text     = _dcsbiosControl5.identifier;
                 TextBoxSearch5.Text = _typeToSearch;
             }
             SetFormState();
         }
         _popupSearch.IsOpen = false;
         SetFormState();
     }
     catch (Exception ex)
     {
         Common.ShowErrorMessageBox(ex);
     }
 }
 public DCSBiosOutputTriggerWindow(DCSAirframe dcsAirframe, string description, DCSBIOSOutput dcsBiosOutput, bool showCriteria = true)
 {
     InitializeComponent();
     _showCriteria  = showCriteria;
     _dcsAirframe   = dcsAirframe;
     _description   = description;
     _dcsBiosOutput = dcsBiosOutput;
     DCSBIOSControlLocator.LoadControls();
     _dcsbiosControl  = DCSBIOSControlLocator.GetControl(_dcsBiosOutput.ControlId);
     _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
 }
        public StreamDeckDCSBIOSDecoderWindow(string streamDeckInstanceId, EnumStreamDeckButtonNames streamDeckButton)
        {
            InitializeComponent();
            _dcsbiosDecoder = new DCSBIOSDecoder();
            _dcsbiosDecoder.SetEssentials(streamDeckInstanceId, streamDeckButton);
            LoadDefaults();
            DCSBIOSControlLocator.LoadControls();
            _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
            _dcsbiosDecoder.StreamDeckButtonName = streamDeckButton;
            _streamDeckInstanceId = streamDeckInstanceId;
            var thread = new Thread(ThreadLoop);

            thread.Start();
        }
 public DCSBiosOutputFormulaWindow(string description, DCSBIOSOutput dcsBiosOutput, bool limitDecimals, int decimalPlaces, bool userEditsDescription = false, bool showDecimalSetting = false)
 {
     InitializeComponent();
     _description          = description;
     _userEditsDescription = userEditsDescription;
     _showDecimalSetting   = showDecimalSetting;
     _dcsBiosOutput        = dcsBiosOutput;
     _limitDecimals        = limitDecimals;
     _decimalPlaces        = decimalPlaces;
     DCSBIOSControlLocator.LoadControls();
     _dcsbiosControl  = DCSBIOSControlLocator.GetControl(_dcsBiosOutput.ControlId);
     _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
     BIOSEventHandler.AttachDataListener(this);
 }
示例#28
0
 public StreamDeckDCSBIOSDecoderWindow(StreamDeckPanel streamDeckPanel)
 {
     InitializeComponent();
     _streamDeckPanel = streamDeckPanel;
     _dcsbiosDecoder  = new DCSBIOSDecoder
     {
         DecoderSourceType       = DCSBiosOutputType.IntegerType,
         StreamDeckPanelInstance = streamDeckPanel,
         StreamDeckButtonName    = streamDeckPanel.SelectedButtonName
     };
     LoadDefaults();
     DCSBIOSControlLocator.LoadControls();
     _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
     BIOSEventHandler.AttachDataListener(this);
 }
        public StreamDeckDCSBIOSDecoderWindow(string panelHash)
        {
            InitializeComponent();
            _dcsbiosDecoder = new DCSBIOSDecoder();
            _dcsbiosDecoder.DecoderSourceType = DCSBiosOutputType.INTEGER_TYPE;
            _dcsbiosDecoder.PanelHash         = panelHash;
            LoadDefaults();
            DCSBIOSControlLocator.LoadControls();
            _dcsbiosControls = DCSBIOSControlLocator.GetIntegerOutputControls();
            _dcsbiosDecoder.StreamDeckButtonName = StreamDeckPanel.GetInstance(panelHash).SelectedButtonName;
            _panelHash = panelHash;
            var thread = new Thread(ThreadLoop);

            thread.Start();
        }
 private void CopyValues()
 {
     //Use single DCSBIOSOutput
     //This is were DCSBiosOutput (subset of DCSBIOSControl) get populated from DCSBIOSControl
     try
     {
         if (_dcsbiosControl == null && !string.IsNullOrWhiteSpace(TextBoxControlId.Text))
         {
             _dcsbiosControl = DCSBIOSControlLocator.GetControl(TextBoxControlId.Text);
             _dcsBiosOutput.Consume(_dcsbiosControl);
         }
     }
     catch (Exception ex)
     {
         throw new Exception($"Error while creating DCSBIOSOutput object : {ex.Message}");
     }
 }