30 std::vector<std::string> params;
31 params.push_back(
"period");
32 params.push_back(
"waveform");
33 params.push_back(
"signal_frequency");
34 params.push_back(
"signal_amplitude");
35 params.push_back(
"driver_frame_size");
42 if (paramName ==
"period")
44 paramValue = std::to_string(
m_period);
47 if (paramName ==
"waveform")
52 if (paramName ==
"signal_frequency")
57 if (paramName ==
"signal_amplitude")
62 if (paramName ==
"driver_frame_size")
68 yError() <<
"parameter '" << paramName <<
"' was not found";
87 if (config.
check(
"help"))
96 if (config.
check(
"period"))
99 yCInfo(FakeMicrophoneParamsCOMPONENT) <<
"Parameter 'period' using value:" <<
m_period;
103 yCInfo(FakeMicrophoneParamsCOMPONENT) <<
"Parameter 'period' using DEFAULT value:" <<
m_period;
105 prop_check.
unput(
"period");
110 if (config.
check(
"waveform"))
113 yCInfo(FakeMicrophoneParamsCOMPONENT) <<
"Parameter 'waveform' using value:" <<
m_waveform;
117 yCInfo(FakeMicrophoneParamsCOMPONENT) <<
"Parameter 'waveform' using DEFAULT value:" <<
m_waveform;
119 prop_check.
unput(
"waveform");
124 if (config.
check(
"signal_frequency"))
133 prop_check.
unput(
"signal_frequency");
138 if (config.
check(
"signal_amplitude"))
147 prop_check.
unput(
"signal_amplitude");
152 if (config.
check(
"driver_frame_size"))
161 prop_check.
unput(
"driver_frame_size");
196 doc = doc + std::string(
"\n=============================================\n");
197 doc = doc + std::string(
"This is the help for device: FakeMicrophone\n");
198 doc = doc + std::string(
"\n");
199 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
200 doc = doc + std::string(
"'period': the period of processing thread\n");
201 doc = doc + std::string(
"'waveform': Defines the shape of the waveform. Can be one of the following: sine,sawtooth,square,constant\n");
202 doc = doc + std::string(
"'signal_frequency': Frequency of the generated signal\n");
203 doc = doc + std::string(
"'signal_amplitude': Amplitude of the generated signal\n");
204 doc = doc + std::string(
"'driver_frame_size': the number of samples to process on each iteration of the thread\n");
205 doc = doc + std::string(
"\n");
206 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
207 doc = doc +
" yarpdev --device fakeMicrophone --period 0.010 --waveform sine --signal_frequency 440 --signal_amplitude 32000 --driver_frame_size 512\n";
208 doc = doc + std::string(
"Using only mandatory params:\n");
209 doc = doc +
" yarpdev --device fakeMicrophone\n";
210 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string m_provided_configuration
FakeMicrophone_ParamsParser()
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.
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
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 YARP_LOG_COMPONENT(name,...)