[FEAT] VF-Linienzug Modus 2+3: Segment-Gruppen-Dialoge + Highlight
Modus 2 (Pfad+Zielhoehe) und Modus 3 (Vorwaerts-Nachbau) fassen die je Segment unmittelbar aufeinanderfolgenden Fragen (Typ + ggf. Neigung/ Vario-Winkel/Variante) in EINEM Wizard-DCL-Dialog zusammen - analog zu Modus 1. Der Dialogkopf zeigt "Segment i/n ..."; das aktuelle Pfad-Segment (LINE/ARC) wird vorher per redraw-Highlight in der Zeichnung hervorgehoben. - Neue DCL-Dialoge: vflw_seg_linie_m2, vflw_seg_linie_m3, vflw_seg_bogen - Neue Helfer: vflw-seg-*-impl (fuellen *vflw-pending*), vfl-seg-highlight, vfl-seg-kopf - Modus 3 zusaetzlich: Kettenstart- und AS-Element-Gruppen-Dialog; AS-Winkel jetzt pending-aware ueber vfl-in-value - Bogen-Dialog: vario-erlaubt-Flag (Modus 3 nur im offenen VF-Lauf), sonst wuerde die unkonsumierte Variante-Antwort ins naechste Segment lecken Alles hinter (vfl-wizard-aktiv) - bei GUI-aus (Tests) faellt alles unveraendert auf Konsole/Replay zurueck. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+213
-5
@@ -845,6 +845,159 @@
|
||||
(if mit-ende (list (itoa (1+ (atoi gende)))) nil))))))
|
||||
(princ))
|
||||
|
||||
;; ============================================================
|
||||
;; TEIL 0b-4b: SEGMENT-GRUPPEN-DIALOGE (Modus 2 + Modus 3)
|
||||
;; ============================================================
|
||||
;; Modus 2 und Modus 3 gehen die Kette Segment fuer Segment durch und stellen
|
||||
;; je Segment mehrere unmittelbar aufeinanderfolgende Fragen (Typ + ggf.
|
||||
;; Neigung/Vario-Winkel/Variante). Diese werden - wie die uebrigen Gruppen -
|
||||
;; im Wizard in EINEM Dialog erfasst und die Antworten in *vflw-pending*
|
||||
;; abgelegt; die unveraenderten vfl-in-*/vfl-menu-Aufrufe im Segment-Loop
|
||||
;; konsumieren sie danach der Reihe nach. Der Dialog-Kopf zeigt immer
|
||||
;; "Segment i/n ..." (wie die Konsolen-Frage). Das jeweils abgefragte Segment
|
||||
;; wird VOR dem Dialog per vfl-seg-highlight in der Zeichnung hervorgehoben.
|
||||
;;
|
||||
;; Highlight: Segment-Entity (LINE/ARC) hervorheben (redraw-Modus 3) bzw.
|
||||
;; zuruecksetzen (0). ent darf nil sein (dann No-op) - der Aufrufer uebergibt
|
||||
;; (car (nth i kette)) als VLA-Objekt; wir wandeln in einen Ename fuer redraw.
|
||||
(defun vfl-seg-highlight (ent an / en)
|
||||
(if ent
|
||||
(progn
|
||||
(setq en (vl-catch-all-apply 'vlax-vla-object->ename (list ent)))
|
||||
(if (and en (not (vl-catch-all-error-p en)))
|
||||
(redraw en (if an 3 0)))))
|
||||
(princ))
|
||||
|
||||
;; Kopfzeile "Segment i/n: <Text>" fuer die Segment-Dialoge (i 1-basiert).
|
||||
(defun vfl-seg-kopf (i n txt)
|
||||
(strcat "Segment " (itoa i) "/" (itoa n) ": " txt))
|
||||
|
||||
;; --- Modus 2, Segment "Gerade": Typ (GF/VF) + [bei GF] Neigung ---
|
||||
;; Original-Reihenfolge/-Journal im Loop: vfl-menu (Typ), dann bei GF
|
||||
;; vfl-in-real (Neigung). Bei VF wird KEIN Neigungswert gefragt -> nur "2"
|
||||
;; in die Pending-Queue. neigung-default: Vorbelegung Neigungsfeld (Grad).
|
||||
(defun vflw-seg-linie-m2-impl (kopf-txt neigung-default / dat ergebnis gtyp gwert)
|
||||
(setq dat (load_dialog (vflw-dcl-pfad)))
|
||||
(if (not (new_dialog "vflw_seg_linie_m2" dat))
|
||||
(if (and dat (>= dat 0)) (unload_dialog dat))
|
||||
(progn
|
||||
(set_tile "kopf" (vflw-clean kopf-txt))
|
||||
(start_list "typ")
|
||||
(add_list (vflw-clean "GF (Neigungswinkel)"))
|
||||
(add_list (vflw-clean "VF (Bruecke)"))
|
||||
(end_list)
|
||||
(set_tile "typ" "0")
|
||||
(set_tile "wert" (rtos (float neigung-default) 2 1))
|
||||
;; Neigungsfeld nur bei GF (Index 0) aktiv.
|
||||
(action_tile "typ"
|
||||
"(mode_tile \"wert\" (if (= (get_tile \"typ\") \"0\") 0 1))")
|
||||
(action_tile "accept"
|
||||
"(setq gtyp (get_tile \"typ\")) (setq gwert (get_tile \"wert\")) (done_dialog 1)")
|
||||
(action_tile "cancel" "(done_dialog 0)")
|
||||
(setq ergebnis (start_dialog))
|
||||
(unload_dialog dat)
|
||||
(if (= ergebnis 1)
|
||||
(if (= gtyp "0")
|
||||
(vflw-pending-push-all (list "1" (atof gwert))) ; GF + Neigung
|
||||
(vflw-pending-push-all (list "2")))))) ; VF (keine Neigung)
|
||||
(princ))
|
||||
|
||||
;; --- Modus 3, Segment "Gerade": Typ (GF/VF-Ab/VF-Auf/VF-Hor) + Wert ---
|
||||
;; Original-Reihenfolge/-Journal im Loop: vfl-in-string (Typ "1".."4"), dann
|
||||
;; bei GF vfl-in-real (Neigung), bei VF-Ab/Auf vfl-in-int (Vario-Winkel), bei
|
||||
;; VF-Hor KEINE weitere Frage. neigung-default/vario-default: Vorbelegungen.
|
||||
(defun vflw-seg-linie-m3-impl (kopf-txt neigung-default vario-default /
|
||||
dat ergebnis gtyp gwert)
|
||||
(setq dat (load_dialog (vflw-dcl-pfad)))
|
||||
(if (not (new_dialog "vflw_seg_linie_m3" dat))
|
||||
(if (and dat (>= dat 0)) (unload_dialog dat))
|
||||
(progn
|
||||
(set_tile "kopf" (vflw-clean kopf-txt))
|
||||
(start_list "typ")
|
||||
(add_list (vflw-clean "GF (Neigungswinkel)"))
|
||||
(add_list (vflw-clean "VF-Ab"))
|
||||
(add_list (vflw-clean "VF-Auf"))
|
||||
(add_list (vflw-clean "VF-Horizontal"))
|
||||
(end_list)
|
||||
(set_tile "typ" "0")
|
||||
(set_tile "wlabel" "GF-Neigung (Grad):")
|
||||
(set_tile "wert" (rtos (float neigung-default) 2 1))
|
||||
;; Feld/Beschriftung schaltet mit dem Typ um: GF->Neigung, VF-Ab/Auf->
|
||||
;; Vario-Winkel, VF-Hor->deaktiviert. Werte-Defaults liegen als lokale
|
||||
;; Variablen vor und werden im Callback (dynamic scope) gelesen.
|
||||
(action_tile "typ"
|
||||
"(cond
|
||||
((= (get_tile \"typ\") \"0\")
|
||||
(set_tile \"wlabel\" \"GF-Neigung (Grad):\")
|
||||
(set_tile \"wert\" (rtos (float neigung-default) 2 1))
|
||||
(mode_tile \"wert\" 0))
|
||||
((= (get_tile \"typ\") \"3\")
|
||||
(set_tile \"wlabel\" \"(kein Wert)\")
|
||||
(mode_tile \"wert\" 1))
|
||||
(t
|
||||
(set_tile \"wlabel\" \"Vario-Winkel (Grad):\")
|
||||
(set_tile \"wert\" (rtos (float vario-default) 2 1))
|
||||
(mode_tile \"wert\" 0)))")
|
||||
(action_tile "accept"
|
||||
"(setq gtyp (get_tile \"typ\")) (setq gwert (get_tile \"wert\")) (done_dialog 1)")
|
||||
(action_tile "cancel" "(done_dialog 0)")
|
||||
(setq ergebnis (start_dialog))
|
||||
(unload_dialog dat)
|
||||
(if (= ergebnis 1)
|
||||
(cond
|
||||
;; typ 0 = GF -> "1" + Neigung(real)
|
||||
((= gtyp "0") (vflw-pending-push-all (list "1" (atof gwert))))
|
||||
;; typ 1 = VF-Ab -> "2" + Vario-Winkel(int)
|
||||
((= gtyp "1") (vflw-pending-push-all (list "2" (fix (atof gwert)))))
|
||||
;; typ 2 = VF-Auf -> "3" + Vario-Winkel(int)
|
||||
((= gtyp "2") (vflw-pending-push-all (list "3" (fix (atof gwert)))))
|
||||
;; typ 3 = VF-Hor -> "4" (kein Wert)
|
||||
(t (vflw-pending-push-all (list "4")))))))
|
||||
(princ))
|
||||
|
||||
;; --- Segment "Eck/Bogen" (Modus 2 + Modus 3): Typ + [bei Vario] Variante ---
|
||||
;; Original-Reihenfolge/-Journal: vfl-in-string/vfl-menu (Typ "1"/"2"), dann
|
||||
;; bei Vario-Kurve vfl-in-string/vfl-menu (Variante "1"/"2"). Bei GF-Bogen
|
||||
;; wird KEINE Variante gefragt -> nur "1" in die Pending-Queue.
|
||||
;; vario-erlaubt: T, wenn Vario-Kurve hier zulaessig ist (Modus 2 immer T;
|
||||
;; Modus 3 nur im offenen VF-Lauf - sonst konsumiert der Aufrufer die
|
||||
;; Variante-Antwort nicht und sie wuerde ins naechste Segment lecken). Bei
|
||||
;; nil wird die Vario-Kurve-Option deaktiviert und bei versehentlicher Wahl
|
||||
;; als GF-Bogen ("1") behandelt (der Aufrufer weist Vario dort ohnehin ab).
|
||||
(defun vflw-seg-bogen-impl (kopf-txt vario-erlaubt / dat ergebnis gtyp gvariante)
|
||||
(setq dat (load_dialog (vflw-dcl-pfad)))
|
||||
(if (not (new_dialog "vflw_seg_bogen" dat))
|
||||
(if (and dat (>= dat 0)) (unload_dialog dat))
|
||||
(progn
|
||||
(set_tile "kopf" (vflw-clean kopf-txt))
|
||||
(start_list "typ")
|
||||
(add_list (vflw-clean "GF-Bogen"))
|
||||
(add_list (vflw-clean (if vario-erlaubt "Vario-Kurve" "Vario-Kurve (nur im VF-Lauf)")))
|
||||
(end_list)
|
||||
(set_tile "typ" "0")
|
||||
(start_list "variante")
|
||||
(add_list (vflw-clean (ssg-text "vfl-variante-aussen")))
|
||||
(add_list (vflw-clean (ssg-text "vfl-variante-innen")))
|
||||
(end_list)
|
||||
(set_tile "variante" "0")
|
||||
(mode_tile "variante" 1) ; Variante erst bei Vario-Kurve aktiv
|
||||
;; Variante-Feld nur aktivieren, wenn Vario gewaehlt UND erlaubt.
|
||||
(if vario-erlaubt
|
||||
(action_tile "typ"
|
||||
"(mode_tile \"variante\" (if (= (get_tile \"typ\") \"1\") 0 1))"))
|
||||
(action_tile "accept"
|
||||
"(setq gtyp (get_tile \"typ\")) (setq gvariante (get_tile \"variante\")) (done_dialog 1)")
|
||||
(action_tile "cancel" "(done_dialog 0)")
|
||||
(setq ergebnis (start_dialog))
|
||||
(unload_dialog dat)
|
||||
(if (= ergebnis 1)
|
||||
(if (and (= gtyp "1") vario-erlaubt)
|
||||
;; Vario-Kurve: "2" + Variante ("1"=aussen / "2"=innen; Index+1)
|
||||
(vflw-pending-push-all (list "2" (itoa (1+ (atoi gvariante)))))
|
||||
;; GF-Bogen (oder Vario unzulaessig): "1" (keine Variante)
|
||||
(vflw-pending-push-all (list "1"))))))
|
||||
(princ))
|
||||
|
||||
;; ============================================================
|
||||
;; TEIL 0b-3: GRUPPEN-DIALOGE (PENDING-QUEUE)
|
||||
;; ============================================================
|
||||
@@ -4369,7 +4522,7 @@
|
||||
best)
|
||||
|
||||
(defun vf-linienzug-modus3 ( / ss obj-liste startpunkt start-hoehe as-seite
|
||||
es-seite kette segmente n i seg typ hz laenge
|
||||
es-seite kette segmente n i seg seg-ent typ hz laenge
|
||||
bwinkel bseite frame antwort winkel deltaL
|
||||
anzahl-gf anzahl-vf vfl-nummer lastEnt hoehe-bis
|
||||
ecke-bad first-line last-line letzt-winkel
|
||||
@@ -4417,16 +4570,32 @@
|
||||
(setq obj-liste (mapcar 'vlax-ename->vla-object ss))
|
||||
|
||||
;; --- 2. Startpunkt (hoehere Seite) + Hoehe + AS-Seite ---
|
||||
;; Wizard: Startpunkt+Hoehe als EIN Gruppen-Dialog (analog Modus 2). Die
|
||||
;; unveraenderten vfl-in-point/vfl-in-real-Aufrufe konsumieren die Antworten
|
||||
;; danach aus *vflw-pending*.
|
||||
(if (vfl-wizard-aktiv)
|
||||
(vl-catch-all-apply 'vflw-gruppe-punkt-hoehe-impl
|
||||
(list "vfl-m3-prompt-startpunkt" "Starthoehe (Z, mm):")))
|
||||
(setq startpunkt (vfl-in-point nil (ssg-text "vfl-m3-prompt-startpunkt")))
|
||||
(if (null startpunkt) (progn (princ (ssg-text "vfl-abgebrochen")) (exit)))
|
||||
(setq start-hoehe (vfl-in-real (ssg-textf "vfl-prompt-hoehe-startpunkt"
|
||||
(list (rtos (caddr startpunkt) 2 1)))))
|
||||
(if (null start-hoehe) (setq start-hoehe (caddr startpunkt)))
|
||||
(setq startpunkt (list (car startpunkt) (cadr startpunkt) start-hoehe))
|
||||
;; vf-frage-element-winkel ruft direkt getstring/vflw-wahl auf (kein
|
||||
;; vfl-in-*-Wrapper darin) - manuell mitloggen, sonst wuerde diese eine
|
||||
;; Eingabe durchrutschen.
|
||||
(setq *vfl-as-winkel* (vf-frage-element-winkel "vf-winkel-aus-header")) ; 30/90 vor Seite
|
||||
;; AS-Element (in Modus 3 immer gesetzt): Winkel(30/90) + Seite als EIN
|
||||
;; Gruppen-Dialog. vflw-gruppe-winkel-seite-impl legt Winkel ("90"/"30")
|
||||
;; und Seite ("1"/"2") in *vflw-pending* ab - genau die Reihenfolge, die
|
||||
;; die beiden Reads unten erwarten. AS-Winkel ueber vfl-in-value (pending-
|
||||
;; aware; vf-frage-element-winkel selbst ist es NICHT), damit der vom Dialog
|
||||
;; abgelegte Wert konsumiert wird statt live erneut zu fragen.
|
||||
(if (vfl-wizard-aktiv)
|
||||
(vl-catch-all-apply 'vflw-gruppe-winkel-seite-impl
|
||||
(list "vf-winkel-aus-header"
|
||||
(list (ssg-text "vf-winkel-90") (ssg-text "vf-winkel-30"))
|
||||
(list "90" "30"))))
|
||||
(setq *vfl-as-winkel*
|
||||
(vfl-in-value "STR"
|
||||
(function (lambda () (vf-frage-element-winkel "vf-winkel-aus-header"))))) ; 30/90 vor Seite
|
||||
(if dbg-an (progn (dbgmsg "AS-Winkel:") (dbg '*vfl-as-winkel*) (dbgflush)))
|
||||
(princ (ssg-text "vfl-vwnb-aus-seite-menu"))
|
||||
(setq as-seite (if (= (vfl-in-string (ssg-text "prompt-wahl-1-2")) "2") "rechts" "links"))
|
||||
@@ -4478,6 +4647,26 @@
|
||||
(setq i 0)
|
||||
(while (< i n)
|
||||
(setq seg (nth i segmente) typ (car seg) hz (cadr seg))
|
||||
(setq seg-ent (car (nth i kette))) ; echte LINE/ARC-Entity dieses Segments
|
||||
;; Wizard: alle Fragen dieses Segments in EINEM Dialog erfassen (die
|
||||
;; unveraenderten vfl-in-*-Aufrufe unten konsumieren die Antworten aus
|
||||
;; *vflw-pending*). Segment vorher in der Zeichnung hervorheben. Bei einem
|
||||
;; Bogen ist Vario-Kurve nur im offenen VF-Lauf erlaubt - deshalb die
|
||||
;; Variante-Antwort nur mitschicken, wenn run-typ="VF" (sonst konsumiert
|
||||
;; der Aufrufer sie nicht und sie wuerde ins naechste Segment lecken).
|
||||
(if (vfl-wizard-aktiv)
|
||||
(progn
|
||||
(vfl-seg-highlight seg-ent T)
|
||||
(if (= typ "Linie")
|
||||
(vflw-seg-linie-m3-impl
|
||||
(vfl-seg-kopf (1+ i) n
|
||||
(strcat "Gerade L=" (rtos (caddr seg) 2 0) " mm hz=" (rtos hz 2 1)))
|
||||
*vfk-gefaelle-winkel* 3)
|
||||
(vflw-seg-bogen-impl
|
||||
(vfl-seg-kopf (1+ i) n
|
||||
(strcat "Eck/Bogen " (itoa (nth 3 seg)) " Grad " (nth 4 seg)))
|
||||
(= run-typ "VF"))) ; Modus 3: Vario nur im offenen VF-Lauf
|
||||
(vfl-seg-highlight seg-ent nil)))
|
||||
(cond
|
||||
;; ===================== GERADE =====================
|
||||
((= typ "Linie")
|
||||
@@ -4806,6 +4995,7 @@
|
||||
|
||||
(defun vf-linienzug-modus2 ( / ss k obj-liste startpunkt start-hoehe as-seite
|
||||
endpunkt end-hoehe es-seite kette segmente n i seg
|
||||
seg-ent
|
||||
typ hz laenge bwinkel bseite antwort winkel klass
|
||||
plan e ecke-bad vf-start vf-ende dz z-front
|
||||
z-junction dH-bruecke span-bruecke dH-gesamt
|
||||
@@ -4952,6 +5142,24 @@
|
||||
(setq n (length segmente) i 0 plan '())
|
||||
(while (< i n)
|
||||
(setq seg (nth i segmente) typ (car seg) hz (cadr seg) laenge (caddr seg))
|
||||
(setq seg-ent (car (nth i kette))) ; echte LINE/ARC-Entity dieses Segments
|
||||
;; Wizard: alle Fragen dieses Segments in EINEM Dialog erfassen (die
|
||||
;; unveraenderten vfl-menu/vfl-in-*-Aufrufe unten konsumieren die Antworten
|
||||
;; aus *vflw-pending*). Segment vorher in der Zeichnung hervorheben. Der
|
||||
;; nach-kurve-Fall stellt keine Frage (auto-VF) -> kein Dialog.
|
||||
(if (and (vfl-wizard-aktiv) (not (and (= typ "Linie") nach-kurve)))
|
||||
(progn
|
||||
(vfl-seg-highlight seg-ent T)
|
||||
(if (= typ "Linie")
|
||||
(vflw-seg-linie-m2-impl
|
||||
(vfl-seg-kopf (1+ i) n
|
||||
(strcat "Gerade L=" (rtos laenge 2 0) " mm hz=" (rtos hz 2 1)))
|
||||
*vfk-gefaelle-winkel*)
|
||||
(vflw-seg-bogen-impl
|
||||
(vfl-seg-kopf (1+ i) n
|
||||
(strcat "Eck/Bogen " (itoa (nth 3 seg)) " Grad " (nth 4 seg)))
|
||||
T)) ; Modus 2: Vario-Kurve immer erlaubt
|
||||
(vfl-seg-highlight seg-ent nil)))
|
||||
(cond
|
||||
((= typ "Linie")
|
||||
(princ (ssg-textf "vfl-m3-seg-gerade"
|
||||
|
||||
Reference in New Issue
Block a user