Oberfläche für Standard von Varioförder und Gefällestrecke bauen lassen
This commit is contained in:
@@ -25,8 +25,12 @@
|
||||
|
||||
|
||||
;; --- Ergebnis eines Testfalls als JSON-String erzeugen ---
|
||||
(defun gefaellestrecke:test-json (test-id modus hz deltaL winkel h-von h-bis d-h status /
|
||||
;; as-winkel/es-winkel: "30" oder "90" (Element-Variante); default "90"
|
||||
(defun gefaellestrecke:test-json (test-id modus hz deltaL winkel h-von h-bis d-h status
|
||||
as-winkel es-winkel /
|
||||
json)
|
||||
(if (null as-winkel) (setq as-winkel "90"))
|
||||
(if (null es-winkel) (setq es-winkel "90"))
|
||||
(setq json
|
||||
(strcat " {\n"
|
||||
" \"test_id\": \"" test-id "\",\n"
|
||||
@@ -34,6 +38,8 @@
|
||||
" \"hz_grad\": " (rtos (float hz) 2 1) ",\n"
|
||||
" \"deltaL_mm\": " (rtos (float deltaL) 2 0) ",\n"
|
||||
" \"winkel_grad\": " (rtos (float winkel) 2 3) ",\n"
|
||||
" \"as_winkel\": \"" as-winkel "\",\n"
|
||||
" \"es_winkel\": \"" es-winkel "\",\n"
|
||||
" \"hoehe_von_mm\": " (rtos (float h-von) 2 0) ",\n"
|
||||
" \"hoehe_bis_mm\": " (rtos (float h-bis) 2 0) ",\n"
|
||||
" \"delta_h_mm\": " (rtos (float d-h) 2 0) ",\n"
|
||||
@@ -296,6 +302,7 @@
|
||||
m2-start m2-deltaH m2-deltaL
|
||||
m3-start m3-end m3-line-vla
|
||||
m3b-start m3b-end m3b-e1 m3b-e2 m3b-e3 m3b-objliste
|
||||
w30-rad w30-sepx w30-lstau
|
||||
lbl-layer lbl-h lbl-h2)
|
||||
|
||||
;; Block-Bibliothek initialisieren (setzt aus-dx, ein-dx, aus-dz, ein-dz usw.)
|
||||
@@ -376,7 +383,7 @@
|
||||
(setq gf-ins
|
||||
(car (gefaellestrecke-einfuegen
|
||||
test-L_stau test-winkel (list 0 0 test-z-start)
|
||||
"links" "links" 0.0 test-deltaL)))
|
||||
"links" "links" 0.0 test-deltaL "90" "90")))
|
||||
(if gf-ins
|
||||
(progn
|
||||
(setq attribs (ssg-attrib-read gf-ins))
|
||||
@@ -388,13 +395,13 @@
|
||||
" dH=" (itoa d-h) " mm W=" w-str " OK"))
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M1_hz000" 1 0.0 test-deltaL
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT")
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT" "90" "90")
|
||||
results-list)))
|
||||
(progn
|
||||
(princ " FEHLER")
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M1_hz000" 1 0.0 test-deltaL
|
||||
0.0 0 0 0 "FEHLER")
|
||||
0.0 0 0 0 "FEHLER" "90" "90")
|
||||
results-list))))
|
||||
|
||||
;; --- M1: hz=90 Grad (Nord), Start (15000, 0, 5000) ---
|
||||
@@ -408,7 +415,7 @@
|
||||
(setq gf-ins
|
||||
(car (gefaellestrecke-einfuegen
|
||||
test-L_stau test-winkel (list 15000 0 test-z-start)
|
||||
"links" "links" 90.0 test-deltaL)))
|
||||
"links" "links" 90.0 test-deltaL "90" "90")))
|
||||
(if gf-ins
|
||||
(progn
|
||||
(setq attribs (ssg-attrib-read gf-ins))
|
||||
@@ -420,13 +427,13 @@
|
||||
" dH=" (itoa d-h) " mm W=" w-str " OK"))
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M1_hz090" 1 90.0 test-deltaL
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT")
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT" "90" "90")
|
||||
results-list)))
|
||||
(progn
|
||||
(princ " FEHLER")
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M1_hz090" 1 90.0 test-deltaL
|
||||
0.0 0 0 0 "FEHLER")
|
||||
0.0 0 0 0 "FEHLER" "90" "90")
|
||||
results-list))))
|
||||
|
||||
;; --- M1: hz=180 Grad (West), Start (0, -15000, 5000) ---
|
||||
@@ -440,7 +447,7 @@
|
||||
(setq gf-ins
|
||||
(car (gefaellestrecke-einfuegen
|
||||
test-L_stau test-winkel (list 0 -15000 test-z-start)
|
||||
"links" "links" 180.0 test-deltaL)))
|
||||
"links" "links" 180.0 test-deltaL "90" "90")))
|
||||
(if gf-ins
|
||||
(progn
|
||||
(setq attribs (ssg-attrib-read gf-ins))
|
||||
@@ -452,13 +459,13 @@
|
||||
" dH=" (itoa d-h) " mm W=" w-str " OK"))
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M1_hz180" 1 180.0 test-deltaL
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT")
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT" "90" "90")
|
||||
results-list)))
|
||||
(progn
|
||||
(princ " FEHLER")
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M1_hz180" 1 180.0 test-deltaL
|
||||
0.0 0 0 0 "FEHLER")
|
||||
0.0 0 0 0 "FEHLER" "90" "90")
|
||||
results-list))))
|
||||
|
||||
;; --- M1: hz=270 Grad (Sued), Start (15000, -15000, 5000) ---
|
||||
@@ -472,7 +479,7 @@
|
||||
(setq gf-ins
|
||||
(car (gefaellestrecke-einfuegen
|
||||
test-L_stau test-winkel (list 15000 -15000 test-z-start)
|
||||
"links" "links" 270.0 test-deltaL)))
|
||||
"links" "links" 270.0 test-deltaL "90" "90")))
|
||||
(if gf-ins
|
||||
(progn
|
||||
(setq attribs (ssg-attrib-read gf-ins))
|
||||
@@ -484,13 +491,13 @@
|
||||
" dH=" (itoa d-h) " mm W=" w-str " OK"))
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M1_hz270" 1 270.0 test-deltaL
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT")
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT" "90" "90")
|
||||
results-list)))
|
||||
(progn
|
||||
(princ " FEHLER")
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M1_hz270" 1 270.0 test-deltaL
|
||||
0.0 0 0 0 "FEHLER")
|
||||
0.0 0 0 0 "FEHLER" "90" "90")
|
||||
results-list))))
|
||||
|
||||
;; ============================================================
|
||||
@@ -522,7 +529,7 @@
|
||||
(princ (strcat "\n\n M2_hz000: Start=(0,-35000," (rtos test-z-start 2 0) ") ..."))
|
||||
(setq ergebnis
|
||||
(gefaellestrecke-einfuegen
|
||||
test-L_stau test-winkel m2-start "links" "links" 0.0 test-deltaL))
|
||||
test-L_stau test-winkel m2-start "links" "links" 0.0 test-deltaL "90" "90"))
|
||||
(setq gf-ins (car ergebnis))
|
||||
(if gf-ins
|
||||
(progn
|
||||
@@ -541,7 +548,7 @@
|
||||
" mm W=" w-str " OK"))
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M2_hz000" 2 0.0 test-deltaL
|
||||
(atof w-str) h-von h-bis m2-deltaH "GEBAUT")
|
||||
(atof w-str) h-von h-bis m2-deltaH "GEBAUT" "90" "90")
|
||||
results-list)))
|
||||
(progn
|
||||
;; Fallback: sin(3deg) * 10000 ≈ 523mm
|
||||
@@ -550,7 +557,7 @@
|
||||
(princ (strcat " FEHLER (Fallback " delta-sym "H=" (rtos m2-deltaH 2 3) ")"))
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M2_hz000" 2 0.0 test-deltaL
|
||||
0.0 0 0 0 "FEHLER")
|
||||
0.0 0 0 0 "FEHLER" "90" "90")
|
||||
results-list))))
|
||||
|
||||
;; ============================================================
|
||||
@@ -618,20 +625,20 @@
|
||||
" W=" w-str " OK"))
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M3_hz270" 3 270.0 test-deltaL
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT")
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT" "90" "90")
|
||||
results-list)))
|
||||
(progn
|
||||
(princ "\n -> FEHLER (modus3-einfuegen)")
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M3_hz270" 3 270.0 test-deltaL
|
||||
0.0 0 0 0 "FEHLER")
|
||||
0.0 0 0 0 "FEHLER" "90" "90")
|
||||
results-list)))))
|
||||
;; 3D-Linie konnte nicht erzeugt werden
|
||||
(progn
|
||||
(princ "\n FEHLER: 3D-Linie nicht erzeugbar!")
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M3_hz270" 3 270.0 test-deltaL
|
||||
0.0 0 0 0 "FEHLER_LINIE")
|
||||
0.0 0 0 0 "FEHLER_LINIE" "90" "90")
|
||||
results-list))))
|
||||
|
||||
;; ============================================================
|
||||
@@ -688,15 +695,71 @@
|
||||
" " delta-sym "H-Soll=200 mm W=" w-str " OK"))
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M3_Bogen" 3 0.0 14785.0
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT")
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT" "90" "90")
|
||||
results-list)))
|
||||
(progn
|
||||
(princ "\n -> FEHLER (modus3-einfuegen mit Bogen)")
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M3_Bogen" 3 0.0 14785.0
|
||||
0.0 0 0 0 "FEHLER")
|
||||
0.0 0 0 0 "FEHLER" "90" "90")
|
||||
results-list))))
|
||||
|
||||
;; ============================================================
|
||||
;; MODUS 1 - 30-Grad AUS-/EIN-Elemente (statt 90 Grad)
|
||||
;; Prueft die per DCL-Dialog waehlbare Element-Variante 30 Grad.
|
||||
;; hz=0, Start (30000, 0, 5000). Eigene L_stau-Berechnung, da die
|
||||
;; 30-Grad-Elemente andere aus-dx/ein-dx-Masse besitzen.
|
||||
;; ============================================================
|
||||
(princ "\n\n================================================================")
|
||||
(princ "\n MODUS 1 - 30-Grad Elemente (M1_w30)")
|
||||
(princ "\n================================================================")
|
||||
|
||||
(entmake (list '(0 . "TEXT")
|
||||
(cons 10 (list 30000 1200.0 test-z-start))
|
||||
(cons 11 (list 30000 1200.0 test-z-start))
|
||||
(cons 40 lbl-h)
|
||||
(cons 1 (strcat "M1 | hz=0" grad-zeichen " | AS/ES=30" grad-zeichen
|
||||
" | " delta-sym "L=10000 | W=3" grad-zeichen))
|
||||
'(7 . "Standard") (cons 8 lbl-layer) '(72 . 1) '(73 . 2)))
|
||||
|
||||
;; 30-Grad-Element-Masse setzen und L_stau dafuer berechnen
|
||||
(vf-set-as-masse "30" "links")
|
||||
(vf-set-es-masse "30" "links")
|
||||
(setq w30-rad (* test-winkel (/ pi 180.0)))
|
||||
(setq w30-sepx (* 300.0 (cos w30-rad)))
|
||||
(setq w30-lstau
|
||||
(/ (- test-deltaL (float aus-dx) (float ein-dx) w30-sepx) (cos w30-rad)))
|
||||
(princ (strcat "\n\n M1_w30: AS/ES=30 Grad, aus-dx=" (rtos (float aus-dx) 2 1)
|
||||
" ein-dx=" (rtos (float ein-dx) 2 1)
|
||||
" L_stau=" (rtos w30-lstau 2 1) " ..."))
|
||||
(setq gf-ins
|
||||
(car (gefaellestrecke-einfuegen
|
||||
w30-lstau test-winkel (list 30000 0 test-z-start)
|
||||
"links" "links" 0.0 test-deltaL "30" "30")))
|
||||
(if gf-ins
|
||||
(progn
|
||||
(setq attribs (ssg-attrib-read gf-ins))
|
||||
(setq h-von (atoi (cdr (assoc "HOEHE_VON_mm" attribs))))
|
||||
(setq h-bis (atoi (cdr (assoc "HOEHE_BIS_mm" attribs))))
|
||||
(setq d-h (abs (- h-von h-bis)))
|
||||
(setq w-str (cdr (assoc "GF_WINKEL" attribs)))
|
||||
(princ (strcat " von=" (itoa h-von) " bis=" (itoa h-bis)
|
||||
" dH=" (itoa d-h) " mm W=" w-str " OK"))
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M1_w30" 1 0.0 test-deltaL
|
||||
(atof w-str) h-von h-bis d-h "GEBAUT" "30" "30")
|
||||
results-list)))
|
||||
(progn
|
||||
(princ " FEHLER")
|
||||
(setq results-list
|
||||
(cons (gefaellestrecke:test-json "M1_w30" 1 0.0 test-deltaL
|
||||
0.0 0 0 0 "FEHLER" "30" "30")
|
||||
results-list))))
|
||||
|
||||
;; Element-Masse wieder auf 90 Grad zuruecksetzen (fuer Folgelaeufe)
|
||||
(vf-set-as-masse "90" "links")
|
||||
(vf-set-es-masse "90" "links")
|
||||
|
||||
;; ============================================================
|
||||
;; Zusammenfassung und Export
|
||||
;; ============================================================
|
||||
|
||||
Reference in New Issue
Block a user