Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean Up and bugfixing #187

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: nuget/setup-nuget@v1

- name: Build & Package
run: ./build.bat ".\SRS-Radio-Presets" ${{ steps.version.outputs.version_tag }}
run: ./build.bat ${{ steps.version.outputs.version_tag }}

- name: Setup VSTest
uses: Malcolmnixon/Setup-VSTest@v3
Expand All @@ -50,6 +50,6 @@ jobs:
tag: ${{ steps.version.outputs.version_tag }}
name: Release ${{ steps.version.outputs.version_tag }}
body: "Please update Release notes"
artifacts: "Vanguard-SRS-${{ steps.version.outputs.version_tag }}.zip"
artifacts: "VCS-SRS-${{ steps.version.outputs.version_tag }}.zip"
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
6 changes: 3 additions & 3 deletions DCS-SR-Client/DCS-SR-Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@
<Compile Include="UI\ClientWindow\SettingPages\LegacyPage.xaml.cs">
<DependentUpon>LegacyPage.xaml</DependentUpon>
</Compile>
<Compile Include="UI\ClientWindow\SettingPages\MiscellaneousPage.xaml.cs">
<DependentUpon>MiscellaneousPage.xaml</DependentUpon>
<Compile Include="UI\ClientWindow\SettingPages\BalancingPage.xaml.cs">
<DependentUpon>BalancingPage.xaml</DependentUpon>
</Compile>
<Compile Include="UI\ClientWindow\SettingPages\RadioEffectsPage.xaml.cs">
<DependentUpon>RadioEffectsPage.xaml</DependentUpon>
Expand Down Expand Up @@ -564,7 +564,7 @@
<Page Include="UI\ClientWindow\SettingPages\GeneralPage.xaml" />
<Page Include="UI\ClientWindow\SettingPages\KeybindingPage.xaml" />
<Page Include="UI\ClientWindow\SettingPages\LegacyPage.xaml" />
<Page Include="UI\ClientWindow\SettingPages\MiscellaneousPage.xaml" />
<Page Include="UI\ClientWindow\SettingPages\BalancingPage.xaml" />
<Page Include="UI\ClientWindow\SettingPages\RadioEffectsPage.xaml" />
<Page Include="UI\ClientWindow\SettingPages\SettingsPage.xaml" />
<Page Include="UI\ClientWindow\SupportPage.xaml">
Expand Down
5 changes: 5 additions & 0 deletions DCS-SR-Client/Network/DCS/DCSRadioSyncManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Ciribob.DCS.SimpleRadio.Standalone.Common.Network;
using Newtonsoft.Json;
using NLog;
using Xamarin.Forms.Internals;

