mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-02 20:05:23 +01:00
refactor(physics): six more of what the rest only reads are private, under names of their own
The mass of the empty vehicle, the braking force, the outcome of a derailment,
the departure signal, the traction mode of a dual-mode vehicle and the moment
of the motors are private to physics::Vehicle like the 53 before them, read
through Mass(), Fb(), Derailed(), DepartureSignal(), TractionMode() and Mm().
Inside the class they are emptyMass, brakingForce, derailOutcome,
departureSignalOn, tractionModeSetting and motorMoment, as the plain camelCase
names were taken by locals there.
No change in behaviour: the golden traces recorded on dfb43c4f match bit for bit.
This commit is contained in:
+10
-10
@@ -89,7 +89,7 @@ TEST_CASE("pullee: a dead Vectron vents the brake pipe of the train hauling it,
|
||||
CHECK(train.hauled->brakes.emergencyValve.flow == 0.0);
|
||||
CHECK(train.locomotive->brakePipe.Pressure() > 4.99);
|
||||
CHECK(train.hauled->brakes.cylinderPressure < 0.1);
|
||||
CHECK(train.hauled->Fb < 1.0);
|
||||
CHECK(train.hauled->Fb() < 1.0);
|
||||
CHECK(train.hauled.speed() > 40.0); // running resistance alone
|
||||
}
|
||||
}
|
||||
@@ -154,11 +154,11 @@ TEST_CASE("pullee: the spring brake of a dead locomotive without air stops the t
|
||||
// no air came from anywhere: the cylinder of the spring brake is empty either way
|
||||
REQUIRE(hauled.brakes.spring.pressure < 0.1);
|
||||
if (pullee) {
|
||||
CHECK(hauled.Fb < 1.0);
|
||||
CHECK(hauled.Fb() < 1.0);
|
||||
CHECK(train.hauled.speed() > 45.0);
|
||||
}
|
||||
else {
|
||||
CHECK(hauled.Fb > 30000.0);
|
||||
CHECK(hauled.Fb() > 30000.0);
|
||||
CHECK(std::abs(train.hauled.speed()) < 1.0);
|
||||
}
|
||||
}
|
||||
@@ -178,14 +178,14 @@ TEST_CASE("pullee: a dead EU47 starts to drag once its main reservoir has leaked
|
||||
train.run(180.0);
|
||||
// charged and released: nothing holds it yet
|
||||
CHECK(hauled.brakes.cylinderPressure < 0.1);
|
||||
CHECK(hauled.Fb < 1.0);
|
||||
CHECK(hauled.Fb() < 1.0);
|
||||
train.run(1020.0); // 20 minutes since the start
|
||||
CHECK(hauled.mainPipe.Pressure() < hauled.brakes.spring.minForcePressure);
|
||||
if (pullee) {
|
||||
CHECK(hauled.Fb < 1.0);
|
||||
CHECK(hauled.Fb() < 1.0);
|
||||
}
|
||||
else {
|
||||
CHECK(hauled.Fb > 5000.0);
|
||||
CHECK(hauled.Fb() > 5000.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,11 +209,11 @@ TEST_CASE("pullee: a vehicle prepared for hauling brakes and releases with the t
|
||||
train.locomotive.hold_brake_pipe(3.5);
|
||||
train.run(20.0);
|
||||
CHECK(hauled.brakes.cylinderPressure > 2.0);
|
||||
CHECK(hauled.Fb > 30000.0);
|
||||
CHECK(hauled.Fb() > 30000.0);
|
||||
train.locomotive.hold_brake_pipe(5.0);
|
||||
train.run(90.0);
|
||||
CHECK(hauled.brakes.cylinderPressure < 0.1);
|
||||
CHECK(hauled.Fb < 1.0);
|
||||
CHECK(hauled.Fb() < 1.0);
|
||||
CHECK(hauled.brakes.emergencyValve.flow == 0.0);
|
||||
}
|
||||
}
|
||||
@@ -420,7 +420,7 @@ TEST_CASE("pullee: every real vehicle prepared for hauling runs free behind a lo
|
||||
train.run(60.0);
|
||||
CHECK(hauled.brakes.emergencyValve.flow == 0.0);
|
||||
CHECK(hauled.brakes.cylinderPressure < 0.1);
|
||||
CHECK(hauled.Fb < 1.0);
|
||||
CHECK(hauled.Fb() < 1.0);
|
||||
CHECK(train.locomotive->brakePipe.Pressure() > 4.99);
|
||||
CHECK(train.hauled.speed() > 40.0);
|
||||
}
|
||||
@@ -444,6 +444,6 @@ TEST_CASE("pullee: every real vehicle standing braked releases once prepared for
|
||||
CHECK(hauled.brakes.emergencyValve.flow == 0.0);
|
||||
CHECK(hauled.brakes.cylinderPressure < 0.1);
|
||||
// the cylinders of a few are still letting out the last of their air (6Dg, SM42, 810: 15-72 N)
|
||||
CHECK(hauled.Fb < 500.0);
|
||||
CHECK(hauled.Fb() < 500.0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user