00001 // 00002 // Created by Noam Dori on 19/06/18. 00003 // 00004 00005 #include <ddynamic_reconfigure/param/dd_double_param.h> 00006 00007 namespace ddynamic_reconfigure { 00008 string DDDouble::getName() const { 00009 return name_; 00010 } 00011 00012 void DDDouble::prepGroup(Group &group) { 00013 ParamDescription desc; 00014 desc.name = name_; 00015 desc.level = level_; 00016 desc.description = desc_; 00017 desc.type = "double"; 00018 group.parameters.push_back(desc); 00019 } 00020 00021 void DDDouble::prepConfig(Config &conf) { 00022 DoubleParameter param; 00023 param.name = name_; 00024 param.value = val_; 00025 conf.doubles.push_back(param); 00026 } 00027 00028 void DDDouble::prepConfigDescription(ConfigDescription &conf_desc) { 00029 DoubleParameter param; 00030 param.name = name_; 00031 param.value = def_; 00032 conf_desc.dflt.doubles.push_back(param); 00033 param.value = max_; 00034 conf_desc.max.doubles.push_back(param); 00035 param.value = min_; 00036 conf_desc.min.doubles.push_back(param); 00037 } 00038 00039 int DDDouble::getLevel() const { 00040 return level_; 00041 } 00042 00043 bool DDDouble::sameType(Value val) { 00044 return val.getType() == "double"; 00045 } 00046 00047 bool DDDouble::sameValue(Value val) { 00048 return val.toDouble() == val_; 00049 } 00050 00051 void DDDouble::setValue(Value val) { 00052 val_ = val.toDouble(); 00053 } 00054 00055 Value DDDouble::getValue() const { 00056 return Value(val_); 00057 } 00058 }