Skip to content

Commit 7f50029

Browse files
author
scelts
committed
readme.md and some small tweaks
1 parent 01991be commit 7f50029

File tree

8 files changed

+225
-28
lines changed

8 files changed

+225
-28
lines changed

GeesWPF/GeesWPF.csproj

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,21 @@
8080
<Reference Include="CsvHelper, Version=15.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
8181
<HintPath>..\packages\CsvHelper.15.0.7\lib\net47\CsvHelper.dll</HintPath>
8282
</Reference>
83-
<Reference Include="CTrue.FsConnect, Version=1.0.2.0, Culture=neutral, processorArchitecture=AMD64">
84-
<HintPath>..\packages\CTrue.FsConnect.1.0.2\lib\net40\CTrue.FsConnect.dll</HintPath>
83+
<Reference Include="CTrue.FsConnect, Version=1.3.3.0, Culture=neutral, processorArchitecture=AMD64">
84+
<HintPath>..\packages\CTrue.FsConnect.1.3.3\lib\net45\CTrue.FsConnect.dll</HintPath>
8585
</Reference>
8686
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
8787
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
8888
</Reference>
8989
<Reference Include="Microsoft.FlightSimulator.SimConnect, Version=11.0.62651.3, Culture=neutral, PublicKeyToken=baf445ffb3a06b5c, processorArchitecture=AMD64">
90-
<HintPath>..\packages\CTrue.FsConnect.1.0.2\lib\net40\Microsoft.FlightSimulator.SimConnect.dll</HintPath>
90+
<HintPath>..\packages\CTrue.FsConnect.1.3.3\lib\net45\Microsoft.FlightSimulator.SimConnect.dll</HintPath>
9191
</Reference>
9292
<Reference Include="Octokit, Version=0.48.0.0, Culture=neutral, processorArchitecture=MSIL">
9393
<HintPath>..\packages\Octokit.0.48.0\lib\net46\Octokit.dll</HintPath>
9494
</Reference>
95+
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
96+
<HintPath>..\packages\Serilog.2.10.0\lib\net46\Serilog.dll</HintPath>
97+
</Reference>
9598
<Reference Include="System" />
9699
<Reference Include="System.Data" />
97100
<Reference Include="System.Drawing" />
@@ -231,17 +234,17 @@
231234
<Resource Include="Images\bounce.png" />
232235
</ItemGroup>
233236
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
234-
<Import Project="..\packages\CTrue.FsConnect.1.0.2\build\CTrue.FsConnect.targets" Condition="Exists('..\packages\CTrue.FsConnect.1.0.2\build\CTrue.FsConnect.targets')" />
235-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
236-
<PropertyGroup>
237-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
238-
</PropertyGroup>
239-
<Error Condition="!Exists('..\packages\CTrue.FsConnect.1.0.2\build\CTrue.FsConnect.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CTrue.FsConnect.1.0.2\build\CTrue.FsConnect.targets'))" />
240-
</Target>
241237
<Target Name="AfterBuild">
242238
<ItemGroup>
243239
<MoveToLibFolder Include="$(OutputPath)*.dll ; $(OutputPath)*.pdb ; $(OutputPath)*.xml" />
244240
</ItemGroup>
245241
<Move SourceFiles="@(MoveToLibFolder)" DestinationFolder="$(OutputPath)lib" OverwriteReadOnlyFiles="true" />
246242
</Target>
243+
<Import Project="..\packages\CTrue.FsConnect.1.3.3\build\CTrue.FsConnect.targets" Condition="Exists('..\packages\CTrue.FsConnect.1.3.3\build\CTrue.FsConnect.targets')" />
244+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
245+
<PropertyGroup>
246+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
247+
</PropertyGroup>
248+
<Error Condition="!Exists('..\packages\CTrue.FsConnect.1.3.3\build\CTrue.FsConnect.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CTrue.FsConnect.1.3.3\build\CTrue.FsConnect.targets'))" />
249+
</Target>
247250
</Project>

GeesWPF/MainWindow.xaml.cs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
using System.Windows.Navigation;
2424
using System.Windows.Shapes;
2525
using System.Windows.Threading;
26+
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
2627
using MouseEventArgs = System.Windows.Forms.MouseEventArgs;
2728

2829

@@ -62,12 +63,13 @@ public partial class MainWindow : Window
6263
static List<PlaneInfoResponse> Inair = new List<PlaneInfoResponse>();
6364
static List<PlaneInfoResponse> Onground = new List<PlaneInfoResponse>();
6465
static FsConnect fsConnect = new FsConnect();
65-
static List<SimProperty> definition = new List<SimProperty>();
66+
static List<SimVar> definition = new List<SimVar>();
6667
static string updateUri;
6768
static public string version;
6869
int lastDeactivateTick;
6970
bool lastDeactivateValid;
7071
int bounces = 0;
72+
int myDefineId;
7173

