* wrap/python/cgi/ltl2tgba.in (add_options): Revamp options output

using this new function.
This commit is contained in:
Alexandre Duret-Lutz 2004-04-21 19:32:37 +00:00
parent 0c3d4fef9f
commit 5904255b14
2 changed files with 37 additions and 26 deletions

View file

@ -1,5 +1,8 @@
2004-04-21 Alexandre Duret-Lutz <adl@gnu.org> 2004-04-21 Alexandre Duret-Lutz <adl@gnu.org>
* wrap/python/cgi/ltl2tgba.in (add_options): Revamp options output
using this new function.
* wrap/python/spot.i: Process tgbaalgos/neverclaim.hh. * wrap/python/spot.i: Process tgbaalgos/neverclaim.hh.
* wrap/python/cgi/ltl2tgba.in: Display the never claim on demand. * wrap/python/cgi/ltl2tgba.in: Display the never claim on demand.

View file

@ -194,24 +194,23 @@ formula = form.getfirst('formula', '')
color_fm = '#E0D8E0' color_fm = '#E0D8E0'
color_lacim = "#F8D8E8" color_lacim = "#F8D8E8"
options = [( options_common = [
'Common options', 0, '', [
('show_formula_png', 'draw the formula', 0), ('show_formula_png', 'draw the formula', 0),
('show_automaton_png', 'draw Büchi automaton', 1), ('show_automaton_png', 'draw Büchi automaton', 1),
('show_degen_png', 'draw degeneralized Büchi automaton', 0), ('show_degen_png', 'draw degeneralized Büchi automaton', 0),
('show_never_claim', 'output Spin never claim', 0), ('show_never_claim', 'output Spin never claim', 0),
('show_lbtt', 'convert automaton for LBTT', 0), ('show_lbtt', 'convert automaton for LBTT', 0),
]), ( ]
'Debugging options', 0, '', [ options_debug = [
('show_parse', 'show traces during parsing', 0), ('show_parse', 'show traces during parsing', 0),
('show_dictionnay', 'print BDD dictionary', 0), ('show_dictionnay', 'print BDD dictionary', 0),
]), ( ]
'Couvreur/FM options', 1, color_fm, [ options_trans_fm = [
('opt_exprop', 'optimize determinism', 1), ('opt_exprop', 'optimize determinism', 1),
('opt_symb_merge', ('opt_symb_merge',
'merge states with same symbolic successor representation', 1), 'merge states with same symbolic successor representation', 1),
]), ( ]
'Couvreur/LaCIM options', 1, color_lacim, [ options_trans_lacim = [
('show_relation_set', ('show_relation_set',
'print the transition relation as a BDD set', 0), 'print the transition relation as a BDD set', 0),
('show_relation_png', ('show_relation_png',
@ -220,7 +219,7 @@ options = [(
'print the acceptance relation as a BDD set', 0), 'print the acceptance relation as a BDD set', 0),
('show_acceptance_png', ('show_acceptance_png',
'draw the acceptance relation', 0), 'draw the acceptance relation', 0),
])] ]
default_translator = 'trans_fm'; default_translator = 'trans_fm';
translators = [ translators = [
@ -300,23 +299,14 @@ an indentifier: <code>aUb</code> is an atomic proposition, unlike
column = [[], []] column = [[], []]
column[0].append("<TH>Algorithm</TH>") def add_options(opt_group, opt_column, opt_color, opt_list):
trans = form.getfirst("trans", default_translator)
for opt, desc, color in translators:
if trans == opt:
str = "checked"
else:
str = ""
globals()[opt] = str
s = '<TD bgcolor=%s><INPUT type="radio" name="trans" value="%s" %s>%s</TD>'
column[0].append(s % (color, opt, str, desc))
print """</TD></TR></TABLE><TABLE>"""
for opt_group, opt_column, opt_color, opt_list in options:
if opt_color: if opt_color:
opt_color = ' bgcolor="%s"' % opt_color opt_color = ' bgcolor="%s"' % opt_color
column[opt_column].append(("<TH%s>" % opt_color) + opt_group + "</TH>") if opt_group:
column[opt_column].append(("<TH%s>" % opt_color) + opt_group + "</TH>")
prefix = ''
else:
prefix = '&nbsp;&nbsp;&nbsp;&nbsp;'
for opt, desc, arg, in opt_list: for opt, desc, arg, in opt_list:
if formula: if formula:
val = int(form.getfirst(opt, 0)) val = int(form.getfirst(opt, 0))
@ -327,8 +317,26 @@ for opt_group, opt_column, opt_color, opt_list in options:
else: else:
str = "" str = ""
globals()[opt] = val globals()[opt] = val
s = '<TD%s><INPUT type="checkbox" name="%s" value="1"%s>%s</TD>' s = '<TD%s>%s<INPUT type="checkbox" name="%s" value="1"%s>%s</TD>'
column[opt_column].append(s % (opt_color, opt, str, desc)) column[opt_column].append((s % (opt_color, prefix, opt, str, desc)))
column[0].append("<TH>Algorithm</TH>")
trans = form.getfirst("trans", default_translator)
for opt, desc, color in translators:
if trans == opt:
str = "checked"
else:
str = ""
globals()[opt] = str
s = '<TD bgcolor=%s><INPUT type="radio" name="trans" value="%s" %s>%s</TD>'
column[0].append(s % (color, opt, str, desc))
add_options('', 0, color, globals()['options_' + opt])
print """</TD></TR></TABLE><TABLE>"""
add_options("Common Options", 1, '', options_common)
add_options("Debugging Options", 1, '', options_debug)
print '<TABLE>' print '<TABLE>'
width = range(len(column)) width = range(len(column))