Verwendung der Config Basierten Sensor-Typisierung und Kabel Abfage mithilfe von BMK.cfg.

Hier evtl in Zukunft zusammenlegen der beiden Configs zu einer (-> Abklärung mit Fachabteilung)
This commit is contained in:
2025-06-13 11:00:34 +02:00
parent 68d1519853
commit 15187ab85f
2 changed files with 24 additions and 20 deletions
+6 -3
View File
@@ -83,6 +83,9 @@ def get_type_of_name_cfg(name):
return "unknown"
def get_attributes_of_insert(insert):
'''
Hier in Zukunft weniger Abfragen: IO und B und Reale_Position wird überflüssig wenn jeder Sensor nur noch eiun Block mit allen Attributen!
'''
id = ""
ld = dict()
typ = 'unknown'
@@ -95,7 +98,7 @@ def get_attributes_of_insert(insert):
ld[attr_tag] = attr_text
if attr_tag == "IO":
typ = get_type_of_name(attr_text)
typ = get_type_of_name_cfg(attr_text)
id = attr_text
#print(f"-- coord io {id}--: {attrib.dxf.insert}") # position des Blocks
pos = attrib.dxf.insert #Position aufzeichnen und bei Bedarf später mit REAL_POS überschreiben
@@ -103,7 +106,7 @@ def get_attributes_of_insert(insert):
if attr_tag == "B":
# Suche nach Sensoren
typ = get_type_of_name(attr_text)
typ = get_type_of_name_cfg(attr_text)
id = attr_text
pos = attrib.dxf.insert #Position aufzeichnen und bei Bedarf später mit REAL_POS überschreiben
ld["pos"] = (round(pos.x, 1), round(pos.y, 1))
@@ -155,7 +158,7 @@ def get_input_positions(msp) -> tuple:
def get_input_positions_iter(dxf_path) -> tuple:
return extract_input_positions(iterdxf.modelspace(dxf_path))
def create_mappings(positions:dict) -> dict:
def create_mappings(positions:dict) -> tuple:
unterverteiler_pfad = ""
dnamen = dict()
# sammle die Sensoren mit ihren zugehörigen Unterverteilern