Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to vacuum brakes #103

Merged
merged 30 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6f6ad6c
Changes to vacuum brakes
peternewell Sep 30, 2019
1619306
Changes to fix engine brake
peternewell Oct 1, 2019
aa54d7e
Adjusted Engine Brake to conform with BR standards, and added new eng…
peternewell Oct 20, 2019
5625ddd
Incorporate working Large Ejector and switch for Simple/Advanced Cont…
peternewell Oct 26, 2019
0a54f5f
Modifications to allow trailing cars to take same brake system as lea…
peternewell Nov 17, 2019
4987c5f
Correct an issue with cabview control not animating correctly
peternewell Nov 21, 2019
6b1e28f
Adjustments to GWR Controller
peternewell Nov 23, 2019
6537826
Adjustments to GWR brake token
peternewell Nov 27, 2019
7d81a7f
Changes to vacuum reservoir calculation to compensate for volume chan…
peternewell Dec 3, 2019
88ba8ca
Adjusted error in volume calculation
peternewell Dec 15, 2019
12254a0
Minor change to vacuum reservoir "pressure" as brakes are applied and…
peternewell Dec 16, 2019
657335a
Adjust brake release to "automatically" release if Large Ejector not …
peternewell Jan 3, 2020
88555e3
Adjustment to vacuum brake to allow application of brake for combined…
peternewell Jan 4, 2020
e4c2b21
Adjustment to Dreadnought brake controller
peternewell Jan 5, 2020
cc78055
Further adjustment to GWR controller
peternewell Jan 13, 2020
51fbe5f
Set Simple Controls/Physics for Adhesion coefficient selection.
peternewell Jan 25, 2020
fad1e48
Addition of diesel locomotive vacuum brake (initial)
peternewell Jan 30, 2020
2ce78cf
Add control for vacuum exhauster on diesel locomotives.
peternewell Jan 31, 2020
369fc6c
Change text notification on vacuum exhauster
peternewell Feb 1, 2020
123baed
Adjustments to vacuum exhauster operation
peternewell Feb 3, 2020
f2390e2
Adjustment to diesel vacuum brake.
peternewell Feb 5, 2020
3975da0
Add Brake cuts power feature
peternewell Feb 6, 2020
6694d46
Changes to Brake cuts power
peternewell Feb 7, 2020
25ef655
Further adjustments to brakes cutting power
peternewell Feb 8, 2020
683f09a
Fix issue with OR not reading user input
peternewell Feb 12, 2020
fffc416
Attempt to fix merge issue
peternewell May 20, 2020
ff992c7
Revert "Attempt to fix merge issue"
peternewell May 20, 2020
f315db6
Reverse merge conflict issues
peternewell May 21, 2020
709fe36
Correct merge issue
peternewell May 21, 2020
1f1de08
Small corrections and documentation for manual.
peternewell May 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 25 additions & 10 deletions Source/Documentation/Manual/physics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1999,8 +1999,8 @@ wagon section of the WAG or ENG file.
- ``wagon(ORTSBrakeShoeFriction`` -- defines the friction curve for the brake shoe
with speed (default curve for cast iron brake shoes included in OR).

Other standard brake parameters such as MaxBrakeForce, MaxReleaseRate , MaxApplicationRate,
BrakeCylinderPressureForMaxBrakeBrakeForce can be used as well.
Other standard brake parameters such as ``MaxBrakeForce``, ``MaxReleaseRate``, ``MaxApplicationRate``,
``BrakeCylinderPressureForMaxBrakeBrakeForce`` can be used as well.

Additionaly the following are defined in the engine section of the ENG file:

Expand Down Expand Up @@ -2033,22 +2033,37 @@ Additionaly the following are defined in the engine section of the ENG file:

**Note: It is strongly recommended that UoM be used whenever units such as InHg, etc are specificed in the above parameters.**

Other standard brake parameters such as VacuumBrakesHasVacuumPump, VacuumBrakesMinBoilerPressureMaxVacuum,
VacuumBrakesSmallEjectorUsageRate, VacuumBrakesLargeEjectorUsageRate can be defined as well.
Other standard brake parameters such as ``VacuumBrakesHasVacuumPump``, ``VacuumBrakesMinBoilerPressureMaxVacuum``,
``VacuumBrakesSmallEjectorUsageRate``, ``VacuumBrakesLargeEjectorUsageRate`` can be defined as well.

When defining the Brake Controllers for vacuum braked locomotives, only the following BrakesController
tokens should be used - TrainBrakesControllerFullQuickReleaseStart, TrainBrakesControllerReleaseStart,
TrainBrakesControllerRunningStart, TrainBrakesControllerApplyStart, TrainBrakesControllerHoldLappedStart,
TrainBrakesControllerVacuumContinuousServiceStart, TrainBrakesControllerEmergencyStart,
EngineBrakesControllerReleaseStart, EngineBrakesControllerRunningStart, EngineBrakesControllerApplyStart.
tokens should be used - ``TrainBrakesControllerFullQuickReleaseStart``, ``TrainBrakesControllerReleaseStart``,
``TrainBrakesControllerRunningStart``, ``TrainBrakesControllerApplyStart``, ``TrainBrakesControllerHoldLappedStart``,
``TrainBrakesControllerVacuumContinuousServiceStart``, ``TrainBrakesControllerEmergencyStart``,
``EngineBrakesControllerReleaseStart``, ``EngineBrakesControllerRunningStart``, ``EngineBrakesControllerApplyStart``.

If ``TrainPipeLeakRate`` has been set in the ENG file, then the small ejector will be required to offset the leakage
in the Brake Pipe. The *J* and *Shft-J* keys can be used to increase the level of operation of the small ejector.
in the Brake Pipe. The *J* and *Shft-J* keys can be used to increase/decrease the level of operation of the small ejector.

An engine controller can be configured to customise the operation of the small ejector. This controller is called
``ORTSSmallEjector ( w, x, y, z )``, and will be set up as a standard 4 value controller.

Engine brakes can also be configured for locomotives as required. They will work in a similar fashion to those fitted to air braked locomotives.
An engine controller can also be configured to customise the operation of the large ejector. This controller is called
``ORTSLargeEjector ( w, x, y, z )``, and will be set up as a standard 4 value controller. The large ejector needs to
be operated to release the brakes. The *Alt-J* and *Ctrl-J* keys can be used to decrease/increase the level of
operation of the large ejector.

In diesel and electric locomotives, the Vacuum Exhauster preforms a similar function to the small and large ejector,
but in an "automated" fashion. The *J* key can be used to run the vacuum exhauster at high speed to facilitate a
quicker release of the brakes. An engine controller called ``ORTSFastVacuumExhauster ( x y z )``, and will be set
up as a standard 3 value controller.

If it is not desired to operate the large ejector, a simplified brake operation can be used by selecting the
"Simple Contol and Physics" option in the options menu (Simulator TAB). This option can also be used if there is a
"mismatch" between the locomotive and car brakes to set a standard default set of brakes.

Engine brakes can also be configured for locomotives as required. They will work in a similar fashion to those fitted
to air braked locomotives.



Expand Down
13 changes: 13 additions & 0 deletions Source/Menu/Options.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Source/Menu/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ public OptionsForm(UserSettings settings, UpdateManager updateManager, bool init
checkDoubleWire.Checked = Settings.DoubleWire;

// Simulation tab

checkSimpleControlPhysics.Checked = Settings.SimpleControlPhysics;
checkUseAdvancedAdhesion.Checked = Settings.UseAdvancedAdhesion;
labelAdhesionMovingAverageFilterSize.Enabled = checkUseAdvancedAdhesion.Checked;
numericAdhesionMovingAverageFilterSize.Enabled = checkUseAdvancedAdhesion.Checked;
Expand Down Expand Up @@ -462,6 +464,7 @@ void buttonOK_Click(object sender, EventArgs e)
Settings.DoubleWire = checkDoubleWire.Checked;

// Simulation tab
Settings.SimpleControlPhysics = checkSimpleControlPhysics.Checked;
Settings.UseAdvancedAdhesion = checkUseAdvancedAdhesion.Checked;
Settings.AdhesionMovingAverageFilterSize = (int)numericAdhesionMovingAverageFilterSize.Value;
Settings.BreakCouplers = checkBreakCouplers.Checked;
Expand Down
3 changes: 3 additions & 0 deletions Source/ORTS.Common/Input/UserCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,11 @@ public enum UserCommand
[GetString("Control Firing Rate Decrease")] ControlFiringRateDecrease,
[GetString("Control Fire Shovel Full")] ControlFireShovelFull,
[GetString("Control Cylinder Cocks")] ControlCylinderCocks,
[GetString("Control Large Ejector Increase")] ControlLargeEjectorIncrease,
[GetString("Control Large Ejector Decrease")] ControlLargeEjectorDecrease,
[GetString("Control Small Ejector Increase")] ControlSmallEjectorIncrease,
[GetString("Control Small Ejector Decrease")] ControlSmallEjectorDecrease,
[GetString("Control Vacuum Exhauster")] ControlVacuumExhausterPressed,
[GetString("Control Cylinder Compound")] ControlCylinderCompound,
[GetString("Control Firing")] ControlFiring,
[GetString("Control Refill")] ControlRefill,
Expand Down
3 changes: 3 additions & 0 deletions Source/ORTS.Settings/InputSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,11 @@ static void InitializeCommands(UserCommandInput[] Commands)
Commands[(int)UserCommand.ControlCircuitBreakerOpeningOrder] = new UserCommandKeyInput(0x17);
Commands[(int)UserCommand.ControlCircuitBreakerClosingAuthorization] = new UserCommandKeyInput(0x18, KeyModifiers.Shift);
Commands[(int)UserCommand.ControlCylinderCocks] = new UserCommandKeyInput(0x2E);
Commands[(int)UserCommand.ControlLargeEjectorIncrease] = new UserCommandKeyInput(0x24, KeyModifiers.Control);
Commands[(int)UserCommand.ControlLargeEjectorDecrease] = new UserCommandKeyInput(0x24, KeyModifiers.Alt);
Commands[(int)UserCommand.ControlSmallEjectorIncrease] = new UserCommandKeyInput(0x24);
Commands[(int)UserCommand.ControlSmallEjectorDecrease] = new UserCommandKeyInput(0x24, KeyModifiers.Shift);
Commands[(int)UserCommand.ControlVacuumExhausterPressed] = new UserCommandKeyInput(0x24);
Commands[(int)UserCommand.ControlCylinderCompound] = new UserCommandKeyInput(0x19);
Commands[(int)UserCommand.ControlDamperDecrease] = new UserCommandKeyInput(0x32, KeyModifiers.Shift);
Commands[(int)UserCommand.ControlDamperIncrease] = new UserCommandKeyInput(0x32);
Expand Down
3 changes: 3 additions & 0 deletions Source/ORTS.Settings/UserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ public enum Menu_SelectionIndex
public int DayAmbientLight { get; set; }

// Simulation settings:

[Default(false)]
public bool SimpleControlPhysics { get; set; }
[Default(true)]
public bool UseAdvancedAdhesion { get; set; }
[Default(10)]
Expand Down
4 changes: 3 additions & 1 deletion Source/Orts.Formats.Msts/CabViewFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public enum CABViewControlTypes
DYNAMIC_BRAKE_DISPLAY,
SANDERS,
WIPERS,
VACUUM_EXHAUSTER,
HORN,
BELL,
FRONT_HLIGHT,
Expand Down Expand Up @@ -168,6 +169,7 @@ public enum CABViewControlTypes
ORTS_MIRRORS,
ORTS_PANTOGRAPH3,
ORTS_PANTOGRAPH4,
ORTS_LARGE_EJECTOR,
ORTS_WATER_SCOOP,
ORTS_HOURDIAL,
ORTS_MINUTEDIAL,
Expand Down Expand Up @@ -1029,7 +1031,7 @@ public CVCDiscrete(STFReader stf, string basepath)
ControlType == CABViewControlTypes.ORTS_PANTOGRAPH3 || ControlType == CABViewControlTypes.ORTS_PANTOGRAPH4)
ControlStyle = CABViewControlStyles.ONOFF;
if (ControlType == CABViewControlTypes.HORN || ControlType == CABViewControlTypes.SANDERS || ControlType == CABViewControlTypes.BELL
|| ControlType == CABViewControlTypes.RESET)
|| ControlType == CABViewControlTypes.RESET || ControlType == CABViewControlTypes.VACUUM_EXHAUSTER)
ControlStyle = CABViewControlStyles.WHILE_PRESSED;
if (ControlType == CABViewControlTypes.DIRECTION && Orientation == 0)
Direction = 1 - Direction;
Expand Down
56 changes: 55 additions & 1 deletion Source/Orts.Simulation/Common/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,36 @@ public AlerterCommand( CommandLog log, bool toState )
}
}

