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,
if(copt.count("Highlight")) p->setAttribute("Highlight", copt["Highlight"][0]);
if(copt.count("Macro")) p->setAttribute("Macro", copt["Macro"][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
p->setAttribute("AutoCheck", copt["AutoCheck"][0]);
......
......@@ -137,7 +137,13 @@ namespace onelab{
}
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;
// remove path
std::string::size_type last = _name.find_last_of('/');
......@@ -154,7 +160,10 @@ namespace onelab{
// start'
while(s.size() && s[0] >= '0' && s[0] <= '9')
s = s.substr(1);
if(units.empty())
return s;
else
return s + " [" + units + "]";
}
int getChanged(const std::string &client="") const
{
......@@ -1278,8 +1287,8 @@ namespace onelab{
{
if(!_gmshClient){
int res = system(command.c_str());
if (res)
{// error
if(res){
// report error
}
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment