Skip to content

Commit

Permalink
Update for vatSys version change
Browse files Browse the repository at this point in the history
ATC Freq only return first freq in array
  • Loading branch information
jgolin committed Apr 27, 2022
1 parent 18f930e commit 00b0afd
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
4 changes: 2 additions & 2 deletions SetupWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public SetupWindow()
{
InitializeComponent();

arrivalView.BackColor = Colours.GetColour(Colours.Identities.WindowBackgound);
arrivalView.BackColor = Colours.GetColour(Colours.Identities.WindowBackground);
arrivalView.ForeColor = Colours.GetColour(Colours.Identities.InteractiveText);
departureView.BackColor = Colours.GetColour(Colours.Identities.WindowBackgound);
departureView.BackColor = Colours.GetColour(Colours.Identities.WindowBackground);
departureView.ForeColor = Colours.GetColour(Colours.Identities.InteractiveText);

// Retrieve Properties Information
Expand Down
12 changes: 9 additions & 3 deletions vStripsConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ private void SendControllerInfo()
SendVersion();

//CALLSIGN:NAME:FREQ
string pack = $"U{Network.Me.Callsign}:{Network.Me.RealName}:{ConvertToFreqString(Network.Me.Frequency)}";
string pack = $"U{Network.Me.Callsign}:{Network.Me.RealName}:{ConvertFreqArrayToString(Network.Me.Frequencies)}";
Instance?.SendData(pack);

string trans = $"T{RDP.TRANSITION_ALTITUDE}";
Expand All @@ -247,8 +247,8 @@ private void SendQnh()
private void SendATCOnline(NetworkATC atc)
{
if (Instance?.connected==true)
{
Instance?.SendData($"C{atc.Callsign}:{atc.RealName}:{ConvertToFreqString(atc.Frequency)}");
{
Instance?.SendData($"C{atc.Callsign}:{atc.RealName}:{(ConvertFreqArrayToString(atc.Frequencies))}");
}
}

Expand Down Expand Up @@ -541,6 +541,12 @@ private void ProcessData(string packet)
Console.WriteLine(packet);
}

private static string ConvertFreqArrayToString(int[] vatsysFreqArray)
{
return vatsysFreqArray[0].ToString().Substring(0, 5);
}


private static string ConvertToFreqString(uint vatsysFreq)
{
return vatsysFreq.ToString().Substring(0, 5);
Expand Down
19 changes: 19 additions & 0 deletions vStripsPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -30,6 +31,24 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
Expand Down
5 changes: 5 additions & 0 deletions vStripsPlugin.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{59170BAC-129C-4AB8-884D-F583E460AA63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59170BAC-129C-4AB8-884D-F583E460AA63}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59170BAC-129C-4AB8-884D-F583E460AA63}.Debug|x86.ActiveCfg = Release|x86
{59170BAC-129C-4AB8-884D-F583E460AA63}.Debug|x86.Build.0 = Release|x86
{59170BAC-129C-4AB8-884D-F583E460AA63}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59170BAC-129C-4AB8-884D-F583E460AA63}.Release|Any CPU.Build.0 = Release|Any CPU
{59170BAC-129C-4AB8-884D-F583E460AA63}.Release|x86.ActiveCfg = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 00b0afd

Please sign in to comment.