977b5c826e8208fd3de9c932367e4e8438b99018
Takes the original DXF, the CSV export and the derived TROs and writes a copy of the drawing with the TRO information overlaid. The original is never touched. Per TRO a block marker with attributes, not loose geometry: one block definition per type (TRO_SYM_<type>), inserted at the plant coordinate, carrying TRO_ID, TRO_TYPE, FB_BLOCK visibly and ITEMS, CONFIDENCE, SEPARATORS as hidden data. That makes the result queryable and editable inside BricsCAD, and a corrected TRO_ID can later feed back into the generator. Layers follow the colour groups of tro_catalog (TRO_MARKER_sep, _vario, _store, ...) with the group colour as true colour and entities BYLAYER, so the layer manager filters by TRO type. Flow arrows and the legend get their own layers. Re-runs are idempotent through XDATA, not layer names: every generated entity is tagged with the SPS_SKEL_TRO appid and a re-run deletes exactly those. Deleting by layer would also destroy anything a user had put on the same layer. Switches follow the other tools; --check reports the registration and what would be drawn without writing, --flow adds the TRO-level arrows, --fb shows the function block, --offset and --re-register override the stored transform. DWG is rejected with a clear message since ezdxf cannot read it. Verified against the real 23.8 MB drawing: 9 markers on the correct layers with readable attributes, 15 flow arrows, and a re-run replaces its own 46 entities instead of duplicating them. Adds ezdxf to requirements and stores the verified Mubea transform in cfg/. 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%