Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
verimag
synchrone
sasa
Commits
7c662175
Commit
7c662175
authored
May 08, 2021
by
erwan
Browse files
Fix: the rdbgui4sasa was not quite rigth. Now it seems to work.
parent
7df6d8e0
Pipeline
#66614
passed with stages
in 3 minutes and 36 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
tools/rdbg4sasa/gtkgui.ml
View file @
7c662175
(* Time-stamp: <modified the 0
7
/05/2021 (at 1
7:28
) by Erwan Jahier> *)
(* Time-stamp: <modified the 0
8
/05/2021 (at 1
0: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
;
s
d
()
;
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
;
s
d
()
;
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
;
s
d
()
;
e
:=
next_cond
!
e
(
fun
e
->
e
.
kind
=
Ltop
);
d
()
;
p
"Locally central step: finish me"
|
ManualCentral
->
()
(* SNO *)
|
Manual
->
s
d
()
|
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment