Go to the documentation of this file.
12 return get<bool>(name);
18 return get<float>(name);
24 return get<std::uint32_t>(name);
30 return get<std::int32_t>(name);
36 return get<types::LinearConfig>(name);
42 return get<types::ModularConvertedValueConfig>(name);
48 return get<std::string>(name);
54 return get<std::list<bool>>(name);
60 return get<std::list<float>>(name);
63 std::list<std::uint32_t>
66 return get<std::list<std::uint32_t>>(name);
69 std::list<std::int32_t>
72 return get<std::list<std::int32_t>>(name);
84 "Configuration element " + i.first +
85 " was not expected by the Device code but defined in HardwareConfig.",
93 template <
class... Ts>
96 using Ts::operator()...;
99 template <
class... Ts>
112 if (i !=
list.size())
117 s <<
"}" << std::endl;
125 for (
int i = 0; i < indention; i++)
129 s <<
c.first <<
" (";
134 s << arg << std::endl;
139 s << arg << std::endl;
141 [&
s](std::uint32_t arg)
144 s << arg << std::endl;
146 [&
s](std::int32_t arg)
149 s << arg << std::endl;
154 s << arg << std::endl;
158 s <<
"LinearConvertedValue): factor=" << arg.getFactor()
159 <<
" offset=" << arg.getOffset() << std::endl;
163 s <<
"ModularConvertedValueConfig): "
164 <<
"zeroOffset=" << arg.getZeroOffset() << std::endl;
166 [&
s](std::string arg)
169 s << arg << std::endl;
171 [&
s](std::list<bool> arg)
176 [&
s](std::list<float> arg)
181 [&
s](std::list<std::uint32_t> arg)
186 [&
s](std::list<std::int32_t> arg)
192 s <<
"Matrix<Float>):" << std::endl << arg << std::endl;
195 s <<
"Matrix<UInt>):" << std::endl << arg << std::endl;
198 s <<
"Matrix<Int>):" << std::endl << arg << std::endl;
207 set<bool>(name,
value, tag);
213 set<float>(name,
value, tag);
219 set<std::uint32_t>(name,
value, tag);
225 set<std::int32_t>(name,
value, tag);
231 set<types::LinearConfig>(name,
value, tag);
239 set<types::ModularConvertedValueConfig>(name,
value, tag);
245 set<std::string>(name,
value, tag);
251 set<std::list<bool>>(name,
value, tag);
257 set<std::list<float>>(name,
value, tag);
263 set<std::list<std::uint32_t>>(name,
value, tag);
269 set<std::list<std::int32_t>>(name,
value, tag);
286 std::shared_ptr<Config> controllerConfig)
319 for (
auto& i :
items)
321 i.second.isRead =
false;
328 std::stringstream ss;
329 ss <<
message << std::endl <<
"Context:" << std::endl;
330 context.
print(ss, 0);
void printList(std::stringstream &s, std::list< T > list)
std::list< std::int32_t > getIntList(const std::string name)
Get a IntList (std::list<std::int32_t>) typed Config attribute by name.
void setFloatList(const std::string name, std::list< float > value, ConfigTag tag)
void setModularConvertedValueConfig(const std::string name, types::ModularConvertedValueConfig &&value, ConfigTag tag)
Config & getControllerConfig(const std::string controllerName)
std::list< float > getFloatList(const std::string name)
Get a FloatList (std::list<float>) typed Config attribute by name.
The ConfigElementNotFoundError class represents an error that is thrown when trying to get a config v...
The LinearConfig class represents a linear conversion and has a factor and offset.
void setBool(const std::string name, bool value, ConfigTag tag)
list(APPEND SOURCES ${QT_RESOURCES}) set(COMPONENT_LIBS ArmarXGui ArmarXCoreObservers ArmarXCoreEigen3Variants PlotterController $
void setUintList(const std::string name, std::list< std::uint32_t > value, ConfigTag tag)
types::LinearConfig getLinearConfig(const std::string name)
Get a LinearConvertedValue typed Config attribute by name.
message(STATUS "Boost-Library-Dir: " "${Boost_LIBRARY_DIRS}") message(STATUS "Boost-LIBRARIES
overloaded(Ts...) -> overloaded< Ts... >
void setInt(const std::string name, std::int32_t value, ConfigTag tag)
std::int32_t getInt(const std::string name)
Get a Int (std::int32_t) typed Config attribute by name.
std::shared_ptr< Value > value()
void setLinearConfig(const std::string name, types::LinearConfig &&value, ConfigTag tag)
ConfigTag
The ConfigTag is used when setting a config value.
std::string createErrorMessageWithContext(std::string message, const Config &context)
Create an error message that prints part of the current Config object to make it easiier to find the ...
std::list< std::uint32_t > getUintList(const std::string name)
Get a UIntList (std::list<std::uint32_t>) typed Config attribute by name.
types::ModularConvertedValueConfig getModularConvertedValueConfig(const std::string &name)
Get a ModularConvertedValue typed Config attribute by name.
void setFloat(const std::string name, float value, ConfigTag tag)
bool getBool(const std::string name)
Get a Bool typed Config attribute by name.
std::uint32_t getUint(const std::string name)
Get a Uint (std::uint32_t) typed Config attribute by name.
std::string tagName(ConfigTag tag)
virtual void onParsingFinished()
This method is called when the config is completely read form the HardwareConfig file.
void setBoolList(const std::string name, std::list< bool > value, ConfigTag tag)
void setString(const std::string name, std::string value, ConfigTag tag)
std::list< bool > getBoolList(const std::string name)
Get a BoolList (std::list<bool>) typed Config attribute by name.
std::map< std::string, ConfigItemWithMetadata > items
The Config class is the base class of all specialized configurations that have a direct key -> value ...
void setUint(const std::string name, std::uint32_t value, ConfigTag tag)
requires isVisitor< VisitorImplementation, typename VisitorImplementation::Input > void visit(VisitorImplementation &v, typename VisitorImplementation::Input &o)
std::string getString(const std::string name)
Get a String typed Config attribute by name.
void setIntList(const std::string name, std::list< std::int32_t > value, ConfigTag tag)
std::map< std::string, std::shared_ptr< Config > > controllerConfigs
float getFloat(const std::string name)
Get a Float typed Config attribute by name.
double s(double t, double s0, double v0, double a0, double j)
Config with additional Config objects for controllers.
virtual bool checkAllItemsRead(std::vector< std::string > &errors) const
This method is called once the device has read the configuration data it needs.
virtual void print(std::stringstream &s, int indention) const
Print this configuration.
void addControllerConfig(const std::string controllerName, std::shared_ptr< Config > controllerConfig)
Add a Config for a controller with name.