Stufen 2 und 3 aus doc/Konzept_Layout_Hardware_SCL.md: - lib/hw_import.py: TIA-Import (*_TIA.xlsx, ohne openpyxl gelesen) + Positionsdatei (*_positionsconv.json) -> <projekt>_hw.json: je BMK Adresse, Index-Konstante, VERW, Station, Lage, Foerderer (K0102, #106 -> K0106); Antriebe MA/FC/GF; Gegenpruefung beider Quellen. - lib/merge_hw_layout.py: <csv>_tro.json + <projekt>_hw.json -> <csv>_anlage.json (model.AnlageDocument): bindings je TRO-ID + Slot + Rolle mit Konstante und Adresse, Foerderer per Mehrheit (Mubea: K0102 = Kreisel3, K0104 = Kreisel2, K0105 = Kreisel1), Handkorrekturen cfg/hw_overrides.ini. Zuordnungslogik aus e_planning.py hierher verschoben; e_planning re-exportiert sie, Ergebnis unveraendert. - TRO-JSON traegt optional `parts` (Lage/Huellbox, tro_flow --json), PinStore bekommt Slots line<n>. - Gespeicherter Lagebezug mit SHA-256 der Positionsdatei; Unterordner in Eingabenamen relativ zu SKEL_DATA. - Doku: Python_Scripts.md 5d/5e, Konzept, E-Planung_Bruecke (Abgleich mubea_layout.dxf / CSV / E-Planung). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.3 KiB
Bash
35 lines
1.3 KiB
Bash
#!/usr/bin/env bash
|
|
# ================================================================
|
|
# SPS_SKEL - Hardwareplanung einlesen (TIA-Import + Positionsdatei)
|
|
# ================================================================
|
|
# Aufruf:
|
|
# bash bin/hw_import.sh --tia Mubea/mubea-1_TIA.xlsx --positions Mubea/Mubea_positionsconv.json
|
|
# bash bin/hw_import.sh --tia mubea-1_TIA.xlsx --project Mubea
|
|
#
|
|
# TIA-Import und *_positionsconv.json bzw. *_positionsdraw.json werden in
|
|
# $SKEL_DATA gesucht (auch mit Unterordner, oder als Pfad angegeben).
|
|
# Ergebnis <projekt>_hw.json und Bericht <projekt>_hw.md in $SKEL_RESULTS.
|
|
#
|
|
# Weiter: bin/merge_hw_layout.sh --tro <csv>_tro.json --hw <projekt>_hw.json
|
|
# ================================================================
|
|
|
|
set -eu
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
# Umgebung setzen (SKEL_DATA, SKEL_RESULTS, SKEL_LIB, PYTHONPATH ...)
|
|
# shellcheck source=/dev/null
|
|
. "$SCRIPT_DIR/setenv.sh" >/dev/null
|
|
|
|
# Virtuelle Umgebung nutzen, falls vorhanden (pydantic wird benoetigt)
|
|
if [ -f "$SPS_SKEL/.venv/bin/activate" ]; then
|
|
# shellcheck source=/dev/null
|
|
. "$SPS_SKEL/.venv/bin/activate"
|
|
fi
|
|
|
|
# Python-Interpreter bestimmen
|
|
PY="python3"
|
|
command -v python3 >/dev/null 2>&1 || PY="python"
|
|
|
|
exec "$PY" "$SKEL_LIB/hw_import.py" "$@"
|