Пример #1
0
        private void RadioRefresh(object sender, EventArgs eventArgs)
        {
            var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo;

            bool first = true;

            foreach (var radio in radioControlGroup)
            {
                radio.RepaintRadioReceive();
                radio.RepaintRadioStatus();

                //TODO show and hide radio 4 if its visible
            }

            Intercom.RepaintRadioStatus();

            TransponderPanel.RepaintTransponderStatus();


            if ((dcsPlayerRadioInfo != null) && dcsPlayerRadioInfo.IsCurrent())
            {
                var avalilableRadios = 0;

                for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++)
                {
                    if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED)
                    {
                        avalilableRadios++;
                    }
                }

                if (avalilableRadios > 1)
                {
                    if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS)
                    {
                        ControlText.Text = "HOTAS Controls";
                    }
                    else
                    {
                        ControlText.Text = "Cockpit Controls";
                    }
                }
                else
                {
                    ControlText.Text = "";
                }
            }
            else
            {
                ControlText.Text = "";
            }

            FocusDCS();
        }
Пример #2
0
        private void RadioRefresh(object sender, EventArgs eventArgs)
        {
            var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo;

            foreach (var radio in radioControlGroup)
            {
                radio.RepaintRadioStatus();
                radio.RepaintRadioReceive();
            }

            Intercom.RepaintRadioStatus();

            TransponderPanel.RepaintTransponderStatus();



            if ((dcsPlayerRadioInfo != null) && dcsPlayerRadioInfo.IsCurrent())
            {
                var availableRadios = 0;

                //handle 4th radio on the overlay or not
                if (dcsPlayerRadioInfo.radios.Length < 5)
                {
                    Radio4.Visibility = Visibility.Collapsed;
                    if (MinHeight != _originalMinHeight)
                    {
                        MinHeight = _originalMinHeight;
                        Recalculate();
                    }
                }
                else
                {
                    if (dcsPlayerRadioInfo.radios[4].modulation == RadioInformation.Modulation.DISABLED)
                    {
                        Radio4.Visibility = Visibility.Collapsed;
                        if (MinHeight != _originalMinHeight)
                        {
                            MinHeight = _originalMinHeight;
                            Recalculate();
                        }
                    }
                    else
                    {
                        //show it
                        Radio4.Visibility = Visibility.Visible;

                        if (MinHeight == _originalMinHeight)
                        {
                            MinHeight += Radio4.Height;
                            Recalculate();
                        }
                    }
                }

                for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++)
                {
                    if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED)
                    {
                        availableRadios++;
                    }
                }

                if (availableRadios > 1)
                {
                    if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS)
                    {
                        ControlText.Text = "HOTAS Controls";
                    }
                    else
                    {
                        ControlText.Text = "Cockpit Controls";
                    }
                }
                else
                {
                    ControlText.Text = "";
                }
            }
            else
            {
                Radio4.Visibility = Visibility.Collapsed;
                if (MinHeight != _originalMinHeight)
                {
                    MinHeight = _originalMinHeight;
                    Recalculate();
                }

                ControlText.Text = "";
            }

            FocusDCS();
        }
Пример #3
0
        private void RadioRefresh(object sender, EventArgs eventArgs)
        {
            var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo;

            foreach (var radio in radioControlGroup)
            {
                radio.RepaintRadioStatus();
                radio.RepaintRadioReceive();
            }

            Intercom.RepaintRadioStatus();

            TransponderPanel.RepaintTransponderStatus();



            if ((dcsPlayerRadioInfo != null) && dcsPlayerRadioInfo.IsCurrent())
            {
                var availableRadios = 0;

                for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++)
                {
                    if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED)
                    {
                        availableRadios++;
                    }
                }

                if (availableRadios == 6 ||
                    dcsPlayerRadioInfo.radios.Length >= 6 &&
                    dcsPlayerRadioInfo.radios[5].modulation != RadioInformation.Modulation.DISABLED)
                {
                    Radio5.Visibility = Visibility.Visible;
                    Radio4.Visibility = Visibility.Visible;

                    if (MinHeight != _originalMinHeight + (_radioHeight * 2))
                    {
                        MinHeight = (_originalMinHeight + (_radioHeight * 2));
                        Recalculate();
                    }
                }
                else if (availableRadios == 5 ||
                         dcsPlayerRadioInfo.radios.Length >= 5 &&
                         dcsPlayerRadioInfo.radios[4].modulation != RadioInformation.Modulation.DISABLED)
                {
                    Radio5.Visibility = Visibility.Collapsed;
                    Radio4.Visibility = Visibility.Visible;
                    if (MinHeight != _originalMinHeight + _radioHeight)
                    {
                        MinHeight = _originalMinHeight + _radioHeight;
                        Recalculate();
                    }
                }
                else
                {
                    ResetHeight();
                }


                if (availableRadios > 1)
                {
                    if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS)
                    {
                        ControlText.Text = "HOTAS Controls";
                    }
                    else
                    {
                        ControlText.Text = "Cockpit Controls";
                    }
                }
                else
                {
                    ControlText.Text = "";
                }
            }
            else
            {
                ResetHeight();
                ControlText.Text = "";
            }

            FocusDCS();
        }