Skip to content
Snippets Groups Projects
Commit 8c0da225 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

new "Units" attribute

parent 780f910a
No related branches found
No related tags found
No related merge requests found
...@@ -1011,6 +1011,7 @@ static void _setStandardOptions(onelab::parameter *p, ...@@ -1011,6 +1011,7 @@ static void _setStandardOptions(onelab::parameter *p,
if(copt.count("Highlight")) p->setAttribute("Highlight", copt["Highlight"][0]); if(copt.count("Highlight")) p->setAttribute("Highlight", copt["Highlight"][0]);
if(copt.count("Macro")) p->setAttribute("Macro", copt["Macro"][0]); if(copt.count("Macro")) p->setAttribute("Macro", copt["Macro"][0]);
if(copt.count("GmshOption")) p->setAttribute("GmshOption", copt["GmshOption"][0]); if(copt.count("GmshOption")) p->setAttribute("GmshOption", copt["GmshOption"][0]);
if(copt.count("Units")) p->setAttribute("Units", copt["Units"][0]);
if(copt.count("AutoCheck")) // for backward compatibility if(copt.count("AutoCheck")) // for backward compatibility
p->setAttribute("AutoCheck", copt["AutoCheck"][0]); p->setAttribute("AutoCheck", copt["AutoCheck"][0]);
......
...@@ -137,7 +137,13 @@ namespace onelab{ ...@@ -137,7 +137,13 @@ namespace onelab{
} }
std::string getShortName() const std::string getShortName() const
{ {
if(_label.size()) return _label; std::string units = getAttribute("Units");
if(_label.size()){
if(units.empty())
return _label;
else
return _label + " [" + units + "]";
}
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('/');
...@@ -154,7 +160,10 @@ namespace onelab{ ...@@ -154,7 +160,10 @@ namespace onelab{
// start' // start'
while(s.size() && s[0] >= '0' && s[0] <= '9') while(s.size() && s[0] >= '0' && s[0] <= '9')
s = s.substr(1); s = s.substr(1);
return s; if(units.empty())
return s;
else
return s + " [" + units + "]";
} }
int getChanged(const std::string &client="") const int getChanged(const std::string &client="") const
{ {
...@@ -1277,9 +1286,9 @@ namespace onelab{ ...@@ -1277,9 +1286,9 @@ namespace onelab{
void runNonBlockingSubClient(const std::string &name, const std::string &command) void runNonBlockingSubClient(const std::string &name, const std::string &command)
{ {
if(!_gmshClient){ if(!_gmshClient){
int res=system(command.c_str()); int res = system(command.c_str());
if (res) if(res){
{// error // report error
} }
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment