Skip to content

Commit fb65914

Browse files
committed
Automatic merge of T1.5.1-1678-gf88b8b9b1 and 11 pull requests
- Pull request #900 at b54024b: DMI in 3D cab + two more dials - Pull request #1030 at d3ae4a2: Refactor settings, in prep for settings exporter - Pull request #1057 at cf3caa0: Switchable brake system - Pull request #1062 at 3b18c48: Train Forces popup Window. - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #1000 at d8d9709: Locomotive operation from control car - Pull request #1029 at 92c74ef: Superelevation Follow Up Fixes - Pull request #1063 at 6c23191: Better Missing Track Section Error Message - Pull request #1065 at 409064d: Fix for PantographToggle sound event - Pull request #1068 at d6e1f83: Build for online-only documentation files - Pull request #896 at f1681df: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains
13 parents 88b3e3e + f88b8b9 + b54024b + d3ae4a2 + cf3caa0 + 3b18c48 + 1f5ba4c + d8d9709 + 92c74ef + 6c23191 + 409064d + d6e1f83 + f1681df commit fb65914

36 files changed

+1323
-1728
lines changed

Source/Documentation/Manual/physics.rst

Lines changed: 17 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,58 +1141,6 @@ with the ``ORTSTractionMotorType ( AC ) `` parameter, to be inserted in the Engi
11411141
section of the ENG file. The use of this motor will have an impact on wheel slip,
11421142
because the wheel speed never exceeds the frequency of the rotating magnetic field.
11431143
1144-
Traction force retardation
1145-
''''''''''''''''''''''''''
1146-
1147-
.. index::
1148-
single: ORTSTractiveForceRampUpRate
1149-
single: ORTSTractiveForceRampDownRate
1150-
single: ORTSTractiveForceRampDownToZeroRate
1151-
single: ORTSDynamicBrakeForceRampUpRate
1152-
single: ORTSDynamicBrakeForceRampDownRate
1153-
single: ORTSDynamicBrakeForceRampDownToZeroRate
1154-
single: ORTSDelayTimeBeforeUpdating
1155-
1156-
When the driver sets full throttle, the control electronics may not apply the full
1157-
tractive force instantly, but it will instead linearly apply force until reaching
1158-
the target demand. This can be tuned both for traction and dynamic braking by inserting
1159-
``ORTSTractiveForceRampUpRate``, ``ORTSTractiveForceRampDownRate``,
1160-
``ORTSTractiveForceRampDownToZeroRate``, ``ORTSDynamicBrakeForceRampUpRate``,
1161-
``ORTSDynamicBrakeForceRampDownRate`` and ``ORTSDynamicBrakeForceRampDownToZeroRate``
1162-
in the .eng file. The value of each parameter determines the force increase/decrease
1163-
rate in one second.
1164-
1165-
Example::
1166-
1167-
Engine (
1168-
ORTSTractiveForceRampUpRate ( 50kN )
1169-
ORTSTractiveForceRampDownRate ( 50kN )
1170-
ORTSTractiveForceRampDownToZeroRate ( 100kN )
1171-
ORTSDynamicBrakeForceRampUpRate ( 70kN )
1172-
ORTSDynamicBrakeForceRampDownRate ( 50kN )
1173-
ORTSDynamicBrakeForceRampDownToZeroRate ( 50kN )
1174-
)
1175-
1176-
Another possibility to avoid sudden variations in tractive force while the driver
1177-
is moving the throttle, is to only update the throttle/brake demand when the lever
1178-
has not been moved for a defined amount of time. This can be implemented using the
1179-
``ORTSDelayTimeBeforeUpdating``, which has to be inserted for the desired
1180-
controller in the ``EngineControllers`` block.
1181-
1182-
Example::
1183-
1184-
Engine (
1185-
EngineControllers (
1186-
Throttle ( 0 1 0.1 0
1187-
NumNotches ( 0 )
1188-
ORTSDelayTimeBeforeUpdating ( 0.5s )
1189-
)
1190-
Brake_Dynamic ( 0 1 0.1 0
1191-
NumNotches ( 0 )
1192-
ORTSDelayTimeBeforeUpdating ( 1s )
1193-
)
1194-
)
1195-
)
11961144
11971145
Steam Locomotives
11981146
-----------------
@@ -2642,10 +2590,6 @@ behave exactly the same way as player controlled ones.
26422590

