YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FakeBattery_ParamsParser Class Reference

This class is the parameters parser for class FakeBattery. More...

#include <fake/fakeBattery/FakeBattery_ParamsParser.h>

+ Inheritance diagram for FakeBattery_ParamsParser:

Classes

struct  parser_version_type
 

Public Member Functions

 FakeBattery_ParamsParser ()
 
 ~FakeBattery_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
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.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Public Attributes

const std::string m_device_classname = {"FakeBattery"}
 
const std::string m_device_name = {"fakeBattery"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
const std::string m_period_defaultValue = {"0.02"}
 
const std::string m_charge_defaultValue = {"50.0"}
 
const std::string m_voltage_defaultValue = {"30.0"}
 
const std::string m_current_defaultValue = {"3.0"}
 
const std::string m_temperature_defaultValue = {"20.0"}
 
const std::string m_info_defaultValue = {"Fake battery system v2.0"}
 
const std::string m_rpc_port_name_defaultValue = {"/fakeBattery/rpc"}
 
double m_period = {0.02}
 
double m_charge = {50.0}
 
double m_voltage = {30.0}
 
double m_current = {3.0}
 
double m_temperature = {20.0}
 
std::string m_info = {"Fake battery system v2.0"}
 
std::string m_rpc_port_name = {"/fakeBattery/rpc"}
 

Detailed Description

This class is the parameters parser for class FakeBattery.

These are the used parameters:

Group name Parameter name Type Units Default Value Required Description Notes
- period double s 0.02 0 thread period -
- charge double - 50.0 0 Initial charge -
- voltage double V 30.0 0 Initial voltage -
- current double A 3.0 0 Initial current -
- temperature double C 20.0 0 Initial temperature -
- info string - Fake battery system v2.0 0 Initial battery information -
- rpc_port_name string - /fakeBattery/rpc 0 Full rpc port name -

The device can be launched by yarpdev using one of the following examples (with and without all optional parameters):

yarpdev --device fakeBattery --period 0.02 --charge 50.0 --voltage 30.0 --current 3.0 --temperature 20.0 --info Fake battery system v2.0 --rpc_port_name /fakeBattery/rpc
yarpdev --device fakeBattery

Definition at line 47 of file FakeBattery_ParamsParser.h.

Constructor & Destructor Documentation

◆ FakeBattery_ParamsParser()

FakeBattery_ParamsParser::FakeBattery_ParamsParser ( )

Definition at line 23 of file FakeBattery_ParamsParser.cpp.

◆ ~FakeBattery_ParamsParser()

FakeBattery_ParamsParser::~FakeBattery_ParamsParser ( )
overridedefault

Member Function Documentation

◆ getDeviceClassName()

std::string FakeBattery_ParamsParser::getDeviceClassName ( ) const
inlineoverridevirtual

Get the name of the DeviceDriver class.

Returns
A string containing the name of the class.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 81 of file FakeBattery_ParamsParser.h.

◆ getDeviceName()

std::string FakeBattery_ParamsParser::getDeviceName ( ) const
inlineoverridevirtual

Get the name of the device (i.e.

the plugin name).

Returns
A string containing the name of the device.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 82 of file FakeBattery_ParamsParser.h.

◆ getDocumentationOfDeviceParams()

std::string FakeBattery_ParamsParser::getDocumentationOfDeviceParams ( ) const
overridevirtual

Get the documentation of the DeviceDriver's parameters.

Returns
A string containing the documentation.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 179 of file FakeBattery_ParamsParser.cpp.

◆ getListOfParams()

std::vector< std::string > FakeBattery_ParamsParser::getListOfParams ( ) const
overridevirtual

Return a list of all params used by the device.

Returns
A vector containing the names of parameters used by the device.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 28 of file FakeBattery_ParamsParser.cpp.

◆ parseParams()

bool FakeBattery_ParamsParser::parseParams ( const yarp::os::Searchable config)
overridevirtual

Parse the DeviceDriver parameters.

Returns
true if the parsing is successful, false otherwise

Implements yarp::dev::IDeviceDriverParams.

Definition at line 42 of file FakeBattery_ParamsParser.cpp.

Member Data Documentation

◆ m_charge

double FakeBattery_ParamsParser::m_charge = {50.0}

Definition at line 73 of file FakeBattery_ParamsParser.h.

◆ m_charge_defaultValue

const std::string FakeBattery_ParamsParser::m_charge_defaultValue = {"50.0"}

Definition at line 65 of file FakeBattery_ParamsParser.h.

◆ m_current

double FakeBattery_ParamsParser::m_current = {3.0}

Definition at line 75 of file FakeBattery_ParamsParser.h.

◆ m_current_defaultValue

const std::string FakeBattery_ParamsParser::m_current_defaultValue = {"3.0"}

Definition at line 67 of file FakeBattery_ParamsParser.h.

◆ m_device_classname

const std::string FakeBattery_ParamsParser::m_device_classname = {"FakeBattery"}

Definition at line 54 of file FakeBattery_ParamsParser.h.

◆ m_device_name

const std::string FakeBattery_ParamsParser::m_device_name = {"fakeBattery"}

Definition at line 55 of file FakeBattery_ParamsParser.h.

◆ m_info

std::string FakeBattery_ParamsParser::m_info = {"Fake battery system v2.0"}

Definition at line 77 of file FakeBattery_ParamsParser.h.

◆ m_info_defaultValue

const std::string FakeBattery_ParamsParser::m_info_defaultValue = {"Fake battery system v2.0"}

Definition at line 69 of file FakeBattery_ParamsParser.h.

◆ m_parser_is_strict

bool FakeBattery_ParamsParser::m_parser_is_strict = false

Definition at line 56 of file FakeBattery_ParamsParser.h.

◆ m_parser_version

const parser_version_type FakeBattery_ParamsParser::m_parser_version = {}

Definition at line 62 of file FakeBattery_ParamsParser.h.

◆ m_period

double FakeBattery_ParamsParser::m_period = {0.02}

Definition at line 72 of file FakeBattery_ParamsParser.h.

◆ m_period_defaultValue

const std::string FakeBattery_ParamsParser::m_period_defaultValue = {"0.02"}

Definition at line 64 of file FakeBattery_ParamsParser.h.

◆ m_rpc_port_name

std::string FakeBattery_ParamsParser::m_rpc_port_name = {"/fakeBattery/rpc"}

Definition at line 78 of file FakeBattery_ParamsParser.h.

◆ m_rpc_port_name_defaultValue

const std::string FakeBattery_ParamsParser::m_rpc_port_name_defaultValue = {"/fakeBattery/rpc"}

Definition at line 70 of file FakeBattery_ParamsParser.h.

◆ m_temperature

double FakeBattery_ParamsParser::m_temperature = {20.0}

Definition at line 76 of file FakeBattery_ParamsParser.h.

◆ m_temperature_defaultValue

const std::string FakeBattery_ParamsParser::m_temperature_defaultValue = {"20.0"}

Definition at line 68 of file FakeBattery_ParamsParser.h.

◆ m_voltage

double FakeBattery_ParamsParser::m_voltage = {30.0}

Definition at line 74 of file FakeBattery_ParamsParser.h.

◆ m_voltage_defaultValue

const std::string FakeBattery_ParamsParser::m_voltage_defaultValue = {"30.0"}

Definition at line 66 of file FakeBattery_ParamsParser.h.


The documentation for this class was generated from the following files: