18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 08:04:57 +01:00
Commit Graph

3 Commits

Author SHA1 Message Date
jerrrrycho
a3ad30b72b fix: the odometer store merges the file other simulations saved, keeps a made up state replaceable by the cab's counter
- each process writes its own <file>.<pid>.tmp and renames it in place; before writing it re-reads the file and
  merges it per vehicle (a known state beats a made up one, else the larger one, never the sum)
- a state counted from a made up one is saved as ~<km> and the .mmd counter offset still replaces it later
- a vehicle removed from the scenery has its odometer recorded right away
2026-11-08 18:18:35 +01:00
jerrrrycho
1083f3cb5d fix: make the odometer test's scratch directory in the build directory for CI
Sonar (S5443) flags the shared temporary directory; the tests now use one
in their working directory. Also makes the scratch directory non-copyable
and spells out the optional checks Sonar asked about.
2026-11-08 04:23:30 +01:00
jerrrrycho
6dc42e976f feat: keep the vehicle odometers between the sessions (#72)
Every vehicle gets an odometer (TMoverParameters::Odometer) counting along
with the per-session DistCounter, starting from its state saved in
eu07_odometers.txt in the user's settings directory, else from the file a
python screen kept it in (kilometry/<name>_przebieg.txt), else from a state
made up from the vehicle name. The store is saved every minute of
simulation time and on closing.

The cab's distcounter: gauge shows the odometer; its .mmd offset seeds a
vehicle with no known state. Python screens get it as
state["odometer_total"]; state["odometer"] stays the session distance the
logbook and mirror scripts count differences of.
2026-11-07 22:08:42 +01:00