From e5197b2f50a82ed0990f7d9db257b8f2da6debed Mon Sep 17 00:00:00 2001 From: y5nw Date: Mon, 23 Aug 2021 18:04:00 +0200 Subject: [PATCH] (Trivial) print newlines in graphviz output for debugging --- dataserver.lisp | 2 +- tracks/database.lisp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dataserver.lisp b/dataserver.lisp index 4910391..4f73f8e 100644 --- a/dataserver.lisp +++ b/dataserver.lisp @@ -104,7 +104,7 @@ (ywsw:safe-graphviz-route graph-ilroutes ("/graph/ilroutes" :method :get) () ("Return a simple graph of TCBs and available routes") - (format nil "digraph{~{\"~a\"->\"~a\";~}}" + (format nil "digraph{~%~{\"~a\"->\"~a\";~%~}}" (loop for pos being the hash-keys of (atil:ildb-tcbs *ildb*) using (hash-value tcb) append (loop with side = (atil:make-tcbside :pos pos :side 0) diff --git a/tracks/database.lisp b/tracks/database.lisp index a9d45d0..dfef05a 100644 --- a/tracks/database.lisp +++ b/tracks/database.lisp @@ -116,12 +116,13 @@ (defun gvdump (tdb) (with-output-to-string (stream) (princ "digraph{" stream) + (write-char #\Newline stream) (loop for pos being the hash-keys of tdb using (hash-value track) for connections = (track-connects track) do (loop for i from 0 to 15 for connects = (aref connections i) for trackside = (make-trackside :pos pos :side i) do (labels ((draw-connection (from to dist) - (format stream "\"~a\"->\"~a\"[label=\"~a\"];" from to dist))) + (format stream "\"~a\"->\"~a\"[label=\"~a\"];~%" from to dist))) (loop for j in (cddr connects) for target = (aref connections j) do (draw-connection trackside (car target) (cadr target))))))