26432591
.. _physics-braking:
26442592

2645-
.. index::
2646-
single: BrakeSystemType
2647-
single: BrakeEquipmentType
2648-
26492593
Open Rails Braking
26502594
==================
26512595

@@ -2683,15 +2627,13 @@ graduated release. It will also force graduated release of brakes in triple
26832627
valves. This option should be unchecked, except for compatibility problems
26842628
with old MSTS stock.
26852629

2686-
The following brake types are implemented in OR. They can be selected using
2687-
the ``Wagon(BrakeSystemType`` parameter:
2630+
The following brake types are implemented in OR:
26882631

2689-
- Vacuum single pipe: ``BrakeSystemType ("Vacuum_single_pipe")``
2690-
- Air single-pipe: ``BrakeSystemType ("Air_single_pipe")``
2691-
- Air twin-pipe: ``BrakeSystemType ("Air_twin_pipe")``
2692-
- EP (Electro-pneumatic, twin-pipe): ``BrakeSystemType ("EP")``
2693-
- EP single-pipe: ``BrakeSystemType ("EP_single_pipe")``
2694-
- Single-transfer-pipe (air and vacuum): ``BrakeSystemType ("Air_piped")`` or ``BrakeSystemType ("Vacuum_piped")``
2632+
- Vacuum single
2633+
- Air single-pipe
2634+
- Air twin-pipe
2635+
- EP (Electro-pneumatic)
2636+
- Single-transfer-pipe (air and vacuum)
26952637

26962638
The operation of air single-pipe brakes is described in general below.
26972639

@@ -2716,19 +2658,17 @@ brake features.
27162658
For EP brakes, two variants are available:
27172659

27182660
- If ``Wagon(ORTSEPBrakeControlsBrakePipe`` is set to 0 (default situation),
2719-
an electrical wire (application wire) provides simultaneous fast brake application
2720-
along the train. Release time will be fast if standard air brake haven't been applied,
2721-
otherwise air brakes will determine release time. Typically this system is present
2722-
with Train Brake Controllers having an EP-only application section, followed by an
2723-
air application portion which serves as a fallback system, or in combination with a
2724-
solenoid valve that isolates the triple valve when EP brakes are operational.
2725-
2661+
an electrical wire (application wire) provides simultaneous fast brake application
2662+
along the train. Release time will be fast if standard air brake haven't been applied,
2663+
otherwise air brakes will determine release time. Typically this system is present
2664+
with Train Brake Controllers having an EP-only application section, followed by an
2665+
air application portion which serves as a fallback system.
27262666
- If ``Wagon(ORTSEPBrakeControlsBrakePipe`` is set to 1, brake pipe is charged and discharged
2727-
simultaneously at each car in the train, providing fast and uniform brake application and release.
2728-
The locomotive instructs the cars to "charge" or "discharge" the brake pipe to reach
2729-
a reference pressure. Standard triple valves or distributors will follow brake pipe variations
2730-
actuating the cylinders. This system is sometimes called "UIC EP brake". It is typically the system
2731-
used in high speed trains.
2667+
simultaneously at each car in the train, providing fast and uniform brake application and release.
2668+
The locomotive instructs the cars to "charge" or "discharge" the brake pipe to reach
2669+
a reference pressure. Standard triple valves or distributors will follow brake pipe variations
2670+
actuating the cylinders. This system is sometimes called "UIC EP brake". It is typically the system
2671+
used in high speed trains.
27322672

27332673
.. _physics-brake-controller:
27342674

@@ -3440,12 +3380,10 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
34403380
single: ORTSBrakeEmergencyTimeFactor
34413381
single: ORTSBrakePipeTimeFactor
34423382
single: ORTSEPBrakeControlsBrakePipe
3443-
single: ORTSEPBrakeInhibitsTripleValve
34443383
single: ORTSCompressorIsMuControlled
34453384
single: Supply_Reservoir
34463385
single: ORTSSupplyResCapacity
34473386
single: ORTSSupplyResChargingRate
3448-
single: Emergency_Solenoid_Valve
34493387

34503388
- ``Wagon(BrakePipeVolume`` -- Volume of car's brake pipe in cubic feet
34513389
(default .5).
@@ -3518,8 +3456,6 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
35183456
by the brake system.
35193457
- ``Wagon(ORTSEPBrakeControlsBrakePipe`` -- Set to 1 for UIC EP brake: brake pipe
35203458
pressure is electrically controlled at every fitted car.
3521-
- ``Wagon(ORTSEPBrakeInhibitsTripleValve`` -- Set to 1 if the car is fitted with a
3522-
selector valve that ignores brake pipe pressure when EP brakes are operational.
35233459
- ``Wagon(ORTSBrakeRelayValveRatio`` -- Determines the proportionality constant
35243460
between pressure as demanded by the triple valve and brake cylinder pressure.
35253461
This is achieved via a relay valve which sets BC pressure proportionally.
@@ -3598,7 +3534,7 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
35983534
- ``Wagon(ORTSInitialApplicationThreshold`` -- The pressure difference between
35993535
the brake pipe and auxiliary reservoir at which the triple valve will
36003536
change from release to apply (default 1 psi).
3601-
- ``Wagon(BrakeEquipmentType(Supply_Reservoir`` -- Adds a supply reservoir to the
3537+
- ``BrakeEquipmentType(Supply_Reservoir`` -- Adds a supply reservoir to the
36023538
loco or wagon, which will constantly charge to the brake pipe pressure
36033539
or MR pipe (if equipped) pressure. If a supply reservoir is equipped,
36043540
supply res air will be used to pressurize the brake cylinders thru the relay
@@ -3635,10 +3571,6 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
36353571
Pipe for twin pipe braking systems (default = Main Reservoir Pressure).
36363572
- ``Engine(ORTSCompressorIsMuControlled`` -- Set to 1 if compressors from
36373573
all locomotives are synchronized.
3638-
- ``Wagon(BrakeEquipmentType(Emergency_Solenoid_Valve`` -- Adds an
3639-
electrically controlled valve that quickly applies maximum
3640-
brake cylinder pressure during an emergency braking. Only available if the
3641-
brake cylinder pressure is controlled using a relay valve.
36423574

36433575
.. _physics-retainers:
36443576

Source/Orts.Common/Conversions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public static class Kg
189189
/// <summary>Convert from kilograms to UK Tons</summary>
190190
public static float ToTUK(float kg) { return kg * (1.0f / 1016.047f); }
191191
/// <summary>Convert from kilogram to metric tonnes</summary>
192-
public static float ToTonne(float kg) { return kg * (1.0f / 1000.0f); }
192+
public static float ToTonne(float kg) { return kg / 1000.0f; }
193193
/// <summary>Convert from metrix tonnes to kilogram</summary>
194194
public static float FromTonne(float tonne) { return tonne * 1000.0f; }
195195
}

Source/Orts.Formats.Msts/RouteFile.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ public Tr_RouteFile(STFReader stf)
126126
new STFReader.TokenProcessor("ortscurvesmsnumber", ()=>{ CurveSMSNumber = stf.ReadIntBlock(null); }),
127127
new STFReader.TokenProcessor("ortscurveswitchsmsnumber", ()=>{ CurveSwitchSMSNumber = stf.ReadIntBlock(null); }),
128128
new STFReader.TokenProcessor("ortsopendoorsinaitrains", ()=>{ OpenDoorsInAITrains = stf.ReadBoolBlock(false); }),
129-
new STFReader.TokenProcessor("ortsplaytracksoundsbasecontinuous", ()=>{ TrackSoundDefaultContinuousPlay = stf.ReadBoolBlock(false); }),
130-
new STFReader.TokenProcessor("ortsdistancebetweentrackjoints", ()=>{ DistanceBetweenTrackJointsM = stf.ReadFloatBlock(STFReader.UNITS.Distance, null); }),
131-
new STFReader.TokenProcessor("ortsconcretesleepers", ()=>{ ConcreteSleepers = stf.ReadFloatBlock(STFReader.UNITS.None, null); }),
129+
132130
});
133131
//TODO This should be changed to STFException.TraceError() with defaults values created
134132
if (RouteID == null) throw new STFException(stf, "Missing RouteID");
@@ -177,11 +175,6 @@ public Tr_RouteFile(STFReader stf)
177175
public float ForestClearDistance = 0;
178176
public bool RemoveForestTreesFromRoads = false;
179177

180-
// Track based sounds
181-
public bool TrackSoundDefaultContinuousPlay = false;
182-
public float DistanceBetweenTrackJointsM;
183-
public float ConcreteSleepers;
184-
185178
// images
186179
public string Thumbnail;
187180
public string LoadingScreen;

Source/Orts.Formats.Msts/SoundManagmentFile.cs

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ public class SharedSMSFileManager
3838
public static int CurveSwitchSMSNumber;
3939
public static bool AutoTrackSound = false;
4040

41-
public static bool PlayDefaultTrackSoundsContinuous = false;
42-
public static float ConcreteSleepers;
43-
4441
public static SoundManagmentFile Get(string path)
4542
{
4643
if (!SharedSMSFiles.ContainsKey(path))
@@ -243,7 +240,7 @@ public struct CurvePoint
243240

244241
public class VolumeCurve
245242
{
246-
public enum Controls { None, DistanceControlled, SpeedControlled, Variable1Controlled, Variable1_2Controlled, Variable1_3Controlled, Variable1_4Controlled, Variable2Controlled, Variable2BoosterControlled, Variable3Controlled, BrakeCylControlled, CurveForceControlled, AngleofAttackControlled, CarFrictionControlled, WheelRpMControlled };
243+
public enum Controls { None, DistanceControlled, SpeedControlled, Variable1Controlled, Variable1_2Controlled, Variable1_3Controlled, Variable1_4Controlled, Variable2Controlled, Variable2BoosterControlled, Variable3Controlled, BrakeCylControlled, CurveForceControlled };
247244

248245
public Controls Control = Controls.None;
249246
public float Granularity = 1.0f;
@@ -267,9 +264,6 @@ public VolumeCurve(STFReader stf)
267264
case "variable3controlled": Control = Controls.Variable3Controlled; break;
268265
case "brakecylcontrolled": Control = Controls.BrakeCylControlled; break;
269266
case "curveforcecontrolled": Control = Controls.CurveForceControlled; break;
270-
case "angleofattackcontrolled": Control = Controls.AngleofAttackControlled; break;
271-
case "carfrictioncontrolled": Control = Controls.CarFrictionControlled; break;
272-
case "wheelrpmcontrolled": Control = Controls.WheelRpMControlled; break;
273267
default: STFException.TraceWarning(stf, "Crash expected: Skipped unknown VolumeCurve/Frequencycurve type " + type); stf.SkipRestOfBlock(); return;
274268
}
275269
stf.ParseBlock(new STFReader.TokenProcessor[] {
@@ -391,8 +385,7 @@ public Discrete_Trigger(STFReader f)
391385
public class Variable_Trigger : Trigger
392386
{
393387
public enum Events { Speed_Inc_Past, Speed_Dec_Past, Distance_Inc_Past, Distance_Dec_Past,
394-
Variable1_Inc_Past, Variable1_2_Inc_Past, Variable1_3_Inc_Past, Variable1_4_Inc_Past, Variable1_Dec_Past, Variable1_2_Dec_Past, Variable1_3_Dec_Past, Variable1_4_Dec_Past, Variable2_Inc_Past, Variable2_Dec_Past, Variable3_Inc_Past, Variable3_Dec_Past, BrakeCyl_Inc_Past, BrakeCyl_Dec_Past, CurveForce_Inc_Past, CurveForce_Dec_Past, AngleofAttack_Inc_Past, AngleofAttack_Dec_Past, WheelRpM_Dec_Past, WheelRPM_Inc_Past, TrackJoints_Inc_Past, TrackJoints_Dec_Past, CarOnSwitch_Inc_Past, CarOnSwitch_Dec_Past, CarOnXover_Inc_Past, CarOnXover_Dec_Past, WagonAxles_Inc_Past, WagonAxles_Dec_Past,
395-
ConcreteSleepers_Inc_Past, ConcreteSleepers_Dec_Past, CarInTunnel_Inc_Past, CarInTunnel_Dec_Past
388+
Variable1_Inc_Past, Variable1_2_Inc_Past, Variable1_3_Inc_Past, Variable1_4_Inc_Past, Variable1_Dec_Past, Variable1_2_Dec_Past, Variable1_3_Dec_Past, Variable1_4_Dec_Past, Variable2_Inc_Past, Variable2_Dec_Past, Variable3_Inc_Past, Variable3_Dec_Past, BrakeCyl_Inc_Past, BrakeCyl_Dec_Past, CurveForce_Inc_Past, CurveForce_Dec_Past
396389
};
397390

398391
public Events Event;
@@ -438,23 +431,6 @@ public Variable_Trigger(STFReader f)
438431
case "brakecyl_dec_past": Event = Events.BrakeCyl_Dec_Past; break;
439432
case "curveforce_inc_past": Event = Events.CurveForce_Inc_Past; break;
440433
case "curveforce_dec_past": Event = Events.CurveForce_Dec_Past; break;
441-
442-
case "angleofattack_inc_past": Event = Events.AngleofAttack_Inc_Past; break;
443-
case "angleofattack_dec_past": Event = Events.AngleofAttack_Dec_Past; break;
444-
case "wheelrpm_inc_past": Event = Events.WheelRPM_Inc_Past; break;
445-
case "wheelrpm_dec_past": Event = Events.WheelRpM_Dec_Past; break;
446-
case "trackjoints_inc_past": Event = Events.TrackJoints_Inc_Past; break;
447-
case "trackjoints_dec_past": Event = Events.TrackJoints_Dec_Past; break;
448-
case "wagonaxles_inc_past": Event = Events.WagonAxles_Inc_Past; break;
449-
case "wagonaxles_dec_past": Event = Events.WagonAxles_Dec_Past; break;
450-
case "caronswitch_inc_past": Event = Events.CarOnSwitch_Inc_Past; break;
451-
case "caronswitch_dec_past": Event = Events.CarOnSwitch_Dec_Past; break;
452-
case "caronxover_inc_past": Event = Events.CarOnXover_Inc_Past; break;
453-
case "caronxover_dec_past": Event = Events.CarOnXover_Dec_Past; break;
454-
case "concretesleepers_inc_past": Event = Events.ConcreteSleepers_Inc_Past; break;
455-
case "concretesleepers_dec_past": Event = Events.ConcreteSleepers_Dec_Past; break;
456-
case "carintunnel_inc_past": Event = Events.CarInTunnel_Inc_Past; break;
457-
case "carintunnel_dec_past": Event = Events.CarInTunnel_Dec_Past; break;
458434
}
459435

460436

Source/Orts.Parsers.Msts/STFReader.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,10 @@ public float ReadFloat(UNITS validUnits, float? defaultValue)
609609
// However, some values (mostly "time" ones) may be followed by text. Therefore that approach cannot be used consistently
610610
// and has been abandoned. </CJComment>
611611

612-
float val;
613-
double scale = ParseUnitSuffix(ref item, validUnits);
614612
if (item.Length == 0) return 0.0f;
615613
if (item[item.Length - 1] == ',') item = item.TrimEnd(',');
616-
if (float.TryParse(item, parseNum, parseNFI, out val)) return (scale == 1) ? val : (float)(scale * val);
614+
double scale = ParseUnitSuffix(ref item, validUnits); // must be after TrimEnd(','), otherwise the unit parsed becomes invalid
615+
if (float.TryParse(item, parseNum, parseNFI, out float val)) return (scale == 1) ? val : (float)(scale * val);
617616
STFException.TraceWarning(this, "Cannot parse the constant number " + item);
618617
if (item == ")") StepBackOneItem();
619618
return defaultValue.GetValueOrDefault(0);

0 commit comments

Comments
 (0)