mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-19 05:16:01 +01:00
Merge pull request #280 from MaSzyna-EU07/feat/radio-fuse
Radio fuse: a cut-off in the radio's power supply (eu07/maszyna#438)
This commit is contained in:
@@ -26,3 +26,33 @@ TEST_CASE("radio: a radio switched off or without the low voltage doesn't") {
|
||||
}
|
||||
CHECK_FALSE(vehicle->RadioPowered());
|
||||
}
|
||||
|
||||
// the cut-off in the radio's power supply (eu07/maszyna#438): a fuse, a desk lever or the switch on the radio's
|
||||
// power supply, closed unless the driver opens it
|
||||
|
||||
TEST_CASE("radio: the radio fuse is closed by default") {
|
||||
test::vehicle vehicle{test::definition::load("wagon")};
|
||||
CHECK(vehicle->RadioFuse);
|
||||
}
|
||||
|
||||
TEST_CASE("radio: an opened radio fuse cuts the radio off") {
|
||||
test::vehicle vehicle{test::definition::load("wagon")};
|
||||
vehicle->Radio = true;
|
||||
vehicle->Power24vIsAvailable = true;
|
||||
vehicle->RadioFuse = false;
|
||||
CHECK_FALSE(vehicle->RadioPowered());
|
||||
vehicle->RadioFuse = true;
|
||||
CHECK(vehicle->RadioPowered());
|
||||
}
|
||||
|
||||
TEST_CASE("radio: opening the radio fuse at a standstill resets the radio-stop, as switching the radio off does") {
|
||||
test::vehicle loco{test::definition::fiz("4e_v1/4e")};
|
||||
loco->Battery = true;
|
||||
loco->Radio = true;
|
||||
REQUIRE(loco->RadiostopSwitch(true));
|
||||
loco->SecuritySystemCheck(0.1);
|
||||
CHECK(loco->RadioStopFlag);
|
||||
loco->RadioFuse = false;
|
||||
loco->SecuritySystemCheck(0.1);
|
||||
CHECK_FALSE(loco->RadioStopFlag);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user