Skip to content
Merged
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
32 changes: 32 additions & 0 deletions Source/ORTS.Common/Input/UserCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,37 @@ public enum UserCommand
[GetString("Control AI Fire Reset")] ControlAIFireReset,
[GetString("Control Battery")] ControlBattery,
[GetString("Control PowerKey")] ControlPowerKey,
[GetString("Control Speed Regulator Mode Increase")] ControlSpeedRegulatorModeIncrease,
[GetString("Control Speed Regulator Mode Descrease")] ControlSpeedRegulatorModeDecrease,
[GetString("Control Selected Speed Increase")] ControlSpeedRegulatorSelectedSpeedIncrease,
[GetString("Control Selected Speed Decrease")] ControlSpeedRegulatorSelectedSpeedDecrease,
[GetString("Control Speed Regulator Max Acceleration Increase")] ControlSpeedRegulatorMaxAccelerationIncrease,
[GetString("Control Speed Regulator Max Acceleration Decrease")] ControlSpeedRegulatorMaxAccelerationDecrease,
[GetString("Control Number Of Axles Increase")] ControlNumberOfAxlesIncrease,
[GetString("Control Number Of Axles Decrease")] ControlNumberOfAxlesDecrease,
[GetString("Control Restricted Speed Zone Active")] ControlRestrictedSpeedZoneActive,
[GetString("Control Cruise Control Mode Increase")] ControlCruiseControlModeIncrease,
[GetString("Control Cruise Control Mode Decrease")] ControlCruiseControlModeDecrease,
[GetString("Control Train Type Change (Passenger/Cargo)")] ControlTrainTypePaxCargo,
[GetString("Control Select Speed 10 kph/mph")] ControlSelectSpeed10,
[GetString("Control Select Speed 20 kph/mph")] ControlSelectSpeed20,
[GetString("Control Select Speed 30 kph/mph")] ControlSelectSpeed30,
[GetString("Control Select Speed 40 kph/mph")] ControlSelectSpeed40,
[GetString("Control Select Speed 50 kph/mph")] ControlSelectSpeed50,
[GetString("Control Select Speed 60 kph/mph")] ControlSelectSpeed60,
[GetString("Control Select Speed 70 kph/mph")] ControlSelectSpeed70,
[GetString("Control Select Speed 80 kph/mph")] ControlSelectSpeed80,
[GetString("Control Select Speed 90 kph/mph")] ControlSelectSpeed90,
[GetString("Control Select Speed 100 kph/mph")] ControlSelectSpeed100,
[GetString("Control Select Speed 110 kph/mph")] ControlSelectSpeed110,
[GetString("Control Select Speed 120 kph/mph")] ControlSelectSpeed120,
[GetString("Control Select Speed 130 kph/mph")] ControlSelectSpeed130,
[GetString("Control Select Speed 140 kph/mph")] ControlSelectSpeed140,
[GetString("Control Select Speed 150 kph/mph")] ControlSelectSpeed150,
[GetString("Control Select Speed 160 kph/mph")] ControlSelectSpeed160,
[GetString("Control Select Speed 170 kph/mph")] ControlSelectSpeed170,
[GetString("Control Select Speed 180 kph/mph")] ControlSelectSpeed180,
[GetString("Control Select Speed 190 kph/mph")] ControlSelectSpeed190,
[GetString("Control Select Speed 200 kph/mph")] ControlSelectSpeed200,
}
}
38 changes: 37 additions & 1 deletion Source/ORTS.Settings/InputSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ UserCommand[] GetCommands()

public override object GetDefaultValue(string name)
{
return DefaultCommands[(int)GetCommand(name)].PersistentDescriptor;
return DefaultCommands[(int)GetCommand(name)].PersistentDescriptor;
}

protected override object GetValue(string name)
Expand Down Expand Up @@ -434,6 +434,42 @@ static void InitializeCommands(UserCommandInput[] Commands)
Commands[(int)UserCommand.ControlWaterScoop] = new UserCommandKeyInput(0x15);
Commands[(int)UserCommand.ControlWiper] = new UserCommandKeyInput(0x2F);

// Jindrich
Commands[(int)UserCommand.ControlSpeedRegulatorModeIncrease] = new UserCommandKeyInput(0x11, KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSpeedRegulatorModeDecrease] = new UserCommandKeyInput(0x1F, KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSpeedRegulatorMaxAccelerationIncrease] = new UserCommandKeyInput(0x20, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSpeedRegulatorMaxAccelerationDecrease] = new UserCommandKeyInput(0x1E, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSpeedRegulatorSelectedSpeedIncrease] = new UserCommandKeyInput(0x20, KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSpeedRegulatorSelectedSpeedDecrease] = new UserCommandKeyInput(0x1E, KeyModifiers.Shift);
Commands[(int)UserCommand.ControlNumberOfAxlesIncrease] = new UserCommandKeyInput(0x48, KeyModifiers.Shift);
Commands[(int)UserCommand.ControlNumberOfAxlesDecrease] = new UserCommandKeyInput(0x50, KeyModifiers.Shift);
Commands[(int)UserCommand.ControlRestrictedSpeedZoneActive] = new UserCommandKeyInput(0x13, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlCruiseControlModeDecrease] = new UserCommandKeyInput(0x1E, KeyModifiers.Control);
Commands[(int)UserCommand.ControlCruiseControlModeIncrease] = new UserCommandKeyInput(0x20, KeyModifiers.Control);
Commands[(int)UserCommand.ControlTrainTypePaxCargo] = new UserCommandKeyInput(0x31, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed10] = new UserCommandKeyInput(0x3B, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed20] = new UserCommandKeyInput(0x3C, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed30] = new UserCommandKeyInput(0x3D, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed40] = new UserCommandKeyInput(0x3E, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed50] = new UserCommandKeyInput(0x3F, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed60] = new UserCommandKeyInput(0x40, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed70] = new UserCommandKeyInput(0x41, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed80] = new UserCommandKeyInput(0x42, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed90] = new UserCommandKeyInput(0x43, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed100] = new UserCommandKeyInput(0x44, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed110] = new UserCommandKeyInput(0x57, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed120] = new UserCommandKeyInput(0x58, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed110] = new UserCommandKeyInput(0x02, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed120] = new UserCommandKeyInput(0x03, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed130] = new UserCommandKeyInput(0x04, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed140] = new UserCommandKeyInput(0x05, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed150] = new UserCommandKeyInput(0x06, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed160] = new UserCommandKeyInput(0x07, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed170] = new UserCommandKeyInput(0x08, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed180] = new UserCommandKeyInput(0x09, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed190] = new UserCommandKeyInput(0x0A, KeyModifiers.Control | KeyModifiers.Shift);
Commands[(int)UserCommand.ControlSelectSpeed200] = new UserCommandKeyInput(0x0B, KeyModifiers.Control | KeyModifiers.Shift);

