hw_import + merge_hw_layout: Hardwareplanung einlesen und mit dem Layout zusammenfuehren
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>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c4122b4497
commit
df24cf5adb
+15
-1
@@ -179,7 +179,7 @@ from material_flow import (
|
||||
resolve_input,
|
||||
)
|
||||
from kreisel_junctions import Junction, find_junctions
|
||||
from model import Analysis, DerivedTro, TroDocument
|
||||
from model import Analysis, DerivedTro, LayoutPart, TroDocument
|
||||
from parameter import get_float, get_int
|
||||
from tro_ids import (
|
||||
DEFAULT_TOLERANCE,
|
||||
@@ -2210,6 +2210,19 @@ def _tro_label(tro: DerivedTro) -> str:
|
||||
return _dot_label(lines)
|
||||
|
||||
|
||||
def layout_parts(elements: list[Element]) -> list[LayoutPart]:
|
||||
"""Alle Bauteile mit Lage fuer die TRO-JSON (``parts``).
|
||||
|
||||
Ziel der raeumlichen Zuordnung in merge_hw_layout: Separatoren, Aus-/
|
||||
Einschleuselemente, Weichen, Scanner, Foerderer (mit Huellbox).
|
||||
"""
|
||||
return [
|
||||
LayoutPart(layout_id=e.teile_id, kind=e.kind, name=e.name,
|
||||
position=e.position, bbox=e.bbox)
|
||||
for e in elements if e.position is not None
|
||||
]
|
||||
|
||||
|
||||
def missing_positions(analysis: Analysis) -> list[str]:
|
||||
"""TROs/Systemgrenzen ohne Koordinate - mit ihnen ist kein lagerichtiges
|
||||
Layout moeglich (auch eine Systemgrenze wird als Knoten gezeichnet)."""
|
||||
@@ -3312,6 +3325,7 @@ def main(argv: list[str] | None = None) -> int:
|
||||
analysis, source=csv_file.name,
|
||||
note="Aus dem CSV-Export abgeleitet (lib/tro_flow.py) - die "
|
||||
"Zeichnung ist nur Ansicht, keine Datenquelle.",
|
||||
parts=layout_parts(elements),
|
||||
)
|
||||
json_target.write_text(document.to_json(), encoding="utf-8")
|
||||
json_file = json_target
|
||||
|
||||
Reference in New Issue
Block a user