/**
Keeps radio information in Sync Between DCS and
Expand Down Expand Up @@ -105,6 +106,10 @@ public void StartExternalAWACSModeLoop()
{
radioJson = File.ReadAllText(AWACS_RADIOS_FILE);
awacsRadios = JsonConvert.DeserializeObject<RadioInformation[]>(radioJson);
foreach (var radio in awacsRadios)
{
Logger.Debug($"Loaded AWACS radio file: '{radio.name}': freq: {radio.freq}, stbyfreq: {radio.standbyfreq}");
}
}
}
catch (Exception ex)
Expand Down
16 changes: 10 additions & 6 deletions DCS-SR-Client/Network/SRSClientSyncHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class SRSClientSyncHandler
private IPEndPoint _serverEndpoint;
private TcpClient _tcpClient;

private DateTime _connectedAt;

private readonly ClientStateSingleton _clientStateSingleton = ClientStateSingleton.Instance;
private readonly SyncedServerSettings _serverSettings = SyncedServerSettings.Instance;
private readonly ConnectedClientsSingleton _clients = ConnectedClientsSingleton.Instance;
Expand Down Expand Up @@ -159,7 +161,7 @@ private void Connect()
_vaicomSync.Start();

_tcpClient.NoDelay = true;

_connectedAt = DateTime.Now;
CallOnMain(true);
ClientSyncLoop();
}
Expand Down Expand Up @@ -343,7 +345,6 @@ private void ClientSyncLoop()
break;
case NetworkMessage.MessageType.RADIO_UPDATE:
case NetworkMessage.MessageType.UPDATE:

if (serverMessage.ServerSettings != null)
{
_serverSettings.Decode(serverMessage.ServerSettings);
Expand Down Expand Up @@ -403,10 +404,13 @@ private void ClientSyncLoop()
if (_clientStateSingleton.ExternalAWACSModelSelected &&
!_serverSettings.GetSettingAsBool(Common.Setting.ServerSettingsKeys.EXTERNAL_AWACS_MODE))
{
Logger.Debug("Closing AWACS Mode after Update message...");
Logger.Debug($"Mode selected: {_clientStateSingleton.ExternalAWACSModelSelected}");
Logger.Debug($"Server AWACS Settings: {_serverSettings.GetSettingAsBool(Common.Setting.ServerSettingsKeys.EXTERNAL_AWACS_MODE)}");
DisconnectExternalAWACSMode();
if (_connectedAt.AddSeconds(2) < DateTime.Now)
{
Logger.Debug("Closing AWACS Mode after Update message...");
Logger.Debug($"Mode selected: {_clientStateSingleton.ExternalAWACSModelSelected}");
Logger.Debug($"Server AWACS Settings: {_serverSettings.GetSettingAsBool(Common.Setting.ServerSettingsKeys.EXTERNAL_AWACS_MODE)}");
DisconnectExternalAWACSMode();
}
}

CallUpdateUIOnMain();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@
<Button
Background="IndianRed"
Click="ToggleSwitch_Click"
Content="Off"
FontSize="5"
Foreground="Black"
Height="10"
Expand All @@ -245,7 +244,11 @@
Name="RadioEnabled"
Padding="0"
Style="{StaticResource DarkStyle-Button}"
Width="15" />
Width="15" >
<Button.Content>
<TextBlock Text="Off" FontSize="5" />
</Button.Content>
</Button>

<Slider
Height="20"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ private void ToggleButtons(bool enable)
if (currentRadio != null)
{
RadioEnabled.Background = currentRadio.modulation != RadioInformation.Modulation.DISABLED ? radioOn : radioOff;
RadioEnabled.Content = currentRadio.modulation != RadioInformation.Modulation.DISABLED ? "On" : "Off";
RadioEnabled.Content = new TextBlock
{
FontSize = 5,
Text = currentRadio.modulation != RadioInformation.Modulation.DISABLED ? "On" : "Off",
};
}
else
{
Expand All @@ -219,7 +223,11 @@ private void ToggleButtons(bool enable)
else
{
RadioEnabled.Background = radioOff;
RadioEnabled.Content = "Off";
RadioEnabled.Content = new TextBlock
{
FontSize = 5,
Text = "Off",
};
}

if (enable)
Expand Down Expand Up @@ -755,14 +763,22 @@ private void SetRadioEnabled(bool enabled)
{
RadioHelper.SetRadioModulation(RadioId, RadioInformation.Modulation.AM);
RadioEnabled.Background = radioOn;
RadioEnabled.Content = "On";
RadioEnabled.Content = new TextBlock
{
FontSize = 5,
Text = "On",
};

}
else if (currentRadio != null)
{
RadioHelper.SetRadioModulation(RadioId, RadioInformation.Modulation.DISABLED);
RadioEnabled.Background = radioOff;
RadioEnabled.Content = "Off";
RadioEnabled.Content = new TextBlock
{
FontSize = 5,
Text = "Off",
};
}
else
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<UserControl
Height="20"
Name="RadioControlContainerSwitch"
Width="200"
Width="180"
x:Class="Ciribob.DCS.SimpleRadio.Standalone.Client.UI.AwacsRadioOverlayWindow.RadioControlGroupSwitch"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:presetChannels="clr-namespace:Ciribob.DCS.SimpleRadio.Standalone.Client.UI.RadioOverlayWindow.PresetChannels"
Expand All @@ -17,7 +17,6 @@
<Button
Background="IndianRed"
Click="ToggleSwitch_Click"
Content="Off"
FontSize="5"
Foreground="Black"
Height="10"
Expand All @@ -28,7 +27,11 @@
Opacity="1"
Padding="0"
Style="{StaticResource DarkStyle-Button}"
Width="15" />
Width="15" >
<Button.Content>
<TextBlock Text="Off" FontSize="5" />
</Button.Content>
</Button>
<!--<Button
Background="DarkGray"
Click="ToggleChannel_Click"
Expand Down Expand Up @@ -218,7 +221,6 @@
<Button
Background="Gray"
Click="SwapStandbyFrequency_Click"
Content="S"
FontSize="5"
FontWeight="Light"
Foreground="Black"
Expand All @@ -230,7 +232,11 @@
Opacity="1"
Padding="0"
Style="{StaticResource DarkStyle-Button}"
Width="10" />
Width="10" >
<Button.Content>
<TextBlock Text="S" FontSize="5" />
</Button.Content>
</Button>
</StackPanel>
</StackPanel>

Expand Down
Loading