Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sasa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
verimag
synchrone
sasa
Commits
47f12787
Commit
47f12787
authored
3 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
Update: take advantage of the new rdbg mv_hook Exit event for more robustness
parent
229c1479
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#67033
passed
3 years ago
Stage: build
Stage: release
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sasa.opam
+1
-1
1 addition, 1 deletion
sasa.opam
tools/rdbg4sasa/gtkgui.ml
+36
-23
36 additions, 23 deletions
tools/rdbg4sasa/gtkgui.ml
with
37 additions
and
24 deletions
sasa.opam
+
1
−
1
View file @
47f12787
...
@@ -23,7 +23,7 @@ depends: [
...
@@ -23,7 +23,7 @@ depends: [
"dune" { >= "1.11" }
"dune" { >= "1.11" }
"ocamlgraph"
"ocamlgraph"
"lutils"
"lutils"
"rdbg" { >= "1.19
3.1
" }
"rdbg" { >= "1.19
4
" }
]
]
depopts: [
depopts: [
"lustre-v6"
"lustre-v6"
...
...
This diff is collapsed.
Click to expand it.
tools/rdbg4sasa/gtkgui.ml
+
36
−
23
View file @
47f12787
(* Time-stamp: <modified the 1
1
/05/2021 (at 1
8:19
) by Erwan Jahier> *)
(* Time-stamp: <modified the 1
4
/05/2021 (at 1
5:40
) by Erwan Jahier> *)
#
thread
#
thread
#
require
"lablgtk3"
#
require
"lablgtk3"
...
@@ -69,16 +69,23 @@ let daemongui_activate = Hashtbl.create 1
...
@@ -69,16 +69,23 @@ let daemongui_activate = Hashtbl.create 1
let
(
fake_val_of_type
:
Data
.
t
->
Data
.
v
)
=
function
let
(
fake_val_of_type
:
Data
.
t
->
Data
.
v
)
=
function
|
Bool
->
B
false
|
Bool
->
B
false
|
Int
->
I
0
|
Int
->
I
(
Random
.
int
10
)
|
Real
->
F
0
.
0
|
Real
->
F
(
Random
.
float
1
0
.
0
)
|
Extern
_
|
Extern
_
->
assert
false
|
Enum
_
|
Enum
_
->
assert
false
|
Struct
_
|
Struct
_
->
assert
false
|
Array
_
|
Array
_
->
assert
false
|
Alpha
_
|
Alpha
_
->
assert
false
|
Alias
_
|
Alias
_
->
assert
false
|
String
_
->
assert
false
|
String
_
->
assert
false
(* *)
let
goto_hook_call
()
=
e
:=
next_cond
!
e
(
fun
e
->
e
.
name
=
"mv_hook"
&&
e
.
kind
=
Call
)
let
goto_hook_exit
()
=
e
:=
next_cond
!
e
(
fun
e
->
e
.
name
=
"mv_hook"
&&
e
.
kind
=
Exit
)
let
init_rdbg_hook
()
=
let
init_rdbg_hook
()
=
let
guidaemon
sl
=
let
guidaemon
sl
=
if
sl
=
[]
then
if
sl
=
[]
then
...
@@ -144,9 +151,12 @@ let custom_daemon p gtext vbox step_button round_button =
...
@@ -144,9 +151,12 @@ let custom_daemon p gtext vbox step_button round_button =
set_tooltip
dk_manual
(
Printf
.
sprintf
"Set the manual mode"
);
set_tooltip
dk_manual
(
Printf
.
sprintf
"Set the manual mode"
);
set_tooltip
dk_manual_central
(
Printf
.
sprintf
"Set the manual central mode"
);
set_tooltip
dk_manual_central
(
Printf
.
sprintf
"Set the manual central mode"
);
(* Necessary for pour salut *)
(* Necessary for salut (to perform a fake step that let sasa provide
if
args
.
salut_mode
then
e
:=
next_cond
!
e
(
fun
e
->
e
.
kind
=
Ltop
);
the first set of enables) *)
(* if !e.kind <> Exit then e := next_cond !e (fun e -> e.kind = Exit && e.depth = 2); *)
if
args
.
salut_mode
then
(
goto_hook_call
()
;
goto_hook_call
()
;
d
()
);
let
nodes_enabled
=
rdbg_nodes_enabled
!
e
in
let
nodes_enabled
=
rdbg_nodes_enabled
!
e
in
(** Met à jour le hook pour node quand le bouton ou une checkbox correspondant est activé *)
(** Met à jour le hook pour node quand le bouton ou une checkbox correspondant est activé *)
...
@@ -233,7 +243,8 @@ let custom_daemon p gtext vbox step_button round_button =
...
@@ -233,7 +243,8 @@ let custom_daemon p gtext vbox step_button round_button =
ignore
(
pushbox
#
event
#
connect
#
button_press
ignore
(
pushbox
#
event
#
connect
#
button_press
~
callback
:
(
fun
_
->
~
callback
:
(
fun
_
->
update_rdbg_hook
name
true
;
update_rdbg_hook
name
true
;
sd
()
;
goto_hook_call
()
;
goto_hook_call
()
;
refresh
()
;
refresh
()
;
false
));
false
));
Hashtbl
.
add
pushbox_map
name
pushbox
Hashtbl
.
add
pushbox_map
name
pushbox
...
@@ -348,9 +359,6 @@ let custom_daemon p gtext vbox step_button round_button =
...
@@ -348,9 +359,6 @@ let custom_daemon p gtext vbox step_button round_button =
aux
0
[]
nl
aux
0
[]
nl
in
in
let
step
()
=
let
step
()
=
let
ne
=
if
!
e
.
name
=
"mv_hook"
then
next_cond
!
e
(
fun
e
->
e
.
name
=
"mv_hook"
)
else
!
e
in
e
:=
ne
;
let
nodes_enabled
=
rdbg_nodes_enabled
!
e
in
let
nodes_enabled
=
rdbg_nodes_enabled
!
e
in
let
nodes
=
List
.
filter
(
fun
(
_
,
b
)
->
b
)
nodes_enabled
in
let
nodes
=
List
.
filter
(
fun
(
_
,
b
)
->
b
)
nodes_enabled
in
let
nodes
=
get_higher_prioriry
nodes
in
let
nodes
=
get_higher_prioriry
nodes
in
...
@@ -361,19 +369,19 @@ let custom_daemon p gtext vbox step_button round_button =
...
@@ -361,19 +369,19 @@ let custom_daemon p gtext vbox step_button round_button =
let
to_activate
=
Daemon
.
distributed
nodes
in
let
to_activate
=
Daemon
.
distributed
nodes
in
Hashtbl
.
clear
daemongui_activate
;
Hashtbl
.
clear
daemongui_activate
;
List
.
iter
(
fun
n
->
Hashtbl
.
replace
daemongui_activate
n
true
)
to_activate
;
List
.
iter
(
fun
n
->
Hashtbl
.
replace
daemongui_activate
n
true
)
to_activate
;
e
:=
next_cond
!
e
(
fun
e
->
e
.
kind
=
Ltop
);
d
()
;
goto_hook_exit
()
;
goto_hook_call
(
)
;
d
()
)
)
|
Synchronous
->
(
|
Synchronous
->
(
Hashtbl
.
clear
daemongui_activate
;
Hashtbl
.
clear
daemongui_activate
;
List
.
iter
(
fun
n
->
Hashtbl
.
replace
daemongui_activate
n
true
)
nodes
;
List
.
iter
(
fun
n
->
Hashtbl
.
replace
daemongui_activate
n
true
)
nodes
;
e
:=
next_cond
!
e
(
fun
e
->
e
.
kind
=
Ltop
);
d
()
;
goto_hook_exit
()
;
goto_hook_call
(
)
;
d
()
)
)
|
Central
->
(
|
Central
->
(
let
nodes
=
List
.
map
(
fun
x
->
[
x
])
nodes
in
let
nodes
=
List
.
map
(
fun
x
->
[
x
])
nodes
in
let
to_activate
=
Daemon
.
central
nodes
in
let
to_activate
=
Daemon
.
central
nodes
in
Hashtbl
.
clear
daemongui_activate
;
Hashtbl
.
clear
daemongui_activate
;
List
.
iter
(
fun
n
->
Hashtbl
.
replace
daemongui_activate
n
true
)
to_activate
;
List
.
iter
(
fun
n
->
Hashtbl
.
replace
daemongui_activate
n
true
)
to_activate
;
e
:=
next_cond
!
e
(
fun
e
->
e
.
kind
=
Ltop
);
d
()
;
goto_hook_exit
()
;
goto_hook_call
(
)
;
d
()
)
)
|
LocCentral
->
(
|
LocCentral
->
(
let
get_neigbors
x
=
let
get_neigbors
x
=
...
@@ -387,10 +395,10 @@ let custom_daemon p gtext vbox step_button round_button =
...
@@ -387,10 +395,10 @@ let custom_daemon p gtext vbox step_button round_button =
let
to_activate
=
Daemon
.
locally_central
nodes
in
let
to_activate
=
Daemon
.
locally_central
nodes
in
Hashtbl
.
clear
daemongui_activate
;
Hashtbl
.
clear
daemongui_activate
;
List
.
iter
(
fun
n
->
Hashtbl
.
replace
daemongui_activate
n
true
)
to_activate
;
List
.
iter
(
fun
n
->
Hashtbl
.
replace
daemongui_activate
n
true
)
to_activate
;
e
:=
next_cond
!
e
(
fun
e
->
e
.
kind
=
Ltop
);
d
()
;
goto_hook_exit
()
;
goto_hook_call
(
)
;
d
()
)
)
|
ManualCentral
->
()
(* SNO *)
|
ManualCentral
->
()
(* SNO
; the step is done in pushbox callbacks
*)
|
Manual
->
e
:=
next_cond
!
e
(
fun
e
->
e
.
kind
=
Ltop
);
d
()
|
Manual
->
goto_hook_exit
()
;
goto_hook_call
(
)
;
d
()
in
in
step
step
...
@@ -550,7 +558,12 @@ let main () =
...
@@ -550,7 +558,12 @@ let main () =
(
button_cb
(
button_cb
(
fun
()
->
(
fun
()
->
r
()
;
r
()
;
if
args
.
salut_mode
then
e
:=
next_cond
!
e
(
fun
e
->
e
.
kind
=
Ltop
);
if
args
.
salut_mode
then
(* in this mode, the hook plays first to provide fake values to sasa
but the hook does not need input at this first step
*)
goto_hook_call
()
;
goto_hook_call
()
;
d
()
))
d
()
))
in
in
let
_
=
make_button
`MEDIA_PLAY
"_Sim2chro"
"Launch sim2chro on the generated data (so far)"
let
_
=
make_button
`MEDIA_PLAY
"_Sim2chro"
"Launch sim2chro on the generated data (so far)"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment