Skip to content

Commit 1af32dc

Browse files
committed
Updating RailDriver SDK library to prepare for 64bit mode
1 parent f199695 commit 1af32dc

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed
-32 KB
Binary file not shown.

Source/RunActivity/RunActivity.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@
6767
<SpecificVersion>False</SpecificVersion>
6868
<HintPath>..\3rdPartyLibs\Newtonsoft.Json.dll</HintPath>
6969
</Reference>
70-
<Reference Include="PIEHidDotNet, Version=2.2.3.26389, Culture=neutral, processorArchitecture=MSIL">
71-
<SpecificVersion>False</SpecificVersion>
72-
<HintPath>..\3rdPartyLibs\PIEHidDotNet.dll</HintPath>
70+
<Reference Include="RailDriver, Version=0.7.0.0, Culture=neutral, processorArchitecture=MSIL">
71+
<HintPath>..\packages\RailDriver.0.7.10\lib\netstandard2.0\RailDriver.dll</HintPath>
7372
</Reference>
7473
<Reference Include="Swan.Lite, Version=3.0.0.0, Culture=neutral, PublicKeyToken=30c707c872729fff, processorArchitecture=MSIL">
7574
<HintPath>..\packages\Unosquare.Swan.Lite.3.0.0\lib\net461\Swan.Lite.dll</HintPath>

Source/RunActivity/Viewer3D/UserInputRailDriver.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@
2323
using Orts.Simulation.RollingStocks;
2424
using ORTS.Common;
2525
using ORTS.Common.Input;
26-
using PIEHidDotNet;
26+
27+
using RailDriver;
2728

2829
namespace Orts.Viewer3D
2930
{
3031
/// <summary>
3132
/// Class to get data from RailDriver and translate it into something useful for UserInput
3233
/// </summary>
33-
public class UserInputRailDriver : PIEDataHandler, PIEErrorHandler
34+
public class UserInputRailDriver : IDataHandler, IErrorHandler
3435
{
3536
PIEDevice Device; // Our RailDriver
3637
byte[] WriteBuffer; // Buffer for sending data to RailDriver
@@ -69,15 +70,15 @@ public UserInputRailDriver(string basePath)
6970
{
7071
try
7172
{
72-
PIEDevice[] devices = PIEHidDotNet.PIEDevice.EnumeratePIE();
73+
PIEDevice[] devices = PIEDevice.EnumeratePIE();
7374
for (int i = 0; i < devices.Length; i++)
7475
{
7576
if (devices[i].HidUsagePage == 0xc && devices[i].Pid == 210)
7677
{
7778
Device = devices[i];
7879
Device.SetupInterface();
7980
Device.SetErrorCallback(this);
80-
Device.SetDataCallback(this, DataCallbackFilterType.callOnChangedData);
81+
Device.SetDataCallback(this);
8182
WriteBuffer = new byte[Device.WriteLength];
8283
State = new RailDriverState();
8384
SetLEDs(0x40, 0x40, 0x40);
@@ -98,7 +99,7 @@ public UserInputRailDriver(string basePath)
9899
/// </summary>
99100
/// <param name="data"></param>
100101
/// <param name="sourceDevice"></param>
101-
public void HandlePIEHidData(Byte[] data, PIEDevice sourceDevice)
102+
public void HandleHidData(byte[] data, PIEDevice sourceDevice, int error)
102103
{
103104
if (sourceDevice != Device)
104105
return;
@@ -157,7 +158,7 @@ public void HandlePIEHidData(Byte[] data, PIEDevice sourceDevice)
157158
/// </summary>
158159
/// <param name="error"></param>
159160
/// <param name="sourceDevice"></param>
160-
public void HandlePIEHidError(Int32 error, PIEDevice sourceDevice)
161+
public void HandleHidError(PIEDevice sourceDevice, int error)
161162
{
162163
Trace.TraceWarning("RailDriver Error: {0}", error);
163164
}

Source/RunActivity/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="EmbedIO" version="3.4.3" targetFramework="net472" />
4+
<package id="RailDriver" version="0.7.10" targetFramework="net472" />
45
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
56
<package id="Unosquare.Swan.Lite" version="3.0.0" targetFramework="net472" />
67
</packages>

0 commit comments

Comments
 (0)