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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
b25548db
Commit
b25548db
authored
13 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
reverting Francois's last commit -- need to find a better solution
parent
40cff9aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/GmshMessage.cpp
+19
-19
19 additions, 19 deletions
Common/GmshMessage.cpp
Common/onelab.h
+6
-19
6 additions, 19 deletions
Common/onelab.h
with
25 additions
and
38 deletions
Common/GmshMessage.cpp
+
19
−
19
View file @
b25548db
...
@@ -610,26 +610,26 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
...
@@ -610,26 +610,26 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
if
(
ps
.
size
()){
// use value from server
if
(
ps
.
size
()){
// use value from server
val
[
0
]
=
ps
[
0
].
getValue
();
val
[
0
]
=
ps
[
0
].
getValue
();
}
}
else
{
// send value to server
onelab
::
number
o
(
name
);
onelab
::
number
o
(
name
,
val
[
0
]);
o
.
setDefaultValue
(
val
[
0
]);
if
(
fopt
.
count
(
"Range"
)
&&
fopt
[
"Range"
].
size
()
==
2
){
if
(
fopt
.
count
(
"Range"
)
&&
fopt
[
"Range"
].
size
()
==
2
){
o
.
setMin
(
fopt
[
"Range"
][
0
]);
o
.
setMax
(
fopt
[
"Range"
][
1
]);
o
.
setMin
(
fopt
[
"Range"
][
0
]);
o
.
setMax
(
fopt
[
"Range"
][
1
]);
}
}
else
if
(
fopt
.
count
(
"Min"
)
&&
fopt
.
count
(
"Max"
)){
else
if
(
fopt
.
count
(
"Min"
)
&&
fopt
.
count
(
"Max"
)){
o
.
setMin
(
fopt
[
"Min"
][
0
]);
o
.
setMax
(
fopt
[
"Max"
][
0
]);
o
.
setMin
(
fopt
[
"Min"
][
0
]);
o
.
setMax
(
fopt
[
"Max"
][
0
]);
}
}
else
if
(
fopt
.
count
(
"Min"
)){
else
if
(
fopt
.
count
(
"Min"
)){
o
.
setMin
(
fopt
[
"Min"
][
0
]);
o
.
setMax
(
1.e200
);
o
.
setMin
(
fopt
[
"Min"
][
0
]);
o
.
setMax
(
1.e200
);
}
}
else
if
(
fopt
.
count
(
"Max"
)){
else
if
(
fopt
.
count
(
"Max"
)){
o
.
setMax
(
fopt
[
"Max"
][
0
]);
o
.
setMin
(
-
1.e200
);
o
.
setMax
(
fopt
[
"Max"
][
0
]);
o
.
setMin
(
-
1.e200
);
}
if
(
fopt
.
count
(
"Step"
))
o
.
setStep
(
fopt
[
"Step"
][
0
]);
if
(
fopt
.
count
(
"Choices"
))
o
.
setChoices
(
fopt
[
"Choices"
]);
if
(
copt
.
count
(
"Help"
))
o
.
setHelp
(
copt
[
"Help"
][
0
]);
if
(
copt
.
count
(
"ShortHelp"
))
o
.
setShortHelp
(
copt
[
"ShortHelp"
][
0
]);
_onelabClient
->
set
(
o
);
}
}
if
(
fopt
.
count
(
"Step"
))
o
.
setStep
(
fopt
[
"Step"
][
0
]);
if
(
fopt
.
count
(
"Choices"
))
o
.
setChoices
(
fopt
[
"Choices"
]);
if
(
copt
.
count
(
"Help"
))
o
.
setHelp
(
copt
[
"Help"
][
0
]);
if
(
copt
.
count
(
"ShortHelp"
))
o
.
setShortHelp
(
copt
[
"ShortHelp"
][
0
]);
_onelabClient
->
set
(
o
);
}
}
void
Msg
::
FinalizeOnelab
()
void
Msg
::
FinalizeOnelab
()
...
...
This diff is collapsed.
Click to expand it.
Common/onelab.h
+
6
−
19
View file @
b25548db
...
@@ -132,28 +132,19 @@ namespace onelab{
...
@@ -132,28 +132,19 @@ namespace onelab{
double
_value
,
_defaultValue
,
_min
,
_max
,
_step
;
double
_value
,
_defaultValue
,
_min
,
_max
,
_step
;
std
::
vector
<
double
>
_choices
;
std
::
vector
<
double
>
_choices
;
public:
public:
number
(
const
std
::
string
&
name
=
""
,
double
defaultValue
=
maxNumber
()
,
number
(
const
std
::
string
&
name
=
""
,
double
defaultValue
=
0.
,
const
std
::
string
&
shortHelp
=
""
,
const
std
::
string
&
help
=
""
)
const
std
::
string
&
shortHelp
=
""
,
const
std
::
string
&
help
=
""
)
:
parameter
(
name
,
shortHelp
,
help
),
_value
(
defaultValue
),
:
parameter
(
name
,
shortHelp
,
help
),
_value
(
defaultValue
),
_defaultValue
(
defaultValue
),
_min
(
-
maxNumber
()),
_max
(
maxNumber
()),
_defaultValue
(
defaultValue
),
_min
(
-
maxNumber
()),
_max
(
maxNumber
()),
_step
(
0.
)
{}
_step
(
0.
)
{}
void
setValue
(
double
value
){
_value
=
value
;
}
void
setValue
(
double
value
){
_value
=
value
;
}
void
setDefaultValue
(
double
value
)
{
_defaultValue
=
value
;
}
void
setDefaultValue
(
double
value
){
_defaultValue
=
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
;
}
void
setStep
(
double
step
){
_step
=
step
;
}
void
setStep
(
double
step
){
_step
=
step
;
}
void
setChoices
(
std
::
vector
<
double
>
&
choices
){
_choices
=
choices
;
}
void
setChoices
(
std
::
vector
<
double
>
&
choices
){
_choices
=
choices
;
}
std
::
string
getType
()
const
{
return
"number"
;
}
std
::
string
getType
()
const
{
return
"number"
;
}
double
getValue
()
const
{
// never returns an unset value
double
getValue
()
const
{
return
_value
;
}
if
(
_value
!=
maxNumber
())
return
_value
;
else
if
(
_defaultValue
!=
maxNumber
())
return
_defaultValue
;
else
{
std
::
cerr
<<
"The number "
<<
getName
()
<<
" is not set"
<<
std
::
endl
;
exit
(
1
);
}
}
double
getDefaultValue
()
const
{
return
_defaultValue
;
}
double
getDefaultValue
()
const
{
return
_defaultValue
;
}
double
getMin
()
const
{
return
_min
;
}
double
getMin
()
const
{
return
_min
;
}
double
getMax
()
const
{
return
_max
;
}
double
getMax
()
const
{
return
_max
;
}
...
@@ -161,11 +152,11 @@ namespace onelab{
...
@@ -161,11 +152,11 @@ namespace onelab{
const
std
::
vector
<
double
>
&
getChoices
(){
return
_choices
;
}
const
std
::
vector
<
double
>
&
getChoices
(){
return
_choices
;
}
void
update
(
const
number
&
p
)
void
update
(
const
number
&
p
)
{
{
if
(
(
p
.
_v
alue
!=
maxNumber
()
/*=is set*/
)
&&
(
p
.
_value
!=
_value
)){
if
(
p
.
getV
alue
()
!=
getValue
(
)){
setValue
(
p
.
_v
alue
);
setValue
(
p
.
getV
alue
()
);
setChanged
(
true
);
setChanged
(
true
);
}
}
if
(
(
p
.
getDefaultValue
()
!=
maxNumber
()
/*=is set*/
)
&&
(
p
.
getDefaultValue
()
!=
getDefaultValue
())
)
if
(
p
.
getDefaultValue
()
&&
p
.
getDefaultValue
()
!=
getDefaultValue
())
setDefaultValue
(
p
.
getDefaultValue
());
setDefaultValue
(
p
.
getDefaultValue
());
if
(
p
.
getMin
()
!=
-
maxNumber
())
if
(
p
.
getMin
()
!=
-
maxNumber
())
setMin
(
p
.
getMin
());
setMin
(
p
.
getMin
());
...
@@ -173,10 +164,6 @@ namespace onelab{
...
@@ -173,10 +164,6 @@ namespace onelab{
setMax
(
p
.
getMax
());
setMax
(
p
.
getMax
());
if
(
p
.
getStep
()
!=
getStep
())
if
(
p
.
getStep
()
!=
getStep
())
setStep
(
p
.
getStep
());
setStep
(
p
.
getStep
());
if
(
p
.
getHelp
().
size
()
&&
p
.
getHelp
()
!=
getHelp
())
setHelp
(
p
.
getHelp
());
if
(
p
.
getShortHelp
().
size
()
&&
p
.
getShortHelp
()
!=
getShortHelp
())
setHelp
(
p
.
getShortHelp
());
}
}
std
::
string
toChar
()
std
::
string
toChar
()
{
{
...
...
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