(Trivial) print newlines in graphviz output for debugging
parent
1728978923
commit
e5197b2f50
|
@ -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)
|
||||
|
|
|
@ -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))))))
|
||||
|
|
Loading…
Reference in New Issue