die CPs bei TEFWeiche sind korrigiert.

This commit is contained in:
2025-09-19 09:03:07 +02:00
parent 49b9ddf3b0
commit 409455d826
30 changed files with 3419 additions and 3419 deletions
@@ -147,26 +147,26 @@ def process_files(json_file_path, txt_files_dir):
# Print final statistics
print("\n" + "="*50)
print("Processing Complete - Summary:")
print(f"JSON文件总项数: {len(json_data)}")
print(f"JSON中 SivasnrTEF 不为 null 的项数: {len(sivasnr_mapping)}")
print(f"未匹配的JSON项数: {len(unmatched_json_items)}")
print(f"TXT目录中找到的文件数: {total_files}")
print(f"在JSON中找到匹配的TXT文件数: {matched_files}")
print(f"成功处理的文件数: {processed_files}")
print(f"Total items in JSON: {len(json_data)}")
print(f"JSON items with non-null SivasnrTEF: {len(sivasnr_mapping)}")
print(f"Unmatched JSON items: {len(unmatched_json_items)}")
print(f"Files found in TXT directory: {total_files}")
print(f"TXT files matched in JSON: {matched_files}")
print(f"Successfully processed files: {processed_files}")
if matched_files > 0:
success_rate = (processed_files / matched_files) * 100
print(f"处理成功率: {success_rate:.2f}%")
# 再次显示未匹配的JSON项统计
print(f"Processing success rate: {success_rate:.2f}%")
# Show unmatched JSON items statistics again
if unmatched_json_items:
print(f"\n注意: 有 {len(unmatched_json_items)} JSON项 (SivasnrTEF不为null) 在TXT目录中没有对应的文件")
print("这些项可能需要手动检查或创建对应的TXT文件")
print("="*50)
print(f"\nNote: {len(unmatched_json_items)} JSON items (with non-null SivasnrTEF) have no corresponding files in the TXT directory")
print("These items may require manual checking or creation of corresponding TXT files")
print("="*50)
if __name__ == "__main__":
json_path = os.environ.get("JSON_PATH_TEFWEICH", "JSON")
json_path = os.environ.get("JSON_PATH_TEFWEICHE", "json")
json_file_path = os.path.join(json_path, "omniflo_TEF_weichen_output.json")
txt_files_dir = r"C:\Program Files\RuleDesigner\RDConfigurator Fusion\WebApi\Editor2D\SSG\shapes\props"
txt_files_dir = os.environ.get("PROPS_PATH", "props")
process_files(json_file_path, txt_files_dir)
@@ -324,7 +324,7 @@
"OFWeiche_CP1_y_mm": 721.216,
"OFWeiche_CP2_x_mm": 0,
"OFWeiche_CP2_y_mm": 21.040,
"OFWeiche_CP3_x_mm": 400.739,
"OFWeiche_CP3_x_mm": 1400.739,
"OFWeiche_CP3_y_mm": 21.040,
"TEFWeiche_CPL1_x_mm": 600.360,
"TEFWeiche_CPL1_y_mm": 859.292,
@@ -349,7 +349,7 @@
"OFWeiche_CP1_y_mm": 721.216,
"OFWeiche_CP2_x_mm": 0,
"OFWeiche_CP2_y_mm": 21.040,
"OFWeiche_CP3_x_mm": 400.739,
"OFWeiche_CP3_x_mm": 1400.739,
"OFWeiche_CP3_y_mm": 21.040,
"TEFWeiche_CPR1_x_mm": 800.380,
"TEFWeiche_CPR1_y_mm": 859.67,
@@ -374,7 +374,7 @@
"OFWeiche_CP1_y_mm": 721.216,
"OFWeiche_CP2_x_mm": 0,
"OFWeiche_CP2_y_mm": 21.040,
"OFWeiche_CP3_x_mm": 400.739,
"OFWeiche_CP3_x_mm": 1400.739,
"OFWeiche_CP3_y_mm": 21.040,
"TEFWeiche_CPL1_x_mm": 600.360,
"TEFWeiche_CPL1_y_mm": 859.292,
@@ -433,12 +433,12 @@
"OFWeiche_CP2_y_mm": 14.8778,
"OFWeiche_CP3_x_mm": 715.1357,
"OFWeiche_CP3_y_mm": 14.8778,
"OFWeiche_CP4_x_mm": 365.0067,
"OFWeiche_CP4_y_mm": 355.0010,
"TEFWeiche_CPR1_x_mm": 465.0167,
"TEFWeiche_CPR1_y_mm": 858.3085,
"TEFWeiche_CPR2_x_mm": 785.7270,
"TEFWeiche_CPR2_y_mm": 85.7221,
"OFWeiche_CP4_x_mm": 442.8527,
"OFWeiche_CP4_y_mm": 355.0010,
"KurvenRichtung": 7,
"SivasnrTEF": "0_B10090+0_B10090"
},
@@ -574,7 +574,7 @@
"OFWeiche_CP1_y_mm": 721.216,
"OFWeiche_CP2_x_mm": 0,
"OFWeiche_CP2_y_mm": 21.040,
"OFWeiche_CP3_x_mm": 400.739,
"OFWeiche_CP3_x_mm": 1400.739,
"OFWeiche_CP3_y_mm": 21.040,
"OFWeiche_CP4_x_mm": 700.370,
"OFWeiche_CP4_y_mm": 361.216,
@@ -601,7 +601,7 @@
"OFWeiche_CP1_y_mm": 721.216,
"OFWeiche_CP2_x_mm": 0,
"OFWeiche_CP2_y_mm": 21.040,
"OFWeiche_CP3_x_mm": 400.739,
"OFWeiche_CP3_x_mm": 1400.739,
"OFWeiche_CP3_y_mm": 21.040,
"OFWeiche_CP4_x_mm": 700.370,
"OFWeiche_CP4_y_mm": 361.216,
@@ -628,7 +628,7 @@
"OFWeiche_CP1_y_mm": 721.216,
"OFWeiche_CP2_x_mm": 0,
"OFWeiche_CP2_y_mm": 21.040,
"OFWeiche_CP3_x_mm": 400.739,
"OFWeiche_CP3_x_mm": 1400.739,
"OFWeiche_CP3_y_mm": 21.040,
"OFWeiche_CP4_x_mm": 700.370,
"OFWeiche_CP4_y_mm": 361.216,
@@ -879,7 +879,7 @@
"OFWeiche_CP1_y_mm": 721.216,
"OFWeiche_CP2_x_mm": 0,
"OFWeiche_CP2_y_mm": 21.04,
"OFWeiche_CP3_x_mm": 400.739,
"OFWeiche_CP3_x_mm": 1400.739,
"OFWeiche_CP3_y_mm": 21.04,
"TEFWeiche_CPL1_x_mm": 600.36,
"TEFWeiche_CPL1_y_mm": 859.292,
@@ -911,7 +911,7 @@
},
{
"id": "cp3",
"x": 286.091,
"x": 1000.0,
"y": 24.485,
"direction": 90,
"linkClass": "Omniflo"
@@ -948,7 +948,7 @@
"OFWeiche_CP1_y_mm": 721.216,
"OFWeiche_CP2_x_mm": 0,
"OFWeiche_CP2_y_mm": 21.04,
"OFWeiche_CP3_x_mm": 400.739,
"OFWeiche_CP3_x_mm": 1400.739,
"OFWeiche_CP3_y_mm": 21.04,
"TEFWeiche_CPR1_x_mm": 800.38,
"TEFWeiche_CPR1_y_mm": 859.67,
@@ -980,7 +980,7 @@
},
{
"id": "cp3",
"x": 286.091,
"x": 1000.0,
"y": 24.475,
"direction": 90,
"linkClass": "Omniflo"
@@ -1017,7 +1017,7 @@
"OFWeiche_CP1_y_mm": 721.216,
"OFWeiche_CP2_x_mm": 0,
"OFWeiche_CP2_y_mm": 21.04,
"OFWeiche_CP3_x_mm": 400.739,
"OFWeiche_CP3_x_mm": 1400.739,
"OFWeiche_CP3_y_mm": 21.04,
"TEFWeiche_CPL1_x_mm": 600.36,
"TEFWeiche_CPL1_y_mm": 859.292,
@@ -1053,7 +1053,7 @@
},
{
"id": "cp3",
"x": 286.091,
"x": 1000.0,
"y": 24.475,
"direction": 90,
"linkClass": "Omniflo"
@@ -1184,12 +1184,12 @@
"OFWeiche_CP2_y_mm": 14.8778,
"OFWeiche_CP3_x_mm": 715.1357,
"OFWeiche_CP3_y_mm": 14.8778,
"OFWeiche_CP4_x_mm": 365.0067,
"OFWeiche_CP4_y_mm": 355.001,
"TEFWeiche_CPR1_x_mm": 465.0167,
"TEFWeiche_CPR1_y_mm": 858.3085,
"TEFWeiche_CPR2_x_mm": 785.727,
"TEFWeiche_CPR2_y_mm": 85.7221,
"OFWeiche_CP4_x_mm": 442.8527,
"OFWeiche_CP4_y_mm": 355.001,
"KurvenRichtung": 7,
"SivasnrTEF": "0_B10090+0_B10090",
"Objekt_width_px": 3053.3253,
@@ -1223,7 +1223,7 @@
},
{
"id": "cp4",
"x": 548.181,
"x": 451.82,
"y": 413.605,
"direction": 0,
"linkClass": "Omniflo"
@@ -1608,7 +1608,7 @@
"OFWeiche_CP1_y_mm": 721.216,
"OFWeiche_CP2_x_mm": 0,
"OFWeiche_CP2_y_mm": 21.04,
"OFWeiche_CP3_x_mm": 400.739,
"OFWeiche_CP3_x_mm": 1400.739,
"OFWeiche_CP3_y_mm": 21.04,
"OFWeiche_CP4_x_mm": 700.37,
"OFWeiche_CP4_y_mm": 361.216,
@@ -1642,7 +1642,7 @@
},
{
"id": "cp3",
"x": 286.091,
"x": 1000.0,
"y": 24.485,
"direction": 90,
"linkClass": "Omniflo"
@@ -1686,7 +1686,7 @@
"OFWeiche_CP1_y_mm": 721.216,
"OFWeiche_CP2_x_mm": 0,
"OFWeiche_CP2_y_mm": 21.04,
"OFWeiche_CP3_x_mm": 400.739,
"OFWeiche_CP3_x_mm": 1400.739,
"OFWeiche_CP3_y_mm": 21.04,
"OFWeiche_CP4_x_mm": 700.37,
"OFWeiche_CP4_y_mm": 361.216,
@@ -1720,7 +1720,7 @@
},
{
"id": "cp3",
"x": 286.091,
"x": 1000.0,
"y": 24.475,
"direction": 90,
"linkClass": "Omniflo"
@@ -1764,7 +1764,7 @@
"OFWeiche_CP1_y_mm": 721.216,
"OFWeiche_CP2_x_mm": 0,
"OFWeiche_CP2_y_mm": 21.04,
"OFWeiche_CP3_x_mm": 400.739,
"OFWeiche_CP3_x_mm": 1400.739,
"OFWeiche_CP3_y_mm": 21.04,
"OFWeiche_CP4_x_mm": 700.37,
"OFWeiche_CP4_y_mm": 361.216,
@@ -1802,7 +1802,7 @@
},
{
"id": "cp3",
"x": 286.091,
"x": 1000.0,
"y": 24.475,
"direction": 90,
"linkClass": "Omniflo"