Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit c53e9c14 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

lurette 0.107 Fri, 25 Oct 2002 10:51:52 +0200 by jahier

Parent-Version:      0.106
Version-Log:

source/lurettetop.ml:
ihm/xlurette/.ml:
   fix a bug when reading the .lurette_rc where the the env were added
   instead of beinf overrided when they were both specified in the rc
   file and as a comd line option.

Project-Description: Lurette
parent 75100e28
......@@ -42,7 +42,7 @@
(mlcuddidl/rdd.mli 7174 1034006019 c/40_rdd.mli 1.1)
(test/Makefile 32 1035531408 c/0_Makefile 1.8)
(source/parse_env.ml 24584 1033723811 41_parse_env. 1.29)
(ihm/xlurette/xlurette_glade_main.ml 19926 1035531408 c/12_xlurette_g 1.9)
(ihm/xlurette/xlurette_glade_main.ml 21315 1035535912 c/12_xlurette_g 1.10)
(demo/chaudiere/chaudiere_oracle.lus 107 1031732392 c/8_chaudiere_ 1.1)
(source/solver.ml 31802 1033732198 39_solver.ml 1.32)
(test/ControleurPorte.lus 3219 1032940601 c/17_Controleur 1.1)
......@@ -69,8 +69,8 @@
(test/porte.luc 1050 1032789516 b/16_porte.env 1.8)
(make_lurette 1306 1034006019 27_make_luret 1.17)
(source/control.ml 4416 1030975996 c/4_control.ml 1.3)
(ihm/xlurette/xlurette_glade_interface.ml 31659 1035531408 c/15_xlurette_g 1.6)
(source/lurettetop.ml 27058 1035531408 c/1_lurettetop 1.16)
(ihm/xlurette/xlurette_glade_interface.ml 31699 1035535912 c/15_xlurette_g 1.7)
(source/lurettetop.ml 27480 1035535912 c/1_lurettetop 1.17)
(mlcuddidl/README 1574 1034006019 d/8_README 1.1)
(source/Makefile.lurettetop 300 1035531408 d/14_Makefile.l 1.1)
(cuddaux/README 1427 1034006019 c/34_README 1.1)
......@@ -83,7 +83,7 @@
(source/env.mli 2027 1033738731 15_env.mli 1.16)
(mlcuddidl/rdd_caml.c 41613 1034006019 c/39_rdd_caml.c 1.1)
(Makefile.common.in 528 1034951022 d/12_Makefile.c 1.2)
(user-rules 13701 1035531408 c/14_myrules 1.13)
(user-rules 13891 1035535912 c/14_myrules 1.14)
(doc/archi.fig 3693 1003928781 20_archi.fig 1.1)
(source/lurette.mli 448 1016027474 11_lurette.ml 1.12)
(source/gne.mli 1552 1033397911 b/36_gne.mli 1.4)
......@@ -98,7 +98,7 @@
(test/vrai_tram.c 3060 1027066799 b/8_vrai_tram. 1.3)
(Makefile 941 1035531408 d/13_Makefile 1.1)
(source/command_line.mli 1482 1035531408 b/21_command_li 1.8)
(ihm/xlurette/xlurette.glade 47909 1035531408 c/13_xlurette.g 1.7)
(ihm/xlurette/xlurette.glade 47917 1035535912 c/13_xlurette.g 1.8)
(demo/chaudiere/chaudiere.luc 446 1032789516 c/11_chaudiere. 1.5)
(source/graph.mli 2218 1027066799 13_graph.mli 1.9)
(mlcuddidl/bdd_caml.c 57199 1034006019 d/4_bdd_caml.c 1.1)
......
......@@ -1036,7 +1036,7 @@
<widget>
<class>GtkRadioButton</class>
<name>radiobutton15</name>
<name>radiobutton_user_seed</name>
<tooltip>Manually initialize the random engine</tooltip>
<can_focus>True</can_focus>
<label>Manual</label>
......
......@@ -704,7 +704,7 @@ let radiobutton_random_seed = GButton.radio_button
in
let _ = GtkBase.Widget.set_can_focus radiobutton_random_seed#as_widget true in
let _ = tooltips#set_tip ~text:"The seed (that initializes the random engine) is set randomly" radiobutton_random_seed#coerce in
let radiobutton15 = GButton.radio_button
let radiobutton_user_seed = GButton.radio_button
~group:radiobutton_random_seed#group
~packing:(hbox9#pack ~padding:0
~fill:false
......@@ -715,8 +715,8 @@ let radiobutton15 = GButton.radio_button
~active:false
()
in
let _ = GtkBase.Widget.set_can_focus radiobutton15#as_widget true in
let _ = tooltips#set_tip ~text:"Manually initialize the random engine" radiobutton15#coerce in
let _ = GtkBase.Widget.set_can_focus radiobutton_user_seed#as_widget true in
let _ = tooltips#set_tip ~text:"Manually initialize the random engine" radiobutton_user_seed#coerce in
let user_seed = GEdit.spin_button
~adjustment:(GData.adjustment~value:1013220000.
~lower:0.
......@@ -1159,7 +1159,7 @@ method vbox9 = vbox9
method hbox9 = hbox9
method label16 = label16
method radiobutton_random_seed = radiobutton_random_seed
method radiobutton15 = radiobutton15
method radiobutton_user_seed = radiobutton_user_seed
method user_seed = user_seed
method hbox2 = hbox2
method label11 = label11
......
......@@ -24,7 +24,7 @@ let _ =
set_binary_mode_in ic false;
set_binary_mode_out oc false
(* XXX won't work under window$ !!! *)
; Unix.set_nonblock lurette_stdout_out
(* ; Unix.set_nonblock lurette_stdout_out *)
; Unix.set_nonblock lurette_stdout_in
type draw_mode = Verteces | Edges | Inside
......@@ -57,12 +57,11 @@ class customized_callbacks = object(self)
let str = input_line ic in
if debug then (print_string (str ^ "\n"); flush stdout);
if
str = ""
then
()
else
if
str = ""
then
()
else if
str = "One more loop ? [type any char to stop, `CR' to continue]"
then
display (
......@@ -91,25 +90,24 @@ class customized_callbacks = object(self)
String.length str > 7 && String.sub str 0 8 = "<lurette"
then
()
else if
((String.length str > 9) && ((String.sub str 0 9) = "--- step "))
then
(
let dot_index = String.index str ':' in
let step_str = String.sub str 9 (dot_index-9) in
let stepf = float_of_string step_str in
progress stepf;
if self#top_xlurette#radiobutton_verbose_on#active then
display (str ^ "\n")
)
else
if
((String.length str > 9) && ((String.sub str 0 9) = "--- step "))
then
(
let dot_index = String.index str ':' in
let step_str = String.sub str 9 (dot_index-9) in
let stepf = float_of_string step_str in
progress stepf;
if self#top_xlurette#radiobutton_verbose_on#active then
display (str ^ " ******\n")
)
else
display (str ^ "\n")
done
with _ -> ()
display (str ^ "\n")
done
with _ -> ()
);
true
method show_step_window () =
self#top_step_by_step_window#step_by_step_window#show ()
......@@ -315,7 +313,7 @@ class customized_callbacks = object(self)
^ cmd_rif_file ^ cmd_env ^ cmd_sut ^ cmd_step ^ cmd_seed
^ cmd_draw_mode ^ cmd_call_sim2chro ^ cmd_display_local
^ cmd_verbose ^ cmd_show_step
method run_lurette () =
let all_cmds = (self#get_all_cmds ()) ^ "run\n" in
......@@ -346,9 +344,6 @@ class customized_callbacks = object(self)
()
method get_env () =
self#top_xlurette#env_name#text
method set_env str =
......@@ -402,11 +397,6 @@ class customized_callbacks = object(self)
method read_commands line =
let lexer = Genlex.make_lexer [] in
......@@ -477,14 +467,45 @@ class customized_callbacks = object(self)
| [< 'Genlex.Ident "set_formula_nb" ; 'Genlex.Int i >] ->
self#set_formula_nb i
| [< 'Genlex.Ident "set_draw_nb" ; 'Genlex.Int i >] ->
self#set_draw_nb i
| [< 'Genlex.Ident "set_seed" ; 'Genlex.Int i >] ->
self#top_xlurette#radiobutton_user_seed#set_active true ;
self#set_seed i
(* XXX Not all are there !!! FINISH ME !*)
| [< _ >] -> ()
| [< 'Genlex.Ident "set_seed_randomly" >] ->
self#top_xlurette#radiobutton_random_seed#set_active true
| [< 'Genlex.Ident "set_step_by_step" ; 'Genlex.Ident id >] ->
if id = "true"
then self#top_xlurette#radiobutton_step_yes#set_active true
else self#top_xlurette#radiobutton_step_no#set_active true
| [< 'Genlex.Ident "set_display_sim2chro" ; 'Genlex.Ident id >] ->
if id = "true"
then self#top_xlurette#radiobutton_call_sim2chro_yes#set_active true
else self#top_xlurette#radiobutton_call_sim2chro_no#set_active true
| [< 'Genlex.Ident "set_display_local_var" ; 'Genlex.Ident id >] ->
if id = "true"
then self#top_xlurette#radiobutton_display_local_yes#set_active true
else self#top_xlurette#radiobutton_display_local_no#set_active true
| [< 'Genlex.Ident "set_verbose" ; 'Genlex.Ident id >] ->
if id = "true"
then self#top_xlurette#radiobutton_verbose_on#set_active true
else self#top_xlurette#radiobutton_verbose_off#set_active true
| [< 'Genlex.Ident "set_show_step" ; 'Genlex.Ident id >] ->
if id = "true"
then self#top_xlurette#radiobutton_show_step_on#set_active true
else self#top_xlurette#radiobutton_show_step_off#set_active true
| [< _ >] -> ()
)
in
......@@ -566,9 +587,6 @@ let rec speclist callbacks =
let main () =
let _ =
let _ =
......@@ -654,31 +672,34 @@ let main () =
read the lurettetop command line options (that will override the
.lurette.=_rc ones)
*)
( try
Arg.parse (speclist callbacks)
(fun s ->
if s = "x"
then callbacks#set_env ((callbacks#get_env ()) ^ " x ")
else callbacks#set_env ((callbacks#get_env ()) ^ " " ^ s )
)
usage
with
Failure(e) ->
(
print_string e;
flush stdout ;
flush stderr ;
exit 2
)
| _ ->
let env_saved = callbacks#get_env () in
callbacks#set_env "";
( try
Arg.parse (speclist callbacks)
(fun s ->
if s = "x"
then callbacks#set_env ((callbacks#get_env ()) ^ " x ")
else callbacks#set_env ((callbacks#get_env ()) ^ " " ^ s )
)
usage
with
Failure(e) ->
(
print_string e;
flush stdout ;
flush stderr ;
exit 2
)
| _ ->
exit 2
);
);
if (callbacks#get_env () = "") then callbacks#set_env env_saved;
xlurette#xlurette#show() ;
let _ = Timeout.add ~ms:100 ~callback:callbacks#read_pipe in
xlurette#xlurette#show() ;
let _ = Timeout.add ~ms:100 ~callback:callbacks#read_pipe in
Main.main ()
Main.main ()
......
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "Lurette")
(Project-Version lurette 0 106)
(Parent-Version lurette 0 105)
(Project-Version lurette 0 107)
(Parent-Version lurette 0 106)
(Version-Log "
source/lurettetop.ml:
Add a --prefix <string> option that is added before the call
to lurette (usefull, eg, for timing purpuses).
source/lurettetop.ml:
source/lurette.ml:
source/command_line.ml:
ihm/xlurette/*
Add a ---show-step options that let one control whether or not
the step number is printed.
ihm/xlurette/.ml:
fix a bug when reading the .lurette_rc where the the env were added
instead of beinf overrided when they were both specified in the rc
file and as a comd line option.
")
(New-Version-Log ""
)
(Checkin-Time "Fri, 25 Oct 2002 09:36:48 +0200")
(Checkin-Time "Fri, 25 Oct 2002 10:51:52 +0200")
(Checkin-Login jahier)
(Populate-Ignore ())
(Project-Keywords)
......@@ -85,7 +79,7 @@ ihm/xlurette/*
(source/gne.mli (lurette/b/36_gne.mli 1.4 644))
(source/gne.ml (lurette/b/37_gne.ml 1.4 644))
(source/lurettetop.ml (lurette/c/1_lurettetop 1.16 644))
(source/lurettetop.ml (lurette/c/1_lurettetop 1.17 644))
(source/gen_stubs.ml (lurette/24_generate_l 1.38 644))
(source/control.mli (lurette/c/3_control.ml 1.2 644))
......@@ -108,7 +102,7 @@ ihm/xlurette/*
(Makefile.common.in (lurette/d/12_Makefile.c 1.2 644))
(OcamlMakefile (lurette/17_OcamlMakef 1.45 644))
(Makefile.lurette (lurette/b/38_Makefile.l 1.14 644))
(user-rules (lurette/c/14_myrules 1.13 644))
(user-rules (lurette/c/14_myrules 1.14 644))
(user-rules.skel (lurette/c/25_user-rules 1.1 644))
(source/Makefile.show_luc (lurette/b/40_Makefile.s 1.7 644))
......@@ -171,9 +165,9 @@ ihm/xlurette/*
(test/Makefile (lurette/c/0_Makefile 1.8 644))
;; xlurette
(ihm/xlurette/xlurette_glade_main.ml (lurette/c/12_xlurette_g 1.9 644))
(ihm/xlurette/xlurette.glade (lurette/c/13_xlurette.g 1.7 644))
(ihm/xlurette/xlurette_glade_interface.ml (lurette/c/15_xlurette_g 1.6 644))
(ihm/xlurette/xlurette_glade_main.ml (lurette/c/12_xlurette_g 1.10 644))
(ihm/xlurette/xlurette.glade (lurette/c/13_xlurette.g 1.8 644))
(ihm/xlurette/xlurette_glade_interface.ml (lurette/c/15_xlurette_g 1.7 644))
(ihm/xlurette/makefile (lurette/c/16_makefile 1.5 644))
......
......@@ -160,6 +160,9 @@ let rec speclist =
"--show-step", Arg.Set flag.show_step,
"\t\tSet on the show step mode.";
"--do-not-show-step", Arg.Clear flag.show_step,
"\t\tSet off the show step mode.";
"--verbose", Arg.Set flag.verbose,
"\t\tSet on the verbose mode.";
"-v", Arg.Set flag.verbose,"\n";
......@@ -297,7 +300,7 @@ let (run : string -> int) =
if !(flag.display_local_var) then " --display-local-var " else " -nlv "
in
let times0 = Unix.times () in
let run_cmd =
let run _cmd =
(flag.prefix ^ " " ^ lurette_tmp_dir ^ "/lurette " ^
(string_of_int flag.step_nb) ^ " " ^
(string_of_int flag.formula_nb) ^ " " ^
......@@ -894,29 +897,35 @@ let _ =
(* read the lurettetop command line options (that will override the
.lurette.=_rc ones) *)
try
Arg.parse speclist
(fun s ->
if s = "x"
then flag.env <- (flag.env ^ " x ")
else flag.env <-
let env =
try Filename.chop_extension s
with Invalid_argument _ -> s
in
if Filename.is_implicit env
then (flag.env ^ user_dir ^ env ^ ".luc ")
else (flag.env ^ env ^ ".luc ")
)
usage
with
Failure(e) ->
print_string e;
flush stdout ;
flush stderr ;
exit 2
| _ ->
exit 2
let env_saved = flag.env in
flag.env <- "";
( try
Arg.parse speclist
(fun s ->
if s = "x"
then flag.env <- (flag.env ^ " x ")
else flag.env <-
let env =
try Filename.chop_extension s
with Invalid_argument _ -> s
in
if Filename.is_implicit env
then (flag.env ^ user_dir ^ env ^ ".luc ")
else (flag.env ^ env ^ ".luc ")
)
usage
with
Failure(e) ->
print_string e;
flush stdout ;
flush stderr ;
exit 2
| _ ->
exit 2
);
if (flag.env = "") then flag.env <- env_saved;
in
let _ = Sys.command ("cp " ^ lurette_dir ^ "/source/lurette.ml " ^ lurette_tmp_dir ^
" ; cp " ^ lurette_dir ^ "/source/lurette.mli " ^ lurette_tmp_dir)
......
......@@ -56,31 +56,31 @@ giro:
time:
rm -f time.res; touch time.res ; \
$(LURETTE_PATH)/bin/lurettetop --prefix "/usr/bin/time -o time.res -a -v " -go -l 10000 -td 1 -tf 1 \
--no-local-var -sut ControleurPorte -seed 1015403953 -ns2c tram usager porte passerelle ;\
--do-not-show-step --no-local-var -sut ControleurPorte -seed 1015403953 -ns2c tram usager porte passerelle ;\
echo " " >> time.res;\
\
$(LURETTE_PATH)/bin/lurettetop --prefix "/usr/bin/time -o time.res -a -v " -go -l 10 -td 100 -tf 100 \
--no-local-var -sut ControleurPorte -seed 1015403953 -ns2c tram usager porte passerelle ;\
--do-not-show-step --no-local-var -sut ControleurPorte -seed 1015403953 -ns2c tram usager porte passerelle ;\
echo " " >> time.res;\
\
$(LURETTE_PATH)/bin/lurettetop --prefix "/usr/bin/time -o time.res -a -v " -go -l 100 -td 50 -tf 50 \
--no-local-var -sut ControleurPorte -seed 1015403953 -ns2c tram usager porte passerelle ;\
--do-not-show-step --no-local-var -sut ControleurPorte -seed 1015403953 -ns2c tram usager porte passerelle ;\
echo " " >> time.res;\
\
$(LURETTE_PATH)/bin/lurettetop --prefix "/usr/bin/time -o time.res -a -v " -go -l 10000 -td 1 -tf 1 --no-local-var -sut heater_float -seed 1015403953 \
-ns2c temp_float ;\
--do-not-show-step -ns2c temp_float ;\
echo " " >> time.res;\
\
$(LURETTE_PATH)/bin/lurettetop --prefix "/usr/bin/time -o time.res -a -v " -go --no-local-var -sut heater_float -l 10 -td 100 -tf 100 -seed 1015403953 \
-ns2c temp_float ;\
--do-not-show-step -ns2c temp_float ;\
echo " " >> time.res;\
\
$(LURETTE_PATH)/bin/lurettetop --prefix "/usr/bin/time -o time.res -a -v " -go --no-local-var -sut heater_int -l 10000 -td 1 -tf 1 -seed 1015403953 \
-ns2c temp_int;\
--do-not-show-step -ns2c temp_int;\
echo " " >> time.res;\
\
$(LURETTE_PATH)/bin/lurettetop --prefix "/usr/bin/time -o time.res -a -v " -go --no-local-var -sut heater_int -l 10 -td 100 -tf 100 -seed 1015403953 \
-ns2c temp_int ;\
--do-not-show-step -ns2c temp_int ;\
\rm -f time.diff; diff -u time.exp time.res >> time.diff; cat time.diff
......@@ -89,20 +89,20 @@ time:
test1:
rm -f ControleurPorte.rif; touch ControleurPorte.rif; \
lurettetop --sut ControleurPorte.lus -l 100 -tf 10 -td 10 \
-o ControleurPorte.rif --seed 1013219512 -ns2c -go \
--do-not-show-step -o ControleurPorte.rif --seed 1013219512 -ns2c -go \
tram.luc usager.luc porte.luc passerelle.luc ;\
rm -f test1.res; diff -u ControleurPorte.rif.exp ControleurPorte.rif > test1.res
test2:
rm -f heater_int.rif; touch heater_int.rif; \
lurettetop -l 30 -tf 10 -td 10 --sut heater_int --seed 1013219512 \
-ns2c -go -o heater_int.rif -go temp_int ;\
--do-not-show-step -ns2c -go -o heater_int.rif -go temp_int ;\
rm -f test3.res; diff -u heater_int.rif.exp heater_int.rif > test2.res
test3:
rm -f heater_float.rif; touch heater_float.rif; \
lurettetop -go -l 30 -tf 10 -td 10 --sut heater_float --seed 1013219512 \
-ns2c -o heater_float.rif temp_float;\
--do-not-show-step -ns2c -o heater_float.rif temp_float;\
rm -f test3.res; diff -u heater_float.rif.exp heater_float.rif > test3.res
test: test1 test2 test3
......
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