Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion irteus/irtgraph.l
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,22 @@ Args:
;; fname finished with '.pdf', remove it
(setq fname (subseq str 0 (1- (length str))))
)))
(send self :write-to-file fname result-path title))
(send self :write-to-file fname result-path title "pdf"))
(:write-to-png (fname &optional result-path
(title (string-right-trim ".png" fname)))
"write graph structure to png
Args:
fname: filename for output
result-path: list of solver-node, it's result of (send solver :solve graph)
title: title of graph
"
(when (substringp ".png" fname)
(let ((str (string-right-trim "png" fname)))
(when (= (elt str (1- (length str))) #\.)
;; fname finished with '.png', remove it
(setq fname (subseq str 0 (1- (length str))))
)))
(send self :write-to-file fname result-path title "png"))
(:original-draw-mode ()
"change draw-mode to original mode"
(send self :draw-both-arc nil)
Expand Down
4 changes: 4 additions & 0 deletions irteus/test/graph.l
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@
;; write graph to pdf file
(warning-message 2 "write to /tmp/robots_in_jsk.pdf~%")
(send g :write-to-pdf "/tmp/robots_in_jsk.pdf" nil "robots_in_jsk")

;; write graph to png file
(warning-message 2 "write to /tmp/robots_in_jsk.png~%")
(send g :write-to-png "/tmp/robots_in_jsk.png" nil "robots_in_jsk")
g))

(eval-when (load eval)
Expand Down