A spawned vehicle is named <spawn>:<number>, and its log went to physicslog/<spawn>:<number>.dat. On
NTFS that isn't even an error: it is the stream <number>.dat of the file <spawn>, which nothing lists,
so the log was written and no one could find it. On Linux the file was there, under a name Windows
can't open.
The name of the file of a log has < > : " / \ | ? * and the control characters replaced by _, on every
system, so the logs are named alike everywhere (spawn_ezt:12 is spawn_ezt_12.dat), and a _ before a
name Windows keeps for a device (con, nul, com1..., with an extension too). The bytes of 1250 stay.
The black box tells the log it begins by the same name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tapes of the user's vehicles were written by update() after the check for the writer of the
recording, which close() drops on entering the editor (F11). With "physicslog no", the speed recorder's
tape ended at F11 while the drivers' own logs of "physicslog yes" went on.
The tapes are files of their own: they are kept from the moment the recording was to be made, the file
made or not, closed or not, until the simulator closes, after the gap of the time in the editor.
Only the recording itself stops at F11, as before.
Reported in the review of #385.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"physicslog.trains yes" in eu07.ini writes the .dat log of each driver who
drives rail vehicles, not of the passengers nor of the road vehicles that make
"physicslog yes" hundreds of files on a big scenery: the tape of every train.
A driver made primary later begins its log then, and isn't counted while it
doesn't log. The black box goes with it when the ini says nothing of its own,
and doesn't write a second log of a driver writing its own. The doc tells the
doors' sides are the vehicle's, the driver's swapped in the rear cab.
The lines kept while files can't be written are cut to their share of 64 MB
before the lock the simulation waits on. A log written in part is cut back to
its length, so the next try doesn't write its start twice. A stop from the
writer itself is told by its id even after another thread took it to join, and
the watchdog's flush waits at most its time, the writing on a thread of its own.
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.
The speed of the cab record is the vehicle's. The speedometer, and a speed recorder's tape with it, shows the
speed of the wheels as they turn, which runs away from it while they slip and drops to 0 while they are
locked in a skid. It is added at the end of the record (194 bytes), where the readers skip what they don't
know; the .dat tapes have it already, in their second column.
"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>