In a unit driven from an unpowered car, the speed of the wheels was of the car
the user is in, whose wheels never slip; now of the motor car, signed as the
occupied vehicle's speed. The doc tells of a log per driver, and of the two
seconds of real time a crash loses.
"physicslog yes" kept the .dat of every vehicle with a driver open for the whole run and flushed it twenty
times a second from the simulation's thread: some 580 open files on Tomaszewo. The lines are kept now and a
thread of their own writes them every two seconds, each file opened only for the moment it is written to.
The files, their lines and their text mode stay as they were.
- The black box, with the physics logs off, writes the tapes of the user's vehicles through the same
writer as it goes, not at the end. A log begins when the user is first in the vehicle and goes on
while the user looks around outside, until another vehicle is taken; back in it, the log goes on after
the gap. The vehicle's own driver keeps the log only if it is the primary one, as a passive one's clock
stands still; otherwise the driver of its train does.
- What is kept is written when the simulator closes, after the black box, at the end of a test run, and
when the test watchdog ends a run. A crash loses the last two seconds.
- On Tomaszewo with the black box alone, the one tape grows every two seconds. With "physicslog yes", the
581 logs grow and the simulator holds as many handles as without them; writing them takes the thread
about 1.9 s, which the closing waits for once.
"blackbox yes" in eu07.ini records the black box with the physics logs on or off, "blackbox no" never;
with no entry it goes with "physicslog yes" as before. With the physics logs off, the recorder keeps the
line of the physics log of the driver the user is with, every 0.05 s, and writes it to
physicslog/<vehicle>.dat when the recording closes: the speed recorder's tape of the vehicles the user
was in, without every vehicle keeping a log open and written twenty times a second.
The line and the header of the log are made by one function of the driver, which its own log writes
too, and the file is opened the same way, so the two are the same to the byte: the readers of these
logs (the old Hasler tape viewer, the starter) read them as before.
* feat(blackbox): a recorder of the run, the cab, the signals and the stations to a file
With the physics logs on (and the new eu07.ini setting blackbox, on by
default), the simulator writes a black box of the session to
physicslog/*.blackbox: the scenery map (tracks, signals, W4 stop points
with their heading, W6 horn points), the timetables of the user's train,
and at 10 Hz the cab of the vehicle the user sits in (speed, controllers,
brakes, pressures, lights with the pattern the run asks for, the movement
kind), the AI's reference for the same place (target speed, next limit,
braking distance), the consist, the cameras and the vehicles around.
Changes go in as they happen: switches, signal aspects, commands,
signals passed with their aspect, stations stopped at, passed or missed,
horn requests, the autopilot switched on or off, couplings and vehicles
removed.
The driving aid's next speed limit moved from the UI panel to
TController::next_speed_limit(), so the panel and the recorder read the
same. The format is described in blackbox_doc.md; the writer and the
reader of the records have unit tests.
* fix(blackbox): the aspect a signal had when passed, the lamps the ends have, vehicles taken off
- A passed signal is written with the aspect the train had of it, kept in
the speed table, not the one its memory cell shows when the pass is
noticed: by then the train itself on the track behind has often set
it to stop, and most passes were written as at stop.
- The cab record gains the lamps the vehicles at the head and the tail
have at their outer ends (136 bytes), so a reader can check the light
pattern against them as the driver does (no upper headlight, the
auxiliary lamps, the rear-end signals only).
- A vehicle taken off the scenery and still pointed at by a coupler or
the camera gets no new number; the camera lets go of it.
- The timetable written before a station goes under the vehicle the
user is in now, not the one of the last look.
- The file buffer is given once the file is open: MSVC passed over one
given before.
- The doc tells the AI fields before the consist is started and when
entering a vehicle is a driver change.
* fix(blackbox): the stop of an automatic block signal passed is written as a stop
The speed table keeps the stop of an automatic block signal (SetVelocity 0 x) as the speed allowed after it, with spStopOnSBL; a pass of it was written as that speed with no flag. It is written as 0 with the flag of an automatic block stop again.
* feat(blackbox): the doors, the brakes of the whole train, a diesel's engine and the rest of the cab
The cab record grows from 136 to 190 bytes, so that a reader can check
everything the driver did:
- the doors: the permits on each side, the departure signal, the steps,
the door lock and whether the doors are locked;
- the brakes: the equalizing reservoir of the driver's valve, the main
reservoir pipe, the highest brake cylinder pressure of the train, the
hand brake, the releaser, the setting (G/P/R/Mg) and the mode
(PS/PN/EP/MED);
- what drives the vehicle (electric, induction, diesel, diesel-electric,
steam, none), its power, a diesel's oil pressure, water, oil and engine
temperatures, overheating, fuel and oil pumps, clutch and torque
converter, the motor fans;
- the cruise control and its speed, the integrated driving handle of a
unit, the radio channel, the horn's tones.
New device bits use the upper half of the 32-bit field; the new fields
come at the end of the record, so older readers still read it.
* fix(blackbox): the driver's valve field is what its gauge shows, the radio channel has no none
Handle->GetCP() is the equalizing reservoir of most valves but the time reservoir of the FV4a, empty but after an overcharge: the field is named and documented as what the valve shows. With no driver the radio channel reads as the first one, not 0.
---------
Co-authored-by: maj00r <maj00r@host>