Omniflo Dialoge mit dcl Datei erzeugt

This commit is contained in:
2026-05-08 13:16:09 +02:00
parent cc229617a5
commit 2c4b708233
4 changed files with 209 additions and 30 deletions
+135 -11
View File
@@ -408,32 +408,156 @@
;; ============================================================
;; OMNIFLO MODUL-BEFEHLE (Dummy-Implementierungen)
;; OMNIFLO BOGEN-DIALOG
;; Generischer Dialog fuer Bogen-Auswahl nach Winkel
;; ============================================================
;; --- Detail-Felder im Dialog aktualisieren ---
;; Wird bei Dropdown-Aenderung aufgerufen (action_tile callback)
(defun omni:bogen-dlg-update (idx-str / idx eintrag wkl)
(setq idx (atoi idx-str))
(setq eintrag (nth idx *OMNI-DLG-BOEGEN*))
(if eintrag
(progn
(set_tile "val_sivasnr"
(omni:sivasid-to-str (omni:val eintrag "Sivasnr")))
(setq wkl (omni:val eintrag "KurvenWinkel"))
(set_tile "val_winkel"
(if (= (type wkl) 'INT) (strcat (itoa wkl) " Grad")
(strcat (rtos wkl 2 1) " Grad")
)
)
(set_tile "val_radius"
(itoa (fix (omni:val eintrag "Radius"))))
(set_tile "val_breite"
(itoa (fix (omni:val eintrag "Breite"))))
(set_tile "val_laenge"
(itoa (fix (omni:val eintrag "Länge"))))
)
)
)
;; --- Bogen-Auswahl-Dialog oeffnen ---
;; winkel = KurvenWinkel (90, 67.5, 45, 22.5, 180)
;; Rueckgabe: gewaehlter Bogen-Eintrag (alist) oder nil bei Abbruch
(defun omni:bogen-dialog (winkel / dcl-pfad dat boegen-liste
profil-liste ergebnis)
(if (null *OMNI-BOEGEN*) (omni:load-data))
;; Boegen nach Winkel filtern
(setq boegen-liste (omni:filter *OMNI-BOEGEN* "KurvenWinkel" winkel))
(if (null boegen-liste)
(progn
(alert (strcat "Keine Boegen fuer "
(if (= (type winkel) 'INT) (itoa winkel) (rtos winkel 2 1))
" Grad gefunden."))
nil
)
(progn
;; In globaler Variable fuer Dialog-Callbacks speichern
(setq *OMNI-DLG-BOEGEN* boegen-liste)
;; ProfilTyp-Liste fuer Dropdown aufbauen
(setq profil-liste
(mapcar '(lambda (e) (cdr (assoc "ProfilTyp" e))) boegen-liste))
;; DCL laden
(setq dcl-pfad (strcat (getenv "DXFM_DCL") "/omniflo_boegen.dcl"))
(setq dat (load_dialog dcl-pfad))
(if (not (new_dialog "omniflo_boegen" dat))
(progn (alert "Bogen-Dialog konnte nicht geladen werden.") nil)
(progn
;; Dropdown befuellen
(start_list "bogenart")
(mapcar 'add_list profil-liste)
(end_list)
(set_tile "bogenart" "0")
;; Startwerte anzeigen
(omni:bogen-dlg-update "0")
;; Callback bei Dropdown-Aenderung
(action_tile "bogenart" "(omni:bogen-dlg-update $value)")
;; OK/Abbrechen
(action_tile "accept"
"(setq ergebnis (atoi (get_tile \"bogenart\"))) (done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(start_dialog)
(unload_dialog dat)
;; Gewaehlten Eintrag zurueckgeben
(if ergebnis
(nth ergebnis *OMNI-DLG-BOEGEN*)
nil
)
)
)
)
)
)
;; ============================================================
;; OMNIFLO MODUL-BEFEHLE
;; ============================================================
;; --- Omniflo / Boegen ---
(defun c:OMNI_APB_630_90 ()
(princ "\n[DUMMY] APB 110 R 630/90 800/800 (821104033)")
(defun c:OMNI_APB_630_90 ( / eintrag)
(setq eintrag (omni:bogen-dialog 90))
(if eintrag
(princ (strcat "\n[BOGEN] Gewaehlt: "
(omni:val eintrag "ProfilTyp") " (SivasNr: "
(omni:sivasid-to-str (omni:val eintrag "Sivasnr")) ")"))
(princ "\n[BOGEN] Abgebrochen.")
)
(princ)
)
(defun c:OMNI_APB_550_675 ()
(princ "\n[DUMMY] APB 110 R 550/67.5 432 (821104027)")
(defun c:OMNI_APB_550_675 ( / eintrag)
(setq eintrag (omni:bogen-dialog 67.5))
(if eintrag
(princ (strcat "\n[BOGEN] Gewaehlt: "
(omni:val eintrag "ProfilTyp") " (SivasNr: "
(omni:sivasid-to-str (omni:val eintrag "Sivasnr")) ")"))
(princ "\n[BOGEN] Abgebrochen.")
)
(princ)
)
(defun c:OMNI_APB_630_45 ()
(princ "\n[DUMMY] APB 110 R 630/45 400 (821104031)")
(defun c:OMNI_APB_630_45 ( / eintrag)
(setq eintrag (omni:bogen-dialog 45))
(if eintrag
(princ (strcat "\n[BOGEN] Gewaehlt: "
(omni:val eintrag "ProfilTyp") " (SivasNr: "
(omni:sivasid-to-str (omni:val eintrag "Sivasnr")) ")"))
(princ "\n[BOGEN] Abgebrochen.")
)
(princ)
)
(defun c:OMNI_APB_550_225 ()
(princ "\n[DUMMY] APB 110 R 550/22.5 84 (821104025)")
(defun c:OMNI_APB_550_225 ( / eintrag)
(setq eintrag (omni:bogen-dialog 22.5))
(if eintrag
(princ (strcat "\n[BOGEN] Gewaehlt: "
(omni:val eintrag "ProfilTyp") " (SivasNr: "
(omni:sivasid-to-str (omni:val eintrag "Sivasnr")) ")"))
(princ "\n[BOGEN] Abgebrochen.")
)
(princ)
)
(defun c:OMNI_APB_650_180 ()
(princ "\n[DUMMY] APB 110 R 650/180 L=150 (821104043)")
(defun c:OMNI_APB_650_180 ( / eintrag)
(setq eintrag (omni:bogen-dialog 180))
(if eintrag
(princ (strcat "\n[BOGEN] Gewaehlt: "
(omni:val eintrag "ProfilTyp") " (SivasNr: "
(omni:sivasid-to-str (omni:val eintrag "Sivasnr")) ")"))
(princ "\n[BOGEN] Abgebrochen.")
)
(princ)
)