18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-18 22:16:02 +01:00
Commit Graph

72 Commits

Author SHA1 Message Date
fa00fff594 Merge pull request #273 from MaSzyna-EU07/feat/6dg-power-demand-5pct-steps
6Dg: power demand in 5% steps (eu07/maszyna#412)
2026-11-09 12:55:39 +00:00
ff88868d32 Merge pull request #275 from MaSzyna-EU07/fix/sm42-shunt-mode-toggle
SM42: shunt mode at the first move of the switch, CA off in the shunt mode
2026-11-09 12:54:21 +00:00
889aa2d5db Merge pull request #278 from MaSzyna-EU07/feat/shunt-lock-resistive
Field shunting locked at zero and on resistive positions (eu07/maszyna#402)
2026-11-09 12:53:57 +00:00
4a9ab1447e Merge pull request #279 from MaSzyna-EU07/fix/multiple-unit-electric-diesel
No multiple-unit control between electric and diesel locomotives (eu07/maszyna#520)
2026-11-09 12:53:30 +00:00
0c95dbfa5a Merge pull request #280 from MaSzyna-EU07/feat/radio-fuse
Radio fuse: a cut-off in the radio's power supply (eu07/maszyna#438)
2026-11-09 12:53:14 +00:00
ebc9eb8740 Merge pull request #281 from MaSzyna-EU07/feat/shunt-pantograph-config
AI: suggested pantograph setup for shunting in the .fiz (eu07/maszyna#461)
2026-11-09 12:52:58 +00:00
3710b2e5d6 Merge pull request #284 from MaSzyna-EU07/feat/light-programmer-cab-light
Light programmer: cab light flag per position (eu07/maszyna#529)
2026-11-09 12:51:37 +00:00
fedbf458b5 Merge pull request #285 from MaSzyna-EU07/feat/duplicate-cab-control-submodels
Cab controls with more than one submodel (eu07/maszyna#527)
2026-11-09 12:50:54 +00:00
28337b5f28 Merge pull request #286 from MaSzyna-EU07/fix/dimmer-position-bounds
fix(lights): keep the headlight dimmer position within the DimmerList
2026-11-09 12:50:35 +00:00
c1089a6b16 Merge pull request #292 from MaSzyna-EU07/fix/en57-ep2-brake-charging
EN57 brakes: charging when hauled with the brake hose alone, Knorr EP brake only with control power
2026-11-09 12:48:13 +00:00
cb1dd60630 Merge pull request #293 from MaSzyna-EU07/fix/door-inner-faces-lowpoly-lighting
Door wings: let the low poly interior have its own, moving inside of the doors (eu07/maszyna#512)
2026-11-09 12:47:58 +00:00
jerrrrycho
38202f4e57 Merge remote-tracking branch 'origin/master' into feat/second-loco-engine-start
# Conflicts:
#	CMakeLists.txt
2026-11-08 21:51:59 +01:00
jerrrrycho
c0f1749e87 Merge remote-tracking branch 'origin/master' into fix/door-inner-faces-lowpoly-lighting
# Conflicts:
#	vehicle/DynObj.cpp
2026-11-08 21:47:32 +01:00
jerrrrycho
db65dfa5f0 test: file-local helpers instead of lambdas in the brake handle tests (Sonar S2259)
The analyser loses track of references captured by lambdas; the St113 EP and MHZ buttons tests call plain helpers, as ep_brake() and ready_knorr_ep() do, which it doesn't report.
2026-11-08 21:15:12 +01:00
maj00r
9fecba82f0 Merge pull request #291 from MaSzyna-EU07/fix/sod-lamp-whole-consist
SOD lamp: doors of the whole consist, three states (eu07/maszyna#288)
2026-11-08 20:56:20 +01:00
maj00r
17676863bc Merge pull request #266 from MaSzyna-EU07/feat/exe-test-mode
Test mode: `--test` runs a scenery unattended and exits with the result (#541)
2026-11-08 20:41:57 +01:00
jerrrrycho
8fb596f218 fix(simulation): any exception ends a test run with error, other runs as on master
main() tells a test run (--test) apart before anything runs. Only a test run
catches every exception and installs a std::terminate handler, both ending the
run with the error code and a test: line; any other run keeps master's
exception handling, so on Linux an uncaught runtime_error aborts at the throw
site again.

A test run doesn't start the Discord RPC thread: it published the test
scenery as the player's presence and held the closing up to 5 s.

run.py drops a case scenery's .sbt cache after a run cut short (wall_timeout,
error, a crash, killed by run.py), which could have been writing it.

The -edit branch of the test command line parser had no effect (a token that
isn't an option is ignored either way) and is gone; its test checks what can
be seen instead.
2026-11-08 19:46:16 +01:00
jerrrrycho
bbd7d9c5bf fix: a stopped diesel engine no longer stops the others every frame (eu07/maszyna#80)
dizel_Momentum() relayed MainSwitch 0 to the consist every frame while the engine stood still, whatever stopped it. In a train with mixed JointEngineStart flags an engine stopped from mainb_off stopped the engines behind it once it spun down, and the stopped engine of the cab's vehicle knocked out the one started from mainb_on. The stop is now relayed only when the engine stalls while running, as on master an engine stalling in a joint start still stops the others.
2026-11-08 19:38:16 +01:00
jerrrrycho
7ba478aea9 test: reach the mover by reference in the brake handle lambdas (Sonar S2259)
The lambdas of the St113 EP brake and the MHZ buttons tests called the mover through test::vehicle::operator->(), which the analyser takes as possibly null; they capture a reference from mover() instead.
2026-11-08 19:30:46 +01:00
jerrrrycho
57db0087ff fix: the SOD lamp of the whole consist is opt-in per vehicle (DoorClosureSignal)
The three-state door closure lamp is switched on by DoorClosureSignal=Yes in the
Doors: section of the .fiz of the vehicle whose cab shows the lamp (the occupied
vehicle), off by default: without it the lamp keeps showing the lock of the
vehicle's own doors. The eu07.ini switch doorclosuresignal is gone, the data
decides. Sets whose cars lack DoorNeedPermit would blink at every standstill, so
only the sets with permits get the key.
2026-11-08 18:30:22 +01:00
jerrrrycho
d755c7708f fix: the SM42's CA off in the shunt mode only with AwareOffInShuntMode, an alarm on kept
Review of #275. The shunt mode suspends the vigilance device (CA) only on the
vehicles whose .fiz sets the new Security key AwareOffInShuntMode=Yes (default
No), instead of on every diesel-electric with ShuntMode=1 (SP42, SU42 and the
401Z generator car had it too). Suspended, the CA counts no time towards a new
alarm, but an alarm already on stays, goes on to the emergency braking and
needs the usual acknowledgement, instead of going out with the shunt mode.
2026-11-08 18:19:59 +01:00
jerrrrycho
91e0d90e8d fix: review of the separate engine start switches (eu07/maszyna#80)
- initialise the cooling power read from the .fiz to its default, no division by an indeterminate value
- integer step counters in the engine start tests
- main_sw opening the consist turns the two-state mainb_sw / mainc_sw off too, left on they'd start the engines again
- the doc comment of MainCircuitOpensWithStarterOnly() back on it; the .fiz read is the controlled vehicle's
2026-11-08 17:38:59 +01:00
jerrrrycho
200d3ae73b fix: review of the EN57 EP brake (Sonar null check, EP fuse of the cab car, AI re-asserts the EP brake)
- tests: REQUIRE the brake handle before dereferencing it (Sonar cpp:S2259)
- TESt::FillBrakeRes is const (S5817)
- cab EP brake command: drop the mvControlled->EpFuse check, SwitchEPBrake
  already checks the cab car's (mvOccupied) EP fuse with the control supply
- AI: with the handle already at the EP brake position, switch the EP brake
  on again once the control supply is back
2026-11-08 17:37:56 +01:00
jerrrrycho
22c588d8f9 feat(cab): 401Da oil pump lamp and slotted speedometer lever (eu07/maszyna#546) (#261)
* feat: 401da oil pump lamp and slotted lever animation (eu07/maszyna#546)

i-oilpump lights while the pre-lubrication oil pump works, so it goes
off once the engine runs. animslottedlever: in the .mmd turns a lever
by a pin on the coupling rod sliding in the lever's slot, which the
speedometer drive of 401Da needs.

The compressor start delay of #546 came with CompressorStartDelay
(Brake section) of master.

* fix: force GLM AVX2 only when the compiler targets AVX2

ENABLE_AVX2=OFF left GLM_FORCE_AVX2 defined, so MSVC still emitted
AVX2 intrinsics and the exe crashed on CPUs without AVX2.

* test: cover the compressor start delay and the oil pump lamp

The delay of an engine stopped before it passed starts over, a
compressor switched on by hand waits too, and the key is read from the
Brake section. In the converter-fed set-up of 401Da the compressor
waits for ConverterStartDelay and then its own delay. The oil pump
(i-oilpump lamp) works before the engine start and stops once the
engine runs.
2026-11-08 14:48:42 +01:00
jerrrrycho
5f46aca43a fix: a latching line breaker lever goes off with the breaker knocked out (#277)
The EP05's single two-state line breaker lever stayed on once the converter
overload relay knocked the breaker out: every press of the toggle tried to
close the open breaker, which the tripped relay refused. A press now puts
a lever left on over an open breaker off first.

(eu07/maszyna#394)
2026-11-08 14:48:04 +01:00
jerrrrycho
b5953ef61e feat: lock the field shunting in both directions on resistive positions
With ScndCtrlResistiveLock=Yes the shunt controller can't be moved down
either while the master controller is at zero or on a resistive position
(eu07/maszyna#402: "inc/dec").

So that a shunt step can't be left stuck there, the shunt controller drops
to 0 whenever the master controller is at zero or on a resistive position:
right after IncMainCtrl()/DecMainCtrl() move it there (before the
positions go down the consist) and in every update, for the master
controller set directly (AI clamp, consist). Electrically nothing changes,
the relays already drop the shunting on resistive positions. Reducing
power is never blocked: the EP09/ET21 master controller turns back with
the shunt on, the ET22 keeps its interlock (shunt off first), and on the
ET22 a shunt left on at a resistive position would otherwise lock both
controllers.

Tests: the shunt goes down on resistance-free positions only; the master
controller taken back or up onto a resistive position from a shunt step,
by hand and directly, on the ET22 and EP09.
2026-11-08 13:00:24 +01:00
jerrrrycho
cea92f0170 test(unit): the test mode tests compare seconds with a tolerance
Floating point values of the command line, the real time limit and the
standstill clock are checked with doctest::Approx rather than ==.
2026-11-08 11:57:03 +01:00
jerrrrycho
e5aafd154f feat(simulation): the pass and the standstill wait for the train under test only
Both waited for every vehicle of the scenery to stand still, so on a scenery
with AI traffic a test could pass only when the traffic happened to stand too,
and the standstill end hardly ever came.

A test scenery names the train under test with test.vehicle <name> in its
config block (once for each train, if several): the pass and the standstill wait
for the consists of these vehicles as they are at the moment, so a train the
tested one couples to counts with it. A name the scenery doesn't have ends the
test with the error code. Without test.vehicle every vehicle counts, as before.
A signal passed at danger counts for every train either way.

run.py puts the case's lead vehicle into test.vehicle. test_mode_standstill_traffic
has the train under test standing on track 2 of Stacja1 while AI traffic leaves
track 1 on the timetable: it ends on its 100 s standstill, where counting every
vehicle runs into the 300 s timeout. Physicslogs of the other trains of a case
(<something>_<vehicle>) are moved out of the game dir too.
2026-11-08 11:39:52 +01:00
jerrrrycho
03a417c7b0 feat(simulation): a real time watchdog ends a test run that hangs
A test run that hung, in the loading or anywhere else, waited until whoever
started it killed it. A watchdog thread now ends a run still going test.wall_timeout
seconds of real time after the start of the simulator, loading included: it says
`test: timeout ... still running after N s of real time` and quits with the
timeout code, whatever the main thread is doing, with no dialog. A test that has
ended but whose simulator doesn't close ends with its own result.

The limit is test.wall_timeout (settings, the scenery's config block) or
--test-wall-timeout, which wins. Not given, it is test.timeout + 600 s: ten
minutes for the loading, and a simulation that runs at least as fast as real
time is never cut short. test.timeout 0 means no watchdog unless the limit is
given; test.wall_timeout 0 turns it off.

run.py passes the case's timeout as --test-wall-timeout and kills a simulator
only 30 s after it. A timeout from the watchdog counts as wall_timeout there, so
a run that hung doesn't pass a case expecting the simulation time to run out;
test_mode_wall_timeout ends while loading on a limit of 2 s.
2026-11-08 11:33:36 +01:00
jerrrrycho
baf6bc2a20 feat(simulation): the test mode's exit codes keep clear of 1 and 3
1 is what a process killed with TerminateProcess (and the plain failure of most
programs) ends with, 3 what abort() ends with on Windows, so a fail or a timeout
couldn't be told from a run that was killed or blew up. The codes other than
pass now are 10 fail, 11 signal passed at danger, 12 timeout, 13 standstill and
14 error: none of them a code a process gets on its own, neither the shells'
126-127 nor 128 + a signal number on Linux. pass stays 0.
2026-11-08 11:21:30 +01:00
jerrrrycho
486a714f52 refactor(simulation): the rules of the test mode in a file of their own, with unit tests
The command line options of the test mode and the end conditions checked after
each frame are now plain functions in simulation/simulationtestrules.cpp, which
needs nothing of the running simulation: parse_test_command_line() and
evaluate_frame(). The file is part of the core library, so the unit tests check
them (tests/unit/test_test_mode.cpp): the --test-timeout value, values of other
options not taken for options, a pass that waits for the stop, the standstill,
the timeout. test_manager only gathers what a frame brought and acts on the
verdict. No change in behaviour.
2026-11-08 11:20:52 +01:00
jerrrrycho
13ded6cdfa feat: separate engine start switches for the vehicles in multiple (eu07/maszyna#80)
In vehicles like the ST43, the SP32 or the SN61 every engine of a train in
multiple has its own start and stop buttons in the cab. Until now the cab's
line breaker / engine start switch (main_sw, main_on_bt, main_off_bt) always
started and stopped the engines of all the vehicles under its control.

- .fiz, Engine: JointEngineStart=Yes|No (default Yes, as before). With No
  the cab's main_* work the cab's own vehicle only, and an engine stopping on
  its own (stalled, out of fuel) stops only its own vehicle instead of every
  engine in the train.
- .mmd: mainb_sw, mainb_on_bt, mainb_off_bt work the second vehicle with an
  engine under the cab's control, mainc_sw, mainc_on_bt, mainc_off_bt the
  third one. They count along the control cable from the cab's vehicle,
  behind the cab first. Like main_*, the start switch has to be held for the
  vehicle's IniCDelay with the vehicle ready (MainSwitchCheck); an impulse
  switch of an electric locomotive with series motors closes on release.
- New commands, added at the end of the command list: linebreakertoggleb,
  linebreakeropenb, linebreakercloseb, linebreakertogglec, linebreakeropenc,
  linebreakerclosec. No default keys.
- The logic is in vehicle/enginestart.{h,cpp} (core library), tested in
  tests/unit/test_engine_start.cpp.

Nothing changes for existing vehicles: the new key and the new cab controls
are optional, and without them the code does what it did before.

Game data (SVN, not changed here, to be done separately; the code works
without it): for the SN61 (dynamic/pkp/sn61_v2), whose cab models already
have the buttons start02/stop02/start03/stop03,
- sn61.fiz, sn61-86.fiz, sn61_v1.fiz and the other SN61 .fiz: add
  JointEngineStart=No to the Engine: line;
- sn61.mmd.inc (and the other SN61 includes): after main_on_bt add
  mainb_off_bt: { stop02 mov -0.005 0 0.1 ... }
  mainb_on_bt: { start02 mov -0.005 0 0.1 ... }
  mainc_off_bt: { stop03 mov -0.005 0 0.1 ... }
  mainc_on_bt: { start03 mov -0.005 0 0.1 ... }
  with the sounds of main_off_bt / main_on_bt.
The tooltips "line breaker B" / "line breaker C" are new strings for lang/*.po.
2026-11-08 07:12:30 +01:00
jerrrrycho
5d6f734b04 feat: pose door wings of the low poly interior along with the main model (eu07/maszyna#512)
The door wings are in the main model, where the door animation finds them, so seen from inside the
vehicle they are lit like the exterior and ignore the compartment lights. A door panel put into the low
poly interior instead stayed closed, since nothing moved it.

A door wing animation now also picks up the submodel of the same name in the low poly interior, if it
has one, and gives it the same pose (shift, rotate, fold with its child wings, plug). Placed under a
compartment section, such a wing is lit with the section and follows its light switch.

The pose maths moved unchanged to vehicle/doorwings.h, with unit tests.

Assets: optional. No low poly interior in the SVN or in the Steam install has a submodel named like a
door wing, so nothing changes for existing vehicles. To use it, a low poly interior gets the inside of
each door wing as a submodel named like the wing in the main model (door1, door01, drzwi1, ...), with
the same pivot and transform, under the compartment section it belongs to, with a SelfIllum threshold
like the section's, and slightly inside the wing of the main model.
2026-11-08 06:05:37 +01:00
jerrrrycho
87f1d960a0 fix: EN57 brakes hauled with the brake hose alone, Knorr EP brake without control power
eu07/maszyna#87: the EP2 (and EP1) valve charged its auxiliary reservoir only
from the main reservoir pipe. A dead EN57 hauled by a locomotive coupled with
the hook and the brake hose alone ("3") never charged it, its control
reservoir stopped at about 2.5 bar and the unit didn't brake. The valve now
refills the auxiliary reservoir from the brake pipe through the slide valve's
check valve, as every ESt does (TESt::FillBrakeRes, shared with TESt::GetPF,
which stays bit for bit the same). With the main reservoir pipe charged the
auxiliary reservoir stays above the brake pipe and nothing changes; the
reservoir now also takes air from the brake pipe while it is below it, e.g.
at start-up before the compressor has charged the main reservoir pipe.

eu07/maszyna#134: the EP brake of the Knorr St113 handle (EN57-001) worked
with the reverser in neutral, the battery off or the EP fuse switched off
(Ctrl+Z). It now needs the control powered, as the Oerlikon handle's does
(EPBrakeControlPowered: battery, reverser out of neutral, EP fuse), and an
EP brake switched on drops out (holding the cylinder pressure) when the
control loses power. The positions of the EP release and brake were already
moved by 810b7ad07; a test pins them.

No change to game data needed.
2026-11-08 04:25:34 +01:00
jerrrrycho
3a71869569 fix: table-drive the same-traction coupling test for CI
The repeated subcases were duplicated code above the Sonar threshold; also
renames a local shadowing coupling::permanent.
2026-11-08 04:22:19 +01:00
jerrrrycho
f2ecbd055c fix: keep the resistive-lock test's controller table index in range for CI
Sonar (S3519) doesn't see the REQUIRE ending the test, so it read the table
at the index below the first resistance-free position as possibly -1.
2026-11-08 04:22:13 +01:00
jerrrrycho
4b769d95c1 fix: SOD lamp shows the doors of the whole consist in three states (eu07/maszyna#288)
The door closure signalling lamp (i-door_blocked) showed only Doors.is_locked
of the occupied vehicle, so a door open in another car or a coupled unit
didn't show on it.

TMoverParameters::door_closure() gives the state of one vehicle (none, locked,
released, open), the driver gathers the most severe one of the train in
determine_consist_state(), next to IsAnyDoorOpen, and the lamp is lit for
locked doors, blinks for closed but released ones (a permit given, or no lock
engaged on doors that need no permit) and is dark with a door open.

doorclosuresignal in eu07.ini (default yes) switches it; with no the lamp
shows is_locked of the occupied vehicle as before. No data change needed.
2026-11-08 02:05:45 +01:00
jerrrrycho
326a84445b fix(lights): keep the headlight dimmer position within the DimmerList
modernDimmerPosition indexed dimPositions without a range check in
RaLightsSet(), SetLightDimmings() and the off_from_dimmer value of the
cab's Python state. An empty DimmerList, or a DefaultPos past the end of
a short one, read past the end of the vector; the dimmer commands could
also leave or put the position outside the list.

Reads go through currentDimPosition(), a plain entry (not off, not
dimmed) outside the list. DefaultPos and the position are clamped after
the .fiz is loaded, the increase/decrease commands step through
stepDimmerPosition(), which clamps and does nothing for an empty list,
and headlightsdimenable clamps its position 1.
2026-11-07 23:30:10 +01:00
jerrrrycho
d259251373 feat: cab controls can animate duplicate submodels (eu07/maszyna#527)
A control defined again in the same cab section of the .mmd with the
block key "duplicate: yes" no longer replaces the control: the first
definition stays the control (sounds, type, command feedback), and the
duplicate adds a copy with its own submodel, animation type and scale /
offset, following the control's value and active state. The duplicate's
sound keys are ignored so the control is not heard twice, and clicking
any copy works the control. This lets e.g. the ASF cab move its second
master controller and reverser with the first ones.

Without the key a repeated definition still replaces the earlier one,
as some of the game's .mmd files repeat controls with other submodels.
A duplicate with no definition of the control loaded from the current
cab's models before it is just the control.

clear_cab_controls() now also clears ggCompressorListButton, which kept
the previous cab's submodel.

The rule is in vehicle/gaugeduplicates.h, covered by
tests/unit/test_gauge_duplicates.cpp.

(eu07/maszyna#527)
2026-11-07 23:19:53 +01:00
jerrrrycho
d3dd883700 feat: light programmer positions can switch the cab light (eu07/maszyna#529)
An optional third column in the LightsList rows of the .fiz sets the cab
interior light when the driver moves the light preset selector to that
position: 0 off, 1 on, 3 on dimmed (bit 2 the dimmer). Rows without the
column, or with a negative value, leave the cab light to its own switch,
so the existing tables work as before; a stray note after the two light
columns (e.g. "38 38 / A") is not read as the flag.

The light follows the occupied cab, or all cabs of a JointCabs vehicle,
as with the interior light commands; the dimmer switch is moved along.
The lightsset custom position and the AI leave the cab light alone.

Covered by tests/unit/test_lights_preset_cablight.cpp.

(eu07/maszyna#529)
2026-11-07 23:13:00 +01:00
jerrrrycho
30bdc3da61 feat: radio fuse, a cut-off in the radio's power supply (eu07/maszyna#438)
TMoverParameters::RadioFuse, closed by default, stands for a fuse in the
cabinet, a lever on the desk or the switch on the radio's power supply.
RadioPowered() needs it closed, so with it open the radio's buttons, calls,
messages and the radio-stop stop working; opening it at a standstill resets
the radio-stop as switching the radio off does, and the radio and radio-stop
lamps go out. New commands radiofusetoggle/radiofuseenable/radiofusedisable
(no default keys), cab controls radiofuse_sw: (follows the fuse state),
radiofuseon_sw: and radiofuseoff_sw:, and radio_fuse for the Python screens.
The AI turning the radio back on closes the fuse too.

Existing vehicles don't change: the fuse starts closed and opens only from a
new cab control or a bound key. SVN data, optional: cabs that have such a
fuse or lever get one of the new controls in their .mmd, in the form of
radio_sw: (e.g. "radiofuse_sw: { <submodel> rot 0 0 0 }"); lang/*.po can
translate "radio fuse".

(eu07/maszyna#438)
2026-11-07 21:33:28 +01:00
jerrrrycho
8f51ea9a19 feat(ai): suggested pantograph setup for shunting in the .fiz (eu07/maszyna#461)
A new optional key in the AI section of the .fiz, ShuntPantstate= (bits as in
Pantstate: 1 front, 2 rear, 3 both), sets the pantographs the AI driver keeps
up while its order is Shunt or Loose_shunt, moving and standing alike: it
raises those of the setup and lowers the others once one of the setup
collects the voltage, and doesn't raise more when idling. Lowering on the
track's demand still comes first. Without the key (default 0) nothing
changes, so an ET41 no longer has to shunt on all four pantographs once its
.fiz says so.

SVN data, optional: add "AI: ShuntPantstate=<1|2|3>" to the .fiz of vehicles
that should shunt on fewer pantographs, e.g. dynamic/pkp/et41_v2/203e-a.fiz,
203e-b.fiz and their _dsa150 variants (no AI line there yet). Without it the
vehicles behave as before.

(eu07/maszyna#461)
2026-11-07 21:32:41 +01:00
cd52ec8799 Merge pull request #259 from MaSzyna-EU07/fix/sm03-engine-shutdown
fix(cab): a diesel with only the starter button stops its engine with the main switch off command (eu07/maszyna#427)
2026-11-07 20:23:21 +00:00
d6f20f1b0f Merge pull request #260 from MaSzyna-EU07/fix/sx45-line-contactors-lamp
fix(cab): on the SU45 and SU46 the open line contactors lamp lights with the contactors opened by the pressure switch (eu07/maszyna#263)
2026-11-07 20:22:53 +00:00
pwarszawski
39244a88a5 tests: wait for the pressure switches before notching up
full_power() notched up as soon as the controlling half had closed its line
contactors. In the ET42 test the locomotive brake is still at about 2.0 bar
then, right at the pressure switch threshold, so whether the second half
starts as well depended on thousandths of a bar in its cylinder: a half whose
switch is on when the controller leaves zero doesn't close its line
contactors until the controller is back at zero. Any change to the air
brakes could tip it either way (with the corrected ESt3 the second half
stayed off and the train reached 88.7 instead of 106 km/h).

The helper now waits, as a driver does, until no pressure switch in the
train cuts the start off.
2026-11-07 21:17:12 +01:00
jerrrrycho
6dc1239553 fix: no multiple-unit control between electric and diesel locomotives
An electric and a diesel locomotive got their control coupled whenever the
scenario (and so the Starter) asked for it, since the scenery coupling ignores
ControlType, or when neither coupler named a control system, so a Vectron and
an SM42 ran in multiple unit.

TMoverParameters::Attach() now leaves the control connection out between an
electric (ElectricSeriesMotor, ElectricInductionMotor) and a diesel
(DieselEngine, DieselElectric/DumbDE) traction vehicle, for the scenery, the
AI, the coupling keys and the automatic couplers alike, and logs it. Vehicles
without own traction (cars, control trailers) are not affected, nor are
permanent couplings within a unit, nor couplers that both name the same
ControlType, which stays the vehicle authors' way to allow such a pair. The
AI coupling order expects the coupling the vehicles can take, so it doesn't
wait for the control connection forever.

Existing scenarios coupling such a pair still load, without the control
connection. "controlcoupling.enginecheck no" in eu07.ini turns the check off.
No SVN data change is needed. (eu07/maszyna#520)
2026-11-07 21:16:19 +01:00
jerrrrycho
5bc4e7cd2e feat: lock field shunting at zero and on resistive positions
New optional Cntrl. key ScndCtrlResistiveLock=Yes: IncScndCtrl() refuses
to step the shunt controller up while the master controller is at its
no-power position or on a resistive RList position (R >= 0.01), as the
interlock of the ET21, ET22 and EP09 does. Decreasing the shunt stays
allowed so it can't get stuck. The AI doesn't choose field shunting
while the lock applies. Without the key nothing changes.

Game data: the key is to be added to the Cntrl. line of the ET21
(et21_v2), ET22 (et22_v3, et22-2000_v2) and EP09 (ep09_v1, ep09_v2)
.fiz files that define it; until then they behave as before.

(eu07/maszyna#402)
2026-11-07 21:01:54 +01:00
jerrrrycho
329dc4e42e feat: SM42 vigilance device switched off in the shunt mode (eu07/maszyna#457)
The shunt mode of the diesel-electrics (ShuntMode=1: SM42, SP42, SU42) now
suspends their vigilance device (CA): no alerter while running, no alarm for the
button held too long, and an alarm already on goes out. The cab signalling (SHP)
stays as it was. Back in the line mode the CA works as before.
2026-11-07 20:13:46 +01:00
jerrrrycho
a86bcb1ef5 fix: SM42 shunt mode switched on at the first move of the switch (eu07/maszyna#497)
CurrentSwitch() asked MaxCurrentSwitch() first. Since 2e86b3a5 (2021) that one
takes any change of the motor overload relay threshold, on every engine type, and
reports it, so the first move of the switch only flipped the threshold (meaningless
on a diesel) and the shunt mode of the SM42/SP42 (and the 2Ls150 gear of the SM03)
took a second one, both on and off; the cab switch, which shows the shunt mode,
didn't move at the first click. The diesels with a shunt mode now set it alone.
2026-11-07 20:08:59 +01:00
jerrrrycho
0095551350 feat: universal controller power demand in steps (UCList CtrlValStep)
The 6Dg sets its power demand in 5% steps, while the universal controller
(EIMCtrlType 3) ramped it continuously. A new optional UCList header key,
CtrlValStep (e.g. 0.05), makes the setting move in whole steps: one at once
when the controller is moved onto a raising or lowering position, then one
each time SpeedUp / SpeedDown covers a step, stopping at the position's set
value. Without the key (default 0) nothing changes.

Data (SVN, optional, after this): add CtrlValStep=0.05 to the UCList: line
of dynamic/pkp/6dg_v1/6dg.fiz (its variants include it).

(eu07/maszyna#412)
2026-11-07 19:30:10 +01:00