[Serializable()]
public sealed class VacuumExhausterCommand : BooleanCommand
{
public static MSTSLocomotive Receiver { get; set; }

public VacuumExhausterCommand(CommandLog log, bool toState)
: base(log, toState)
{
Redo();
}

public override void Redo()
{
if (ToState)
{
if (!Receiver.VacuumExhausterPressed)
Receiver.Train.SignalEvent(Event.VacuumExhausterOn);
}
else
{
Receiver.Train.SignalEvent(Event.VacuumExhausterOff);
}
}

public override string ToString()
{
return base.ToString() + " " + (ToState ? "fast" : "normal");
}
}

[Serializable()]
public sealed class HornCommand : BooleanCommand {
public static MSTSLocomotive Receiver { get; set; }
Expand Down Expand Up @@ -921,9 +951,32 @@ public override void Redo()
Receiver.SteamHeatChangeTo(ToState, Target);
}
// Report();
}
}
}

// Large Ejector command
[Serializable()]
public sealed class ContinuousLargeEjectorCommand : ContinuousCommand
{
public static MSTSSteamLocomotive Receiver { get; set; }

public ContinuousLargeEjectorCommand(CommandLog log, int injector, bool toState, float? target, double startTime)
: base(log, toState, target, startTime)
{
Redo();
}

public override void Redo()
{
if (Receiver == null) return;
{
Receiver.LargeEjectorChangeTo(ToState, Target);
}
// Report();
}
}


