Add TRO marker editing to SSG_LIB

The TRO markers written by sps_skel (lib/tro_annotate.py) are blocks
TRO_SYM_<type> carrying ID and TYPE as attributes. This wires them into the
existing SSG_LIB mechanisms rather than adding new ones.

The double-click hook and the EATTEDIT override already exist: ***DOUBLECLICK
routes [INSERT] to SSG_BLOCKEDIT, and c:EATTEDIT is undefined and forwarded to
the same dispatcher. So all that was missing was a branch:

  Blockname TRO_*  ->  c:TRO_EDIT (Lisp/Tro_Edit.lsp)  ->  dcl/tro_edit.dcl

Tro_Edit.lsp follows the conventions of the other edit commands: DCL path from
DXFM_DCL, ssg-start/ssg-end around the command, ssg-attrib-read and
ssg-attrib-set-on for the attributes, all user-visible text via ssg-text/
ssg-textf with keys in lang/de_DE.json and en_GB.json. Implied selection is read
before ssg-start, since ssg-start clears it - the same note Gefaellestrecke.lsp
carries.

TYPE is a picklist rather than free text so it cannot drift from the type
catalogue. The list comes from Lisp/tro_types.lsp, generated on the sps_skel side
by "tro_annotate.py --emit-lisp" into DXFM_LISP. If that file is absent the
dialog offers the block's current type and still works.

Loading is lazy: the module is not preloaded in the MNL. The menu macros and the
dispatcher pull it with (ssg-ensure "Tro_Edit") on first use, and the dispatcher
falls back to native EATTEDIT if the module cannot be found. ssg_load.lsp loads
it for the non-menu path.

Menu: SSG_LIB > TRO with "Marker bearbeiten" and "Bearbeiten (Auto)", plus an
entry in the POP501 edit context menu.

The dialog changes attributes only. The marker shape belongs to the block
definition of the type and FB_BLOCK is derived from it, so both follow on the next
tro_annotate.py run; the dialog states this and the command prints a reminder when
the type was changed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-03 12:06:42 +02:00
parent 9c3391aaf6
commit 45044cdcba
9 changed files with 289 additions and 2 deletions
+12 -1
View File
@@ -648,6 +648,17 @@
"vfl-kette-nur-ein-baustein": "\nAb dem gewaehlten Baustein wurde kein weiterer angeschlossener VF_n-Baustein gefunden - nichts zum Zusammenfuehren.",
"vfl-kette-gefunden": "\n\nKette erkannt: %1 Baustein(e) werden zusammengefuehrt:",
"vfl-kette-luecke-warnung": "\n\n WARNUNG: Nach '%1' wurde ein visuell nahes, aber nicht sauber verbundenes VF_n ('%2') gefunden (KS-Abstand %3 mm) - Kette wurde dort beendet, dieser und alle weiteren Bausteine bleiben unangetastet.",
"vfl-kette-fertig": "\n\n>>> Fertig: neuer Gesamt-Block '%1' aus %2 Baustein(en) erstellt."
"vfl-kette-fertig": "\n\n>>> Fertig: neuer Gesamt-Block '%1' aus %2 Baustein(en) erstellt.",
"cmd-tro-bearbeiten": "\nTRO-Marker bearbeiten: %1",
"tro-edit-kein-tro": "Block %1 ist kein TRO-Marker (erwartet TRO_*).",
"tro-edit-kein-id-attribut": "Block %1 hat kein Attribut ID - bitte neu beschriften lassen (tro_annotate.py).",
"tro-edit-dialog-fehlt": "Dialogdatei nicht gefunden:\n%1\nDXFM_DCL pruefen (setenv.bat).",
"tro-edit-modul-fehlt": "%1 nicht geladen - Attribute werden mit EATTEDIT bearbeitet.",
"tro-edit-block": "Block: %1",
"tro-edit-fb": "Funktionsbaustein: %1",
"tro-edit-hinweis": "Symbol und FB folgen erst beim naechsten Lauf von tro_annotate.py.",
"tro-edit-id-leer": "Die TRO-Kennung darf nicht leer sein - nichts geaendert.",
"tro-edit-gespeichert": "\nTRO gespeichert: ID = %1, TYP = %2",
"tro-edit-typ-geaendert": "\nTyp geaendert - tro_annotate.py neu laufen lassen, damit Symbol und FB passen."
}
}