[FIX] Omniflo TEF einfügen entlang Gerade funktioniert wieder; Omniflo Gerade ist aus dem Menü entfernt worden, da entweder über das Menü Fahrstrecke oder nur als Linie gezeichnet wird
This commit is contained in:
1 parent
afc5dce13a
commit
98106a6af4
17 files changed
+59
-548
No files matched your search
@@ -3,20 +3,12 @@
|
||||
;;
|
||||
;; Baut aus tests/testdata/omniflo_strecke_tests.json einen verketteten
|
||||
;; Streckenzug auf:
|
||||
;; 4 Geraden -> 180-Grad-Kurve (4x 45-Grad-Bogen) -> 4 Geraden
|
||||
;; 2 Boegen + 1 Weiche
|
||||
;;
|
||||
;; Jedes Element traegt bereits seine absolute Platzierung (x, y, drehung)
|
||||
;; sowie Endpunkt (x_ende, y_ende). Die Elemente sind lueckenlos verkettet
|
||||
;; (Ende[i] = Anfang[i+1]), sodass eine durchgehende U-foermige Strecke
|
||||
;; entsteht.
|
||||
;; Jedes Element traegt bereits seine absolute Platzierung (x, y, drehung).
|
||||
;;
|
||||
;; - Boegen (type "bogen"): DXF aus DXFM_OMNIFLO an (x,y) mit Drehung
|
||||
;; einfuegen (wie test_omniflo.lsp).
|
||||
;; - Geraden (type "gerade"): echter Aluprofil-Block ueber den skript-
|
||||
;; faehigen Kern omni:make-gerade (aus OmniModulInsert.lsp). Fehlt die
|
||||
;; Quell-.dwg (kein AP110.dwg im Blockpfad), werden Ersatz-Attribute
|
||||
;; verwendet, sodass dennoch ein Compound-Block (Linie + ATTDEFs) statt
|
||||
;; einer nackten Linie entsteht.
|
||||
;; - Boegen/Weichen (type "bogen"): DXF aus DXFM_OMNIFLO an (x,y) mit
|
||||
;; Drehung einfuegen (wie test_omniflo.lsp).
|
||||
;;
|
||||
;; Ergebnisse -> tests/output/omniflo_strecke_results.json
|
||||
;; (via omniflo_strecke:export-results, aufgerufen von SSG_RUN_ALL_TESTS
|
||||
@@ -90,54 +82,6 @@
|
||||
)
|
||||
|
||||
|
||||
;; --- Gerade non-interaktiv als echten Aluprofil-Block erzeugen ---
|
||||
;; Nutzt den skriptfaehigen Kern omni:make-gerade aus OmniModulInsert.lsp.
|
||||
;; profil = Profiltyp (z.B. "AP110")
|
||||
;; pt-anf = Anfangspunkt, pt-end = Endpunkt (bestimmen Laenge + Drehung)
|
||||
;; hoehe-str / drehung-str = Attributwerte HOEHE/DREHUNG
|
||||
;; Rueckgabe: Block-Entity oder nil.
|
||||
(defun omnistr:build-gerade (profil pt-anf pt-end hoehe-str drehung-str /
|
||||
srcAttribs textHeight textGap blockEnt)
|
||||
(dbgf "omnistr:build-gerade")
|
||||
(dbgmsg (strcat "profil=" (if profil profil "nil")
|
||||
" hoehe=" (if hoehe-str hoehe-str "nil")
|
||||
" drehung=" (if drehung-str drehung-str "nil")))
|
||||
(dbgreturn
|
||||
(if (null (car (atoms-family 1 '("OMNI:MAKE-GERADE"))))
|
||||
(progn
|
||||
;; Precondition-Fehler (Modul nicht geladen): bleibt im Fenster sichtbar
|
||||
(princ "\n[TEST_OMNIFLO_STRECKE] FEHLER: omni:make-gerade nicht geladen (OmniModulInsert.lsp)!")
|
||||
nil
|
||||
)
|
||||
(progn
|
||||
(setq textHeight (ssg-cfg-or "omniflo" "text_height" 100.0))
|
||||
(setq textGap (ssg-cfg-or "omniflo" "text_gap" 20.0))
|
||||
;; Quell-Attribute lesen; falls keine .dwg vorhanden, Ersatz erzeugen
|
||||
(setq srcAttribs (omni:read-src-attribs profil))
|
||||
(if (null srcAttribs)
|
||||
(progn
|
||||
(dbgmsg (strcat "keine Quell-.dwg fuer " profil " - Ersatz-Attribute"))
|
||||
(setq srcAttribs (list (cons "PROFILTYP" profil)
|
||||
(cons "HOEHE" (if hoehe-str hoehe-str "2000"))
|
||||
(cons "ID" "")))
|
||||
)
|
||||
)
|
||||
(setvar "ATTREQ" 0)
|
||||
(setvar "ATTDIA" 0)
|
||||
(setq blockEnt (omni:make-gerade profil pt-anf pt-end
|
||||
srcAttribs textHeight textGap nil))
|
||||
(if (and blockEnt (= (cdr (assoc 0 (entget blockEnt))) "INSERT"))
|
||||
(ssg-attrib-set-on blockEnt
|
||||
(list (cons "HOEHE" (if hoehe-str hoehe-str "2000"))
|
||||
(cons "DREHUNG" (if drehung-str drehung-str "0"))))
|
||||
)
|
||||
blockEnt
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; --- Ergebnis eines Streckenelements als JSON-String erzeugen ---
|
||||
(defun omnistr:test-result-json (test-id seq typ description status / )
|
||||
(strcat " {\n"
|
||||
@@ -184,9 +128,9 @@
|
||||
;; Liest omniflo_strecke_tests.json und baut den Streckenzug auf.
|
||||
;; ============================================================
|
||||
(defun c:TEST_OMNIFLO_STRECKE (/ tests-json-pfad elemente
|
||||
idx eintrag typ sivasnr profil hoehe-str drehung-str
|
||||
description x-val y-val xe-val ye-val seq
|
||||
insert-pt pt-end anzahl-ok anzahl-fehler
|
||||
idx eintrag typ sivasnr hoehe-str drehung-str
|
||||
description x-val y-val seq
|
||||
insert-pt anzahl-ok anzahl-fehler
|
||||
results-list ergebnis)
|
||||
|
||||
(ssg-start "TEST_OMNIFLO_STRECKE"
|
||||
@@ -245,22 +189,15 @@
|
||||
(if (null drehung-str) (setq drehung-str "0"))
|
||||
(if (numberp drehung-str) (setq drehung-str (rtos drehung-str 2 4)))
|
||||
|
||||
;; Anfangs- und Endpunkt lesen
|
||||
(setq x-val (ssg-val eintrag "x")
|
||||
y-val (ssg-val eintrag "y")
|
||||
xe-val (ssg-val eintrag "x_ende")
|
||||
ye-val (ssg-val eintrag "y_ende"))
|
||||
(if (null x-val) (setq x-val 0.0))
|
||||
(if (null y-val) (setq y-val 0.0))
|
||||
(if (null xe-val) (setq xe-val x-val))
|
||||
(if (null ye-val) (setq ye-val y-val))
|
||||
(if (not (numberp x-val)) (setq x-val (atof x-val)))
|
||||
(if (not (numberp y-val)) (setq y-val (atof y-val)))
|
||||
(if (not (numberp xe-val)) (setq xe-val (atof xe-val)))
|
||||
(if (not (numberp ye-val)) (setq ye-val (atof ye-val)))
|
||||
;; Einfuegepunkt lesen
|
||||
(setq x-val (ssg-val eintrag "x")
|
||||
y-val (ssg-val eintrag "y"))
|
||||
(if (null x-val) (setq x-val 0.0))
|
||||
(if (null y-val) (setq y-val 0.0))
|
||||
(if (not (numberp x-val)) (setq x-val (atof x-val)))
|
||||
(if (not (numberp y-val)) (setq y-val (atof y-val)))
|
||||
|
||||
(setq insert-pt (list x-val y-val (atof hoehe-str)))
|
||||
(setq pt-end (list xe-val ye-val (atof hoehe-str)))
|
||||
|
||||
(dbgmsg (strcat (itoa seq) ". " (if typ typ "?") ": "
|
||||
(if description description "")
|
||||
@@ -273,10 +210,6 @@
|
||||
((= typ "bogen")
|
||||
(setq sivasnr (ssg-val eintrag "sivasnr"))
|
||||
(omnistr:insert-bogen sivasnr insert-pt hoehe-str drehung-str))
|
||||
((= typ "gerade")
|
||||
(setq profil (ssg-val eintrag "profil"))
|
||||
(if (null profil) (setq profil "AP110"))
|
||||
(omnistr:build-gerade profil insert-pt pt-end hoehe-str drehung-str))
|
||||
(T
|
||||
(dbgmsg (strcat "WARNUNG: unbekannter Typ '"
|
||||
(if typ typ "nil") "'"))
|
||||
|
||||
Reference in new issue
Block a user