Compare commits

...

3 Commits

8 changed files with 130 additions and 83 deletions
-5
View File
@@ -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
View File
@@ -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)
+1 -1
View File
@@ -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))
)
-1
View File
@@ -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}
+60 -9
View File
@@ -103,7 +103,18 @@ def build_kreisel_details(block):
# --- Bekannte Bloecke ignorieren ---
SKIP_BLOCKS = {"K1", "K2", "K3", "K4", "KS_EIN", "KS_AUS"}
VARIO_BLOCKS = {
# Sivas-Nummern und Bezeichnungen je ILS-Elementtyp
ILS_SIVASNR = {
"kreisel": ("6200", "ILS 2.0 Kreisel"),
"eckrad": ("6210", "ILS 2.0 Eckrad"),
"zusatzmodul":("6215", "ILS 2.0 Zusatzmodul"),
"ils_weiche": ("6216", "ILS 2.0 Weichen"),
"strecke": ("6220", "ILS 2.0 Strecke - Module"),
"automation": ("6269", "ILS 2.0 Automation und Pneumatik - Gesamtanlage"),
}
# Strecken-Module: Blocknamen-Fragmente fuer Vario/Staustrecke-Elemente
STRECKE_BLOCKS = {
"AUS_Element_links", "EIN_Element_links",
"Staustrecke_SP_1000_mm", "Staustrecke_Separator_SP_300_mm",
"Vario_Spannstation_SP_500mm", "Vario_Motorstation_SP_500mm",
@@ -233,9 +244,14 @@ def process_blocks(blocks, lookup):
counters["anzahl_streckengruppen"] = 1
continue
# --- VarioFoerderer ---
for vb in VARIO_BLOCKS:
if vb in bname:
# --- ILS Eckrad ---
if bname.startswith("ECKRAD_"):
counters["anzahl_eckraeder"] += 1
continue
# --- ILS Strecke-Module (Vario/Staustrecke) ---
for sb in STRECKE_BLOCKS:
if sb in bname:
counters["anzahl_variofoerderer"] += 1
break
@@ -286,10 +302,11 @@ def process_blocks(blocks, lookup):
nr += 1
for block in kreisel_list:
sivasnr, teileart = ILS_SIVASNR["kreisel"]
items.append({
"nr": nr,
"teileart": "ILS 2.0 Kreisel",
"sivasnr": "6200",
"teileart": teileart,
"sivasnr": sivasnr,
"sivasnr_quoted": True,
"dispgruppe": 20,
"anzahl": 1,
@@ -299,8 +316,41 @@ def process_blocks(blocks, lookup):
})
nr += 1
if counters["anzahl_eckraeder"] > 0:
sivasnr, teileart = ILS_SIVASNR["eckrad"]
items.append({
"nr": nr,
"teileart": teileart,
"sivasnr": sivasnr,
"sivasnr_quoted": True,
"dispgruppe": 20,
"anzahl": counters["anzahl_eckraeder"],
"laenge_mm": "",
"hoehe_m": "",
"details": {},
})
nr += 1
if counters["anzahl_variofoerderer"] > 0:
sivasnr, teileart = ILS_SIVASNR["strecke"]
items.append({
"nr": nr,
"teileart": teileart,
"sivasnr": sivasnr,
"sivasnr_quoted": True,
"dispgruppe": 20,
"anzahl": counters["anzahl_variofoerderer"],
"laenge_mm": "",
"hoehe_m": "",
"details": {},
})
nr += 1
# ILS Automation Summierungszeile (nur wenn ILS-Elemente vorhanden)
if counters["anzahl_kreisel"] > 0 or counters["anzahl_variofoerderer"] > 0:
has_ils = (counters["anzahl_kreisel"] > 0
or counters["anzahl_eckraeder"] > 0
or counters["anzahl_variofoerderer"] > 0)
if has_ils:
automation_details = {
"Anzahl Kreisel": counters["anzahl_kreisel"],
"Anzahl Kreisel mit Pinband": counters["anzahl_kreisel_pinband"],
@@ -323,10 +373,11 @@ def process_blocks(blocks, lookup):
"Anzahl aller BTBeladung": counters["anzahl_btbeladung"],
"Anzahl aller Abwurfstationen": counters["anzahl_abwurfstationen"],
}
auto_sivasnr, auto_teileart = ILS_SIVASNR["automation"]
items.append({
"nr": nr,
"teileart": "ILS 2.0 Automation",
"sivasnr": "6270",
"teileart": auto_teileart,
"sivasnr": auto_sivasnr,
"sivasnr_quoted": True,
"dispgruppe": 20,
"anzahl": 1,
-1
View File
@@ -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
View File
@@ -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))
)
;; ==========================================================
+15
View File
@@ -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 }
]