tro_annotate --anlage: Staubereiche in der Zeichnung, --read-jams zurueck
Mit --anlage <csv>_anlage.json zeichnet tro_annotate je Staubereich einen Block JAM_AREA (Layer TRO_JAM): Rechteck mit dem Namen Jam<NNNN>_<k> wie in der SCL, jam_versatz vor dem Separator Richtung Vorgaenger. Attribute CONVEYOR, NUMBER, TRO + ENTRY (stabiler Schluessel), AREA, AUTO. Doppelklick oeffnet den Dialog JAM_EDIT (dxfmakros). --read-jams uebernimmt im Dialog geaenderte Nummern aus der beschrifteten Zeichnung nach cfg/<csv>_jam_names.ini (nur Abweichungen von AUTO); scl_skeleton wendet die Datei mit der Anlagen-JSON an (scl_context: jam_numbers + Korrekturen, load/save_jam_overrides). Dematic: 25 Staubereiche gezeichnet; Rundreise TRO20 -> Jam0054_9 bis in die SCL geprueft. Gemeinsame Zeichnung mit --offset 0,0 beschriften (automatischer Lagebezug waehlte dy +360 mm). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+22
-2
@@ -43,6 +43,7 @@ Aufruf ueber bin/scl_skeleton.bat bzw. bin/scl_skeleton.sh.
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import configparser
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
@@ -60,7 +61,15 @@ from e_planning import EPLAN_SCHEMA, EplanDocument
|
||||
from hw_import import HardwareDocument
|
||||
from material_flow import env_dir
|
||||
from model import ANLAGE_SCHEMA, SCHEMA, AnlageDocument, TroDocument
|
||||
from scl_context import TODO, SclFile, SclName, SclTro, build_context
|
||||
from scl_context import (
|
||||
JAM_NAMES_SUFFIX,
|
||||
TODO,
|
||||
SclFile,
|
||||
SclName,
|
||||
SclTro,
|
||||
build_context,
|
||||
load_jam_overrides,
|
||||
)
|
||||
|
||||
# Parametrisierte Aufrufstellen je FB (doc/SCL_Templates.md); Dateiname = fbType.
|
||||
TEMPLATE_DIR = Path(__file__).resolve().parent / "scl_templates"
|
||||
@@ -466,8 +475,17 @@ def main(argv: list[str] | None = None) -> int:
|
||||
f"TRO-JSON zu '{document.source}'.", file=sys.stderr)
|
||||
return 1
|
||||
|
||||
# Staubereichs-Nummern, im Dialog JAM_EDIT geaendert und mit
|
||||
# tro_annotate --read-jams uebernommen (nur mit Anlagen-JSON wirksam)
|
||||
jam_file = env_dir("SKEL_CFG", "cfg") / f"{Path(document.source).stem}{JAM_NAMES_SUFFIX}"
|
||||
try:
|
||||
jam_overrides = load_jam_overrides(jam_file) if anlage is not None else {}
|
||||
except (OSError, ValueError, configparser.Error) as exc:
|
||||
print(f"FEHLER: Staubereichs-Korrekturen nicht lesbar: {exc}", file=sys.stderr)
|
||||
return 1
|
||||
|
||||
context = build_context(document, json_file.name, args.start, eplan=eplan,
|
||||
anlage=anlage)
|
||||
anlage=anlage, jam_overrides=jam_overrides)
|
||||
mit, ohne = template_usage(context, templates)
|
||||
if args.strict and ohne:
|
||||
print(f"FEHLER: kein Template fuer {', '.join(ohne)} (--strict) - "
|
||||
@@ -530,6 +548,8 @@ def main(argv: list[str] | None = None) -> int:
|
||||
print(f"Eingesetzt = {len(known_names(context))} Namen aus der Anlagen-JSON")
|
||||
if hw_file is not None:
|
||||
print(f"Gegenpruefung = {len(unbekannt)} unbekannte Namen ({hw_file.name})")
|
||||
if jam_overrides:
|
||||
print(f"Staubereiche = {len(jam_overrides)} Korrekturen aus {jam_file}")
|
||||
print(f"Offene Stellen = {offen} (Marker '{TODO}')")
|
||||
print(f"SCL = {out_file}")
|
||||
print("================================================================")
|
||||
|
||||
Reference in New Issue
Block a user