s.ayadi 849e985008 Add TRO flow program deriving the control objects from the layout
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>
2026-07-30 13:13:45 +02:00
2026-07-20 16:28:31 +02:00

sps_skel

Das Programm erhält ein mechanische Layout von der Projektierung oder Angebotswesen zusammen mit dem elektronischen Layout mit der Liste aller Sensoren, Stopper, etc. Daraus erstellt es dann ein Skelett für die SPS Programmierung, welches direkt ins TIA Portal importiert werden kann.

Projektstruktur

sps_skel/
  bin/                      Skripte zur Umgebungsverwaltung
    setenv.bat/.sh          Umgebungsvariablen setzen
    install_py.bat/.sh      venv erstellen + pip install
    activate_venv.bat/.sh   venv aktivieren
    get_cmd.bat/.sh         Shell mit Umgebung oeffnen
  cfg/                      Konfigurationsdateien (INI/JSON)
  data/                     Eingabedaten (nicht im Git)
  doc/                      Dokumentation
  examples/                 Beispieldateien
  lib/                      Python-Quellcode / Bibliothek
  log/                      Log-Dateien (nicht im Git)
  results/                  Ergebnisse / Ausgaben (nicht im Git)
  tests/                    Unit Tests
  .gitignore
  LICENSE
  README.md
  requirements.txt

Umgebungsvariablen

Variable Beschreibung
SPS_SKEL Wurzelverzeichnis
SKEL_BIN Skriptverzeichnis
SKEL_LIB Python-Quellcode
SKEL_CFG Konfigurationsdateien
SKEL_DATA Eingabedaten
SKEL_LOG Log-Dateien
SKEL_RESULTS Ergebnisse
SKEL_EXAMPLES Beispieldateien
PYTHONPATH Erweitert um SKEL_LIB

Installation

Voraussetzungen

  • Python 3.10 oder hoeher

Setup (Windows)

bin\install_py.bat

Setup (Linux / macOS)

bash bin/install_py.sh

Nutzung

Umgebung setzen

bin\setenv.bat              # Windows
source bin/setenv.sh        # Linux / macOS

Shell mit gesetzten Variablen oeffnen

bin\get_cmd.bat             # Windows
source bin/get_cmd.sh       # Linux / macOS

venv aktivieren

bin\activate_venv.bat       # Windows
source bin/activate_venv.sh # Linux / macOS

Lizenz

MIT License - siehe LICENSE

Autor

Michael Stangl (GitHub: mistamichael)

S
Description
No description provided
Readme MIT 25 MiB
Languages
Python 92.9%
Shell 3.5%
Batchfile 3.5%