7274
const int SAMPLE_RATE = 20; //ms
7375
const int BUFFER_SIZE = 2;
@@ -119,19 +121,21 @@ public MainWindow()
119121
timerRead.Tick += timerRead_Tick;
120122
timerBounce.Tick += timerBounce_Tick;
121123
fsConnect.FsDataReceived += HandleReceivedFsData;
122-
definition.Add(new SimProperty("TITLE", null, SIMCONNECT_DATATYPE.STRING256));
123-
definition.Add(new SimProperty("SIM ON GROUND", "Bool", SIMCONNECT_DATATYPE.INT32));
124-
definition.Add(new SimProperty("AIRCRAFT WIND X", "Knots", SIMCONNECT_DATATYPE.FLOAT64));
125-
definition.Add(new SimProperty("AIRCRAFT WIND Z", "Knots", SIMCONNECT_DATATYPE.FLOAT64));
126-
definition.Add(new SimProperty("AIRSPEED INDICATED", "Knots", SIMCONNECT_DATATYPE.FLOAT64));
127-
definition.Add(new SimProperty("GROUND VELOCITY", "Knots", SIMCONNECT_DATATYPE.FLOAT64));
128-
definition.Add(new SimProperty("VELOCITY BODY X", "Feet per second", SIMCONNECT_DATATYPE.FLOAT64));
129-
definition.Add(new SimProperty("VELOCITY BODY Z", "Feet per second", SIMCONNECT_DATATYPE.FLOAT64));
130-
definition.Add(new SimProperty("G FORCE", "GForce", SIMCONNECT_DATATYPE.FLOAT64));
131-
definition.Add(new SimProperty("PLANE TOUCHDOWN NORMAL VELOCITY", "Feet per second", SIMCONNECT_DATATYPE.FLOAT64));
124+
definition.Add(new SimVar("TITLE", null, SIMCONNECT_DATATYPE.STRING256));
125+
definition.Add(new SimVar("SIM ON GROUND", "Bool", SIMCONNECT_DATATYPE.INT32));
126+
definition.Add(new SimVar("AIRCRAFT WIND X", "Knots", SIMCONNECT_DATATYPE.FLOAT64));
127+
definition.Add(new SimVar("AIRCRAFT WIND Z", "Knots", SIMCONNECT_DATATYPE.FLOAT64));
128+
definition.Add(new SimVar("AIRSPEED INDICATED", "Knots", SIMCONNECT_DATATYPE.FLOAT64));
129+
definition.Add(new SimVar("GROUND VELOCITY", "Knots", SIMCONNECT_DATATYPE.FLOAT64));
130+
definition.Add(new SimVar("VELOCITY BODY X", "Feet per second", SIMCONNECT_DATATYPE.FLOAT64));
131+
definition.Add(new SimVar("VELOCITY BODY Z", "Feet per second", SIMCONNECT_DATATYPE.FLOAT64));
132+
definition.Add(new SimVar("G FORCE", "GForce", SIMCONNECT_DATATYPE.FLOAT64));
133+
definition.Add(new SimVar("PLANE TOUCHDOWN NORMAL VELOCITY", "Feet per second", SIMCONNECT_DATATYPE.FLOAT64));
132134
//SHOW LRM
133135
winLRM = new LRMDisplay(viewModel);
134136
winLRM.Show();
137+
138+
135139
}
136140

137141
#region Reading and processing simconnect data
@@ -141,7 +145,7 @@ private void timerRead_Tick(object sender, EventArgs e)
141145
{
142146
try
143147
{
144-
fsConnect.RequestData(Requests.PlaneInfo);
148+
fsConnect.RequestData(Requests.PlaneInfo, Requests.PlaneInfo);
145149
}
146150
catch
147151
{
@@ -170,7 +174,7 @@ private static void HandleReceivedFsData(object sender, FsDataReceivedEventArgs
170174
{
171175
if (!ShowLanding)
172176
{
173-
PlaneInfoResponse r = (PlaneInfoResponse)e.Data;
177+
PlaneInfoResponse r = (PlaneInfoResponse)e.Data.FirstOrDefault();
174178
//ignore when noone is flying
175179
if (r.ForwardSpeed < 4) //if less then 4kt, it's not a landing or out to menu
176180
{
@@ -309,7 +313,7 @@ private void backgroundConnector_DoWork(object sender, System.ComponentModel.DoW
309313
{
310314
try
311315
{
312-
fsConnect.Connect("TestApp", "localhost", 500);
316+
fsConnect.Connect("TestApp", "localhost", 500, SimConnectProtocol.Ipv4);
313317
fsConnect.RegisterDataDefinition<PlaneInfoResponse>(Requests.PlaneInfo, definition);
314318
}
315319
catch { } // ignore
@@ -452,6 +456,5 @@ private void backgroundWorkerUpdate_DoWork(object sender, System.ComponentModel.
452456
}
453457

454458
#endregion
455-
456459
}
457460
}

GeesWPF/packages.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="CsvHelper" version="15.0.7" targetFramework="net472" />
4-
<package id="CTrue.FsConnect" version="1.0.2" targetFramework="net472" />
4+
<package id="CTrue.FsConnect" version="1.3.3" targetFramework="net472" />
55
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.0" targetFramework="net472" />
66
<package id="Microsoft.CSharp" version="4.5.0" targetFramework="net472" />
77
<package id="Octokit" version="0.48.0" targetFramework="net472" />
88
<package id="PrettyBin" version="1.1.0" targetFramework="net472" />
9+
<package id="Serilog" version="2.10.0" targetFramework="net472" />
910
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
1011
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net472" />
1112
</packages>

Icons/gear.png

910 Bytes
Loading

Icons/gear.svg

Lines changed: 53 additions & 0 deletions
Loading

Icons/ingame_gear.svg

Lines changed: 55 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)