Fehler-Handling erweitert: Warnings die bei erstellung des Mappings entstehen werden durch routing hindurch bis nach drawdxf geleitet und in Excel ausgabe geschrieben.
This commit is contained in:
+7
-4
@@ -144,11 +144,13 @@ def prepare_data(rawdata:dict):
|
||||
|
||||
dtunlength = rawdata["tunnels"]["length"]
|
||||
|
||||
# Fehler, welche im getpositions auftreten weiterführen: im Layout fehlende Dists / Sensoren / fehlende Attribute
|
||||
errors_dists = rawdata["not_found"]["missing_distributors"]
|
||||
errors_sensors = rawdata["not_found"]["missing_sensors"]
|
||||
errors_attributes = rawdata["not_found"]["missing_attributes"]
|
||||
|
||||
|
||||
return (dracks, dsensors, dsubdists, mapping, dtunnels, dtunlength, errors_dists, errors_sensors)
|
||||
return (dracks, dsensors, dsubdists, mapping, dtunnels, dtunlength, errors_dists, errors_sensors, errors_attributes)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
@@ -170,7 +172,7 @@ if __name__ == "__main__":
|
||||
|
||||
# Einlesen und Vorbereiten der Daten
|
||||
rawdata = load_json(sensors_path)
|
||||
(racks, sensors, subdists, mapping, tunnels, tunlength, errors_dists, errors_sensors) = prepare_data(rawdata)
|
||||
(racks, sensors, subdists, mapping, tunnels, tunlength, errors_dists, errors_sensors, errors_attributes) = prepare_data(rawdata)
|
||||
|
||||
config = configparser.ConfigParser(allow_no_value=True, delimiters=("="))
|
||||
config.optionxform = lambda option: option # preserve case for letters
|
||||
@@ -191,8 +193,9 @@ if __name__ == "__main__":
|
||||
# Ausgabe schreiben
|
||||
if args.write:
|
||||
basename = os.path.splitext(args.write)[0]
|
||||
cable_paths["errors_existing_dists"] = errors_dists
|
||||
cable_paths["errors_existing_sensors"] = errors_sensors
|
||||
cable_paths["errors_dists_not_in_layout"] = errors_dists
|
||||
cable_paths["errors_sensors_not_in_layout"] = errors_sensors
|
||||
cable_paths["errors_missing_attributes"] = errors_attributes
|
||||
write_results(to_json(cable_paths), work_dir, f"{basename}.json")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user