s.ayadi 035c86ced9 Draw the TRO flow to scale with neato via --use-cords
Adds a --use-cords switch to tro_flow.py (--use-coords accepted too). With it,
every TRO node carries its plant coordinate as a pos attribute and the SVG is
produced by "neato -n" instead of dot, so the diagram looks like the plant
layout rather than a computed left-to-right flow.

Scale is 0.25 pt/mm (COORD_SCALE), which turns the ~11 x 20 m plant into roughly
2800 x 5000 pt - large enough that the TRO boxes do not overlap. Without the
switch the pos attributes stay in the DOT as information only, at 1:100, and dot
ignores them; the default layout is unchanged.

Two details neato -n needs: the legend gets a position of its own, placed below
left of the plant bounding box, because with -n a node without pos would land at
0,0 in the middle of the drawing. And the switch is refused with a clear message
if any TRO has no coordinate, since -n cannot lay out a graph with missing
positions.

Verified that neato -n reproduces the given coordinates: the positions it reports
back differ from the input by a constant offset only (spread 0.08 pt, from
Graphviz moving the drawing into the positive quadrant), and no node distance
changes by more than 0.08 pt over spans of up to 3600 pt.

graph_to_svg() in material_flow.py replaces dot_to_svg() to take an engine and
the no-op flag; dot_to_svg() stays as a thin wrapper. It now also treats output
on stderr as an error, so neato's "node has no position" warnings do not pass
silently.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:24:14 +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%
Shell 4%
Batchfile 3.9%
Common Lisp 0.1%