Veraltetes Menü Etagenförderer entfernt. Testdaten für den Förderertest wird jetzt aus .json Datei geladen. Testfunktionen des Förderers bauen jetzt auch Block um jeden Förderer, damit ein Export möglich ist . Fix einiger Funktionsaufrufe in den Varioförderer Funktionen.
This commit is contained in:
@@ -16,11 +16,6 @@
|
||||
)
|
||||
|
||||
;; --- ILS / Foerderer ---
|
||||
(defun c:ILS_ETF_Etagenfoerderer ()
|
||||
(princ "\n[DUMMY] ILS_ETF_Etagenfoerderer aufgerufen")
|
||||
(princ)
|
||||
)
|
||||
|
||||
(defun c:ILS_TEF_Strecke ()
|
||||
(princ "\n[DUMMY] ILS_TEF_Strecke aufgerufen")
|
||||
(princ)
|
||||
|
||||
+1
-1
@@ -370,7 +370,7 @@
|
||||
(progn
|
||||
(setq tag (cdr (assoc 2 ed)))
|
||||
(setq wert (cdr (assoc tag attrib-alist)))
|
||||
(if (and wert (> (strlen wert) 0))
|
||||
(if (and wert (= (type wert) 'STR) (> (strlen wert) 0))
|
||||
(progn
|
||||
(entmod (subst (cons 1 wert) (assoc 1 ed) ed))
|
||||
(entupd obj)
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
)
|
||||
(setq missing '())
|
||||
(foreach bname required-blocks
|
||||
(setq datei (strcat block-pfad bname ".dxf"))
|
||||
(setq datei (strcat block-pfad bname ".dwg"))
|
||||
(if (not (findfile datei))
|
||||
(setq missing (cons datei missing))
|
||||
)
|
||||
|
||||
@@ -16,7 +16,6 @@ SSG_LIB
|
||||
│ │ ├── BTMT-Beladung → ILS_BTMT_Beladung
|
||||
│ │ └── BTMT-Entladung → ILS_BTMT_Entladung
|
||||
│ ├── Foerderer
|
||||
│ │ ├── ETF Etagenfoerderer → ILS_ETF_Etagenfoerderer
|
||||
│ │ ├── TEF Strecke → ILS_TEF_Strecke
|
||||
│ │ ├── VarioFoerderer → FOERDERANLAGE
|
||||
│ │ ├── Kurven angetr. Aussen → ILS_K{90,60,30}{LA,RA}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
[BTMT-Beladung]^C^C(ssg-ensure "SSG_LIB_Commands") ILS_BTMT_Beladung
|
||||
[<-BTMT-Entladung]^C^C(ssg-ensure "SSG_LIB_Commands") ILS_BTMT_Entladung
|
||||
[->Foerderer]
|
||||
[ETF Etagenfoerderer]^C^CI(ssg-ensure "SSG_LIB_Commands") LS_ETF_Etagenfoerderer
|
||||
[Durch TEF angetriebene Strecke]^C^C(ssg-ensure "SSG_LIB_Commands") ILS_TEF_Strecke
|
||||
[VarioFoerderer]^C^CVarioFoerderer
|
||||
[EtageVarioFoerderer]^C^CETAGEVARIOFOERDERER
|
||||
|
||||
+53
-65
@@ -1,10 +1,9 @@
|
||||
;; ============================================================
|
||||
;; test_foerderer.lsp - Automatischer Integrationstest fuer VarioFoerderer
|
||||
;;
|
||||
;; Erzeugt 12 Variofoerderer (6x Auf, 6x Ab) mit deltaL=7000
|
||||
;; und verschiedenen Hoehenstufen. Speichert:
|
||||
;; Liest Testfaelle aus tests/testdata/foerderer_tests.json.
|
||||
;; Speichert:
|
||||
;; - tests/output/foerderer_results.json (Ergebnisse)
|
||||
;; - tests/output/foerderer_tests.dwg (Zeichnung)
|
||||
;;
|
||||
;; Voraussetzungen:
|
||||
;; - SSG_LIB geladen (VarioFoerderer.lsp, ssg_core.lsp)
|
||||
@@ -70,12 +69,12 @@
|
||||
;; ============================================================
|
||||
;; C:TEST_FOERDERER - Hauptbefehl
|
||||
;; ============================================================
|
||||
(defun c:TEST_FOERDERER ( / deltaL deltaH richtung ergebnis
|
||||
best-winkel L_GF L_VF
|
||||
y-offset hoehen-liste idx
|
||||
anz-gebaut anz-nicht-gebaut
|
||||
results-list
|
||||
test-id)
|
||||
(defun c:TEST_FOERDERER ( / json-datei testdaten cfg tests
|
||||
eintrag test-id richtung deltaL deltaH
|
||||
ergebnis best-winkel L_GF L_VF
|
||||
y-offset y-abstand idx
|
||||
anz-gebaut anz-nicht-gebaut results-list
|
||||
startpunkt vf-nummer hoehe-von hoehe-bis lastEnt)
|
||||
|
||||
;; Bibliothek initialisieren (laedt Block-Library und extrahiert Masse)
|
||||
(if (not *lib-initialized*)
|
||||
@@ -87,8 +86,30 @@
|
||||
(setvar "ATTREQ" 0)
|
||||
(setvar "ATTDIA" 0)
|
||||
|
||||
(setq deltaL 7000)
|
||||
(setq hoehen-liste '(0 1000 2000 3000 4000 5000))
|
||||
;; Testdaten aus JSON laden
|
||||
(setq json-datei
|
||||
(strcat (vl-string-translate "\\" "/" (getenv "DXFMAKRO"))
|
||||
"/tests/testdata/foerderer_tests.json"))
|
||||
(setq testdaten (ssg-load-json json-datei))
|
||||
(if (null testdaten)
|
||||
(progn
|
||||
(alert (strcat "Testdaten nicht gefunden:\n" json-datei))
|
||||
(ssg-end)
|
||||
(exit)
|
||||
)
|
||||
)
|
||||
|
||||
;; Konfiguration aus erstem Eintrag (ohne test_id)
|
||||
(setq cfg (car testdaten))
|
||||
(setq y-abstand (ssg-val cfg "y_abstand"))
|
||||
(if (or (null y-abstand) (= y-abstand 0)) (setq y-abstand 400))
|
||||
|
||||
;; Nur Eintraege mit test_id sind Testfaelle
|
||||
(setq tests
|
||||
(vl-remove-if-not
|
||||
'(lambda (e) (ssg-val e "test_id"))
|
||||
testdaten))
|
||||
|
||||
(setq y-offset 0)
|
||||
(setq idx 0)
|
||||
(setq results-list '())
|
||||
@@ -99,66 +120,26 @@
|
||||
(princ "\n================================================================")
|
||||
(princ "\n TEST_FOERDERER - Variofoerderer Integrationstest")
|
||||
(princ "\n================================================================")
|
||||
(princ (strcat "\n Distanz dL = " (rtos deltaL 2 0) " mm"))
|
||||
(princ "\n Hoehenstufen: 0, 1000, 2000, 3000, 4000, 5000 mm")
|
||||
(princ "\n Richtungen: Auf + Ab")
|
||||
(princ (strcat "\n Testdaten: " json-datei))
|
||||
(princ (strcat "\n Testfaelle: " (itoa (length tests))))
|
||||
(princ (strcat "\n Y-Abstand: " (rtos y-abstand 2 0) " mm"))
|
||||
(princ "\n================================================================")
|
||||
|
||||
;; ==========================================================
|
||||
;; TEIL 1: Aufwaerts-Tests (6 Foerderer)
|
||||
;; Alle Testfaelle aus JSON ausfuehren
|
||||
;; ==========================================================
|
||||
(foreach deltaH hoehen-liste
|
||||
(foreach eintrag tests
|
||||
(setq test-id (ssg-val eintrag "test_id"))
|
||||
(setq richtung (ssg-val eintrag "richtung"))
|
||||
(setq deltaL (float (ssg-val eintrag "deltaL")))
|
||||
(setq deltaH (float (ssg-val eintrag "deltaH")))
|
||||
(setq idx (1+ idx))
|
||||
(setq richtung "Auf")
|
||||
(setq test-id (strcat "VF_Auf_" (rtos deltaH 2 0)))
|
||||
|
||||
(setq ergebnis (berechne-alle-winkel deltaL deltaH richtung))
|
||||
(setq best-winkel (car ergebnis))
|
||||
(setq L_GF (cadr ergebnis))
|
||||
(setq L_VF (caddr ergebnis))
|
||||
|
||||
(if (and best-winkel L_GF L_VF (> L_GF 0) (> L_VF 0))
|
||||
(progn
|
||||
(setq anz-gebaut (1+ anz-gebaut))
|
||||
(princ (strcat "\n " (itoa idx) ". " test-id " -> GEBAUT "
|
||||
(itoa best-winkel) " Grad L_GF=" (rtos L_GF 2 1)
|
||||
" L_VF=" (rtos L_VF 2 1)))
|
||||
|
||||
(variofoerderer-einfuegen deltaL deltaH richtung best-winkel
|
||||
(/ L_GF 2.0) (/ L_GF 2.0) L_VF
|
||||
(list 0 y-offset 0) "links" idx 0)
|
||||
|
||||
(setq results-list (cons
|
||||
(foerderer:test-result-json test-id richtung deltaL deltaH
|
||||
"GEBAUT" best-winkel L_GF L_VF)
|
||||
results-list))
|
||||
)
|
||||
(progn
|
||||
(setq anz-nicht-gebaut (1+ anz-nicht-gebaut))
|
||||
(princ (strcat "\n " (itoa idx) ". " test-id " -> NICHT_GEBAUT"))
|
||||
|
||||
(setq results-list (cons
|
||||
(foerderer:test-result-json test-id richtung deltaL deltaH
|
||||
"NICHT_GEBAUT" nil nil nil)
|
||||
results-list))
|
||||
)
|
||||
)
|
||||
(setq y-offset (- y-offset 200))
|
||||
)
|
||||
|
||||
;; ==========================================================
|
||||
;; TEIL 2: Abwaerts-Tests (6 Foerderer)
|
||||
;; ==========================================================
|
||||
(foreach deltaH hoehen-liste
|
||||
(setq idx (1+ idx))
|
||||
(setq richtung "Ab")
|
||||
(setq test-id (strcat "VF_Ab_" (rtos deltaH 2 0)))
|
||||
|
||||
(if (< deltaH 1)
|
||||
;; Geometrisch unmoeglich: Ab mit deltaH=0
|
||||
(if (and (= richtung "Ab") (< deltaH 1))
|
||||
(progn
|
||||
(setq anz-nicht-gebaut (1+ anz-nicht-gebaut))
|
||||
(princ (strcat "\n " (itoa idx) ". " test-id " -> GEOMETRISCH_UNMOEGLICH"))
|
||||
|
||||
(setq results-list (cons
|
||||
(foerderer:test-result-json test-id richtung deltaL deltaH
|
||||
"GEOMETRISCH_UNMOEGLICH" nil nil nil)
|
||||
@@ -177,9 +158,17 @@
|
||||
(itoa best-winkel) " Grad L_GF=" (rtos L_GF 2 1)
|
||||
" L_VF=" (rtos L_VF 2 1)))
|
||||
|
||||
(setq startpunkt (list 0 y-offset 0))
|
||||
(setq vf-nummer idx)
|
||||
(setq hoehe-von 0)
|
||||
(setq hoehe-bis (if (= richtung "Auf") deltaH (- deltaH)))
|
||||
(setq lastEnt (entlast))
|
||||
(variofoerderer-einfuegen deltaL deltaH richtung best-winkel
|
||||
(/ L_GF 2.0) (/ L_GF 2.0) L_VF
|
||||
(list 0 y-offset 0) "links" idx 0)
|
||||
startpunkt "links")
|
||||
(vf-block-erstellen "standard" "links" vf-nummer 0
|
||||
hoehe-von hoehe-bis deltaH deltaL L_VF L_GF
|
||||
richtung best-winkel startpunkt lastEnt)
|
||||
|
||||
(setq results-list (cons
|
||||
(foerderer:test-result-json test-id richtung deltaL deltaH
|
||||
@@ -189,7 +178,6 @@
|
||||
(progn
|
||||
(setq anz-nicht-gebaut (1+ anz-nicht-gebaut))
|
||||
(princ (strcat "\n " (itoa idx) ". " test-id " -> NICHT_GEBAUT"))
|
||||
|
||||
(setq results-list (cons
|
||||
(foerderer:test-result-json test-id richtung deltaL deltaH
|
||||
"NICHT_GEBAUT" nil nil nil)
|
||||
@@ -198,7 +186,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(setq y-offset (- y-offset 200))
|
||||
(setq y-offset (- y-offset y-abstand))
|
||||
)
|
||||
|
||||
;; ==========================================================
|
||||
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
[
|
||||
{ "y_abstand": 400 },
|
||||
{ "test_id": "VF_Auf_0", "richtung": "Auf", "deltaL": 7000, "deltaH": 0 },
|
||||
{ "test_id": "VF_Auf_1000", "richtung": "Auf", "deltaL": 7000, "deltaH": 1000 },
|
||||
{ "test_id": "VF_Auf_2000", "richtung": "Auf", "deltaL": 7000, "deltaH": 2000 },
|
||||
{ "test_id": "VF_Auf_3000", "richtung": "Auf", "deltaL": 7000, "deltaH": 3000 },
|
||||
{ "test_id": "VF_Auf_4000", "richtung": "Auf", "deltaL": 7000, "deltaH": 4000 },
|
||||
{ "test_id": "VF_Auf_5000", "richtung": "Auf", "deltaL": 7000, "deltaH": 5000 },
|
||||
{ "test_id": "VF_Ab_0", "richtung": "Ab", "deltaL": 7000, "deltaH": 0 },
|
||||
{ "test_id": "VF_Ab_1000", "richtung": "Ab", "deltaL": 7000, "deltaH": 1000 },
|
||||
{ "test_id": "VF_Ab_2000", "richtung": "Ab", "deltaL": 7000, "deltaH": 2000 },
|
||||
{ "test_id": "VF_Ab_3000", "richtung": "Ab", "deltaL": 7000, "deltaH": 3000 },
|
||||
{ "test_id": "VF_Ab_4000", "richtung": "Ab", "deltaL": 7000, "deltaH": 4000 },
|
||||
{ "test_id": "VF_Ab_5000", "richtung": "Ab", "deltaL": 7000, "deltaH": 5000 }
|
||||
]
|
||||
Reference in New Issue
Block a user