19 YARP_LOG_COMPONENT(FrameGrabberCropperParamsCOMPONENT,
"yarp.device.FrameGrabberCropper")
30 std::vector<std::string> params;
31 params.push_back(
"x1");
32 params.push_back(
"y1");
33 params.push_back(
"x2");
34 params.push_back(
"y2");
35 params.push_back(
"forwardRgbVisualParams");
44 paramValue = std::to_string(
m_x1);
49 paramValue = std::to_string(
m_y1);
54 paramValue = std::to_string(
m_x2);
59 paramValue = std::to_string(
m_y2);
62 if (paramName ==
"forwardRgbVisualParams")
65 else paramValue =
"false";
69 yError() <<
"parameter '" << paramName <<
"' was not found";
88 if (config.
check(
"help"))
97 if (config.
check(
"x1"))
100 yCInfo(FrameGrabberCropperParamsCOMPONENT) <<
"Parameter 'x1' using value:" <<
m_x1;
104 yCError(FrameGrabberCropperParamsCOMPONENT) <<
"Mandatory parameter 'x1' not found!";
105 yCError(FrameGrabberCropperParamsCOMPONENT) <<
"Description of the parameter: x1";
108 prop_check.
unput(
"x1");
113 if (config.
check(
"y1"))
116 yCInfo(FrameGrabberCropperParamsCOMPONENT) <<
"Parameter 'y1' using value:" <<
m_y1;
120 yCError(FrameGrabberCropperParamsCOMPONENT) <<
"Mandatory parameter 'y1' not found!";
121 yCError(FrameGrabberCropperParamsCOMPONENT) <<
"Description of the parameter: y1";
124 prop_check.
unput(
"y1");
129 if (config.
check(
"x2"))
132 yCInfo(FrameGrabberCropperParamsCOMPONENT) <<
"Parameter 'x2' using value:" <<
m_x2;
136 yCError(FrameGrabberCropperParamsCOMPONENT) <<
"Mandatory parameter 'x2' not found!";
137 yCError(FrameGrabberCropperParamsCOMPONENT) <<
"Description of the parameter: x2";
140 prop_check.
unput(
"x2");
145 if (config.
check(
"y2"))
148 yCInfo(FrameGrabberCropperParamsCOMPONENT) <<
"Parameter 'y2' using value:" <<
m_y2;
152 yCError(FrameGrabberCropperParamsCOMPONENT) <<
"Mandatory parameter 'y2' not found!";
153 yCError(FrameGrabberCropperParamsCOMPONENT) <<
"Description of the parameter: y2";
156 prop_check.
unput(
"y2");
161 if (config.
check(
"forwardRgbVisualParams"))
170 prop_check.
unput(
"forwardRgbVisualParams");
205 doc = doc + std::string(
"\n=============================================\n");
206 doc = doc + std::string(
"This is the help for device: FrameGrabberCropper\n");
207 doc = doc + std::string(
"\n");
208 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
209 doc = doc + std::string(
"'x1': x1\n");
210 doc = doc + std::string(
"'y1': y1\n");
211 doc = doc + std::string(
"'x2': x2\n");
212 doc = doc + std::string(
"'y2': y2\n");
213 doc = doc + std::string(
"'forwardRgbVisualParams': Forward the the IRgbVisualParams calls to the attached device\n");
214 doc = doc + std::string(
"\n");
215 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
216 doc = doc +
" yarpdev --device frameGrabberCropper --x1 0 --y1 0 --x2 100 --y2 100 --forwardRgbVisualParams false\n";
217 doc = doc + std::string(
"Using only mandatory params:\n");
218 doc = doc +
" yarpdev --device frameGrabberCropper --x1 0 --y1 0 --x2 100 --y2 100\n";
219 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
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.
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.
FrameGrabberCropper_ParamsParser()
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
bool m_forwardRgbVisualParams
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,...)