POT Beispiel korrigiert. Octal Nummerierung eingebaut
This commit is contained in:
@@ -340,7 +340,7 @@
|
||||
"layout_type": "horizontal",
|
||||
"base_x": 1000,
|
||||
"base_y": 3000,
|
||||
"spacing": 1500
|
||||
"spacing": 2000
|
||||
},
|
||||
{
|
||||
"name": "POT-MA30@@",
|
||||
@@ -348,7 +348,7 @@
|
||||
"layout_type": "horizontal",
|
||||
"base_x": 1000,
|
||||
"base_y": 2000,
|
||||
"spacing": 1500
|
||||
"spacing": 2000
|
||||
},
|
||||
{
|
||||
"name": "POT-UC30@@",
|
||||
@@ -356,7 +356,7 @@
|
||||
"layout_type": "horizontal",
|
||||
"base_x": 1000,
|
||||
"base_y": 1000,
|
||||
"spacing": 1500
|
||||
"spacing": 2000
|
||||
}
|
||||
],
|
||||
"renaming_frames": [
|
||||
|
||||
@@ -90,6 +90,9 @@ class TestDataGenerator:
|
||||
{'name': '0', 'color': 7}, # Standard-Layer
|
||||
{'name': 'ILS_MOTOR', 'color': 7},
|
||||
{'name': 'ILS_RENAMER', 'color': 1}, # Rot
|
||||
{'name': 'ILS_Eingang', 'color': 7}, # BG-Symbole
|
||||
{'name': 'ILS_Ausgang', 'color': 7}, # MB-Symbole
|
||||
{'name': 'ILS_POT-Erdung', 'color': 7}, # POT-Symbole
|
||||
{'name': 'VALIDATION_ERROR', 'color': 1}, # Rot für Fehlerkreise
|
||||
{'name': 'TEXT-D', 'color': -7}, # Ausgeschaltet (negativ)
|
||||
{'name': 'TEXT-E', 'color': 7},
|
||||
@@ -604,6 +607,22 @@ class TestDataGenerator:
|
||||
print("Fehler: io-Block konnte nicht erstellt werden")
|
||||
return
|
||||
|
||||
# Prüfe ob POT-Symbole in der Scene verwendet werden
|
||||
if self.config and 'test_scenes' in self.config and scene_name in self.config['test_scenes']:
|
||||
scene = self.config['test_scenes'][scene_name]
|
||||
if 'pot_groups' in scene and scene['pot_groups']:
|
||||
print("POT-Symbole erkannt, lade ILS_POT-Erdung Block...")
|
||||
# Lade POT-Block aus Referenzdatei
|
||||
pot_reference_file = os.path.join(PROJECT, 'testdata', 'Nummerierung_IO.dxf')
|
||||
if os.path.exists(pot_reference_file):
|
||||
pot_block = self.load_block_from_file(pot_reference_file, 'ILS_POT-Erdung')
|
||||
if pot_block:
|
||||
print(f"POT-Block 'ILS_POT-Erdung' erfolgreich geladen")
|
||||
else:
|
||||
print(f"WARNUNG: POT-Block konnte nicht aus {pot_reference_file} geladen werden")
|
||||
else:
|
||||
print(f"WARNUNG: Referenzdatei {pot_reference_file} nicht gefunden")
|
||||
|
||||
# Wenn Config geladen ist, verwende sie, ansonsten Hard-coded Defaults
|
||||
if self.config and 'test_scenes' in self.config and scene_name in self.config['test_scenes']:
|
||||
print(f"Verwende JSON-Config für {scene_name}...")
|
||||
|
||||
@@ -344,7 +344,7 @@ def enumerate_symbols(symbols, attributes):
|
||||
# Ersetze @-Zeichen durch Zahlen
|
||||
# Zähle wie viele @ im Template sind
|
||||
at_count = name_template.count('@')
|
||||
number_str = str(counter).zfill(at_count)
|
||||
number_str = oct(counter)[2:].zfill(at_count)
|
||||
|
||||
# Aktualisiere Attribute im Symbol
|
||||
for attrib in symbol['entity'].attribs:
|
||||
|
||||
Reference in New Issue
Block a user