diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayFiveHorizontal.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayFiveHorizontal.xaml.cs index a55019d2..313589c2 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayFiveHorizontal.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayFiveHorizontal.xaml.cs @@ -116,22 +116,22 @@ private void RadioRefresh(object sender, EventArgs eventArgs) { if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS) { - ControlText.Text = "5 Horizontal"; + ControlText.Text = "5 Radio Panel"; } else { - ControlText.Text = "5 Horizontal"; + ControlText.Text = "5 Radio Panel"; } } else { - ControlText.Text = "5 Horizontal (Disconnected)"; + ControlText.Text = "5 Radio Panel (Disconnected)"; } } else { - ControlText.Text = "5 Horizontal (Disconnected)"; + ControlText.Text = "5 Radio Panel (Disconnected)"; } } diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayFiveVertical.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayFiveVertical.xaml.cs index c20bdc63..c1436613 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayFiveVertical.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayFiveVertical.xaml.cs @@ -135,22 +135,22 @@ private void RadioRefresh(object sender, EventArgs eventArgs) { if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS) { - ControlText.Text = "5 Vertical"; + ControlText.Text = "5 Radio Panel"; } else { - ControlText.Text = "5 Vertical"; + ControlText.Text = "5 Radio Panel"; } } else { - ControlText.Text = "5 Vertical (Disconnected)"; + ControlText.Text = "5 Radio Panel (Disconnected)"; } } else { - ControlText.Text = "5 Vertical (Disconnected)"; + ControlText.Text = "5 Radio Panel (Disconnected)"; } FocusDCS(); diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayOneHorizontal.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayOneHorizontal.xaml.cs index 02a12846..5b4e9a12 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayOneHorizontal.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayOneHorizontal.xaml.cs @@ -132,23 +132,23 @@ private void RadioRefresh(object sender, EventArgs eventArgs) { if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS) { - ControlText.Text = "1 Horizontal"; + ControlText.Text = "1 Radio Panel"; } else { - ControlText.Text = "1 Horizontal"; + ControlText.Text = "1 Radio Panel"; } } else { - ControlText.Text = "1 Horizontal (Disconnected)"; + ControlText.Text = "1 Radio Panel (Disconnected)"; } } else { ResetHeight(); - ControlText.Text = "1 Horizontal (Disconnected)"; + ControlText.Text = "1 Radio Panel (Disconnected)"; } FocusDCS(); diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayOneVertical.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayOneVertical.xaml.cs index a872a38c..39ddffd6 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayOneVertical.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayOneVertical.xaml.cs @@ -26,6 +26,7 @@ namespace Ciribob.DCS.SimpleRadio.Standalone.Overlay public partial class RadioOverlayWindowOneVertical : Window { private double _aspectRatio; + private readonly Logger Logger = LogManager.GetCurrentClassLogger(); private readonly Client.UI.AwacsRadioOverlayWindow.RadioControlGroup[] radioControlGroup = @@ -128,23 +129,23 @@ private void RadioRefresh(object sender, EventArgs eventArgs) { if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS) { - ControlText.Text = "1 Vertical"; + ControlText.Text = "1 Radio Panel"; } else { - ControlText.Text = "1 Vertical"; + ControlText.Text = "1 Radio Panel"; } } else { - ControlText.Text = "1 Vertical (Disconnected)"; + ControlText.Text = "1 Radio Panel (Disconnected)"; } } else { ResetHeight(); - ControlText.Text = "1 Vertical (Disconnected)"; + ControlText.Text = "1 Radio Panel (Disconnected)"; } FocusDCS(); diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenHorizontal.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenHorizontal.xaml.cs index a1e71aee..c4c38bf2 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenHorizontal.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenHorizontal.xaml.cs @@ -19,8 +19,11 @@ namespace Ciribob.DCS.SimpleRadio.Standalone.Overlay public partial class RadioOverlayWindowTenHorizontal : Window { private readonly double _aspectRatio; + private readonly Logger Logger = LogManager.GetCurrentClassLogger(); + private long _lastUnitId; + private readonly RadioControlGroup[] radioControlGroup = new RadioControlGroup[10]; private readonly DispatcherTimer _updateTimer; @@ -94,6 +97,8 @@ private void Location_Changed(object sender, EventArgs e) private void RadioRefresh(object sender, EventArgs eventArgs) { + var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo; + foreach (var radio in radioControlGroup) { radio.RepaintRadioStatus(); @@ -102,23 +107,45 @@ private void RadioRefresh(object sender, EventArgs eventArgs) intercom.RepaintRadioStatus(); - var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo; - if (dcsPlayerRadioInfo != null) + if ((dcsPlayerRadioInfo != null) && dcsPlayerRadioInfo.IsCurrent()) { - if (_clientStateSingleton.IsConnected && dcsPlayerRadioInfo.IsCurrent() - && _clientStateSingleton.DcsPlayerRadioInfo.simultaneousTransmissionControl == DCSPlayerRadioInfo.SimultaneousTransmissionControl.ENABLED_INTERNAL_SRS_CONTROLS) + //reset when we switch planes + if (_lastUnitId != dcsPlayerRadioInfo.unitId) { + _lastUnitId = dcsPlayerRadioInfo.unitId; + } - var avalilableRadios = 0; + var availableRadios = 0; - for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++) + for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++) + { + if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED) { - if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED) - { - avalilableRadios++; - } + availableRadios++; + } } + + if (availableRadios > 1) + { + if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS) + { + ControlText.Text = "10 Radio Panel"; + } + else + { + ControlText.Text = "10 Radio Panel"; + } + } + else + { + ControlText.Text = "10 Radio Panel (Disconnected)"; + + } + } + else + { + ControlText.Text = "10 Radio Panel (Disconnected)"; } } diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenHorizontalWide.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenHorizontalWide.xaml.cs index 67f18ac9..aa2da331 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenHorizontalWide.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenHorizontalWide.xaml.cs @@ -19,8 +19,11 @@ namespace Ciribob.DCS.SimpleRadio.Standalone.Overlay public partial class RadioOverlayWindowTenHorizontalWide : Window { private readonly double _aspectRatio; + private readonly Logger Logger = LogManager.GetCurrentClassLogger(); + private long _lastUnitId; + private readonly RadioControlGroup[] radioControlGroup = new RadioControlGroup[10]; private readonly DispatcherTimer _updateTimer; @@ -90,6 +93,8 @@ private void Location_Changed(object sender, EventArgs e) private void RadioRefresh(object sender, EventArgs eventArgs) { + var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo; + foreach (var radio in radioControlGroup) { radio.RepaintRadioStatus(); @@ -98,23 +103,45 @@ private void RadioRefresh(object sender, EventArgs eventArgs) intercom.RepaintRadioStatus(); - var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo; - if (dcsPlayerRadioInfo != null) + if ((dcsPlayerRadioInfo != null) && dcsPlayerRadioInfo.IsCurrent()) { - if (_clientStateSingleton.IsConnected && dcsPlayerRadioInfo.IsCurrent() - && _clientStateSingleton.DcsPlayerRadioInfo.simultaneousTransmissionControl == DCSPlayerRadioInfo.SimultaneousTransmissionControl.ENABLED_INTERNAL_SRS_CONTROLS) + //reset when we switch planes + if (_lastUnitId != dcsPlayerRadioInfo.unitId) { + _lastUnitId = dcsPlayerRadioInfo.unitId; + } - var avalilableRadios = 0; + var availableRadios = 0; - for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++) + for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++) + { + if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED) { - if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED) - { - avalilableRadios++; - } + availableRadios++; + } } + + if (availableRadios > 1) + { + if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS) + { + ControlText.Text = "10 Radio Panel"; + } + else + { + ControlText.Text = "10 Radio Panel"; + } + } + else + { + ControlText.Text = "10 Radio Panel (Disconnected)"; + + } + } + else + { + ControlText.Text = "10 Radio Panel (Disconnected)"; } } diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenVertical.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenVertical.xaml.cs index 6b36d133..d9ea4ba2 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenVertical.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenVertical.xaml.cs @@ -19,8 +19,11 @@ namespace Ciribob.DCS.SimpleRadio.Standalone.Overlay public partial class RadioOverlayWindowTenVertical : Window { private readonly double _aspectRatio; + private readonly Logger Logger = LogManager.GetCurrentClassLogger(); + private long _lastUnitId; + private readonly RadioControlGroup[] radioControlGroup = new RadioControlGroup[10]; private readonly DispatcherTimer _updateTimer; @@ -86,6 +89,8 @@ public RadioOverlayWindowTenVertical(Action ToggleOverlay) private void RadioRefresh(object sender, EventArgs eventArgs) { + var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo; + foreach (var radio in radioControlGroup) { radio.RepaintRadioStatus(); @@ -94,23 +99,45 @@ private void RadioRefresh(object sender, EventArgs eventArgs) intercom.RepaintRadioStatus(); - var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo; - if (dcsPlayerRadioInfo != null) + if ((dcsPlayerRadioInfo != null) && dcsPlayerRadioInfo.IsCurrent()) { - if (_clientStateSingleton.IsConnected && dcsPlayerRadioInfo.IsCurrent() - && _clientStateSingleton.DcsPlayerRadioInfo.simultaneousTransmissionControl == DCSPlayerRadioInfo.SimultaneousTransmissionControl.ENABLED_INTERNAL_SRS_CONTROLS) + //reset when we switch planes + if (_lastUnitId != dcsPlayerRadioInfo.unitId) { + _lastUnitId = dcsPlayerRadioInfo.unitId; + } - var avalilableRadios = 0; + var availableRadios = 0; - for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++) + for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++) + { + if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED) { - if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED) - { - avalilableRadios++; - } + availableRadios++; + } } + + if (availableRadios > 1) + { + if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS) + { + ControlText.Text = "10 Radio Panel"; + } + else + { + ControlText.Text = "10 Radio Panel"; + } + } + else + { + ControlText.Text = "10 Radio Panel (Disconnected)"; + + } + } + else + { + ControlText.Text = "10 Radio Panel (Disconnected)"; } } diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenVerticalLong.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenVerticalLong.xaml.cs index 6985dcb6..6094a624 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenVerticalLong.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTenVerticalLong.xaml.cs @@ -19,8 +19,11 @@ namespace Ciribob.DCS.SimpleRadio.Standalone.Overlay public partial class RadioOverlayWindowTenVerticalLong : Window { private readonly double _aspectRatio; + private readonly Logger Logger = LogManager.GetCurrentClassLogger(); + private long _lastUnitId; + private readonly RadioControlGroup[] radioControlGroup = new RadioControlGroup[10]; private readonly DispatcherTimer _updateTimer; @@ -82,6 +85,8 @@ public RadioOverlayWindowTenVerticalLong() private void RadioRefresh(object sender, EventArgs eventArgs) { + var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo; + foreach (var radio in radioControlGroup) { radio.RepaintRadioStatus(); @@ -90,23 +95,45 @@ private void RadioRefresh(object sender, EventArgs eventArgs) intercom.RepaintRadioStatus(); - var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo; - if (dcsPlayerRadioInfo != null) + if ((dcsPlayerRadioInfo != null) && dcsPlayerRadioInfo.IsCurrent()) { - if (_clientStateSingleton.IsConnected && dcsPlayerRadioInfo.IsCurrent() - && _clientStateSingleton.DcsPlayerRadioInfo.simultaneousTransmissionControl == DCSPlayerRadioInfo.SimultaneousTransmissionControl.ENABLED_INTERNAL_SRS_CONTROLS) + //reset when we switch planes + if (_lastUnitId != dcsPlayerRadioInfo.unitId) { + _lastUnitId = dcsPlayerRadioInfo.unitId; + } - var avalilableRadios = 0; + var availableRadios = 0; - for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++) + for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++) + { + if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED) { - if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED) - { - avalilableRadios++; - } + availableRadios++; + } } + + if (availableRadios > 1) + { + if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS) + { + ControlText.Text = "10 Radio Panel"; + } + else + { + ControlText.Text = "10 Radio Panel"; + } + } + else + { + ControlText.Text = "10 Radio Panel (Disconnected)"; + + } + } + else + { + ControlText.Text = "10 Radio Panel (Disconnected)"; } } diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayThreeHorizontal.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayThreeHorizontal.xaml.cs index 44e3ee2d..e9a3f1f1 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayThreeHorizontal.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayThreeHorizontal.xaml.cs @@ -114,22 +114,22 @@ private void RadioRefresh(object sender, EventArgs eventArgs) { if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS) { - ControlText.Text = "3 Horizontal"; + ControlText.Text = "3 Radio Panel"; } else { - ControlText.Text = "3 Horizontal"; + ControlText.Text = "3 Radio Panel"; } } else { - ControlText.Text = "3 Horizontal (Disconnected)"; + ControlText.Text = "3 Radio Panel (Disconnected)"; } } else { - ControlText.Text = "3 Horizontal (Disconnected)"; + ControlText.Text = "3 Radio Panel (Disconnected)"; } } diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayThreeVertical.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayThreeVertical.xaml.cs index 3e3712a7..5442280c 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayThreeVertical.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayThreeVertical.xaml.cs @@ -133,23 +133,23 @@ private void RadioRefresh(object sender, EventArgs eventArgs) { if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS) { - ControlText.Text = "3 Vertical"; + ControlText.Text = "3 Radio Panel"; } else { - ControlText.Text = "3 Vertical"; + ControlText.Text = "3 Radio Panel"; } } else { - ControlText.Text = "3 Vertical (Disconnected)"; + ControlText.Text = "3 Radio Panel (Disconnected)"; } } else { ResetHeight(); - ControlText.Text = "3 Vertical (Disconnected)"; + ControlText.Text = "3 Radio Panel (Disconnected)"; } FocusDCS(); diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoHorizontal.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoHorizontal.xaml.cs index eacf7060..146eb44d 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoHorizontal.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoHorizontal.xaml.cs @@ -112,22 +112,22 @@ private void RadioRefresh(object sender, EventArgs eventArgs) { if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS) { - ControlText.Text = "2 Horizontal"; + ControlText.Text = "2 Radio Panel"; } else { - ControlText.Text = "2 Horizontal"; + ControlText.Text = "2 Radio Panel"; } } else { - ControlText.Text = "2 Horizontal (Disconnected)"; + ControlText.Text = "2 Radio Panel (Disconnected)"; } } else { - ControlText.Text = "2 Horizontal (Disconnected)"; + ControlText.Text = "2 Radio Panel (Disconnected)"; } } diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoVertical.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoVertical.xaml.cs index 67841ff5..0981715b 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoVertical.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoVertical.xaml.cs @@ -147,23 +147,23 @@ private void RadioRefresh(object sender, EventArgs eventArgs) { if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS) { - ControlText.Text = "2 Vertical"; + ControlText.Text = "2 Radio Panel"; } else { - ControlText.Text = "2 Vertical"; + ControlText.Text = "2 Radio Panel"; } } else { - ControlText.Text = "2 Vertical (Disconnected)"; + ControlText.Text = "2 Radio Panel (Disconnected)"; } } else { ResetHeight(); - ControlText.Text = "2 Vertical (Disconnected)"; + ControlText.Text = "2 Radio Panel (Disconnected)"; } FocusDCS();