This commit is contained in:
BlubbFish 2015-11-12 22:33:17 +00:00
parent b5e98da66b
commit 30b88acba7
6 changed files with 369 additions and 170 deletions

View File

@ -20,7 +20,7 @@ namespace RailWorks_Joystick_API {
private bool _Running;
private bool _IsStopped = true;
private List<JoystickState> _lastDeviceStates = new List<JoystickState>();
public bool DeviceFound;
public bool DeviceFound = false;
public int PollInterval = 20;
public int AxisFilter = 0;

View File

@ -13,7 +13,7 @@
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
@ -111,6 +111,7 @@
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="ClassDiagram1.cd" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -132,103 +133,297 @@
</Page>
</ItemGroup>
<ItemGroup>
<Content Include="Images\Background.png" />
<Content Include="Images\BrakeKnob.png" />
<Content Include="Images\BtnAlternateActive.png" />
<Content Include="Images\BtnAWSActive1.png" />
<Content Include="Images\BtnAWSActive2.png" />
<Content Include="Images\BtnAWSInactive.png" />
<Content Include="Images\BtnBellActive.png" />
<Content Include="Images\BtnBlank.png" />
<Content Include="Images\BtnCabActive.png" />
<Content Include="Images\BtnCouplingActive.png" />
<Content Include="Images\BtnCylinderCocksActive.png" />
<Content Include="Images\BtnDriverGuideActive.png" />
<Content Include="Images\BtnDriverGuideInactive.png" />
<Content Include="Images\BtnEBrakeActive.png" />
<Content Include="Images\BtnEBrakeInactive.png" />
<Content Include="Images\BtnExternalFrontActive.png" />
<Content Include="Images\BtnExternalRearActive.png" />
<Content Include="Images\BtnFreeRoamActive.png" />
<Content Include="Images\BtnHeadOutLeftActive.png" />
<Content Include="Images\BtnHeadOutRightActive.png" />
<Content Include="Images\BtnHornActive.png" />
<Content Include="Images\BtnJunctionAheadActive.png" />
<Content Include="Images\BtnJunctionAheadInactive.png" />
<Content Include="Images\BtnJunctionBehindActive.png" />
<Content Include="Images\BtnJunctionBehindInactive.png" />
<Content Include="Images\BtnLightsActive1.png" />
<Content Include="Images\BtnLightsActive2.png" />
<Content Include="Images\BtnLoadUnloadActive.png" />
<Content Include="Images\BtnManualCouplingActive.png" />
<Content Include="Images\BtnManualCouplingInactive.png" />
<Content Include="Images\BtnMapActive.png" />
<Content Include="Images\BtnMapInactive.png" />
<Content Include="Images\BtnNextCabActive.png" />
<Content Include="Images\BtnPADAheadActive.png" />
<Content Include="Images\BtnPADAheadInactive.png" />
<Content Include="Images\BtnPADBehindActive.png" />
<Content Include="Images\BtnPADBehindInactive.png" />
<Content Include="Images\BtnPantographActive.png" />
<Content Include="Images\BtnPassengerActive.png" />
<Content Include="Images\btnPBrakeActive.png" />
<Content Include="Images\btnPBrakeInactive.png" />
<Content Include="Images\BtnPreviousCabActive.png" />
<Content Include="Images\BtnSanderActive.png" />
<Content Include="Images\BtnSmallEjectorActive.png" />
<Content Include="Images\BtnStarterActive.png" />
<Content Include="Images\BtnStarterInactive.png" />
<Content Include="Images\BtnTracksideActive.png" />
<Content Include="Images\BtnVigilanceActive.png" />
<Content Include="Images\BtnVigilanceInactive.png" />
<Content Include="Images\BtnWipersActive.png" />
<Content Include="Images\BtnYardActive.png" />
<Content Include="Images\BtnZoomInActive.png" />
<Content Include="Images\BtnZoomOutActive.png" />
<Content Include="Images\ButtonControls1bg.png" />
<Content Include="Images\ButtonControls2bg.png" />
<Content Include="Images\ControlSlot.png" />
<Content Include="Images\ControlSlotGear.png" />
<Content Include="Images\Digi0.png" />
<Content Include="Images\Digi1.png" />
<Content Include="Images\Digi2.png" />
<Content Include="Images\Digi3.png" />
<Content Include="Images\Digi4.png" />
<Content Include="Images\Digi5.png" />
<Content Include="Images\Digi6.png" />
<Content Include="Images\Digi7.png" />
<Content Include="Images\Digi8.png" />
<Content Include="Images\Digi9.png" />
<Content Include="Images\DigiBlank.png" />
<Content Include="Images\DigiDot.png" />
<Content Include="Images\DigiMinus.png" />
<Content Include="Images\GearKnob.png" />
<Content Include="Images\LabelPanel.png" />
<Content Include="Images\ReverserKnob.png" />
<Content Include="Images\SpeedoBg200Day.png" />
<Content Include="Images\SpeedoBg200KPHDay.png" />
<Content Include="Images\SpeedoBg300KPHDay.png" />
<Content Include="Images\SpeedoBg360KPHDay.png" />
<Content Include="Images\SpeedoBgBlue.png" />
<Content Include="Images\SpeedoBgDay.png" />
<Content Include="Images\SpeedoBgLarge200Day.png" />
<Content Include="Images\SpeedoBgLarge200KPHDay.png" />
<Content Include="Images\SpeedoBgLarge300KPHDay.png" />
<Content Include="Images\SpeedoBgLarge360KPHDay.png" />
<Content Include="Images\SpeedoBgLargeBlue.png" />
<Content Include="Images\SpeedoBgLargeDay.png" />
<Content Include="Images\SpeedoBgLargeOrange.png" />
<Content Include="Images\SpeedoBgOrange.png" />
<Content Include="Images\SpeedoGlass120.png" />
<Content Include="Images\SpeedoGlass200.png" />
<Content Include="Images\SpeedoGlassLarge120.png" />
<Content Include="Images\SpeedoGlassLarge200.png" />
<Content Include="Images\SpeedoIndicator.png" />
<Content Include="Images\SpeedoIndicatorBlue.png" />
<Content Include="Images\SpeedoIndicatorLarge.png" />
<Content Include="Images\SpeedoIndicatorLargeBlue.png" />
<Content Include="Images\ThrottleBrakeHandle.png" />
<Content Include="Images\ThrottleHandle.png" />
<Content Include="Images\Background.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BrakeKnob.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnAlternateActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnAWSActive1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnAWSActive2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnAWSInactive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnBellActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnBlank.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnCabActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnCouplingActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnCylinderCocksActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnDriverGuideActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnDriverGuideInactive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnEBrakeActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnEBrakeInactive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnExternalFrontActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnExternalRearActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnFreeRoamActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnHeadOutLeftActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnHeadOutRightActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnHornActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnJunctionAheadActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnJunctionAheadInactive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnJunctionBehindActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnJunctionBehindInactive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnLightsActive1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnLightsActive2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnLoadUnloadActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnManualCouplingActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnManualCouplingInactive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnMapActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnMapInactive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnNextCabActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnPADAheadActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnPADAheadInactive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnPADBehindActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnPADBehindInactive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnPantographActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnPassengerActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\btnPBrakeActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\btnPBrakeInactive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnPreviousCabActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnSanderActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnSmallEjectorActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnStarterActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnStarterInactive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnTracksideActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnVigilanceActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnVigilanceInactive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnWipersActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnYardActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnZoomInActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\BtnZoomOutActive.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\ButtonControls1bg.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\ButtonControls2bg.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\ControlSlot.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\ControlSlotGear.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\Digi0.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\Digi1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\Digi2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\Digi3.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\Digi4.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\Digi5.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\Digi6.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\Digi7.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\Digi8.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\Digi9.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\DigiBlank.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\DigiDot.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\DigiMinus.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\GearKnob.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\LabelPanel.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\ReverserKnob.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBg200Day.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBg200KPHDay.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBg300KPHDay.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBg360KPHDay.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBgBlue.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBgDay.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBgLarge200Day.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBgLarge200KPHDay.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBgLarge300KPHDay.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBgLarge360KPHDay.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBgLargeBlue.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBgLargeDay.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBgLargeOrange.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoBgOrange.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoGlass120.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoGlass200.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoGlassLarge120.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoGlassLarge200.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoIndicator.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoIndicatorBlue.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoIndicatorLarge.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SpeedoIndicatorLargeBlue.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\ThrottleBrakeHandle.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\ThrottleHandle.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="RailWorks_Joystick_API.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />

View File

@ -32,8 +32,8 @@ namespace RailWorks_Joystick_API {
Globals.DeviceNames = Globals.JoyDevices.GetDeviceNames();
Globals.DevStatus = txtDevStatus;
Globals.DevStatus.Text = string.Join("\r\n", Globals.DeviceNames.ToArray());
this.Show();
Application.DoEvents();
//this.Show();
//Application.DoEvents();
Globals.IHandler = new InputHandler(Globals.DeviceNames);
System.Threading.Thread.Sleep(100);
Globals.JoyDevices.StartPolling();
@ -151,8 +151,9 @@ namespace RailWorks_Joystick_API {
public frmMain() {
InitializeComponent();
Globals.JoyDevices = new Joystick(this);
this.FormClosing += frmMain_FormClosing;
this.Load += frmMain_Load;
/*this.Load += frmMain_Load;
this.ShowControlsBtn.Click +=ShowControlsBtn_Click;
this.btnShowLargeSpeedo.Click+=btnShowLargeSpeedo_Click;
this.btnVigilanceSettings.Click+=btnVigilanceSettings_Click;
@ -166,7 +167,7 @@ namespace RailWorks_Joystick_API {
this.btnNextDevice.Click+=btnNextDevice_Click;
this.btnAllDevice.Click+=btnAllDevice_Click;
this.btnShiftDown.Click+=btnShiftDown_Click;
this.btnShiftUp.Click+=btnShiftUp_Click;
this.btnShiftUp.Click+=btnShiftUp_Click;*/
}
}
}

View File

@ -3,19 +3,20 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:UI="clr-namespace:RailWorks_Joystick_API.Properties"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="674">
<StackPanel Height="478" Name="AnalogControls" Width="672" Orientation="Vertical">
<StackPanel Height="310" Name="SpeedometerSlot" Width="672" Orientation="Horizontal" ToolTip="Analog Speedometer">
<Grid Width="10" />
<Grid Width="300">
<Image Name="SpeedoBG" Stretch="None" Width="300" Height="300" Source="Images/SpeedoBgDay.png"/>
<Image Name="SpeedoIndicator" Stretch="None" Width="300" Height="300" Source="Images/SpeedoIndicator.png" RenderTransformOrigin="0.5,0.5">
<Image Name="SpeedoBG" Stretch="None" Width="300" Height="300" Source="pack://application:,,,/Images/SpeedoBgDay.png" />
<Image Name="SpeedoIndicator" Stretch="None" Width="300" Height="300" Source="pack://application:,,,/Images/SpeedoIndicator.png" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<RotateTransform Angle="0"/>
</Image.RenderTransform>
</Image>
<Image Name="SpeedoGlass" Stretch="None" Width="300" Height="300" Source="Images/SpeedoGlass120.png"/>
<Image Name="SpeedoGlass" Stretch="None" Width="300" Height="300" Source="pack://application:,,,/Images/SpeedoGlass120.png"/>
</Grid>
<StackPanel Width="254" Orientation="Vertical">
<StackPanel Width="254" Height="219" Orientation="Vertical">
@ -27,44 +28,44 @@
<Grid Width="20" Height="88"/>
<StackPanel Width="56" Height="88" Orientation="Vertical">
<Image Name="MapActive" Width="56" Height="40" Source="Images/BtnMapActive.png" ToolTip="2D Map Toggle"/>
<Image Name="DriverGuideActive" Width="56" Height="40" Source="Images/BtnDriverGuideActive.png" ToolTip="Driver Guide"/>
<Image Name="DriverGuideActive" Width="56" Height="40" Source="pack://application:,,,/Images/BtnDriverGuideActive.png" ToolTip="Driver Guide"/>
<Grid Width="56" Height="8"/>
</StackPanel>
<StackPanel Width="40" Height="88" Orientation="Vertical">
<Grid Width="40" Height="4"/>
<Image Name="PADAheadActive" Width="40" Height="40" Source="Images/BtnPADAheadActive.png" ToolTip="Pass at danger ahead"/>
<Image Name="PADBehindActive" Width="40" Height="40" Source="Images/BtnPADBehindActive.png" ToolTip="Pass at danger behind"/>
<Image Name="PADAheadActive" Width="40" Height="40" Source="pack://application:,,,/Images/BtnPADAheadActive.png" ToolTip="Pass at danger ahead"/>
<Image Name="PADBehindActive" Width="40" Height="40" Source="pack://application:,,,/Images/BtnPADBehindActive.png" ToolTip="Pass at danger behind"/>
<Grid Width="40" Height="4"/>
</StackPanel>
<StackPanel Width="40" Height="88" Orientation="Vertical">
<Grid Width="56" Height="4"/>
<Image Name="JunctionAheadActive" Width="30" Height="30" Source="Images/BtnJunctionAheadActive.png" ToolTip="Switch junction ahead"/>
<Image Name="JunctionBehindActive" Width="30" Height="30" Source="Images/BtnJunctionBehindActive.png" ToolTip="Switch junction behind"/>
<Image Name="PBrakeActive" Width="40" Height="24" Source="Images/BtnPBrakeActive.png" ToolTip="Parking Brake"/>
<Image Name="JunctionAheadActive" Width="30" Height="30" Source="pack://application:,,,/Images/BtnJunctionAheadActive.png" ToolTip="Switch junction ahead"/>
<Image Name="JunctionBehindActive" Width="30" Height="30" Source="pack://application:,,,/Images/BtnJunctionBehindActive.png" ToolTip="Switch junction behind"/>
<Image Name="PBrakeActive" Width="40" Height="24" Source="pack://application:,,,/Images/BtnPBrakeActive.png" ToolTip="Parking Brake"/>
</StackPanel>
</StackPanel>
<StackPanel Width="88" Orientation="Vertical">
<StackPanel.Background>
<ImageBrush ImageSource="Images/ButtonControls1bg.png" />
<ImageBrush ImageSource="pack://application:,,,/Images/ButtonControls1bg.png" />
</StackPanel.Background>
<StackPanel Width="88" Height="6" />
<StackPanel Width="88" Height="25" Orientation="Horizontal">
<Grid Width="6" Height="25" />
<Image Name="WipersActive" Width="25" Height="25" Source="Images/BtnWipersActive.png" ToolTip="Wipers"/>
<Image Name="LightsActive" Width="25" Height="25" Source="Images/BtnLightsActive1.png" ToolTip="Lights"/>
<Image Name="PantographActive" Width="25" Height="25" Source="Images/BtnPantographActive.png" ToolTip="Pantograph"/>
<Image Name="WipersActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnWipersActive.png" ToolTip="Wipers"/>
<Image Name="LightsActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnLightsActive1.png" ToolTip="Lights"/>
<Image Name="PantographActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnPantographActive.png" ToolTip="Pantograph"/>
</StackPanel>
<StackPanel Width="88" Height="25" Orientation="Horizontal">
<Grid Width="6" Height="25" />
<Image Name="LoadUnloadActive" Width="25" Height="25" Source="Images/BtnLoadUnloadActive.png" ToolTip="Load / Unload"/>
<Image Name="SanderActive" Width="25" Height="25" Source="Images/BtnSanderActive.png" ToolTip="Sander"/>
<Image Name="SmallEjectorActive" Width="25" Height="25" Source="Images/BtnSmallEjectorActive.png" ToolTip="Small Ejector"/>
<Image Name="LoadUnloadActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnLoadUnloadActive.png" ToolTip="Load / Unload"/>
<Image Name="SanderActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnSanderActive.png" ToolTip="Sander"/>
<Image Name="SmallEjectorActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnSmallEjectorActive.png" ToolTip="Small Ejector"/>
</StackPanel>
<StackPanel Width="88" Height="25" Orientation="Horizontal">
<Grid Width="6" Height="25" />
<Image Name="HornActive" Width="25" Height="25" Source="Images/BtnHornActive.png" ToolTip="Horn"/>
<Image Name="BellActive" Width="25" Height="25" Source="Images/BtnBellActive.png" ToolTip="Bell"/>
<Image Name="CylinderCocksActive" Width="25" Height="25" Source="Images/BtnCylinderCocksActive.png" ToolTip="Cylinder Cocks"/>
<Image Name="HornActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnHornActive.png" ToolTip="Horn"/>
<Image Name="BellActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnBellActive.png" ToolTip="Bell"/>
<Image Name="CylinderCocksActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnCylinderCocksActive.png" ToolTip="Cylinder Cocks"/>
</StackPanel>
<StackPanel Width="88" Height="6" />
</StackPanel>
@ -73,47 +74,47 @@
<StackPanel Width="116" Orientation="Vertical">
<StackPanel Width="106" Height="40" Orientation="Horizontal">
<Grid Width="5" />
<Image Name="StarterActive" Width="40" Height="40" Source="Images/BtnStarterActive.png" ToolTip="Engine Start/Stop"/>
<Image Name="StarterActive" Width="40" Height="40" Source="pack://application:,,,/Images/BtnStarterActive.png" ToolTip="Engine Start/Stop"/>
<Grid Width="5" />
<Image Name="ManualCouplingActive" Width="56" Height="40" Source="Images/BtnManualCouplingActive.png" ToolTip="Manually Couple"/>
<Image Name="ManualCouplingActive" Width="56" Height="40" Source="pack://application:,,,/Images/BtnManualCouplingActive.png" ToolTip="Manually Couple"/>
</StackPanel>
<StackPanel Width="116" Height="8" Orientation="Horizontal" />
<StackPanel Width="116" Height="40" Orientation="Horizontal">
<Grid Width="0" />
<Image Name="AWSActive" Width="40" Height="40" Source="Images/BtnAWSInactive.png" ToolTip="Advanced Warning System (AWS)"/>
<Image Name="AWSActive" Width="40" Height="40" Source="pack://application:,,,/Images/BtnAWSInactive.png" ToolTip="Advanced Warning System (AWS)"/>
<Grid Width="0" />
<Image Name="EBrakeActive" Width="40" Height="40" Source="Images/BtnEBrakeInactive.png" ToolTip="Emergency Brakes"/>
<Image Name="VigilanceActive" Width="32" Height="32" Source="Images/BtnVigilanceInactive.png" ToolTip="Vigilance System"/>
<Image Name="EBrakeActive" Width="40" Height="40" Source="pack://application:,,,/Images/BtnEBrakeInactive.png" ToolTip="Emergency Brakes"/>
<Image Name="VigilanceActive" Width="32" Height="32" Source="pack://application:,,,/Images/BtnVigilanceInactive.png" ToolTip="Vigilance System"/>
</StackPanel>
</StackPanel>
<StackPanel Width="138" Orientation="Vertical">
<StackPanel.Background>
<ImageBrush ImageSource="Images/ButtonControls2bg.png" Stretch="None" TileMode="None" />
<ImageBrush ImageSource="pack://application:,,,/Images/ButtonControls2bg.png" Stretch="None" TileMode="None" />
</StackPanel.Background>
<StackPanel Width="138" Height="6" />
<StackPanel Width="138" Height="25" Orientation="Horizontal">
<Grid Width="7" Height="25" />
<Image Name="HeadOutLeftActive" Width="25" Height="25" Source="Images/BtnHeadOutLeftActive.png" ToolTip="Head out cab left/right camera"/>
<Image Name="CabActive" Width="25" Height="25" Source="Images/BtnCabActive.png" ToolTip="Cab camera"/>
<Image Name="HeadOutRightActive" Width="25" Height="25" Source="Images/BtnHeadOutRightActive.png" ToolTip="Head out cab left/right camera"/>
<Image Name="TracksideActive" Width="25" Height="25" Source="Images/BtnTracksideActive.png" ToolTip="Trackside camera"/>
<Image Name="AlternateActive" Width="25" Height="25" Source="Images/BtnAlternateActive.png" ToolTip="Alternate camera"/>
<Image Name="HeadOutLeftActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnHeadOutLeftActive.png" ToolTip="Head out cab left/right camera"/>
<Image Name="CabActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnCabActive.png" ToolTip="Cab camera"/>
<Image Name="HeadOutRightActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnHeadOutRightActive.png" ToolTip="Head out cab left/right camera"/>
<Image Name="TracksideActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnTracksideActive.png" ToolTip="Trackside camera"/>
<Image Name="AlternateActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnAlternateActive.png" ToolTip="Alternate camera"/>
</StackPanel>
<StackPanel Width="138" Height="25" Orientation="Horizontal">
<Grid Width="7" Height="25" />
<Image Name="ExternalFrontActive" Width="25" Height="25" Source="Images/BtnExternalFrontActive.png" ToolTip="Front external camera"/>
<Image Name="ExternalRearActive" Width="25" Height="25" Source="Images/BtnExternalRearActive.png" ToolTip="Rear external camera"/>
<Image Name="PassengerActive" Width="25" Height="25" Source="Images/BtnPassengerActive.png" ToolTip="Passenger camera"/>
<Image Name="NextCabActive" Width="25" Height="25" Source="Images/BtnNextcabActive.png" ToolTip="Next cab camera"/>
<Image Name="PreviousCabActive" Width="25" Height="25" Source="Images/BtnPreviousCabActive.png" ToolTip="Previous cab camera"/>
<Image Name="ExternalFrontActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnExternalFrontActive.png" ToolTip="Front external camera"/>
<Image Name="ExternalRearActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnExternalRearActive.png" ToolTip="Rear external camera"/>
<Image Name="PassengerActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnPassengerActive.png" ToolTip="Passenger camera"/>
<Image Name="NextCabActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnNextcabActive.png" ToolTip="Next cab camera"/>
<Image Name="PreviousCabActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnPreviousCabActive.png" ToolTip="Previous cab camera"/>
</StackPanel>
<StackPanel Width="138" Height="25" Orientation="Horizontal">
<Grid Width="7" Height="25" />
<Image Name="CouplingActive" Width="25" Height="25" Source="Images/BtnCouplingActive.png" ToolTip="Coupling camera"/>
<Image Name="YardActive" Width="25" Height="25" Source="Images/BtnYardActive.png" ToolTip="Yard camera"/>
<Image Name="FreeRoamActive" Width="25" Height="25" Source="Images/BtnFreeRoamActive.png" ToolTip="Free roam camera"/>
<Image Name="ZoomInActive" Width="25" Height="25" Source="Images/BtnZoomInActive.png" ToolTip="Zoom in"/>
<Image Name="ZoomOutActive" Width="25" Height="25" Source="Images/BtnZoomOutActive.png" ToolTip="Zoom out"/>
<Image Name="CouplingActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnCouplingActive.png" ToolTip="Coupling camera"/>
<Image Name="YardActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnYardActive.png" ToolTip="Yard camera"/>
<Image Name="FreeRoamActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnFreeRoamActive.png" ToolTip="Free roam camera"/>
<Image Name="ZoomInActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnZoomInActive.png" ToolTip="Zoom in"/>
<Image Name="ZoomOutActive" Width="25" Height="25" Source="pack://application:,,,/Images/BtnZoomOutActive.png" ToolTip="Zoom out"/>
</StackPanel>
<StackPanel Width="138" Height="6" />
</StackPanel>
@ -124,19 +125,19 @@
</StackPanel>
<StackPanel Name="DigitalSpeedo" Width="254" Height="91" Orientation="Horizontal" ToolTip="Digital speedometer">
<Grid Width="56" VerticalAlignment="Top">
<Image Name="SpeedoDigital1" Stretch="None" Width="56" Height="81" Source="Images/DigiMinus.png"/>
<Image Name="SpeedoDigital1" Stretch="None" Width="56" Height="81" Source="pack://application:,,,/Images/DigiMinus.png"/>
</Grid>
<Grid Width="56" VerticalAlignment="Top">
<Image Name="SpeedoDigital2" Stretch="None" Width="56" Height="81" Source="Images/DigiMinus.png"/>
<Image Name="SpeedoDigital2" Stretch="None" Width="56" Height="81" Source="pack://application:,,,/Images/DigiMinus.png"/>
</Grid>
<Grid Width="56" VerticalAlignment="Top">
<Image Name="SpeedoDigital3" Stretch="None" Width="56" Height="81" Source="Images/DigiMinus.png"/>
<Image Name="SpeedoDigital3" Stretch="None" Width="56" Height="81" Source="pack://application:,,,/Images/DigiMinus.png"/>
</Grid>
<Grid Width="30" VerticalAlignment="Top">
<Image Name="SpeedoDigitalDot" Stretch="None" Width="30" Height="81" Source="Images/DigiDot.png"/>
<Image Name="SpeedoDigitalDot" Stretch="None" Width="30" Height="81" Source="pack://application:,,,/Images/DigiDot.png"/>
</Grid>
<Grid Width="56" VerticalAlignment="Top">
<Image Name="SpeedoDigital4" Stretch="None" Width="56" Height="81" Source="Images/DigiMinus.png"/>
<Image Name="SpeedoDigital4" Stretch="None" Width="56" Height="81" Source="pack://application:,,,/Images/DigiMinus.png"/>
</Grid>
</StackPanel>
</StackPanel>
@ -161,12 +162,12 @@
</TextBlock>
</StackPanel.ToolTip>
<Grid Width="112" Height="112">
<Image Stretch="None" Width="112" Height="112" Source="Images/ControlSlot.png"/>
<Image Stretch="None" Width="80" Height="32" Source="Images/ThrottleHandle.png"/>
<Image Stretch="None" Width="112" Height="112" Source="pack://application:,,,/Images/ControlSlot.png"/>
<Image Stretch="None" Width="80" Height="32" Source="pack://application:,,,/Images/ThrottleHandle.png"/>
<Label Content="0%" Height="28" HorizontalAlignment="Center" Margin="0,6,0,0" VerticalAlignment="Top" Foreground="White" />
</Grid>
<Grid Width="112">
<Image Stretch="None" Width="112" Height="56" Source="Images/LabelPanel.png"/>
<Image Stretch="None" Width="112" Height="56" Source="pack://application:,,,/Images/LabelPanel.png"/>
<TextBlock TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="14" FontWeight="Bold">
Throttle
</TextBlock>
@ -174,12 +175,12 @@
</StackPanel>
<StackPanel Name="TrainBrakeControls" Orientation="Vertical" ToolTip="Train Brakes">
<Grid Width="112" Height="112">
<Image Stretch="None" Width="112" Height="112" Source="Images/ControlSlot.png"/>
<Image Stretch="None" Width="48" Height="48" Source="Images/BrakeKnob.png"/>
<Image Stretch="None" Width="112" Height="112" Source="pack://application:,,,/Images/ControlSlot.png"/>
<Image Stretch="None" Width="48" Height="48" Source="pack://application:,,,/Images/BrakeKnob.png"/>
<Label Content="0%" Height="28" HorizontalAlignment="Center" Margin="0,6,0,0" VerticalAlignment="Top" Foreground="White" />
</Grid>
<Grid Width="112">
<Image Stretch="None" Width="112" Height="56" Source="Images/LabelPanel.png"/>
<Image Stretch="None" Width="112" Height="56" Source="pack://application:,,,/Images/LabelPanel.png"/>
<TextBlock TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="14" FontWeight="Bold">
Train<LineBreak/>Brakes
</TextBlock>
@ -187,12 +188,12 @@
</StackPanel>
<StackPanel Name="LocomotiveBrakeControls" Orientation="Vertical" ToolTip="Locomotive Brakes">
<Grid Width="112" Height="112">
<Image Stretch="None" Width="112" Height="112" Source="Images/ControlSlot.png"/>
<Image Stretch="None" Width="48" Height="48" Source="Images/BrakeKnob.png"/>
<Image Stretch="None" Width="112" Height="112" Source="pack://application:,,,/Images/ControlSlot.png"/>
<Image Stretch="None" Width="48" Height="48" Source="pack://application:,,,/Images/BrakeKnob.png"/>
<Label Content="0%" Height="28" HorizontalAlignment="Center" Margin="0,6,0,0" VerticalAlignment="Top" Foreground="White" />
</Grid>
<Grid Width="112">
<Image Stretch="None" Width="112" Height="56" Source="Images/LabelPanel.png"/>
<Image Stretch="None" Width="112" Height="56" Source="pack://application:,,,/Images/LabelPanel.png"/>
<TextBlock TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="14" FontWeight="Bold">
Locomotive<LineBreak/>Brakes
</TextBlock>
@ -200,12 +201,12 @@
</StackPanel>
<StackPanel Name="DynamicBrakeControls" Orientation="Vertical" ToolTip="Dynamic Brakes">
<Grid Width="112" Height="112">
<Image Stretch="None" Width="112" Height="112" Source="Images/ControlSlot.png"/>
<Image Stretch="None" Width="48" Height="48" Source="Images/BrakeKnob.png"/>
<Image Stretch="None" Width="112" Height="112" Source="pack://application:,,,/Images/ControlSlot.png"/>
<Image Stretch="None" Width="48" Height="48" Source="pack://application:,,,/Images/BrakeKnob.png"/>
<Label Content="0%" Height="28" HorizontalAlignment="Center" Margin="0,6,0,0" VerticalAlignment="Top" Foreground="White" />
</Grid>
<Grid Width="112">
<Image Stretch="None" Width="112" Height="56" Source="Images/LabelPanel.png"/>
<Image Stretch="None" Width="112" Height="56" Source="pack://application:,,,/Images/LabelPanel.png"/>
<TextBlock TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="14" FontWeight="Bold">
Dynamic<LineBreak/>Brakes
</TextBlock>
@ -213,12 +214,12 @@
</StackPanel>
<StackPanel Name="ReverserControls" Orientation="Vertical" ToolTip="Reverser">
<Grid Width="112" Height="112">
<Image Stretch="None" Width="112" Height="112" Source="Images/ControlSlot.png"/>
<Image Stretch="None" Width="48" Height="48" Source="Images/ReverserKnob.png"/>
<Image Stretch="None" Width="112" Height="112" Source="pack://application:,,,/Images/ControlSlot.png"/>
<Image Stretch="None" Width="48" Height="48" Source="pack://application:,,,/Images/ReverserKnob.png"/>
<Label Content="0%" Height="28" HorizontalAlignment="Center" Margin="0,6,0,0" VerticalAlignment="Top" Foreground="White" />
</Grid>
<Grid Width="112">
<Image Stretch="None" Width="112" Height="56" Source="Images/LabelPanel.png"/>
<Image Stretch="None" Width="112" Height="56" Source="pack://application:,,,/Images/LabelPanel.png"/>
<TextBlock TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="14" FontWeight="Bold">
Reverser
</TextBlock>
@ -226,12 +227,12 @@
</StackPanel>
<StackPanel Name="GearControls" Orientation="Vertical" ToolTip="Gear">
<Grid Width="112" Height="112">
<Image Stretch="None" Width="112" Height="112" Source="Images/ControlSlotGear.png"/>
<Image Stretch="None" Width="48" Height="48" Source="Images/GearKnob.png"/>
<Image Stretch="None" Width="112" Height="112" Source="pack://application:,,,/Images/ControlSlotGear.png"/>
<Image Stretch="None" Width="48" Height="48" Source="pack://application:,,,/Images/GearKnob.png"/>
<Label Content="0" Height="28" HorizontalAlignment="Center" Margin="0,6,0,0" VerticalAlignment="Top" Foreground="White" />
</Grid>
<Grid Width="112">
<Image Stretch="None" Width="112" Height="56" Source="Images/LabelPanel.png"/>
<Image Stretch="None" Width="112" Height="56" Source="pack://application:,,,/Images/LabelPanel.png"/>
<TextBlock TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="14" FontWeight="Bold">
Gear
</TextBlock>
@ -240,6 +241,6 @@
</StackPanel>
</StackPanel>
<UserControl.Background>
<ImageBrush ImageSource="Images/Background.png" />
<ImageBrush ImageSource="pack://application:,,,/Images/Background.png" />
</UserControl.Background>
</UserControl>

View File

@ -93,8 +93,7 @@ namespace RailWorks_Joystick_API {
public int State;
public void SetState(int Value) {
if((StateImages == null)) {
StateImages = new List<String>();
if((StateImages.Count == 0)) {
if(((Ctrl.Name == "StarterActive")
|| ((Ctrl.Name == "ManualCouplingActive")
|| ((Ctrl.Name == "AWSActive")
@ -444,7 +443,7 @@ namespace RailWorks_Joystick_API {
public event SetupControlEvent SetupButtonControls;
public event SetupControlEvent SetupAnalogControls;
private string Description;
//private string Description;