Commit 5bf546ef authored by Benoit Barbot's avatar Benoit Barbot
Browse files

jsonify

parent 13564806
Pipeline #2216 passed with stages
in 2 minutes and 33 seconds
......@@ -104,8 +104,16 @@ struct
| StateListFull -> fprintf outfile "%a\t%i@." print_state st 1
| StateListDelay -> fprintf outfile "%a\t%i@." print_state st 1
| CoSim ->
fprintf outfile "@[<h 0>%a@. @[<v 2>@[<v 0>%a@]@]@]@."
(print_state_long rgpoly) st
fprintf outfile
"{@[<h 0>\"state\":\"%s\",@ \"clocks\":[%a],@. @[<v 2>@[<v \
0>\"transition\":[%a]@]@]@]}@."
rgpoly.statelist.(fst st).name
(fun f (_, x) ->
Array.iteri
(fun i x ->
Format.fprintf f "%s@ %f" (if i > 0 then "," else "") x)
x)
st
(fun f l ->
l
|> List.map (fun tr ->
......@@ -175,8 +183,10 @@ struct
rgpoly.statelist.((List.hd tr.ZoneGraph.miniedge)
.target)
in
fprintf f "[%s]-[%g;%g]-%g->\"%s\"@," tr.ZoneGraph.action
low up time target.name
fprintf f
"{\"label\":\"%s\",@ \"min_time\": %g,@ \
\"max_time\":%g,@ \"time\":%g,@ \"target\":\"%s\"},@,"
tr.ZoneGraph.action low up time target.name
| None -> ()))
rgpoly.ZoneGraph.statelist.(get_loc st).ZoneGraph.transition
| Debug ->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment