EventTextsTests and SecurityBrakingTests from #55 ran beside the Avalonia
controls collection; their AppBuilder setup raced it and 28 UI tests failed
with "Setup was already called" on every runner.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in MainWindow.axaml.cs, the Activated handler: main (#52) refreshes the list of simulators when
the settings are shown, this branch looks at the scenery files through _sceneryLook. Both kept.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The buzzer has a colour of its own on the timeline and in the cab, no longer the braking's red, and an event of its
own: acknowledged after how long, or not acknowledged when the braking follows. The alerter's buzzer needs its lamp,
since a protection with one acknowledgement tells the cab signalling's buzzer as the alerter's too. Braking with no
lamp, the protection with no power, is not shown as the driver's on the timeline and in the cab either.
TSecuritySystem brakes whenever it has no power, a cab not yet started or a power cut, with no lamp
lit. Only braking with the alerter or the cab signalling lamp is the driver's not acknowledging.
Every command of a vehicle the simulator can record (input/command.cpp) has a Polish and an English
text: those with a key take the key file's and the starter's own, the rest are written out. A command
with no text keeps its name.
The cab panel's drawing and the consist narration are split into smaller
steps, with plain switches and concrete return types where Sonar asked.
Tests drive the black box panels, both tape views, the key bindings, the
windows opened over another, the search count and the themed tree
entries, sliders, number boxes, pickers and settings sections headless,
as someone at the keyboard with a screen reader meets them.
The simulator now also comes built without AVX2, its file name ending in
_noavx2 (eu07-x64_<date>_<hash>_noavx2.exe, eu07_noavx2 on Linux), and both
builds can lie side by side in the game folder. The automatic choice took
eu07.exe or the shortest name and never that one, so a processor without
AVX2 got a simulator that stops at its first instruction and a notice
telling it to build its own.
Without AVX2 the automatic choice now takes the newest _noavx2 build, even
one through Wine before a native build that would not run. With AVX2 the
build made for it stays first and a _noavx2 one is used only when it is all
there is.
The notice comes only when what would start still needs AVX2. With a
_noavx2 build in the folder but another chosen by hand it names both and
offers to go back to the automatic choice; with none it says what such a
build is called and that the starter picks it up from the game folder.
The starter compared every file of every scenery each two seconds: on a full
installation 175 sceneries and 378 files, 15-18 ms a look, thirty looks a
minute with nothing changed. The system now reports changes in the scenery
folder and a look follows once the burst of a save has passed, 400 ms after
the last report.
The reports are only a hint. A look still comes on coming back to the window
and right after the simulator or its editor closes, and every 30 seconds
anyway, for network drives, Wine and Linux past its limit of watches, where
reports may not come. Where the folder cannot be watched at all the look
stays every two seconds as before. A change reported during a look is not
lost: one more look follows it.
The list of simulators in the settings was filled when they opened, so a new
eu07*.exe from CI or one's own build stayed missing until the starter was
reopened, and the older file was easy to start by mistake. The folder is now
looked at again when the settings page is shown, when the list takes focus
and when the window comes back to the front.
Looking again never changes the choice: a file picked from elsewhere, or one
since removed, stays chosen rather than falling back to automatic, and
nothing waits for Save after it. A list that did not change is left alone.
Closes#48
A review against WCAG 2.2 AA left places a screen reader user could not work:
- Key bindings: a key's button says the command and the key, the clear button
which command it clears; a new key is said aloud and focus comes back to its
row. The on-screen keyboard is reached with Tab and walked with the arrows.
- Number fields read their label; the spin buttons are named and left out of Tab.
- Dialogs: Enter presses the main button, Esc closes, focus starts on the first
button and the message is read with it.
- Consist: every change is said - added, removed, turned, moved, replaced,
undone - and the strip is a named list; a turned card says so.
- Searches say how many entries are left once typing pauses.
- Hasler tapes, the black box timeline, timetable and cab panel take focus, work
from the keyboard, read their value as it changes and draw a focus frame.
- Section reset and level controls, the crew button and the tabs carry names;
English names from Avalonia's templates are read in the starter's language;
sort and crew menus are radio items.
- Input borders reach 3:1 against the panels; Tab starts at the top bar; the
splash screen has a title and its progress reads the loading step.
A page swept point by point left a few places a reader heard nothing: the panel
dividers, the vehicle preview in the depot and the texture base, the picture by
a vehicle class and the empty part of the settings categories. Each now has a
name; a picture with a caption beside it reads as the caption.
The tests that build controls run one after another: a control belongs to the
thread that made the first one, and side by side they now and then failed.
Under the mouse a reader hears only what lies there. The row of a tree entry now
carries whether it is open, an arrow or icon in it its name; a picture takes the
name of the button or card it sits in, the scenery picture says what it shows; a
consist figure is one text, label and value together.
Avalonia tells Windows of a closed list's new value only for a list one types
into, so going through the weathers with the arrows was silent; the new choice
is now said aloud.
The tree entry listed the entries under it as its own children, so the controls
inside it lost their way up and Windows failed every lookup there. It now only
points up to the entry it hangs under, which is all the level needs.
The buttons and knob of a slider's track had no name; they now say the slider's
name and value. A button showing only a sign such as "?" takes its tooltip.
NVDA passes over a group that is not content as well as control, so titled
panels and the landmarks are now both. A setting's explanation and the note on
why the simulator ignores it are read after its name. The key under each setting
is no longer a silent stop for Tab, and a step of the fog slider moves the shown
distance.
Avalonia hung the entries under a group on the panel inside it, so NVDA counted
every scenery at level one and the tree sounded flat. An open group now gives its
entries as its own, and each entry names its group as its parent: Całkowo is
level one, calkowo_lotos under it level two.
A list, box, slider or picker with no name of its own takes the text a sighted
reader sees next to it: to its left in a grid row, above it in a grid column, or
just before it in a panel. The name follows the label into another language.
Titled panels are named groups, so the reader says which one focus went into.
The tab bar and the settings categories are navigation, the page is the main
part, the search boxes are search. A quality level, a section put back to its
defaults, settings reloaded, the weather put back or its time set to now are
spoken, as is the save status.
NVDA read a slider's bare number as a share of its length, so -5 °C was 45 and
the fog was where the knob stood on its scale. Sliders now give the text shown
next to them: the weather's temperature and visibility, and every setting row.
The date and time pickers were read as a grid: the button inside them now carries
the field's label and its value. A scenery group in the tree says whether it is
open or closed, and the weather fields are named by their labels.
NVDA read icon buttons as "Material.Icons.Avalonia.MaterialIcon" and the
sceneries in the tree as nothing. Icon buttons are now named by their
tooltip, list and tree entries by the text they show, fields by the hint in
them, and the inputs of a setting row by its label. The lists, the tree and
the language and profile pickers have names, and a consist card says its
place and vehicles.
Adding a vehicle rebuilt the browser list and switched the add button off
for a moment, and focus fell out of the window: Tab did nothing until
something was clicked. Focus goes back to the button or the list, and Tab
with nothing focused starts from the first control. The splitters are no
longer Tab stops.
eu07 now finds files whatever the case of their names on Linux too
(MaSzyna-EU07/maszyna#362), so the starter no longer folds an include or a
scenery's .sbt to lower case to judge whether the simulator opens it: it
looks them up through CaseInsensitivePaths. The IncludeLetterCase fault and
its texts go, being a false alarm now, and the parser takes a plain yes or
no for each include.
"Open texture folder" finds the folder under dynamic, or from the game
folder, through CaseInsensitivePaths, so on Linux it opens the folder
when textures.txt names it in other letter case.
The textures/logo folder and a trainset's or scenery's logo in it are
looked up through CaseInsensitivePaths, with extensions in any case, so
on Linux the chosen logo is shown instead of a random one or none. The
lookup takes the file system, so it is tested.
PhysicalFileSystem matches a search pattern case-insensitively, as on
Windows, so X.SCN, .BMP minis and .FIZ files of data made on Windows are
listed on Linux as well.
An include in a .fiz is looked up in the vehicle's folder through
CaseInsensitivePaths, so its physics are read on Linux when the include
names the file in other letter case. The missing-asset scan finds skins and
models the same way, with extensions in any case, instead of reporting
files that are there.
A //$f attachment is looked up from the game folder through the new
AttachmentLocator, so on Linux its button is enabled and opens the file
when the scenery names it in other letter case or with backslashes.
The i18n folder and its <scenery>_<language>.json tables are looked up
through CaseInsensitivePaths, so on Linux a scenery's texts are translated
when the table is named in other letter case than the scenery file.
The //$i image and a trainset's timetable are looked up through
CaseInsensitivePaths, so on Linux they show when the scenery names them in
other letter case than the disk has. A timetable written with backslashes
is found there too, and with it the train number of a Hasler tape.
The scenery repository's include lookup becomes CaseInsensitivePaths, which
takes any folder over IFileSystem and gives a name as it is on disk. Of
folders named alike in other case it now tries each, not only the first.
A name is joined to the folder as the simulator joins it, a leading slash
counting for nothing. IFileSystem tells whether the disk ignores case; there,
as on Windows, a name missed as written is not looked for any further, so
no folder is listed.
- The rest of the cab record is read when written: what drives the
vehicle, the doors' permits and departure signal, the brakes of the
whole train, a diesel's oil and temperatures, the cruise control and
the rest.
- Cab panel: the traction as fits what drives the vehicle (voltage and
current of an electric one; revolutions, oil pressure and temperatures
of a diesel; clutch or torque converter of a mechanical or hydraulic
one; nothing for a draisine), the equalizing reservoir, the main
reservoir pipe and the most braked cylinder of the train, the brakes'
setting and mode, a group of the doors, the pumps of a diesel where an
electric vehicle has its pantographs, the hand brake, the releaser, the
horn's tone, the radio's channel, the integrated handle of a unit.
- Events: every switch on and off, doors opened and closed, the departure
signal, the hand brake, the brakes' setting, the radio channel, the
cruise control's speed; moving with the doors open and an overheating
engine as faults.
- A vehicle with no lamps at an end (a draisine) is not judged on its
lights, and one which never had a voltage shows none.
- A light pattern asked for in a recording made before the lamps were
written is checked as the signal it shows, as before.
- Whether the couplings were written is told by the format (the
movement in the cab samples), not by there being any: a recording
where every train is a single vehicle has none, and the user going
over to another vehicle left the timetable shown.
- The 2 m a train may stand off the platform is at each end, not for
both together.
- The stations, the signals passed, the horn points, the couplings, the
consists and the timetable progress of the user's train are kept until
a read adds something; the views asked for them every frame, which on
a long session with many trains took the window down. A read that adds
nothing no longer counts as a change.
- The lights are checked against the lamps the vehicles at the ends have
(written by the simulator from now on), as its driver checks them: Pc 1
without the upper headlight, with the auxiliary lamps, Pc 5 with the
rear-end signals. Only while the user drives: the autopilot's lights
are its own.
- A train off the platform counts at both ends: its head past the stop
point as well as its tail before the platform's end.
- A recording without the couplings keeps the timetable for any vehicle
of the user.
- A signal passed at danger is ringed on the map only once it was.
- In the tapes window a black box opens on a click or Enter, not when
the arrow keys go over it.
- The viewer's screenshot of a window not laid out saves nothing and
still closes.
The simulator writes a black box of each run to physicslog/*.blackbox
(blackbox_doc.md in the maszyna repository). Three new projects read and
show it:
- Eu07.BlackBox: the reader of the records, the recording as a whole
(the user's vehicle and consist at a time, the timetable shown, the
progress along it with arrival and departure delays, whether the
train stood at the platform), the light patterns Pc 1, Pc 2, Pc 5 and
Tb 1 with the ones the run asks for, and a summary of the driving.
- Eu07.BlackBox.Views: the player window, with the scenery map (tracks,
signals, W4 stop points with their heading and W32, the train, the
cameras), the cab, the timeline of speed against the AI's reference,
the events, the timetable and the summary.
- Eu07.BlackBox.Viewer: the window on its own, with options for the
time, following the train and screenshots.
The tapes window of the starter lists the black boxes of each session
beside the Hasler tapes and opens them in the player.
The watch of scenery files asked three times per file, whether it is there,
its time and its size, every two seconds for every source of every scenery.
One look gives all three.
A uart or uarttune the settings no longer write was found missing twice, as a
key of set length and as one the file had, and showed twice among the changes.