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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Romin Tomasetti
gmsh
Commits
52c24ab5
Commit
52c24ab5
authored
7 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
handle variables with spaces in "Reset" (multiple variables should be separated with a comma)
parent
73a24ea6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Common/onelab.h
+10
-0
10 additions, 0 deletions
Common/onelab.h
Fltk/onelabGroup.cpp
+5
-4
5 additions, 4 deletions
Fltk/onelabGroup.cpp
benchmarks/misc/master_slave_variables.geo
+3
-0
3 additions, 0 deletions
benchmarks/misc/master_slave_variables.geo
with
18 additions
and
4 deletions
Common/onelab.h
+
10
−
0
View file @
52c24ab5
...
@@ -235,6 +235,16 @@ namespace onelab{
...
@@ -235,6 +235,16 @@ namespace onelab{
out
.
push_back
(
getNextToken
(
msg
,
first
,
separator
));
out
.
push_back
(
getNextToken
(
msg
,
first
,
separator
));
return
out
;
return
out
;
}
}
static
std
::
string
trim
(
const
std
::
string
&
str
,
const
std
::
string
&
whitespace
=
"
\t\n
"
)
{
std
::
string
::
size_type
strBegin
=
str
.
find_first_not_of
(
whitespace
);
if
(
strBegin
==
std
::
string
::
npos
)
return
""
;
// no content
std
::
string
::
size_type
strEnd
=
str
.
find_last_not_of
(
whitespace
);
std
::
string
::
size_type
strRange
=
strEnd
-
strBegin
+
1
;
return
str
.
substr
(
strBegin
,
strRange
);
}
std
::
string
sanitize
(
const
std
::
string
&
in
)
const
std
::
string
sanitize
(
const
std
::
string
&
in
)
const
{
{
std
::
string
out
(
in
);
std
::
string
out
(
in
);
...
...
This diff is collapsed.
Click to expand it.
Fltk/onelabGroup.cpp
+
5
−
4
View file @
52c24ab5
...
@@ -666,10 +666,11 @@ static bool serverAction(const std::string &action)
...
@@ -666,10 +666,11 @@ static bool serverAction(const std::string &action)
return
true
;
return
true
;
}
}
else
if
(
!
action
.
compare
(
0
,
5
,
"Reset"
)){
// reset some variables
else
if
(
!
action
.
compare
(
0
,
5
,
"Reset"
)){
// reset some variables
std
::
vector
<
std
::
string
>
what
=
onelab
::
parameter
::
split
(
action
,
' '
);
std
::
vector
<
std
::
string
>
what
=
onelab
::
parameter
::
split
(
action
.
substr
(
5
),
','
);
for
(
unsigned
int
i
=
1
;
i
<
what
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
what
.
size
();
i
++
){
Msg
::
Debug
(
"Clearing variable '%s'"
,
what
[
i
].
c_str
());
std
::
string
var
=
onelab
::
parameter
::
trim
(
what
[
i
]);
onelab
::
server
::
instance
()
->
clear
(
what
[
i
]);
Msg
::
Debug
(
"Clearing variable '%s'"
,
var
.
c_str
());
onelab
::
server
::
instance
()
->
clear
(
var
);
}
}
FlGui
::
instance
()
->
rebuildTree
(
false
);
FlGui
::
instance
()
->
rebuildTree
(
false
);
return
true
;
return
true
;
...
...
This diff is collapsed.
Click to expand it.
benchmarks/misc/master_slave_variables.geo
+
3
−
0
View file @
52c24ab5
...
@@ -3,6 +3,9 @@ DefineConstant[
...
@@ -3,6 +3,9 @@ DefineConstant[
b
=
{
a
*
2
,
Name
"var2"
,
Label
"Slave (x 2) variable"
,
ReadOnly
1
}
b
=
{
a
*
2
,
Name
"var2"
,
Label
"Slave (x 2) variable"
,
ReadOnly
1
}
c
=
{
a
*
2
,
Name
"var3"
,
Label
"Editable slave (x 2) variable"
}
c
=
{
a
*
2
,
Name
"var3"
,
Label
"Editable slave (x 2) variable"
}
d
=
{
a
*
2
,
Name
"var4"
,
Label
"Standard (x 2) variable"
}
d
=
{
a
*
2
,
Name
"var4"
,
Label
"Standard (x 2) variable"
}
e
=
{
1
,
Name
"var5"
,
Label
"Another master"
,
ServerAction
"Reset var6, var7 space "
}
f
=
{
e
,
Name
"var6"
,
Label
"Another slave (copy)"
}
g
=
{
e
,
Name
"var7 space"
,
Label
"Another slave (copy)"
}
];
];
Printf
(
"a=%g b=%g c=%g d=%g"
,
a
,
b
,
c
,
d
);
Printf
(
"a=%g b=%g c=%g d=%g"
,
a
,
b
,
c
,
d
);
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