Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
Package registry
Model registry
Operate
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Romin Tomasetti
gmsh
Commits
6835e636
Commit
6835e636
authored
13 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
better checl/compute button management
parent
85302656
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Fltk/onelabWindow.cpp
+42
-25
42 additions, 25 deletions
Fltk/onelabWindow.cpp
Fltk/onelabWindow.h
+1
-1
1 addition, 1 deletion
Fltk/onelabWindow.h
with
43 additions
and
26 deletions
Fltk/onelabWindow.cpp
+
42
−
25
View file @
6835e636
...
@@ -598,7 +598,7 @@ void onelab_cb(Fl_Widget *w, void *data)
...
@@ -598,7 +598,7 @@ void onelab_cb(Fl_Widget *w, void *data)
std
::
string
action
((
const
char
*
)
data
);
std
::
string
action
((
const
char
*
)
data
);
if
(
action
==
"refresh"
){
if
(
action
==
"refresh"
){
static
int
recurse
=
false
;
static
bool
recurse
=
false
;
if
(
recurse
)
return
;
if
(
recurse
)
return
;
recurse
=
true
;
recurse
=
true
;
updateOnelabGraphs
();
updateOnelabGraphs
();
...
@@ -609,7 +609,7 @@ void onelab_cb(Fl_Widget *w, void *data)
...
@@ -609,7 +609,7 @@ void onelab_cb(Fl_Widget *w, void *data)
if
(
action
==
"stop"
){
if
(
action
==
"stop"
){
FlGui
::
instance
()
->
onelab
->
stop
(
true
);
FlGui
::
instance
()
->
onelab
->
stop
(
true
);
FlGui
::
instance
()
->
onelab
->
setButtonMode
(
"kill"
);
FlGui
::
instance
()
->
onelab
->
setButtonMode
(
""
,
"kill"
);
for
(
onelab
::
server
::
citer
it
=
onelab
::
server
::
instance
()
->
firstClient
();
for
(
onelab
::
server
::
citer
it
=
onelab
::
server
::
instance
()
->
firstClient
();
it
!=
onelab
::
server
::
instance
()
->
lastClient
();
it
++
){
it
!=
onelab
::
server
::
instance
()
->
lastClient
();
it
++
){
onelab
::
string
o
(
it
->
second
->
getName
()
+
"/Action"
,
"stop"
);
onelab
::
string
o
(
it
->
second
->
getName
()
+
"/Action"
,
"stop"
);
...
@@ -665,11 +665,14 @@ void onelab_cb(Fl_Widget *w, void *data)
...
@@ -665,11 +665,14 @@ void onelab_cb(Fl_Widget *w, void *data)
action
=
"check"
;
action
=
"check"
;
}
}
FlGui
::
instance
()
->
onelab
->
setButtonMode
(
"stop"
);
if
(
action
==
"compute"
)
FlGui
::
instance
()
->
onelab
->
setButtonMode
(
"refresh"
,
"stop"
);
else
FlGui
::
instance
()
->
onelab
->
setButtonMode
(
""
,
"stop"
);
if
(
action
==
"compute"
)
initializeLoop
();
if
(
action
==
"compute"
)
initializeLoop
();
do
{
// enter
computation
loop
do
{
// enter loop
// the Gmsh client is special: it always gets executed first. (The
// the Gmsh client is special: it always gets executed first. (The
// meta-model will allow more flexibility: but in the simple GUI
// meta-model will allow more flexibility: but in the simple GUI
...
@@ -707,7 +710,7 @@ void onelab_cb(Fl_Widget *w, void *data)
...
@@ -707,7 +710,7 @@ void onelab_cb(Fl_Widget *w, void *data)
incrementLoop
());
incrementLoop
());
FlGui
::
instance
()
->
onelab
->
stop
(
false
);
FlGui
::
instance
()
->
onelab
->
stop
(
false
);
FlGui
::
instance
()
->
onelab
->
setButtonMode
(
"compute"
);
FlGui
::
instance
()
->
onelab
->
setButtonMode
(
"check"
,
"compute"
);
if
(
action
!=
"initialize"
)
FlGui
::
instance
()
->
onelab
->
show
();
if
(
action
!=
"initialize"
)
FlGui
::
instance
()
->
onelab
->
show
();
}
}
...
@@ -827,13 +830,13 @@ onelabWindow::onelabWindow(int deltaFontSize)
...
@@ -827,13 +830,13 @@ onelabWindow::onelabWindow(int deltaFontSize)
_tree
->
connectorstyle
(
FL_TREE_CONNECTOR_SOLID
);
_tree
->
connectorstyle
(
FL_TREE_CONNECTOR_SOLID
);
_tree
->
showroot
(
0
);
_tree
->
showroot
(
0
);
_butt
[
0
]
=
new
Fl_Button
(
width
-
WB
-
BB
,
height
-
WB
-
BH
,
BB
,
BH
,
"C
ompute
"
);
_butt
[
0
]
=
new
Fl_Button
(
width
-
2
*
WB
-
2
*
BB
,
height
-
WB
-
BH
,
BB
,
BH
,
"C
heck
"
);
_butt
[
0
]
->
callback
(
onelab_cb
,
(
void
*
)
"c
ompute
"
);
_butt
[
0
]
->
callback
(
onelab_cb
,
(
void
*
)
"c
heck
"
);
_butt
[
1
]
=
new
Fl_Button
(
width
-
2
*
WB
-
2
*
BB
,
height
-
WB
-
BH
,
BB
,
BH
,
"C
heck
"
);
_butt
[
1
]
=
new
Fl_Button
(
width
-
WB
-
BB
,
height
-
WB
-
BH
,
BB
,
BH
,
"C
ompute
"
);
_butt
[
1
]
->
callback
(
onelab_cb
,
(
void
*
)
"c
heck
"
);
_butt
[
1
]
->
callback
(
onelab_cb
,
(
void
*
)
"c
ompute
"
);
_gear
=
new
Fl_Menu_Button
_gear
=
new
Fl_Menu_Button
(
_butt
[
1
]
->
x
()
-
WB
-
BB
/
2
,
_butt
[
1
]
->
y
(),
BB
/
2
,
BH
,
"@-1gmsh_gear"
);
(
_butt
[
0
]
->
x
()
-
WB
-
BB
/
2
,
_butt
[
0
]
->
y
(),
BB
/
2
,
BH
,
"@-1gmsh_gear"
);
_gear
->
align
(
FL_ALIGN_LEFT
|
FL_ALIGN_INSIDE
);
_gear
->
align
(
FL_ALIGN_LEFT
|
FL_ALIGN_INSIDE
);
_gear
->
add
(
"Reset database"
,
0
,
onelab_cb
,
(
void
*
)
"reset"
);
_gear
->
add
(
"Reset database"
,
0
,
onelab_cb
,
(
void
*
)
"reset"
);
_gear
->
add
(
"_Print database"
,
0
,
onelab_cb
,
(
void
*
)
"dump"
);
_gear
->
add
(
"_Print database"
,
0
,
onelab_cb
,
(
void
*
)
"dump"
);
...
@@ -973,25 +976,39 @@ void onelabWindow::checkForErrors(const std::string &client)
...
@@ -973,25 +976,39 @@ void onelabWindow::checkForErrors(const std::string &client)
}
}
}
}
void
onelabWindow
::
setButtonMode
(
const
std
::
string
&
mode
)
void
onelabWindow
::
setButtonMode
(
const
std
::
string
&
butt0
,
const
std
::
string
&
butt1
)
{
{
if
(
mode
==
"compute"
){
if
(
butt0
==
"check"
){
_butt
[
0
]
->
label
(
"Compute"
);
_butt
[
0
]
->
activate
();
_butt
[
0
]
->
callback
(
onelab_cb
,
(
void
*
)
"compute"
);
_butt
[
0
]
->
label
(
"Check"
);
_butt
[
1
]
->
label
(
"Check"
);
_butt
[
0
]
->
callback
(
onelab_cb
,
(
void
*
)
"check"
);
_butt
[
1
]
->
callback
(
onelab_cb
,
(
void
*
)
"check"
);
}
else
if
(
butt0
==
"refresh"
){
_butt
[
0
]
->
activate
();
_butt
[
0
]
->
label
(
"Refresh"
);
_butt
[
0
]
->
callback
(
onelab_cb
,
(
void
*
)
"refresh"
);
}
else
{
_butt
[
0
]
->
deactivate
();
}
if
(
butt1
==
"compute"
){
_butt
[
1
]
->
activate
();
_butt
[
1
]
->
label
(
"Compute"
);
_butt
[
1
]
->
callback
(
onelab_cb
,
(
void
*
)
"compute"
);
}
else
if
(
butt1
==
"stop"
){
_butt
[
1
]
->
activate
();
_butt
[
1
]
->
label
(
"Stop"
);
_butt
[
1
]
->
callback
(
onelab_cb
,
(
void
*
)
"stop"
);
}
}
else
if
(
mode
==
"stop"
){
else
if
(
butt1
==
"kill"
){
_butt
[
0
]
->
label
(
"Stop"
);
_butt
[
1
]
->
activate
();
_butt
[
0
]
->
callback
(
onelab_cb
,
(
void
*
)
"stop"
);
_butt
[
1
]
->
label
(
"Kill"
);
_butt
[
1
]
->
label
(
"Refresh"
);
_butt
[
1
]
->
callback
(
onelab_cb
,
(
void
*
)
"kill"
);
_butt
[
1
]
->
callback
(
onelab_cb
,
(
void
*
)
"refresh"
);
}
}
else
{
else
{
_butt
[
0
]
->
label
(
"Kill"
);
_butt
[
1
]
->
deactivate
();
_butt
[
0
]
->
callback
(
onelab_cb
,
(
void
*
)
"kill"
);
_butt
[
1
]
->
label
(
"Refresh"
);
_butt
[
1
]
->
callback
(
onelab_cb
,
(
void
*
)
"refresh"
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Fltk/onelabWindow.h
+
1
−
1
View file @
6835e636
...
@@ -35,7 +35,7 @@ class onelabWindow{
...
@@ -35,7 +35,7 @@ class onelabWindow{
void
rebuildSolverList
();
void
rebuildSolverList
();
void
rebuildTree
();
void
rebuildTree
();
void
redrawTree
(){
_tree
->
redraw
();
}
void
redrawTree
(){
_tree
->
redraw
();
}
void
setButtonMode
(
const
std
::
string
&
mode
);
void
setButtonMode
(
const
std
::
string
&
butt0
,
const
std
::
string
&
butt1
);
void
show
(){
_win
->
show
();
}
void
show
(){
_win
->
show
();
}
int
shown
(){
return
_win
->
shown
();
}
int
shown
(){
return
_win
->
shown
();
}
int
meshAuto
(){
return
_gear
->
menu
()[
2
].
value
();
}
int
meshAuto
(){
return
_gear
->
menu
()[
2
].
value
();
}
...
...
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