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
b23379dd
Commit
b23379dd
authored
13 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
ShortHelp -> Label
parent
c8f37212
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/GmshMessage.cpp
+3
-1
3 additions, 1 deletion
Common/GmshMessage.cpp
Common/onelab.h
+33
-29
33 additions, 29 deletions
Common/onelab.h
with
36 additions
and
30 deletions
Common/GmshMessage.cpp
+
3
−
1
View file @
b23379dd
...
@@ -660,8 +660,10 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
...
@@ -660,8 +660,10 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
}
}
if
(
fopt
.
count
(
"Step"
))
ps
[
0
].
setStep
(
fopt
[
"Step"
][
0
]);
if
(
fopt
.
count
(
"Step"
))
ps
[
0
].
setStep
(
fopt
[
"Step"
][
0
]);
if
(
fopt
.
count
(
"Choices"
))
ps
[
0
].
setChoices
(
fopt
[
"Choices"
]);
if
(
fopt
.
count
(
"Choices"
))
ps
[
0
].
setChoices
(
fopt
[
"Choices"
]);
if
(
fopt
.
count
(
"Visible"
))
ps
[
0
].
setVisible
(
fopt
[
"Visible"
][
0
]
?
true
:
false
);
if
(
copt
.
count
(
"Help"
))
ps
[
0
].
setHelp
(
copt
[
"Help"
][
0
]);
if
(
copt
.
count
(
"Help"
))
ps
[
0
].
setHelp
(
copt
[
"Help"
][
0
]);
if
(
copt
.
count
(
"ShortHelp"
))
ps
[
0
].
setShortHelp
(
copt
[
"ShortHelp"
][
0
]);
if
(
copt
.
count
(
"Label"
))
ps
[
0
].
setLabel
(
copt
[
"Label"
][
0
]);
if
(
copt
.
count
(
"ShortHelp"
))
ps
[
0
].
setLabel
(
copt
[
"ShortHelp"
][
0
]);
if
(
copt
.
count
(
"Loop"
))
ps
[
0
].
setAttribute
(
"Loop"
,
copt
[
"Loop"
][
0
]);
if
(
copt
.
count
(
"Loop"
))
ps
[
0
].
setAttribute
(
"Loop"
,
copt
[
"Loop"
][
0
]);
if
(
copt
.
count
(
"Graph"
))
ps
[
0
].
setAttribute
(
"Graph"
,
copt
[
"Graph"
][
0
]);
if
(
copt
.
count
(
"Graph"
))
ps
[
0
].
setAttribute
(
"Graph"
,
copt
[
"Graph"
][
0
]);
if
(
copt
.
count
(
"Hightlight"
))
ps
[
0
].
setAttribute
(
"Highlight"
,
copt
[
"Hightlight"
][
0
]);
if
(
copt
.
count
(
"Hightlight"
))
ps
[
0
].
setAttribute
(
"Highlight"
,
copt
[
"Hightlight"
][
0
]);
...
...
This diff is collapsed.
Click to expand it.
Common/onelab.h
+
33
−
29
View file @
b23379dd
...
@@ -40,15 +40,17 @@ namespace onelab{
...
@@ -40,15 +40,17 @@ namespace onelab{
// The base parameter class.
// The base parameter class.
class
parameter
{
class
parameter
{
private:
private:
// the name of the parameter, including its '/'-separated path in
// the name of the parameter, including its '/'-separated path in
the
//
the
parameter hierarchy. Parameters or subpaths can start with
// parameter hierarchy. Parameters or subpaths can start with
numbers to
//
numbers to
force their relative ordering (such numbers are
// force their relative ordering (such numbers are
automatically hidden in
//
automatically hidden in
the interface).
// the interface).
std
::
string
_name
;
std
::
string
_name
;
// help strings (if provided, the short help serves as a better
// the parameter label: if provided it serves as a better way to display the
// way to display the parameter in the interface). Richer encoding
// parameter in the interface (richer encoding (UTF? HTML?) might be used in
// (UTF? HTML?) might be used in the future.
// the future)
std
::
string
_shortHelp
,
_help
;
std
::
string
_label
;
// a help string (richer encoding (UTF? HTML?) might be used in the future)
std
::
string
_help
;
// clients that use this parameter
// clients that use this parameter
std
::
set
<
std
::
string
>
_clients
;
std
::
set
<
std
::
string
>
_clients
;
// flag to check if the parameter has been changed since the last
// flag to check if the parameter has been changed since the last
...
@@ -60,12 +62,13 @@ namespace onelab{
...
@@ -60,12 +62,13 @@ namespace onelab{
// optional additional attributes
// optional additional attributes
std
::
map
<
std
::
string
,
std
::
string
>
_attributes
;
std
::
map
<
std
::
string
,
std
::
string
>
_attributes
;
public:
public:
parameter
(
const
std
::
string
&
name
=
""
,
const
std
::
string
&
shortH
el
p
=
""
,
parameter
(
const
std
::
string
&
name
=
""
,
const
std
::
string
&
lab
el
=
""
,
const
std
::
string
&
help
=
""
)
const
std
::
string
&
help
=
""
)
:
_name
(
name
),
_
shortHelp
(
shortH
el
p
),
_help
(
help
),
_changed
(
true
),
:
_name
(
name
),
_
label
(
lab
el
),
_help
(
help
),
_changed
(
true
),
_visible
(
true
)
{}
_visible
(
true
)
{}
void
setName
(
const
std
::
string
&
name
){
_name
=
name
;
}
void
setName
(
const
std
::
string
&
name
){
_name
=
name
;
}
void
setShortHelp
(
const
std
::
string
&
shortHelp
){
_shortHelp
=
shortHelp
;
}
void
setLabel
(
const
std
::
string
&
label
){
_label
=
label
;
}
void
setShortHelp
(
const
std
::
string
&
label
){
_label
=
label
;
}
// deprecated
void
setHelp
(
const
std
::
string
&
help
){
_help
=
help
;
}
void
setHelp
(
const
std
::
string
&
help
){
_help
=
help
;
}
void
setChanged
(
bool
changed
){
_changed
=
changed
;
}
void
setChanged
(
bool
changed
){
_changed
=
changed
;
}
void
setVisible
(
bool
visible
){
_visible
=
visible
;
}
void
setVisible
(
bool
visible
){
_visible
=
visible
;
}
...
@@ -89,11 +92,12 @@ namespace onelab{
...
@@ -89,11 +92,12 @@ namespace onelab{
}
}
virtual
std
::
string
getType
()
const
=
0
;
virtual
std
::
string
getType
()
const
=
0
;
const
std
::
string
&
getName
()
const
{
return
_name
;
}
const
std
::
string
&
getName
()
const
{
return
_name
;
}
const
std
::
string
&
getShortHelp
()
const
{
return
_shortHelp
;
}
const
std
::
string
&
getLabel
()
const
{
return
_label
;
}
const
std
::
string
&
getShortHelp
()
const
{
return
_label
;
}
// deprecated
const
std
::
string
&
getHelp
()
const
{
return
_help
;
}
const
std
::
string
&
getHelp
()
const
{
return
_help
;
}
std
::
string
getShortName
()
const
std
::
string
getShortName
()
const
{
{
if
(
_
shortH
el
p
.
size
())
return
_
shortH
el
p
;
if
(
_
lab
el
.
size
())
return
_
lab
el
;
std
::
string
s
=
_name
;
std
::
string
s
=
_name
;
// remove path
// remove path
std
::
string
::
size_type
last
=
_name
.
find_last_of
(
'/'
);
std
::
string
::
size_type
last
=
_name
.
find_last_of
(
'/'
);
...
@@ -141,7 +145,7 @@ namespace onelab{
...
@@ -141,7 +145,7 @@ namespace onelab{
std
::
ostringstream
sstream
;
std
::
ostringstream
sstream
;
sstream
<<
version
()
<<
charSep
()
<<
getType
()
<<
charSep
()
sstream
<<
version
()
<<
charSep
()
<<
getType
()
<<
charSep
()
<<
sanitize
(
getName
())
<<
charSep
()
<<
sanitize
(
getName
())
<<
charSep
()
<<
sanitize
(
get
ShortH
el
p
())
<<
charSep
()
<<
sanitize
(
get
Lab
el
())
<<
charSep
()
<<
sanitize
(
getHelp
())
<<
charSep
()
<<
sanitize
(
getHelp
())
<<
charSep
()
<<
(
getVisible
()
?
1
:
0
)
<<
charSep
()
<<
(
getVisible
()
?
1
:
0
)
<<
charSep
()
<<
_attributes
.
size
()
<<
charSep
();
<<
_attributes
.
size
()
<<
charSep
();
...
@@ -161,7 +165,7 @@ namespace onelab{
...
@@ -161,7 +165,7 @@ namespace onelab{
if
(
getNextToken
(
msg
,
pos
)
!=
version
())
return
0
;
if
(
getNextToken
(
msg
,
pos
)
!=
version
())
return
0
;
if
(
getNextToken
(
msg
,
pos
)
!=
getType
())
return
0
;
if
(
getNextToken
(
msg
,
pos
)
!=
getType
())
return
0
;
setName
(
getNextToken
(
msg
,
pos
));
setName
(
getNextToken
(
msg
,
pos
));
set
ShortH
el
p
(
getNextToken
(
msg
,
pos
));
set
Lab
el
(
getNextToken
(
msg
,
pos
));
setHelp
(
getNextToken
(
msg
,
pos
));
setHelp
(
getNextToken
(
msg
,
pos
));
setVisible
(
atoi
(
getNextToken
(
msg
,
pos
).
c_str
()));
setVisible
(
atoi
(
getNextToken
(
msg
,
pos
).
c_str
()));
int
numAttributes
=
atoi
(
getNextToken
(
msg
,
pos
).
c_str
());
int
numAttributes
=
atoi
(
getNextToken
(
msg
,
pos
).
c_str
());
...
@@ -205,8 +209,8 @@ namespace onelab{
...
@@ -205,8 +209,8 @@ namespace onelab{
std
::
vector
<
double
>
_choices
;
std
::
vector
<
double
>
_choices
;
public:
public:
number
(
const
std
::
string
&
name
=
""
,
double
value
=
0.
,
number
(
const
std
::
string
&
name
=
""
,
double
value
=
0.
,
const
std
::
string
&
shortH
el
p
=
""
,
const
std
::
string
&
help
=
""
)
const
std
::
string
&
lab
el
=
""
,
const
std
::
string
&
help
=
""
)
:
parameter
(
name
,
shortH
el
p
,
help
),
_value
(
value
),
:
parameter
(
name
,
lab
el
,
help
),
_value
(
value
),
_min
(
-
maxNumber
()),
_max
(
maxNumber
()),
_step
(
0.
)
{}
_min
(
-
maxNumber
()),
_max
(
maxNumber
()),
_step
(
0.
)
{}
void
setValue
(
double
value
){
_value
=
value
;
}
void
setValue
(
double
value
){
_value
=
value
;
}
void
setMin
(
double
min
){
_min
=
min
;
}
void
setMin
(
double
min
){
_min
=
min
;
}
...
@@ -222,8 +226,9 @@ namespace onelab{
...
@@ -222,8 +226,9 @@ namespace onelab{
void
update
(
const
number
&
p
)
void
update
(
const
number
&
p
)
{
{
addClients
(
p
.
getClients
());
// complete the list
addClients
(
p
.
getClients
());
// complete the list
set
ShortH
el
p
(
p
.
get
ShortH
el
p
());
set
Lab
el
(
p
.
get
Lab
el
());
setHelp
(
p
.
getHelp
());
setHelp
(
p
.
getHelp
());
setVisible
(
p
.
getVisible
());
setAttributes
(
p
.
getAttributes
());
setAttributes
(
p
.
getAttributes
());
if
(
p
.
getValue
()
!=
getValue
()){
if
(
p
.
getValue
()
!=
getValue
()){
setValue
(
p
.
getValue
());
setValue
(
p
.
getValue
());
...
@@ -233,7 +238,6 @@ namespace onelab{
...
@@ -233,7 +238,6 @@ namespace onelab{
setMax
(
p
.
getMax
());
setMax
(
p
.
getMax
());
setStep
(
p
.
getStep
());
setStep
(
p
.
getStep
());
setChoices
(
p
.
getChoices
());
setChoices
(
p
.
getChoices
());
setVisible
(
p
.
getVisible
());
// FIXME Why not?
}
}
std
::
string
toChar
()
const
std
::
string
toChar
()
const
{
{
...
@@ -273,8 +277,8 @@ namespace onelab{
...
@@ -273,8 +277,8 @@ namespace onelab{
std
::
vector
<
std
::
string
>
_choices
;
std
::
vector
<
std
::
string
>
_choices
;
public:
public:
string
(
const
std
::
string
&
name
=
""
,
const
std
::
string
&
value
=
""
,
string
(
const
std
::
string
&
name
=
""
,
const
std
::
string
&
value
=
""
,
const
std
::
string
&
shortH
el
p
=
""
,
const
std
::
string
&
help
=
""
)
const
std
::
string
&
lab
el
=
""
,
const
std
::
string
&
help
=
""
)
:
parameter
(
name
,
shortH
el
p
,
help
),
_value
(
value
),
_kind
(
"generic"
)
{}
:
parameter
(
name
,
lab
el
,
help
),
_value
(
value
),
_kind
(
"generic"
)
{}
void
setValue
(
const
std
::
string
&
value
){
_value
=
value
;
}
void
setValue
(
const
std
::
string
&
value
){
_value
=
value
;
}
void
setKind
(
const
std
::
string
&
kind
){
_kind
=
kind
;
}
void
setKind
(
const
std
::
string
&
kind
){
_kind
=
kind
;
}
void
setChoices
(
const
std
::
vector
<
std
::
string
>
&
choices
){
_choices
=
choices
;
}
void
setChoices
(
const
std
::
vector
<
std
::
string
>
&
choices
){
_choices
=
choices
;
}
...
@@ -285,8 +289,9 @@ namespace onelab{
...
@@ -285,8 +289,9 @@ namespace onelab{
void
update
(
const
string
&
p
)
void
update
(
const
string
&
p
)
{
{
addClients
(
p
.
getClients
());
addClients
(
p
.
getClients
());
set
ShortH
el
p
(
p
.
get
ShortH
el
p
());
set
Lab
el
(
p
.
get
Lab
el
());
setHelp
(
p
.
getHelp
());
setHelp
(
p
.
getHelp
());
setVisible
(
p
.
getVisible
());
setAttributes
(
p
.
getAttributes
());
setAttributes
(
p
.
getAttributes
());
if
(
p
.
getValue
()
!=
getValue
()){
if
(
p
.
getValue
()
!=
getValue
()){
setValue
(
p
.
getValue
());
setValue
(
p
.
getValue
());
...
@@ -297,7 +302,6 @@ namespace onelab{
...
@@ -297,7 +302,6 @@ namespace onelab{
setChanged
(
true
);
setChanged
(
true
);
}
}
setChoices
(
p
.
getChoices
());
setChoices
(
p
.
getChoices
());
setVisible
(
p
.
getVisible
());
// FIXME Why not?
}
}
std
::
string
toChar
()
const
std
::
string
toChar
()
const
{
{
...
@@ -334,15 +338,15 @@ namespace onelab{
...
@@ -334,15 +338,15 @@ namespace onelab{
public:
public:
region
(
const
std
::
string
&
name
=
""
,
region
(
const
std
::
string
&
name
=
""
,
const
std
::
set
<
std
::
string
>
&
value
=
std
::
set
<
std
::
string
>
(),
const
std
::
set
<
std
::
string
>
&
value
=
std
::
set
<
std
::
string
>
(),
const
std
::
string
&
shortH
el
p
=
""
,
const
std
::
string
&
help
=
""
)
const
std
::
string
&
lab
el
=
""
,
const
std
::
string
&
help
=
""
)
:
parameter
(
name
,
shortH
el
p
,
help
),
_value
(
value
)
{}
:
parameter
(
name
,
lab
el
,
help
),
_value
(
value
)
{}
void
setValue
(
const
std
::
set
<
std
::
string
>
&
value
){
_value
=
value
;
}
void
setValue
(
const
std
::
set
<
std
::
string
>
&
value
){
_value
=
value
;
}
std
::
string
getType
()
const
{
return
"region"
;
}
std
::
string
getType
()
const
{
return
"region"
;
}
const
std
::
set
<
std
::
string
>
&
getValue
()
const
{
return
_value
;
}
const
std
::
set
<
std
::
string
>
&
getValue
()
const
{
return
_value
;
}
void
update
(
const
region
&
p
)
void
update
(
const
region
&
p
)
{
{
addClients
(
p
.
getClients
());
addClients
(
p
.
getClients
());
set
ShortH
el
p
(
p
.
get
ShortH
el
p
());
set
Lab
el
(
p
.
get
Lab
el
());
setHelp
(
p
.
getHelp
());
setHelp
(
p
.
getHelp
());
setAttributes
(
p
.
getAttributes
());
setAttributes
(
p
.
getAttributes
());
if
(
p
.
getValue
()
!=
getValue
()){
if
(
p
.
getValue
()
!=
getValue
()){
...
@@ -375,8 +379,8 @@ namespace onelab{
...
@@ -375,8 +379,8 @@ namespace onelab{
std
::
vector
<
std
::
string
>
_choices
;
std
::
vector
<
std
::
string
>
_choices
;
public:
public:
function
(
const
std
::
string
&
name
=
""
,
const
std
::
string
&
value
=
""
,
function
(
const
std
::
string
&
name
=
""
,
const
std
::
string
&
value
=
""
,
const
std
::
string
&
shortH
el
p
=
""
,
const
std
::
string
&
help
=
""
)
const
std
::
string
&
lab
el
=
""
,
const
std
::
string
&
help
=
""
)
:
parameter
(
name
,
shortH
el
p
,
help
),
_value
(
value
)
{}
:
parameter
(
name
,
lab
el
,
help
),
_value
(
value
)
{}
void
setValue
(
const
std
::
string
&
value
,
const
std
::
string
&
region
=
""
)
void
setValue
(
const
std
::
string
&
value
,
const
std
::
string
&
region
=
""
)
{
{
if
(
region
.
empty
())
if
(
region
.
empty
())
...
@@ -402,7 +406,7 @@ namespace onelab{
...
@@ -402,7 +406,7 @@ namespace onelab{
void
update
(
const
function
&
p
)
void
update
(
const
function
&
p
)
{
{
addClients
(
p
.
getClients
());
addClients
(
p
.
getClients
());
set
ShortH
el
p
(
p
.
get
ShortH
el
p
());
set
Lab
el
(
p
.
get
Lab
el
());
setHelp
(
p
.
getHelp
());
setHelp
(
p
.
getHelp
());
setAttributes
(
p
.
getAttributes
());
setAttributes
(
p
.
getAttributes
());
if
(
p
.
getValue
()
!=
getValue
()){
if
(
p
.
getValue
()
!=
getValue
()){
...
...
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