[Serializable()]
public sealed class ContinuousSmallEjectorCommand : ContinuousCommand
{
Expand Down Expand Up @@ -1239,6 +1292,7 @@ public override void Redo()
}
}

// Cylinder Cocks command
[Serializable()]
public sealed class ToggleCylinderCocksCommand : Command {
public static MSTSSteamLocomotive Receiver { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions Source/Orts.Simulation/Common/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public enum Event
SanderOff,
SanderOn,
SemaphoreArm,
LargeEjectorChange,
SmallEjectorChange,
WaterInjector1Off,
WaterInjector1On,
Expand Down Expand Up @@ -330,6 +331,7 @@ public static Event From(bool mstsBinEnabled, Source source, int eventID)
case 157: return Event.CircuitBreakerClosingAuthorizationOn;
case 158: return Event.CircuitBreakerClosingAuthorizationOff;

case 159: return Event.LargeEjectorChange;
case 160: return Event.SmallEjectorChange;

case 161: return Event.CabLightSwitchToggle;
Expand Down
8 changes: 6 additions & 2 deletions Source/Orts.Simulation/Common/Scripting/BrakeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ public enum ControllerState
EBPB, // Emergency Braking Push Button
TCSEmergency, // TCS Emergency Braking
TCSFullServ, // TCS Full Service Braking
VacContServ // TrainBrakesControllerVacuumContinuousServiceStart
VacContServ, // TrainBrakesControllerVacuumContinuousServiceStart
VacApplyContServ, // TrainBrakesControllerVacuumApplyContinuousServiceStart
BrakeNotch // EngineBrakesControllerBrakeNotchStart
};

public static class ControllerStateDictionary
Expand Down Expand Up @@ -244,7 +246,9 @@ public static class ControllerStateDictionary
{ControllerState.EBPB, Catalog.GetString("Emergency Braking Push Button")},
{ControllerState.TCSEmergency, Catalog.GetString("TCS Emergency Braking")},
{ControllerState.TCSFullServ, Catalog.GetString("TCS Full Service Braking")},
{ControllerState.VacContServ, Catalog.GetString("Vac. Cont. Service")}
{ControllerState.VacContServ, Catalog.GetString("Vac. Cont. Service")},
{ControllerState.VacApplyContServ, Catalog.GetString("Vac. Apply Cont. Service")},
{ControllerState.BrakeNotch, Catalog.GetString("Notch")}
};
}
}
10 changes: 6 additions & 4 deletions Source/Orts.Simulation/MultiPlayer/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3152,19 +3152,19 @@ public override string ToString()
public class MSGLocoInfo : Message
{

float EB, DB, TT, VL, CC, BC, DC, FC, I1, I2, SH, SE;
float EB, DB, TT, VL, CC, BC, DC, FC, I1, I2, SH, SE, LE;
string user;
int tnum; //train number

//constructor to create a message from signal data
public MSGLocoInfo(TrainCar c, string u)
{
MSTSLocomotive loco = (MSTSLocomotive)c;
EB = DB = TT = VL = CC = BC = DC = FC = I1 = I2 = SH = SE = 0.0f;
EB = DB = TT = VL = CC = BC = DC = FC = I1 = I2 = SH = SE = LE = 0.0f;
if (loco is MSTSSteamLocomotive)
{
MSTSSteamLocomotive loco1 = (MSTSSteamLocomotive)loco;
loco1.GetLocoInfo(ref CC, ref BC, ref DC, ref FC, ref I1, ref I2, ref SE);
loco1.GetLocoInfo(ref CC, ref BC, ref DC, ref FC, ref I1, ref I2, ref SE, ref LE);
}
if (loco.SteamHeatController != null)
{
Expand Down Expand Up @@ -3204,6 +3204,8 @@ public MSGLocoInfo(string m)
I1 = float.Parse(tmp[10], CultureInfo.InvariantCulture);
I2 = float.Parse(tmp[11], CultureInfo.InvariantCulture);
SH = float.Parse(tmp[12], CultureInfo.InvariantCulture);
SE = float.Parse(tmp[13], CultureInfo.InvariantCulture);
LE = float.Parse(tmp[14], CultureInfo.InvariantCulture);
}

//how to handle the message?
Expand All @@ -3230,7 +3232,7 @@ private void updateValue(MSTSLocomotive loco)
if (loco is MSTSSteamLocomotive)
{
MSTSSteamLocomotive loco1 = (MSTSSteamLocomotive)loco;
loco1.GetLocoInfo(ref CC, ref BC, ref DC, ref FC, ref I1, ref I2, ref SE);
loco1.GetLocoInfo(ref CC, ref BC, ref DC, ref FC, ref I1, ref I2, ref SE, ref LE);
}
if (loco.SteamHeatController != null)
{
Expand Down
9 changes: 7 additions & 2 deletions Source/Orts.Simulation/Simulation/Confirmer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ public enum CabControl {
, FireShovelfull
, CylinderCocks
, CylinderCompound
, LargeEjector
, SmallEjector
, VacuumExhauster
, TenderCoal
, TenderWater
// General
Expand Down Expand Up @@ -165,6 +167,7 @@ public Confirmer(Simulator simulator, double defaultDurationS)
Func<string, string> GetString = (value) => Simulator.Catalog.GetString(value);
Func<string, string, string> GetParticularString = (context, value) => Simulator.Catalog.GetParticularString(context, value);

// The following list needs to be in the same order as the list above under CabControl
ConfirmText = new string[][] {
new string [] { GetString("<none>") }
// Power
Expand Down Expand Up @@ -197,8 +200,10 @@ public Confirmer(Simulator simulator, double defaultDurationS)
, new string [] { GetString("Manual Firing"), GetString("off"), null, GetString("on") }
, new string [] { GetString("Fire"), null, null, GetString("add shovel-full") }
, new string [] { GetString("Cylinder Cocks"), GetString("close"), null, GetString("open") }
, new string [] { GetString("Cylinder Compound"), GetString("close"), null, GetString("open") }
, new string [] { GetString("SmallEjector"), null, null, null, GetString("decrease"), GetString("increase") }
, new string [] { GetString("Cylinder Compound"), GetString("close"), null, GetString("open") }
, new string [] { GetString("LargeEjector"), null, null, null, GetString("decrease"), GetString("increase") }
, new string [] { GetString("SmallEjector"), null, null, null, GetString("decrease"), GetString("increase") }
, new string [] { GetString("VacuumExhauster"), GetString("normal"), null, GetString("fast") }
, new string [] { GetString("Tender"), null, null, GetString("Coal re-filled"), null, GetString("Coal level") }
, new string [] { GetString("Tender"), null, null, GetString("Water re-filled"), null, GetString("Water level") }
// General
Expand Down