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

Don't try to be clever in update by checking if the value is equal to the...

Don't try to be clever in update by checking if the value is equal to the default, it makes everything complicted. Update should just update. If we want something incremental we can do it trivially in the client: just do a get(), complete, then set().

parent 253bcedf
Branches
Tags
No related merge requests found
...@@ -162,7 +162,7 @@ namespace onelab{ ...@@ -162,7 +162,7 @@ namespace onelab{
number(const std::string &name="", double value=0., number(const std::string &name="", double value=0.,
const std::string &shortHelp="", const std::string &help="") const std::string &shortHelp="", const std::string &help="")
: parameter(name, shortHelp, help), _value(value), : parameter(name, shortHelp, help), _value(value),
_min(-maxNumber()), _max(maxNumber()), _step(1.) {} _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; }
void setMax(double max){ _max = max; } void setMax(double max){ _max = max; }
...@@ -180,20 +180,13 @@ namespace onelab{ ...@@ -180,20 +180,13 @@ namespace onelab{
setValue(p.getValue()); setValue(p.getValue());
setChanged(true); setChanged(true);
} }
if(p.getMin() != -maxNumber()) setMin(p.getMin());
setMin(p.getMin()); setMax(p.getMax());
if(p.getMax() != maxNumber()) setStep(p.getStep());
setMax(p.getMax()); setChoices(p.getChoices());
if(p.getStep() != 1.) setShortHelp(p.getShortHelp());
setStep(p.getStep()); setHelp(p.getHelp());
if(p.getChoices().size()) setAttributes(p.getAttributes());
setChoices(p.getChoices());
if(p.getShortHelp().size())
setShortHelp(p.getShortHelp());
if(p.getHelp().size())
setHelp(p.getHelp());
if(p.getAttributes().size())
setAttributes(p.getAttributes());
} }
std::string toChar() std::string toChar()
{ {
...@@ -264,14 +257,10 @@ namespace onelab{ ...@@ -264,14 +257,10 @@ namespace onelab{
setKind(p.getKind()); setKind(p.getKind());
setChanged(true); setChanged(true);
} }
if(p.getChoices().size()) setChoices(p.getChoices());
setChoices(p.getChoices()); setShortHelp(p.getShortHelp());
if(p.getShortHelp().size()) setHelp(p.getHelp());
setShortHelp(p.getShortHelp()); setAttributes(p.getAttributes());
if(p.getHelp().size())
setHelp(p.getHelp());
if(p.getAttributes().size())
setAttributes(p.getAttributes());
} }
std::string toChar() std::string toChar()
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment