- lib/model.py (neu, pydantic): TroBase -> DerivedTro, Connection, OpenPoint, Analysis (aus tro_flow verschoben), TroDocument = TRO-JSON (Schema sps_skel-tro-v2). items/fbType werden immer ueber den Typ aus tro_catalog gelesen, nie gespeichert; abweichende Werte in einer JSON sind ein Fehler. JSON-Schluessel wie bisher (id, type, fbType ...), extra="forbid". - tro_flow: Tro/Analysis aus model.py; neuer Schalter --json schreibt <name>_tro.json (TroDocument) - scl_skeleton: liest die JSON ueber TroDocument statt per Dict-Zugriff, Bauteile ueber TroItem-Konstanten; ungueltige JSON -> Exit 1 ohne SCL, alte tro_extract-JSON (v1) mit Hinweis auf tro_flow --json - tro_annotate: nur noch Ansicht; derselbe analyse_tros-Aufruf wie tro_flow (inkl. sepliste-Gegenprobe), damit Zeichnung und JSON uebereinstimmen - tro_extract: geparkt (unveraendert) - tests/test_model.py + conftest.py, pytest in requirements.txt aktiviert - Doku: Python_Scripts.md (§6b model.py), Commandlines.md, CLAUDE.md, Aufrufkommentare in bin/ (scl_skeleton.bat zeigte tro_flow-Aufrufe) Geprueft: alle tro_flow/tro_annotate-Ausgaben (8 CSVs) bis auf Zeitstempel identisch zum vorherigen Stand; scl_skeleton alt/neu auf derselben JSON byte-identisch (export, mubea, HundM05); 10 Tests gruen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
55 lines
2.1 KiB
Batchfile
55 lines
2.1 KiB
Batchfile
@echo off
|
|
REM ================================================================
|
|
REM SPS_SKEL - TROs ermitteln und TRO-Flussdiagramm erzeugen
|
|
REM ================================================================
|
|
REM Aufruf:
|
|
REM bin\tro_flow.bat --file mubea.csv
|
|
REM bin\tro_flow.bat --file mubea.csv --tosvg
|
|
REM bin\tro_flow.bat --file mubea.csv --tosvg --doc
|
|
REM bin\tro_flow.bat --file mubea.csv --json (TRO-JSON fuer scl_skeleton)
|
|
REM
|
|
REM Die CSV-Datei wird in %SKEL_DATA% gesucht, DOT, SVG, Doku und
|
|
REM Fehlerdatei werden in %SKEL_RESULTS% abgelegt.
|
|
REM
|
|
REM Schwesterprogramm: bin\material_flow.bat (Materialfluss der Objekte)
|
|
REM ================================================================
|
|
|
|
setlocal
|
|
|
|
REM Umgebung setzen (SKEL_DATA, SKEL_RESULTS, SKEL_LIB, PYTHONPATH ...)
|
|
call "%~dp0setenv.bat" >nul
|
|
|
|
REM Virtuelle Umgebung nutzen, falls vorhanden (pydantic wird benoetigt)
|
|
if exist "%SPS_SKEL%\.venv\Scripts\activate.bat" (
|
|
call "%SPS_SKEL%\.venv\Scripts\activate.bat"
|
|
)
|
|
|
|
REM Python-Interpreter bestimmen (py-Launcher bevorzugt, sonst python)
|
|
set "PY=py"
|
|
py --version >nul 2>&1 || set "PY=python"
|
|
|
|
REM Graphviz pruefen, wenn --tosvg SVG erzeugen soll (dot, bei --use-cords/
|
|
REM --use-coords neato) - nur ein frueher Hinweis; das eigentliche Skript
|
|
REM meldet denselben Fehler beim Rendern noch einmal im Detail.
|
|
set "GV_ENGINE=dot"
|
|
echo %*| findstr /i /c:"--use-cords" /c:"--use-coords" >nul && set "GV_ENGINE=neato"
|
|
echo %*| findstr /i /c:"--tosvg" >nul
|
|
if not errorlevel 1 (
|
|
where %GV_ENGINE%.exe >nul 2>&1
|
|
if errorlevel 1 (
|
|
set "GV_OK="
|
|
if /i "%GV_ENGINE%"=="dot" if defined GRAPHVIZ_DOT set "GV_OK=1"
|
|
if not defined GV_OK (
|
|
echo WARNUNG: Graphviz '%GV_ENGINE%' nicht im PATH gefunden - --tosvg wird vermutlich fehlschlagen.
|
|
echo Graphviz installieren ^(https://graphviz.org/download/^), den bin-Ordner
|
|
echo zum PATH hinzufuegen, oder GRAPHVIZ_DOT auf die dot.exe setzen ^(nur fuer 'dot'^).
|
|
echo.
|
|
)
|
|
)
|
|
)
|
|
|
|
"%PY%" "%SKEL_LIB%\tro_flow.py" %*
|
|
set "RC=%ERRORLEVEL%"
|
|
|
|
endlocal & exit /b %RC%
|