Abfrage ob es Fehler gibt bevor Fehler Worksheet erstellt werden

This commit is contained in:
2025-06-04 14:26:44 +02:00
parent c0f8025a92
commit 36f13a736e
+3
View File
@@ -148,6 +148,7 @@ def write_excel_from_json(plines:Polylines, outpath:str):
for rlength in sorted(length_summary): for rlength in sorted(length_summary):
ws2.append([int(rlength), length_summary[rlength]]) ws2.append([int(rlength), length_summary[rlength]])
if len(plines.errors_existing_sensors) > 0 or len(plines.errors_dists) > 0:
# Worksheet 3 - Nicht an Racks gekoppeltes Equipment # Worksheet 3 - Nicht an Racks gekoppeltes Equipment
ws3 = wb.create_sheet("Not connected Equipment") ws3 = wb.create_sheet("Not connected Equipment")
ws3.append(["Type", "ID", "x", "y"]) ws3.append(["Type", "ID", "x", "y"])
@@ -157,6 +158,8 @@ def write_excel_from_json(plines:Polylines, outpath:str):
for error in plines.errors_dists: for error in plines.errors_dists:
ws3.append(["Subistributor", error.name, error.coords.x, error.coords.y]) ws3.append(["Subistributor", error.name, error.coords.x, error.coords.y])
if len(plines.errors_routing) > 0:
# Worksheet 4 - Fehlgeschlagenes Routing # Worksheet 4 - Fehlgeschlagenes Routing
ws4 = wb.create_sheet("Routing Errors") ws4 = wb.create_sheet("Routing Errors")
ws4.append(["Subdistributor", "Sensor / Actuator", "Details"]) ws4.append(["Subdistributor", "Sensor / Actuator", "Details"])