Document the planned DXF-to-JSON-to-SCL generator pipeline

Add a Roadmap section to README.md and CLAUDE.md describing the two
still-to-be-written lib/ tools (tro_export.py, scl_gen.py) that will
turn the annotated CAD drawing into a JSON layout model and then into
TIA-Portal-importable SCL, including the --skip-json shortcut.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-20 21:29:49 +02:00
parent ec009efefe
commit e630ec12d6
2 changed files with 119 additions and 38 deletions
+37 -2
View File
@@ -13,8 +13,10 @@ The repository has moved past pure analysis: `lib/` now holds working Python too
derives a material-flow graph and a TRO list from a CSV export (ILS 2.0) and can annotate a
copy of the BricsCAD drawing with the result. What does **not** exist yet is the actual
SCL-skeleton generator — the step that would emit TIA-Portal-importable SCL from a JSON
layout model. `tests/` and `examples/` are still empty scaffolding (see "Standard Programm
Template" below). What exists today is:
layout model — nor the tool that derives that JSON model from the annotated drawing; see
"Roadmap" below for the planned two-tool pipeline that closes this gap. `tests/` and
`examples/` are still empty scaffolding (see "Standard Programm Template" below). What
exists today is:
- `bin/` — environment/venv management scripts, plus one `.bat`/`.sh` wrapper pair per CLI
tool in `lib/` (see "Environment scripts" below)
@@ -137,6 +139,39 @@ local, fully-vendored SCL source (`FB_ILS_MTRO_Vario_workStation`, `FB_EmptyCarr
`doc/TRO_Katalog/scl_templates/*.scl` as **read-only reference material** for pattern
extraction, not code to execute or modify.
## Roadmap: DXF → JSON → SCL (planned, not implemented)
`tro_annotate.py` is where the current pipeline stops today: the user can keep hand-editing
the annotated DXF copy afterwards (via the BricsCAD `TRO_INSERT`/`TRO_EDIT` commands, see
`doc/HundM/BricsCAD_TRO_Symbol.md`) — moving TROs, adding new ones, or changing a type. Two
more `lib/` tools are planned to carry that drawing the rest of the way to importable SCL:
1. **`lib/tro_export.py`** (planned) — reads the (possibly hand-edited) annotated DXF plus
the CSV export and derives the JSON layout file described in
`doc/HundM/Json_Layout-Konzept.md` (`plc`, `controlUnits`, `sensors[]`, `conveyors[]`,
`tros[]`, `loadingBooms[]`, `emptyCarrBuffers[]`, `routing`, `jamAreas[]`, `scanners[]`,
`connections[]`, `destinations[]`). Per-TRO timing (`trailingTime`, `handlingTime`,
`senFree`, `senWait`, `jamTime`, ...) comes from the type-based default table in
`doc/TRO_Typen.md` unless the CAD symbol carries an `OVERRIDE_TIMING_JSON` value (see
`doc/HundM/BricsCAD_TRO_Symbol.md`), in which case the override wins. The resulting JSON
file is meant to be hand-edited afterwards — that's the intended place to tweak defaults
or individual timings before code generation.
2. **`lib/scl_gen.py`** (planned) — reads the JSON layout file and emits the `.scl` files
(`FB_Main`, `FB_CallSensors`, `FC_Direction`, `FC_Call_Jams` per controller) ready for
TIA Portal import. Takes a `--skip-json` switch for the case where no manual JSON edits
are needed: it then reads the DXF + CSV directly (running the same derivation as
`tro_export.py` internally) and emits SCL immediately, without writing or reading an
intermediate JSON file.
Both tools follow the existing `lib/` conventions once written: a `bin/<name>.bat`/`.sh`
wrapper pair (see "Environment scripts" above) and a switches/outputs section in
`doc/Python_Scripts.md`. Note this is a separate concept from the `create_skel.py` /
`guess_fbtype()` generator sketched in `doc/HundM/suggestion.md` and
`doc/HundM/Json_Layout-Konzept.md` §14.5 — that one is designed to derive its skeleton JSON
from HundM's Excel I/O-list exports (`*_TIA.xlsx`, `*_positions.json`, ...), a different
input source than this repo's CSV+DXF pipeline. The JSON *schema* it targets is the same
(`doc/HundM/Json_Layout-Konzept.md`); only the derivation source differs.
## Standard Programm Template
This project follows the user's standard Python project scaffold convention: