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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
a1d975ca
Commit
a1d975ca
authored
13 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
basic loops OK!
parent
b6fe4fda
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Common/onelab.h
+2
-2
2 additions, 2 deletions
Common/onelab.h
Fltk/inputRange.h
+2
-2
2 additions, 2 deletions
Fltk/inputRange.h
Fltk/onelabWindow.cpp
+31
-3
31 additions, 3 deletions
Fltk/onelabWindow.cpp
with
35 additions
and
7 deletions
Common/onelab.h
+
2
−
2
View file @
a1d975ca
...
@@ -162,7 +162,7 @@ namespace onelab{
...
@@ -162,7 +162,7 @@ namespace onelab{
number
(
const
std
::
string
&
name
=
""
,
double
value
=
0.
,
number
(
const
std
::
string
&
name
=
""
,
double
value
=
0.
,
const
std
::
string
&
shortHelp
=
""
,
const
std
::
string
&
help
=
""
)
const
std
::
string
&
shortHelp
=
""
,
const
std
::
string
&
help
=
""
)
:
parameter
(
name
,
shortHelp
,
help
),
_value
(
value
),
:
parameter
(
name
,
shortHelp
,
help
),
_value
(
value
),
_min
(
-
maxNumber
()),
_max
(
maxNumber
()),
_step
(
0
.
)
{}
_min
(
-
maxNumber
()),
_max
(
maxNumber
()),
_step
(
1
.
)
{}
void
setValue
(
double
value
){
_value
=
value
;
}
void
setValue
(
double
value
){
_value
=
value
;
}
void
setMin
(
double
min
){
_min
=
min
;
}
void
setMin
(
double
min
){
_min
=
min
;
}
void
setMax
(
double
max
){
_max
=
max
;
}
void
setMax
(
double
max
){
_max
=
max
;
}
...
@@ -184,7 +184,7 @@ namespace onelab{
...
@@ -184,7 +184,7 @@ namespace onelab{
setMin
(
p
.
getMin
());
setMin
(
p
.
getMin
());
if
(
p
.
getMax
()
!=
maxNumber
())
if
(
p
.
getMax
()
!=
maxNumber
())
setMax
(
p
.
getMax
());
setMax
(
p
.
getMax
());
if
(
p
.
getStep
())
if
(
p
.
getStep
()
!=
1.
)
setStep
(
p
.
getStep
());
setStep
(
p
.
getStep
());
if
(
p
.
getChoices
().
size
())
if
(
p
.
getChoices
().
size
())
setChoices
(
p
.
getChoices
());
setChoices
(
p
.
getChoices
());
...
...
This diff is collapsed.
Click to expand it.
Fltk/inputRange.h
+
2
−
2
View file @
a1d975ca
...
@@ -32,7 +32,7 @@ class inputRange : public Fl_Group {
...
@@ -32,7 +32,7 @@ class inputRange : public Fl_Group {
_input
->
maximum
(
_max
);
_input
->
maximum
(
_max
);
}
}
if
(
_step
){
if
(
_step
){
tmp
<<
":"
<<
_step
;
if
(
_step
!=
1.
)
tmp
<<
":"
<<
_step
;
_input
->
step
(
_step
);
_input
->
step
(
_step
);
}
}
_range
->
value
(
tmp
.
str
().
c_str
());
_range
->
value
(
tmp
.
str
().
c_str
());
...
@@ -96,7 +96,7 @@ class inputRange : public Fl_Group {
...
@@ -96,7 +96,7 @@ class inputRange : public Fl_Group {
}
}
public
:
public
:
inputRange
(
int
x
,
int
y
,
int
w
,
int
h
,
double
max_number
,
const
char
*
l
=
0
)
inputRange
(
int
x
,
int
y
,
int
w
,
int
h
,
double
max_number
,
const
char
*
l
=
0
)
:
Fl_Group
(
x
,
y
,
w
,
h
,
l
),
_min
(
-
max_number
),
_max
(
max_number
),
_step
(
0
),
:
Fl_Group
(
x
,
y
,
w
,
h
,
l
),
_min
(
-
max_number
),
_max
(
max_number
),
_step
(
1.
),
_max_number
(
max_number
)
_max_number
(
max_number
)
{
{
int
dot_w
=
FL_NORMAL_SIZE
-
2
,
loop_w
=
FL_NORMAL_SIZE
+
6
;
int
dot_w
=
FL_NORMAL_SIZE
-
2
,
loop_w
=
FL_NORMAL_SIZE
+
6
;
...
...
This diff is collapsed.
Click to expand it.
Fltk/onelabWindow.cpp
+
31
−
3
View file @
a1d975ca
...
@@ -320,6 +320,31 @@ static std::string getModelName(onelab::client *c)
...
@@ -320,6 +320,31 @@ static std::string getModelName(onelab::client *c)
}
}
}
}
static
bool
shouldRecompute
()
{
bool
recompute
=
false
;
std
::
vector
<
onelab
::
number
>
numbers
;
onelab
::
server
::
instance
()
->
get
(
numbers
);
for
(
unsigned
int
i
=
0
;
i
<
numbers
.
size
();
i
++
){
if
(
numbers
[
i
].
getAttribute
(
"loop"
)
==
"true"
){
if
(
numbers
[
i
].
getMax
()
!=
onelab
::
parameter
::
maxNumber
()
&&
numbers
[
i
].
getValue
()
<
numbers
[
i
].
getMax
()
&&
numbers
[
i
].
getStep
()){
numbers
[
i
].
setValue
(
numbers
[
i
].
getValue
()
+
numbers
[
i
].
getStep
());
onelab
::
server
::
instance
()
->
set
(
numbers
[
i
]);
Msg
::
Info
(
"Recomputing with %s=%g"
,
numbers
[
i
].
getName
().
c_str
(),
numbers
[
i
].
getValue
());
recompute
=
true
;
}
}
}
if
(
recompute
)
FlGui
::
instance
()
->
onelab
->
rebuildTree
();
return
recompute
;
}
void
onelab_cb
(
Fl_Widget
*
w
,
void
*
data
)
void
onelab_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
{
if
(
!
data
)
return
;
if
(
!
data
)
return
;
...
@@ -346,6 +371,8 @@ void onelab_cb(Fl_Widget *w, void *data)
...
@@ -346,6 +371,8 @@ void onelab_cb(Fl_Widget *w, void *data)
FlGui
::
instance
()
->
onelab
->
deactivate
();
FlGui
::
instance
()
->
onelab
->
deactivate
();
recompute
:
// 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 we
// meta-model will allow more flexibility: but in the simple GUI we
// can assume this)
// can assume this)
...
@@ -411,10 +438,11 @@ void onelab_cb(Fl_Widget *w, void *data)
...
@@ -411,10 +438,11 @@ void onelab_cb(Fl_Widget *w, void *data)
}
}
}
}
FlGui
::
instance
()
->
onelab
->
activate
();
printf
(
"Gmsh ONELAB db:
\n
%s
\n
"
,
onelab
::
server
::
instance
()
->
toChar
().
c_str
());
printf
(
"Gmsh ONELAB db:
\n
%s
\n
"
,
onelab
::
server
::
instance
()
->
toChar
().
c_str
());
if
(
action
==
"compute"
&&
shouldRecompute
())
goto
recompute
;
FlGui
::
instance
()
->
onelab
->
activate
();
FlGui
::
instance
()
->
onelab
->
rebuildTree
();
FlGui
::
instance
()
->
onelab
->
rebuildTree
();
FlGui
::
instance
()
->
onelab
->
show
();
FlGui
::
instance
()
->
onelab
->
show
();
}
}
...
@@ -551,7 +579,7 @@ static std::string getShortName(const std::string &name)
...
@@ -551,7 +579,7 @@ static std::string getShortName(const std::string &name)
void
onelabWindow
::
rebuildTree
()
void
onelabWindow
::
rebuildTree
()
{
{
int
width
=
(
3
*
IW
)
/
2
;
int
width
=
(
int
)(
1.4
*
IW
);
_tree
->
clear
();
_tree
->
clear
();
_tree
->
sortorder
(
FL_TREE_SORT_ASCENDING
);
_tree
->
sortorder
(
FL_TREE_SORT_ASCENDING
);
...
...
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