Neue Blöcke erfordern Änderungen am Parser
This commit is contained in:
+18
-8
@@ -71,20 +71,23 @@ def get_attributes_of_insert(d_insert: dict, d_pos: dict) -> tuple[dict, str, st
|
||||
typ = 'unknown'
|
||||
|
||||
# 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"]
|
||||
if "IO" in d_insert:
|
||||
pos = d_pos["IO"]
|
||||
typ = get_type_of_name_cfg(d_insert["IO"])
|
||||
|
||||
if "ARTINR" in d_insert and "SPS" in d_insert:
|
||||
id_ = d_insert["IO"]+"@"+d_insert["SPS"]
|
||||
ld["pos"] = (pos[0], pos[1])
|
||||
|
||||
if "IO" in d_insert:
|
||||
attr_text = d_insert["IO"]
|
||||
typ = get_type_of_name_cfg(attr_text)
|
||||
if "REALE_POSITION" in d_insert and d_insert["REALE_POSITION"] == 'x':
|
||||
pos = d_pos["REALE_POSITION"]
|
||||
|
||||
else:
|
||||
|
||||
id_ = d_insert["IO"]
|
||||
# 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":
|
||||
id_ = id_+"@"+d_insert["SPS"]
|
||||
pos = d_pos["IO"]
|
||||
|
||||
if "REALE_POSITION" in d_insert and d_insert["REALE_POSITION"] == 'x':
|
||||
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:
|
||||
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:
|
||||
attr_text = d_insert["B"]
|
||||
typ = get_type_of_name_cfg(attr_text)
|
||||
|
||||
Reference in New Issue
Block a user