Commands[(int)UserCommand.DebugClockBackwards] = new UserCommandKeyInput(0x0C);
Commands[(int)UserCommand.DebugClockForwards] = new UserCommandKeyInput(0x0D);
Commands[(int)UserCommand.DebugDumpKeymap] = new UserCommandKeyInput(0x3B, KeyModifiers.Alt);
Expand Down
28 changes: 27 additions & 1 deletion Source/Orts.Formats.Msts/CabViewFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,30 @@ public enum CABViewControlTypes
ORTS_TCS47,
ORTS_TCS48,
ORTS_ETCS,
ORTS_SELECTED_SPEED,
ORTS_SELECTED_SPEED_DISPLAY,
ORTS_SELECTED_SPEED_MODE,
ORTS_SELECTED_SPEED_REGULATOR_MODE,
ORTS_SELECTED_SPEED_MAXIMUM_ACCELERATION,
ORTS_RESTRICTED_SPEED_ZONE_ACTIVE,
ORTS_NUMBER_OF_AXES_DISPLAY_UNITS,
ORTS_NUMBER_OF_AXES_DISPLAY_TENS,
ORTS_NUMBER_OF_AXES_DISPLAY_HUNDREDS,
ORTS_TRAIN_LENGTH_METERS,
ORTS_REMAINING_TRAIN_LENGHT_SPEED_RESTRICTED,
ORTS_REMAINING_TRAIN_LENGTH_PERCENT,
ORTS_MOTIVE_FORCE,
ORTS_MOTIVE_FORCE_KILONEWTON,
ORTS_MAXIMUM_FORCE,
ORTS_FORCE_IN_PERCENT_THROTTLE_AND_DYNAMIC_BRAKE,
ORTS_TRAIN_TYPE_PAX_OR_CARGO,
ORTS_CONTROLLER_VOLTAGE,
ORTS_AMPERS_BY_CONTROLLER_VOLTAGE,
ORTS_ODOMETER,
ORTS_CC_SELECT_SPEED,
ORTS_NUMBER_OF_AXES_INCREASE,
ORTS_NUMBER_OF_AXES_DECREASE,


// Further CabViewControlTypes must be added above this line, to avoid their malfunction in 3DCabs
EXTERNALWIPERS,
Expand Down Expand Up @@ -292,7 +316,9 @@ public enum CABViewControlUnits
INCHES_OF_MERCURY,
MILI_AMPS,
RPM,
LBS
LBS,

KILOMETRES
}

public class CabViewControls : List<CabViewControl>
Expand Down
13 changes: 13 additions & 0 deletions Source/Orts.Simulation/Common/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ public enum Event
GearPosition7,
GearPosition8,

// Jindrich
CruiseControlSpeedRegulator,
CruiseControlSpeedSelector,
CruiseControlMaxForce,
Alert,
Alert1,

}

Expand Down Expand Up @@ -429,6 +435,13 @@ public static Event From(bool mstsBinEnabled, Source source, int eventID)
case 207: return Event.GearPosition7;
case 208: return Event.GearPosition8;

// Jindrich
case 300: return Event.CruiseControlSpeedRegulator;
case 301: return Event.CruiseControlSpeedSelector;
case 302: return Event.CruiseControlMaxForce;
case 303: return Event.Alert;
case 304: return Event.Alert1;

default: return 0;
}
case Source.MSTSCrossing:
Expand Down
2 changes: 2 additions & 0 deletions Source/Orts.Simulation/Orts.Simulation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@
<Compile Include="Simulation\RollingStocks\SubSystems\Controllers\IController.cs" />
<Compile Include="Simulation\RollingStocks\SubSystems\Controllers\MSTSBrakeController.cs" />
<Compile Include="Simulation\RollingStocks\SubSystems\Controllers\MSTSNotchController.cs" />
<Compile Include="Simulation\RollingStocks\SubSystems\Controllers\MultiPositionController.cs" />
<Compile Include="Simulation\RollingStocks\SubSystems\CruiseControl.cs" />
<Compile Include="Simulation\RollingStocks\SubSystems\FreightAnimations.cs" />
<Compile Include="Simulation\RollingStocks\SubSystems\PowerSupplies\AbstractPowerSupply.cs" />
<Compile Include="Simulation\RollingStocks\SubSystems\PowerSupplies\CircuitBreaker.cs" />
Expand Down
Loading