Fehlende .bat für den Aufruf von diff_dimensions.bat hinzugefügt. Differenz wird nun zusätzlich für jedes Element in die Ergebnisdatei geschrieben

This commit is contained in:
2025-07-11 10:46:12 +02:00
parent 634a71e26b
commit f7331611fd
3 changed files with 10 additions and 4 deletions
@@ -3,4 +3,4 @@ REM ~dp0 steht für das Verzeichnis, in der diese Datei liegt
call setenv.bat
python "%PROJECT_LIB%\merge_dimensions.py" %*
python "%PROJECT_LIB%\diff_dimensions.py" %*
+4
View File
@@ -0,0 +1,4 @@
@echo off
REM ~dp0 steht für das Verzeichnis, in der diese Datei liegt
call diff_dimensions.bat --type WEICHE --json_2d omniflo_weichen.json --json_dimensions dimensions.json --tolerance 0.05
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""
JSON Integration Script
Integriert Daten aus JSON_1 in JSON_2 über die Sivasnr
Erzeugt neue JSON Datei mit den SIVAS-Nummern, dessen Maße von 3D (.par) und 2D (.dwg) nicht übereinstimmen.
"""
import json
@@ -104,13 +104,15 @@ def integrate_json_data(json_dimensions_data, json_2d_data, tolerance):
integrated_item = {
'Sivasnr': sivasnr, # Verwende die ursprüngliche Sivasnr aus json_2d_data
'Objekt_width_mm': dimensions_width,
'Objekt_height_mm': dimensions_height
'Objekt_height_mm': dimensions_height,
'w_diff': round(width_diff, 3),
'h_diff': round(height_diff,3),
'tolerance': tolerance
}
# Weitere Attribute aus json_dimensions_data hinzufügen (falls vorhanden)
for key, value in json_dimensions_item.items():
if key not in ['breite', 'hoehe']:
integrated_item[key] = value
integrated_data.append(integrated_item)
updated_count += 1
else: