Skip to content
Snippets Groups Projects
Commit 7c662175 authored by erwan's avatar erwan
Browse files

Fix: the rdbgui4sasa was not quite rigth. Now it seems to work.

parent 7df6d8e0
No related branches found
No related tags found
No related merge requests found
Pipeline #66614 passed
(* Time-stamp: <modified the 07/05/2021 (at 17:28) by Erwan Jahier> *)
(* Time-stamp: <modified the 08/05/2021 (at 10:33) by Erwan Jahier> *)
#thread
#require "lablgtk3"
......@@ -49,7 +49,7 @@ let rdbg_nodes_enabled e =
((node, enab), [])
l
in
List.rev (last::res)
last::res
type daemon_kind = Distributed | Synchronous | Central | LocCentral | ManualCentral | Manual
......@@ -310,21 +310,26 @@ let custom_daemon p gtext vbox step_button round_button =
aux 0 [] nl
in
let step () =
let ne = if !e.kind <> Exit && !e.lang <> "sasa" then
next_cond !e (fun e -> e.kind = Exit && e.lang = "sasa") else !e in
e:=ne;
let nodes_enabled = rdbg_nodes_enabled !e in
let nodes = List.filter (fun (_,b) -> b) nodes_enabled in
let nodes = get_higher_prioriry nodes in
(* p ("==> gtkgui: CALL =" ^ (string_of_event !e)); *)
match !daemon_kind with
| Distributed ->
let nodes = List.map (fun x -> [x]) nodes in
let to_activate = Daemon.distributed nodes in
Hashtbl.clear daemongui_activate;
List.iter (fun n -> Hashtbl.replace daemongui_activate n true) to_activate;
sd ();
e:=next_cond !e (fun e -> e.kind = Ltop); d ();
p ("Distributed step : " ^ (String.concat "," to_activate))
| Synchronous -> (
Hashtbl.clear daemongui_activate;
List.iter (fun n -> Hashtbl.replace daemongui_activate n true) nodes;
sd ();
e:=next_cond !e (fun e -> e.kind = Ltop); d ();
p ("==> gtkgui: EXIT =" ^ (string_of_event !e));
p ("Synchronous step : " ^ (String.concat "," nodes))
)
| Central ->
......@@ -332,7 +337,7 @@ let custom_daemon p gtext vbox step_button round_button =
let to_activate = Daemon.central nodes in
Hashtbl.clear daemongui_activate;
List.iter (fun n -> Hashtbl.replace daemongui_activate n true) to_activate;
sd ();
e:=next_cond !e (fun e -> e.kind = Ltop); d ();
p ("Central step : " ^ (String.concat "," to_activate))
| LocCentral ->
......@@ -347,11 +352,11 @@ let custom_daemon p gtext vbox step_button round_button =
let to_activate = Daemon.locally_central nodes in
Hashtbl.clear daemongui_activate;
List.iter (fun n -> Hashtbl.replace daemongui_activate n true) to_activate;
sd ();
e:=next_cond !e (fun e -> e.kind = Ltop); d ();
p "Locally central step: finish me"
| ManualCentral -> () (* SNO *)
| Manual -> sd ()
| Manual -> e:=next_cond !e (fun e -> e.kind = Ltop); d ()
in
step
......@@ -390,7 +395,6 @@ let main () =
in
let p str =
text_out#set_buffer (GText.buffer ~text:str ());
Printf.fprintf oc_stdin "%s\n%!" str;
Printf.printf "%s\n%!" str;
in
(* It should be better to rely on the gtk event handler
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment