Eigene Routine um flache json kv Files zu parsen.

This commit is contained in:
2026-06-23 15:06:21 +02:00
parent 676117fe22
commit 86d932fa23
5 changed files with 97 additions and 18 deletions
+17 -17
View File
@@ -54,13 +54,13 @@
(defun kreisel:run-insert-test (eintrag / id x y z abstand rotation typ
pt blockEnt ed attribs block-name
block-handle insert-point)
(setq id (omni:val eintrag "id"))
(setq x (omni:val eintrag "x"))
(setq y (omni:val eintrag "y"))
(setq z (omni:val eintrag "z"))
(setq abstand (omni:val eintrag "abstand"))
(setq rotation (omni:val eintrag "rotation"))
(setq typ (omni:val eintrag "typ"))
(setq id (ssg-val eintrag "id"))
(setq x (ssg-val eintrag "x"))
(setq y (ssg-val eintrag "y"))
(setq z (ssg-val eintrag "z"))
(setq abstand (ssg-val eintrag "abstand"))
(setq rotation (ssg-val eintrag "rotation"))
(setq typ (ssg-val eintrag "typ"))
(if (numberp x) (setq x (float x)))
(if (numberp y) (setq y (float y)))
@@ -98,14 +98,14 @@
(defun kreisel:run-connect-test (eintrag / id sx sy sz ex ey ez typ
ptStart ptEnd blockEnt ed attribs
block-name block-handle insert-point)
(setq id (omni:val eintrag "id"))
(setq sx (omni:val eintrag "start_x"))
(setq sy (omni:val eintrag "start_y"))
(setq sz (omni:val eintrag "start_z"))
(setq ex (omni:val eintrag "end_x"))
(setq ey (omni:val eintrag "end_y"))
(setq ez (omni:val eintrag "end_z"))
(setq typ (omni:val eintrag "typ"))
(setq id (ssg-val eintrag "id"))
(setq sx (ssg-val eintrag "start_x"))
(setq sy (ssg-val eintrag "start_y"))
(setq sz (ssg-val eintrag "start_z"))
(setq ex (ssg-val eintrag "end_x"))
(setq ey (ssg-val eintrag "end_y"))
(setq ez (ssg-val eintrag "end_z"))
(setq typ (ssg-val eintrag "typ"))
(if (numberp sx) (setq sx (float sx)))
(if (numberp sy) (setq sy (float sy)))
@@ -194,7 +194,7 @@
(princ)
)
(progn
(setq testfaelle (omni:load-json tests-json-pfad))
(setq testfaelle (ssg-load-json tests-json-pfad))
(if (null testfaelle)
(progn
(princ "\n[TEST_KREISEL] FEHLER: Testdaten konnten nicht geladen werden.")
@@ -213,7 +213,7 @@
;; Testfaelle ausfuehren
(foreach eintrag testfaelle
(setq func (omni:val eintrag "function"))
(setq func (ssg-val eintrag "function"))
(setq result-json
(cond
((= func "insert")