4454af51651712c3d7bb22fcbcd0c2837aa9952b
Reads the CSV export of the plant objects (ILS 2.0) from SKEL_DATA and builds a
directed graph of the material flow, written as Graphviz DOT and optionally SVG
into SKEL_RESULTS.
Node model: one node per Gefaellestrecke and Strecke; a Kreisel becomes two
nodes (-L / -R) wired into a circle, since it is a carousel with one lane per
travel direction. Separators and scanners are no nodes of their own; they are
shown on the label of the object they are assigned to.
Edge direction is not in the CSV - the Nachbarn column is symmetric. It is
derived from geometry instead: a Gefaellestrecke runs downhill away from its
highest neighbour, a driven Strecke follows Antriebfahrtrichtung ("Auf" uphill,
"Ab" downhill). Connections that stay ambiguous, e.g. between two Kreisel at the
same height, are drawn as bidirectional edges and reported.
The lane suffix of a Kreisel is always stated in the *partner's* row, so both
viewpoints of a link are merged before orienting it.
Switches:
--file name of the CSV in SKEL_DATA, or a full path
--tosvg render the DOT via Graphviz
--doc write a Markdown documentation of the plant objects
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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)
Languages
Python
92%
Shell
4%
Batchfile
3.9%
Common Lisp
0.1%