* wrap/python/cgi/ltl2tgba.in: Convert GIFs to PNGs. Restrict

the size of dot's output to 1024x1024.
* src/tgbaalgos/dotty.cc (dotty_bfs::start): Do not preset
the size of the graph.  Set height=0 for the invisible state.
This commit is contained in:
Alexandre Duret-Lutz 2003-08-07 12:14:01 +00:00
parent e88b41d8c9
commit 1276abd290
4 changed files with 32 additions and 13 deletions

View file

@ -1,3 +1,10 @@
2003-08-07 Alexandre Duret-Lutz <adl@gnu.org>
* wrap/python/cgi/ltl2tgba.in: Convert GIFs to PNGs. Restrict
the size of dot's output to 1024x1024.
* src/tgbaalgos/dotty.cc (dotty_bfs::start): Do not preset
the size of the graph. Set height=0 for the invisible state.
2003-08-06 Alexandre Duret-Lutz <adl@gnu.org> 2003-08-06 Alexandre Duret-Lutz <adl@gnu.org>
* src/ltlparse/ltlparse.yy: Fix precedence OP_OR < OP_XOR < OP_AND. * src/ltlparse/ltlparse.yy: Fix precedence OP_OR < OP_XOR < OP_AND.

View file

@ -18,8 +18,7 @@ namespace spot
start() start()
{ {
os_ << "digraph G {" << std::endl; os_ << "digraph G {" << std::endl;
os_ << " size=\"7.26,10.69\"" << std::endl; os_ << " 0 [label=\"\", style=invis, height=0]" << std::endl;
os_ << " 0 [label=\"\", style=invis]" << std::endl;
os_ << " 0 -> 1" << std::endl; os_ << " 0 -> 1" << std::endl;
} }

View file

@ -37,5 +37,8 @@ You have to install the script yourself if you want to test it.
will run the script when the HTTP server processes the will run the script when the HTTP server processes the
request. request.
ltl2tgba purges old files (>10min) from this directory ltl2tgba purges old files (>10min) from this directory
each time it runs. each time it runs.
4) `dot' from the GraphViz package, and `convert' from
the ImageMagick package should be in the PATH.

View file

@ -126,9 +126,11 @@ if show_formula_gif:
outfile = spot.ofstream(imgprefix + '-f.dot') outfile = spot.ofstream(imgprefix + '-f.dot')
spot.dotty(outfile, f) spot.dotty(outfile, f)
del outfile del outfile
os.spawnlp(os.P_WAIT, 'dot', 'dot', '-Tgif', '-o', os.spawnlp(os.P_WAIT, 'dot', 'dot', '-Tgif', '-Gsize=14,14', '-o',
imgprefix + '-f.gif', imgprefix + '-f.dot') imgprefix + '-f.gif', imgprefix + '-f.dot')
print '<img src="' + imgprefix + '-f.gif">' os.spawnlp(os.P_WAIT, 'convert', 'convert',
imgprefix + '-f.gif', imgprefix + '-f.png')
print '<img src="' + imgprefix + '-f.png">'
print '<H2>Automaton</H2>' print '<H2>Automaton</H2>'
@ -155,9 +157,11 @@ if show_automaton_gif:
outfile = spot.ofstream(imgprefix + '-a.dot') outfile = spot.ofstream(imgprefix + '-a.dot')
spot.dotty_reachable(outfile, concrete) spot.dotty_reachable(outfile, concrete)
del outfile del outfile
os.spawnlp(os.P_WAIT, 'dot', 'dot', '-Tgif', '-o', os.spawnlp(os.P_WAIT, 'dot', 'dot', '-Tgif', '-Gsize=14,14', '-o',
imgprefix + '-a.gif', imgprefix + '-a.dot') imgprefix + '-a.gif', imgprefix + '-a.dot')
print '<img src="' + imgprefix + '-a.gif">' os.spawnlp(os.P_WAIT, 'convert', 'convert',
imgprefix + '-a.gif', imgprefix + '-a.png')
print '<img src="' + imgprefix + '-a.png">'
if show_degen_dot or show_degen_gif: if show_degen_dot or show_degen_gif:
@ -174,9 +178,11 @@ if show_degen_dot or show_degen_gif:
outfile = spot.ofstream(imgprefix + '-d.dot') outfile = spot.ofstream(imgprefix + '-d.dot')
spot.dotty_reachable(outfile, degen) spot.dotty_reachable(outfile, degen)
del outfile del outfile
os.spawnlp(os.P_WAIT, 'dot', 'dot', '-Tgif', '-o', os.spawnlp(os.P_WAIT, 'dot', 'dot', '-Tgif', '-Gsize=14,14', '-o',
imgprefix + '-d.gif', imgprefix + '-d.dot') imgprefix + '-d.gif', imgprefix + '-d.dot')
print '<img src="' + imgprefix + '-d.gif">' os.spawnlp(os.P_WAIT, 'convert', 'convert',
imgprefix + '-d.gif', imgprefix + '-d.png')
print '<img src="' + imgprefix + '-d.png">'
else: else:
degen = 0 degen = 0
@ -200,9 +206,11 @@ if show_relation_dot or show_relation_set or show_relation_gif:
spot.bdd_print_dot(outfile, concrete.get_dict(), spot.bdd_print_dot(outfile, concrete.get_dict(),
concrete.get_core_data().relation) concrete.get_core_data().relation)
del outfile del outfile
os.spawnlp(os.P_WAIT, 'dot', 'dot', '-Tgif', '-o', os.spawnlp(os.P_WAIT, 'dot', 'dot', '-Tgif', '-Gsize=14,14', '-o',
imgprefix + '-b.gif', imgprefix + '-b.dot') imgprefix + '-b.gif', imgprefix + '-b.dot')
print '<img src="' + imgprefix + '-b.gif">' os.spawnlp(os.P_WAIT, 'convert', 'convert',
imgprefix + '-b.gif', imgprefix + '-b.png')
print '<img src="' + imgprefix + '-b.png">'
if show_acceptance_dot or show_acceptance_set or show_acceptance_gif: if show_acceptance_dot or show_acceptance_set or show_acceptance_gif:
print '<H3>Acceptance relation</H3>' print '<H3>Acceptance relation</H3>'
@ -217,9 +225,11 @@ if show_acceptance_dot or show_acceptance_set or show_acceptance_gif:
spot.bdd_print_dot(outfile, concrete.get_dict(), spot.bdd_print_dot(outfile, concrete.get_dict(),
concrete.get_core_data().accepting_conditions) concrete.get_core_data().accepting_conditions)
del outfile del outfile
os.spawnlp(os.P_WAIT, 'dot', 'dot', '-Tgif', '-o', os.spawnlp(os.P_WAIT, 'dot', 'dot', '-Tgif', '-Gsize=14,14', '-o',
imgprefix + '-c.gif', imgprefix + '-c.dot') imgprefix + '-c.gif', imgprefix + '-c.dot')
print '<img src="' + imgprefix + '-c.gif">' os.spawnlp(os.P_WAIT, 'convert', 'convert',
imgprefix + '-c.gif', imgprefix + '-c.png')
print '<img src="' + imgprefix + '-c.png">'
if show_lbtt: if show_lbtt:
print '<H3>LBTT conversion</H3>' print '<H3>LBTT conversion</H3>'