horizontale Fahrrichtung (0°/90°/180°/270°) fuer Variofoederer manuelle Werteingabe ergänzen. die Möglichkeit des Horizontal-Varioföerderes wurde bei Ab-Förderrichtung geprüft.
This commit is contained in:
+132
-44
@@ -383,11 +383,61 @@
|
||||
(list best-winkel best-L_GF best-L_VF ergebnis-liste)
|
||||
)
|
||||
|
||||
;; Prueft/berechnet die Variante mit HORIZONTALER Zwischenstrecke (Schritt
|
||||
;; 6/11 bei 0 Grad statt geneigt). Die beiden Vertikalboegen sind dabei
|
||||
;; IMMER auf 3 Grad fixiert (Vario_Bogen_auf_3 / Vario_Bogen_ab_3), weil sie
|
||||
;; nur zwischen der festen 3-Grad-Neigung von Umlenk-/Motorstation und der
|
||||
;; horizontalen Mitte vermitteln muessen - unabhaengig von Auf/Ab.
|
||||
;; WICHTIG (geometrische Konsequenz): GF1+GF2 (an AS/ES-Seite, ebenfalls
|
||||
;; fest bei 3 Grad geneigt) sind die einzige nennenswerte Quelle fuer
|
||||
;; Hoehenaenderung, da sich die beiden Boegen gegenseitig fast vollstaendig
|
||||
;; kompensieren. Die feste 3-Grad-Neigung wirkt IMMER absenkend:
|
||||
;; - "Ab": passt zur gewuenschten Absenkung -> deltaH praktisch beliebig
|
||||
;; erreichbar (im Rahmen von deltaL), GF1+GF2 werden einfach laenger.
|
||||
;; - "Auf": wirkt der gewuenschten Steigung entgegen -> nur fuer SEHR
|
||||
;; KLEINE deltaH ueberhaupt gueltig (wenige cm).
|
||||
;; Rueckgabe: (GF_total L_VF gueltig) oder nil falls Boegen nicht messbar.
|
||||
(defun berechne-horizontale-mitte (deltaL deltaH richtung /
|
||||
mass1 mass2 rad3 bogen-x1 bogen-z1
|
||||
bogen-x2 bogen-z2 deltaH-signiert
|
||||
A-hz B-hz GF_total L_VF-hz gueltig)
|
||||
(setq mass1 (get-bogen-mass bogen-auf 3))
|
||||
(setq mass2 (get-bogen-mass bogen-ab 3))
|
||||
(if (or (null mass1) (null mass2))
|
||||
nil
|
||||
(progn
|
||||
(setq rad3 (* 3.0 (/ pi 180.0)))
|
||||
;; Bogen1 (immer auf_3): Eintritt bei 3 Grad (von Umlenkstation), biegt auf 0 Grad
|
||||
(setq bogen-x1 (+ (* (car mass1) (cos rad3)) (* (caddr mass1) (sin rad3))))
|
||||
(setq bogen-z1 (+ (* (- (car mass1)) (sin rad3)) (* (caddr mass1) (cos rad3))))
|
||||
;; Bogen2 (immer ab_3): Eintritt bei 0 Grad (von der horizontalen Mitte), biegt auf 3 Grad
|
||||
(setq bogen-x2 (car mass2))
|
||||
(setq bogen-z2 (caddr mass2))
|
||||
;; Signierte Ziel-Hoehenaenderung: Auf=+deltaH, Ab=-deltaH
|
||||
(setq deltaH-signiert (if (= richtung "Auf") deltaH (- deltaH)))
|
||||
;; Horizontal-Budget: deltaL minus AS/ES minus beide Boegen minus feste Stationen (bei 3 Grad)
|
||||
(setq A-hz (- deltaL aus-dx ein-dx bogen-x1 bogen-x2
|
||||
(* FESTE_HORIZONTAL (cos rad3))))
|
||||
;; Hoehen-Budget: was GF1+GF2 (bei 3 Grad) noch beitragen muessen
|
||||
(setq B-hz (- (+ aus-dz ein-dz (- (* FESTE_HORIZONTAL (sin rad3)))
|
||||
bogen-z1 bogen-z2)
|
||||
deltaH-signiert))
|
||||
(setq GF_total (/ B-hz (sin rad3)))
|
||||
(setq L_VF-hz (- A-hz (* GF_total (cos rad3))))
|
||||
(setq gueltig (and (>= GF_total 0) (>= L_VF-hz 0)))
|
||||
(list GF_total L_VF-hz gueltig)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; ============================================================
|
||||
;; TEIL 5: BERECHNE-WRAPPER (Schnittstelle fuer Registry)
|
||||
;; ============================================================
|
||||
;; Initialisiert Standard-Bibliothek und berechnet Winkel.
|
||||
;; seite-Parameter wird fuer Standard-Typ nicht benoetigt (keine Vorab-Geometrie).
|
||||
;; Die Machbarkeitspruefung fuer die horizontale Zwischenstrecke passiert
|
||||
;; separat und VORAB in c:VarioFoerderer (vor der Foerderrichtung-Abfrage),
|
||||
;; deshalb liefert diese Funktion nur noch die normale Winkelsuche zurueck.
|
||||
(defun berechne-standard (deltaL deltaH richtung seite)
|
||||
(setq FESTE_HORIZONTAL (ssg-cfg-or "vario" "feste_horizontal" 1600))
|
||||
(setq staustrecke-basis (ssg-cfg-or "vario" "staustrecke_basis" 1000))
|
||||
@@ -400,19 +450,24 @@
|
||||
;; ============================================================
|
||||
;; Gibt endpunkt zurueck (letzter KS_AUS nach ES_90).
|
||||
;; VF_*-Block-Erstellung erfolgt zentral im Dispatcher (vf_core.lsp).
|
||||
;; hz: horizontale Fahrtrichtung in Grad (0=Ost/+X, 90=Nord/+Y, 180=West/-X,
|
||||
;; 270=Sued/-Y). Default 0, falls vom Aufrufer nicht mitgegeben (Etage-
|
||||
;; Registry-Kompatibilitaet - siehe c:VarioFoerderer).
|
||||
(defun variofoerderer-einfuegen (deltaL deltaH richtung best-winkel
|
||||
L_GF1 L_GF2 L_VF startpunkt seite
|
||||
L_GF1 L_GF2 L_VF startpunkt seite hz
|
||||
/ aktueller-punkt bogen-name endpunkt
|
||||
bogen-mass bogen-dx bogen-dz
|
||||
as-block es-block)
|
||||
(if (null hz) (setq hz 0.0))
|
||||
(setq hz (float hz))
|
||||
(setq aktueller-punkt startpunkt)
|
||||
(setq as-block (strcat "AS_Element_90_" seite))
|
||||
(setq es-block (strcat "ES_Element_90_" seite))
|
||||
(if (not *lib-initialized*) (init-bibliothek))
|
||||
|
||||
;; 1. AUS_Element
|
||||
(princ (strcat "\n\n1/11: " as-block " (0 Grad)"))
|
||||
(setq aktueller-punkt (insert-block-by-ks as-block aktueller-punkt))
|
||||
(princ (strcat "\n\n1/11: " as-block " (hz=" (rtos hz 2 1) grad-zeichen ")"))
|
||||
(setq aktueller-punkt (insert-block-by-ks as-block aktueller-punkt hz))
|
||||
|
||||
;; 2. 1. Gefaellestrecke
|
||||
(if (> L_GF1 0.1)
|
||||
@@ -420,7 +475,7 @@
|
||||
(princ (strcat "\n\n2/11: Gefaellestrecke (3 Grad, L=" (rtos L_GF1 2 2) " mm)"))
|
||||
(setq aktueller-punkt
|
||||
(insert-inclined-scaled-block "Staustrecke_SP_1000_mm" aktueller-punkt
|
||||
L_GF1 (ssg-cfg-or "vario" "gefaelle_winkel" 3)))
|
||||
L_GF1 (ssg-cfg-or "vario" "gefaelle_winkel" 3) hz))
|
||||
)
|
||||
(princ "\n\n2/11: (uebersprungen)")
|
||||
)
|
||||
@@ -431,7 +486,7 @@
|
||||
(insert-rotated-block-with-ks "Staustrecke_Separator_SP_300_mm" aktueller-punkt
|
||||
(ssg-cfg-or "vario" "gefaelle_winkel" 3)
|
||||
(ssg-cfg-or "vario" "separator_block_dx" 300)
|
||||
(ssg-cfg-or "vario" "separator_block_dz" 0)))
|
||||
(ssg-cfg-or "vario" "separator_block_dz" 0) hz))
|
||||
|
||||
;; 4. Umlenkstation
|
||||
(princ "\n\n4/11: Umlenkstation (500 mm, 3 Grad geneigt)")
|
||||
@@ -439,42 +494,61 @@
|
||||
(insert-rotated-block-with-ks "Vario_Umlenkstation_500mm" aktueller-punkt
|
||||
(ssg-cfg-or "vario" "gefaelle_winkel" 3)
|
||||
(ssg-cfg-or "vario" "station_block_dx" 500)
|
||||
(ssg-cfg-or "vario" "station_block_dz" 0)))
|
||||
(ssg-cfg-or "vario" "station_block_dz" 0) hz))
|
||||
|
||||
;; 5. 1. Vertikalbogen
|
||||
(if (= richtung "Auf")
|
||||
;; Sonderfall best-winkel=0 (horizontale Zwischenstrecke, siehe
|
||||
;; berechne-horizontale-mitte): Boegen IMMER auf_3/ab_3, unabhaengig von
|
||||
;; Auf/Ab, da sie nur zwischen der festen 3-Grad-Neigung und der
|
||||
;; horizontalen Mitte vermitteln muessen.
|
||||
(if (= best-winkel 0)
|
||||
(progn
|
||||
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa best-winkel)))
|
||||
(setq bogen-mass (get-bogen-mass bogen-auf best-winkel))
|
||||
(setq bogen-name "Vario_Bogen_auf_3")
|
||||
(setq bogen-mass (get-bogen-mass bogen-auf 3))
|
||||
)
|
||||
(progn
|
||||
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa best-winkel)))
|
||||
(setq bogen-mass (get-bogen-mass bogen-ab best-winkel))
|
||||
(if (= richtung "Auf")
|
||||
(progn
|
||||
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa best-winkel)))
|
||||
(setq bogen-mass (get-bogen-mass bogen-auf best-winkel))
|
||||
)
|
||||
(progn
|
||||
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa best-winkel)))
|
||||
(setq bogen-mass (get-bogen-mass bogen-ab best-winkel))
|
||||
)
|
||||
)
|
||||
)
|
||||
(setq bogen-dx (car bogen-mass) bogen-dz (caddr bogen-mass))
|
||||
(princ (strcat "\n\n5/11: " bogen-name " (3 Grad geneigt)"))
|
||||
(setq aktueller-punkt
|
||||
(insert-rotated-block-with-ks bogen-name aktueller-punkt
|
||||
(ssg-cfg-or "vario" "gefaelle_winkel" 3) bogen-dx bogen-dz))
|
||||
(ssg-cfg-or "vario" "gefaelle_winkel" 3) bogen-dx bogen-dz hz))
|
||||
|
||||
;; 6. Variable Strecke L_VF
|
||||
(if (> L_VF 0.1)
|
||||
(progn
|
||||
(if (= richtung "Auf")
|
||||
(if (= best-winkel 0)
|
||||
(progn
|
||||
(princ (strcat "\n\n6/11: Steigungsstrecke ("
|
||||
(itoa (- (- best-winkel 3))) " Grad, L=" (rtos L_VF 2 2) " mm)"))
|
||||
(princ (strcat "\n\n6/11: Horizontale Zwischenstrecke (0 Grad, L="
|
||||
(rtos L_VF 2 2) " mm)"))
|
||||
(setq aktueller-punkt
|
||||
(insert-inclined-scaled-block "Staustrecke_SP_1000_mm" aktueller-punkt
|
||||
L_VF (- (- best-winkel 3))))
|
||||
L_VF 0 hz))
|
||||
)
|
||||
(progn
|
||||
(princ (strcat "\n\n6/11: Gefaellestrecke ("
|
||||
(itoa (+ best-winkel 3)) " Grad, L=" (rtos L_VF 2 2) " mm)"))
|
||||
(setq aktueller-punkt
|
||||
(insert-inclined-scaled-block "Staustrecke_SP_1000_mm" aktueller-punkt
|
||||
L_VF (+ best-winkel 3)))
|
||||
(if (= richtung "Auf")
|
||||
(progn
|
||||
(princ (strcat "\n\n6/11: Steigungsstrecke ("
|
||||
(itoa (- (- best-winkel 3))) " Grad, L=" (rtos L_VF 2 2) " mm)"))
|
||||
(setq aktueller-punkt
|
||||
(insert-inclined-scaled-block "Staustrecke_SP_1000_mm" aktueller-punkt
|
||||
L_VF (- (- best-winkel 3)) hz))
|
||||
)
|
||||
(progn
|
||||
(princ (strcat "\n\n6/11: Gefaellestrecke ("
|
||||
(itoa (+ best-winkel 3)) " Grad, L=" (rtos L_VF 2 2) " mm)"))
|
||||
(setq aktueller-punkt
|
||||
(insert-inclined-scaled-block "Staustrecke_SP_1000_mm" aktueller-punkt
|
||||
L_VF (+ best-winkel 3) hz))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -482,31 +556,45 @@
|
||||
)
|
||||
|
||||
;; 7. 2. Vertikalbogen
|
||||
(if (= richtung "Auf")
|
||||
(if (= best-winkel 0)
|
||||
(progn
|
||||
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa best-winkel)))
|
||||
(setq bogen-mass (get-bogen-mass bogen-ab best-winkel))
|
||||
(setq bogen-name "Vario_Bogen_ab_3")
|
||||
(setq bogen-mass (get-bogen-mass bogen-ab 3))
|
||||
)
|
||||
(progn
|
||||
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa best-winkel)))
|
||||
(setq bogen-mass (get-bogen-mass bogen-auf best-winkel))
|
||||
(if (= richtung "Auf")
|
||||
(progn
|
||||
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa best-winkel)))
|
||||
(setq bogen-mass (get-bogen-mass bogen-ab best-winkel))
|
||||
)
|
||||
(progn
|
||||
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa best-winkel)))
|
||||
(setq bogen-mass (get-bogen-mass bogen-auf best-winkel))
|
||||
)
|
||||
)
|
||||
)
|
||||
(setq bogen-dx (car bogen-mass) bogen-dz (caddr bogen-mass))
|
||||
(if (= richtung "Auf")
|
||||
(if (= best-winkel 0)
|
||||
(progn
|
||||
(princ (strcat "\n\n7/11: " bogen-name
|
||||
" (" (itoa (- 3 best-winkel)) " Grad geneigt)"))
|
||||
(princ (strcat "\n\n7/11: " bogen-name " (3 Grad geneigt)"))
|
||||
(setq aktueller-punkt
|
||||
(insert-rotated-block-with-ks bogen-name aktueller-punkt
|
||||
(- 3 best-winkel) bogen-dx bogen-dz))
|
||||
0 bogen-dx bogen-dz hz))
|
||||
)
|
||||
(progn
|
||||
(princ (strcat "\n\n7/11: " bogen-name
|
||||
" (" (itoa (+ best-winkel 3)) " Grad geneigt)"))
|
||||
(setq aktueller-punkt
|
||||
(insert-rotated-block-with-ks bogen-name aktueller-punkt
|
||||
(+ best-winkel 3) bogen-dx bogen-dz))
|
||||
(if (= richtung "Auf")
|
||||
(progn
|
||||
(princ (strcat "\n\n7/11: " bogen-name
|
||||
" (" (itoa (- 3 best-winkel)) " Grad geneigt)"))
|
||||
(setq aktueller-punkt
|
||||
(insert-rotated-block-with-ks bogen-name aktueller-punkt
|
||||
(- 3 best-winkel) bogen-dx bogen-dz hz))
|
||||
)
|
||||
(progn
|
||||
(princ (strcat "\n\n7/11: " bogen-name
|
||||
" (" (itoa (+ best-winkel 3)) " Grad geneigt)"))
|
||||
(setq aktueller-punkt
|
||||
(insert-rotated-block-with-ks bogen-name aktueller-punkt
|
||||
(+ best-winkel 3) bogen-dx bogen-dz hz))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -516,7 +604,7 @@
|
||||
(insert-rotated-block-with-ks "Vario_Motorstation_500mm" aktueller-punkt
|
||||
(ssg-cfg-or "vario" "gefaelle_winkel" 3)
|
||||
(ssg-cfg-or "vario" "station_block_dx" 500)
|
||||
(ssg-cfg-or "vario" "station_block_dz" 0)))
|
||||
(ssg-cfg-or "vario" "station_block_dz" 0) hz))
|
||||
|
||||
;; 9. 2. Gefaellestrecke
|
||||
(if (> L_GF2 0.1)
|
||||
@@ -524,7 +612,7 @@
|
||||
(princ (strcat "\n\n9/11: Gefaellestrecke (3 Grad, L=" (rtos L_GF2 2 2) " mm)"))
|
||||
(setq aktueller-punkt
|
||||
(insert-inclined-scaled-block "Staustrecke_SP_1000_mm" aktueller-punkt
|
||||
L_GF2 (ssg-cfg-or "vario" "gefaelle_winkel" 3)))
|
||||
L_GF2 (ssg-cfg-or "vario" "gefaelle_winkel" 3) hz))
|
||||
)
|
||||
(princ "\n\n9/11: (uebersprungen)")
|
||||
)
|
||||
@@ -535,11 +623,11 @@
|
||||
(insert-rotated-block-with-ks "Staustrecke_Separator_SP_300_mm" aktueller-punkt
|
||||
(ssg-cfg-or "vario" "gefaelle_winkel" 3)
|
||||
(ssg-cfg-or "vario" "separator_block_dx" 300)
|
||||
(ssg-cfg-or "vario" "separator_block_dz" 0)))
|
||||
(ssg-cfg-or "vario" "separator_block_dz" 0) hz))
|
||||
|
||||
;; 11. EIN_Element
|
||||
(princ (strcat "\n\n11/11: " es-block " (0 Grad)"))
|
||||
(setq endpunkt (insert-block-by-ks es-block aktueller-punkt))
|
||||
(princ (strcat "\n\n11/11: " es-block " (hz=" (rtos hz 2 1) grad-zeichen ")"))
|
||||
(setq endpunkt (insert-block-by-ks es-block aktueller-punkt hz))
|
||||
|
||||
(princ "\n\n=========================================")
|
||||
(princ "\n>>> Standard VarioFoerderer eingefuegt!")
|
||||
|
||||
Reference in New Issue
Block a user