849e985008
Sister program to material_flow.py with the same switches, but --tosvg draws the flow diagram of the TROs instead of the individual objects. It reuses read_elements and build_graph, so CSV parsing and direction logic exist once. A TRO is the control logic of one hand-over point, derived from the separator and what is attached to it, following doc/500573_Mubea/TRO_Identifikation_500573.md: Gefaellestrecke, >= 2 lines sharing feed/discharge -> PinStore_Auto per group Gefaellestrecke, single line -> 1Sep Strecke (driven) -> Vario per segment Kreisel lane -> 1Sep A scanner at the separator deliberately does not change the type: in connect.ini separators with a scanner are predominantly 1Sep, and 1Sep_SSCC is reserved for the SSCC/end-measurement/WCS case, which a mechanical layout cannot reveal. Affected points are reported as hints instead. A host with 2 or 3 outgoing flow edges upgrades 1Sep to 1Sep1Swi/1Sep2Swi. Connectivity contracts passive nodes: material runs separator to separator, so a carousel lane carrying no TRO is traversed rather than treated as a dead end. Without that, a lone separator on a spur loop would be reported as an orphan purely as an artifact of the model. Each TRO must connect to at least one other; otherwise an error file is written and the exit code is 3. Each TRO also carries a plant coordinate - the centroid of the components it was built from, so a 1Sep1Swi sits between its separator and its switch. Written into the DOT as a pos attribute (1:100), which dot ignores and "neato -n" can use to draw the diagram to scale. Types, function blocks, components and colours come exclusively from lib/tro_catalog.py. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
34 lines
1.1 KiB
Batchfile
34 lines
1.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
|
|
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"
|
|
|
|
"%PY%" "%SKEL_LIB%\tro_flow.py" %*
|
|
set "RC=%ERRORLEVEL%"
|
|
|
|
endlocal & exit /b %RC%
|