19 YARP_LOG_COMPONENT(RemoteControlBoardRemapperParamsCOMPONENT,
"yarp.device.RemoteControlBoardRemapper")
30 std::vector<std::string> params;
31 params.push_back(
"remoteControlBoards");
32 params.push_back(
"axesNames");
33 params.push_back(
"localPortPrefix");
34 params.push_back(
"verbose");
41 if (paramName ==
"remoteControlBoards")
43 std::ostringstream oss;
50 paramValue = oss.str();
53 if (paramName ==
"axesNames")
55 std::ostringstream oss;
62 paramValue = oss.str();
65 if (paramName ==
"localPortPrefix")
70 if (paramName ==
"verbose")
73 else paramValue =
"false";
77 yError() <<
"parameter '" << paramName <<
"' was not found";
96 if (config.
check(
"help"))
105 if (config.
check(
"remoteControlBoards"))
112 std::string tempBots = tempBot->
toString();
113 for (
size_t i=0; i<tempBot->
size(); i++)
120 yCError(RemoteControlBoardRemapperParamsCOMPONENT) <<
"parameter 'remoteControlBoards' is not a properly formatted bottle";
127 yCError(RemoteControlBoardRemapperParamsCOMPONENT) <<
"Mandatory parameter 'remoteControlBoards' not found!";
128 yCError(RemoteControlBoardRemapperParamsCOMPONENT) <<
"Description of the parameter: Ordered list of the axes that are part of the remapped device.";
131 prop_check.
unput(
"remoteControlBoards");
136 if (config.
check(
"axesNames"))
143 std::string tempBots = tempBot->
toString();
144 for (
size_t i=0; i<tempBot->
size(); i++)
151 yCError(RemoteControlBoardRemapperParamsCOMPONENT) <<
"parameter 'axesNames' is not a properly formatted bottle";
154 yCInfo(RemoteControlBoardRemapperParamsCOMPONENT) <<
"Parameter 'axesNames' using value:" <<
m_axesNames;
158 yCError(RemoteControlBoardRemapperParamsCOMPONENT) <<
"Mandatory parameter 'axesNames' not found!";
159 yCError(RemoteControlBoardRemapperParamsCOMPONENT) <<
"Description of the parameter: List of remote prefix used by the remote controlboards";
162 prop_check.
unput(
"axesNames");
167 if (config.
check(
"localPortPrefix"))
170 yCInfo(RemoteControlBoardRemapperParamsCOMPONENT) <<
"Parameter 'localPortPrefix' using value:" <<
m_localPortPrefix;
174 yCError(RemoteControlBoardRemapperParamsCOMPONENT) <<
"Mandatory parameter 'localPortPrefix' not found!";
175 yCError(RemoteControlBoardRemapperParamsCOMPONENT) <<
"Description of the parameter: All ports opened by this device will start with this prefix";
178 prop_check.
unput(
"localPortPrefix");
183 if (config.
check(
"verbose"))
186 yCInfo(RemoteControlBoardRemapperParamsCOMPONENT) <<
"Parameter 'verbose' using value:" <<
m_verbose;
190 yCInfo(RemoteControlBoardRemapperParamsCOMPONENT) <<
"Parameter 'verbose' using DEFAULT value:" <<
m_verbose;
192 prop_check.
unput(
"verbose");
227 doc = doc + std::string(
"\n=============================================\n");
228 doc = doc + std::string(
"This is the help for device: RemoteControlBoardRemapper\n");
229 doc = doc + std::string(
"\n");
230 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
231 doc = doc + std::string(
"'remoteControlBoards': Ordered list of the axes that are part of the remapped device.\n");
232 doc = doc + std::string(
"'axesNames': List of remote prefix used by the remote controlboards\n");
233 doc = doc + std::string(
"'localPortPrefix': All ports opened by this device will start with this prefix\n");
234 doc = doc + std::string(
"'verbose': print additional output if enabled\n");
235 doc = doc + std::string(
"\n");
236 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
237 doc = doc +
" yarpdev --device remotecontrolboardremapper --remoteControlBoards <mandatory_value> --axesNames <mandatory_value> --localPortPrefix <mandatory_value> --verbose false\n";
238 doc = doc + std::string(
"Using only mandatory params:\n");
239 doc = doc +
" yarpdev --device remotecontrolboardremapper --remoteControlBoards <mandatory_value> --axesNames <mandatory_value> --localPortPrefix <mandatory_value>\n";
240 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
std::vector< std::string > m_axesNames
std::string m_provided_configuration
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
std::vector< std::string > m_remoteControlBoards
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
RemoteControlBoardRemapper_ParamsParser()
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::string getConfiguration() const override
Return the configuration of the device.
std::string m_localPortPrefix
A simple collection of objects that can be described and transmitted in a portable way.
size_type size() const
Gets the number of elements in the bottle.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
A class for storing options and configuration information.
void unput(const std::string &key)
Remove the association from the given key to a value, if present.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
virtual std::string asString() const
Get string value.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)