Neue Blöcke erfordern Änderungen am Parser

This commit is contained in:
2025-07-21 12:14:15 +02:00
parent 51ecd84d67
commit ad1c053af3
+18 -8
View File
@@ -71,20 +71,23 @@ def get_attributes_of_insert(d_insert: dict, d_pos: dict) -> tuple[dict, str, st
typ = 'unknown' typ = 'unknown'
# die neueren Bläcke heissen nicht IO, sondern haben einen Namen # die neueren Bläcke heissen nicht IO, sondern haben einen Namen
if "NAME" in d_insert: if "IO" in d_insert:
typ = get_type_of_name_cfg(d_insert["NAME"]) pos = d_pos["IO"]
id_ = d_insert["NAME"] typ = get_type_of_name_cfg(d_insert["IO"])
pos = d_pos["NAME"]
if "ARTINR" in d_insert and "SPS" in d_insert:
id_ = d_insert["IO"]+"@"+d_insert["SPS"]
ld["pos"] = (pos[0], pos[1]) ld["pos"] = (pos[0], pos[1])
if "IO" in d_insert: if "REALE_POSITION" in d_insert and d_insert["REALE_POSITION"] == 'x':
attr_text = d_insert["IO"] pos = d_pos["REALE_POSITION"]
typ = get_type_of_name_cfg(attr_text)
else:
id_ = d_insert["IO"] id_ = d_insert["IO"]
# Sensoren werden später gemerged mit den anderen Blöcken des Rahmens mit A,B,C, usw # Sensoren werden später gemerged mit den anderen Blöcken des Rahmens mit A,B,C, usw
if "SPS" in d_insert and typ != "Sensor": if "SPS" in d_insert and typ != "Sensor":
id_ = id_+"@"+d_insert["SPS"] id_ = id_+"@"+d_insert["SPS"]
pos = d_pos["IO"]
if "REALE_POSITION" in d_insert and d_insert["REALE_POSITION"] == 'x': if "REALE_POSITION" in d_insert and d_insert["REALE_POSITION"] == 'x':
pos = d_pos["REALE_POSITION"] pos = d_pos["REALE_POSITION"]
@@ -98,6 +101,13 @@ def get_attributes_of_insert(d_insert: dict, d_pos: dict) -> tuple[dict, str, st
else: else:
ld["pos"] = (pos[0], pos[1]) ld["pos"] = (pos[0], pos[1])
# die neueren Bläcke heissen nicht IO, sondern haben einen Namen
if "NAME" in d_insert:
typ = get_type_of_name_cfg(d_insert["NAME"])
id_ = d_insert["NAME"]
pos = d_pos["NAME"]
ld["pos"] = (pos[0], pos[1])
if "B" in d_insert: if "B" in d_insert:
attr_text = d_insert["B"] attr_text = d_insert["B"]
typ = get_type_of_name_cfg(attr_text) typ = get_type_of_name_cfg(attr_text)