19 YARP_LOG_COMPONENT(MultipleAnalogSensorsClientParamsCOMPONENT,
"yarp.device.MultipleAnalogSensorsClient")
30 std::vector<std::string> params;
31 params.push_back(
"remote");
32 params.push_back(
"local");
33 params.push_back(
"timeout");
34 params.push_back(
"externalConnection");
35 params.push_back(
"carrier");
42 if (paramName ==
"remote")
47 if (paramName ==
"local")
52 if (paramName ==
"timeout")
57 if (paramName ==
"externalConnection")
60 else paramValue =
"false";
63 if (paramName ==
"carrier")
69 yError() <<
"parameter '" << paramName <<
"' was not found";
88 if (config.
check(
"help"))
97 if (config.
check(
"remote"))
100 yCInfo(MultipleAnalogSensorsClientParamsCOMPONENT) <<
"Parameter 'remote' using value:" <<
m_remote;
104 yCError(MultipleAnalogSensorsClientParamsCOMPONENT) <<
"Mandatory parameter 'remote' not found!";
105 yCError(MultipleAnalogSensorsClientParamsCOMPONENT) <<
"Description of the parameter: Prefix of the ports to which to connect, opened by MultipleAnalogSensorsServer device.";
108 prop_check.
unput(
"remote");
113 if (config.
check(
"local"))
116 yCInfo(MultipleAnalogSensorsClientParamsCOMPONENT) <<
"Parameter 'local' using value:" <<
m_local;
120 yCError(MultipleAnalogSensorsClientParamsCOMPONENT) <<
"Mandatory parameter 'local' not found!";
121 yCError(MultipleAnalogSensorsClientParamsCOMPONENT) <<
"Description of the parameter: Port prefix of the ports opened by this device.";
124 prop_check.
unput(
"local");
129 if (config.
check(
"timeout"))
132 yCInfo(MultipleAnalogSensorsClientParamsCOMPONENT) <<
"Parameter 'timeout' using value:" <<
m_timeout;
136 yCInfo(MultipleAnalogSensorsClientParamsCOMPONENT) <<
"Parameter 'timeout' using DEFAULT value:" <<
m_timeout;
138 prop_check.
unput(
"timeout");
143 if (config.
check(
"externalConnection"))
150 yCInfo(MultipleAnalogSensorsClientParamsCOMPONENT) <<
"Parameter 'externalConnection' using DEFAULT value:" <<
m_externalConnection;
152 prop_check.
unput(
"externalConnection");
157 if (config.
check(
"carrier"))
160 yCInfo(MultipleAnalogSensorsClientParamsCOMPONENT) <<
"Parameter 'carrier' using value:" <<
m_carrier;
164 yCInfo(MultipleAnalogSensorsClientParamsCOMPONENT) <<
"Parameter 'carrier' using DEFAULT value:" <<
m_carrier;
166 prop_check.
unput(
"carrier");
201 doc = doc + std::string(
"\n=============================================\n");
202 doc = doc + std::string(
"This is the help for device: MultipleAnalogSensorsClient\n");
203 doc = doc + std::string(
"\n");
204 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
205 doc = doc + std::string(
"'remote': Prefix of the ports to which to connect, opened by MultipleAnalogSensorsServer device.\n");
206 doc = doc + std::string(
"'local': Port prefix of the ports opened by this device.\n");
207 doc = doc + std::string(
"'timeout': Timeout after which the device reports an error if no measurement was received.\n");
208 doc = doc + std::string(
"'externalConnection': If set to true, the connection to the rpc port of the MAS server is skipped and it is possible to connect to the data source externally after being opened\n");
209 doc = doc + std::string(
"'carrier': The carier used for the connection with the server.\n");
210 doc = doc + std::string(
"\n");
211 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
212 doc = doc +
" yarpdev --device multipleanalogsensorsclient --remote <mandatory_value> --local <mandatory_value> --timeout 0.02 --externalConnection false --carrier tcp\n";
213 doc = doc + std::string(
"Using only mandatory params:\n");
214 doc = doc +
" yarpdev --device multipleanalogsensorsclient --remote <mandatory_value> --local <mandatory_value>\n";
215 doc = doc + std::string(
"=============================================\n\n");
return doc;
bool m_externalConnection
MultipleAnalogSensorsClient_ParamsParser()
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
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 > getListOfParams() const override
Return a list of all params used by the device.
std::string getConfiguration() const override
Return the configuration of the device.
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::string m_provided_configuration
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.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)