Motion Master
Loading...
Searching...
No Matches
EthernetOdEntry Class Reference

#include <ethernet_od_entry.h>

Inheritance diagram for EthernetOdEntry:
Collaboration diagram for EthernetOdEntry:

Public Member Functions

 EthernetOdEntry (mm::comm::spoe::Device &ed, uint16_t index, uint8_t subindex)
 EthernetOdEntry (mm::comm::spoe::Device &ed, uint16_t index, uint8_t subindex, const std::vector< uint8_t > &value)
Type get_parameter_type () override
 Get the type of the parameter.
uint16_t get_index () override
 Get the index of the parameter.
uint8_t get_subindex () override
 Get the subindex of the parameter.
bool is_pdo_mapped () override
 Check if the parameter is PDO mapped.
bool set_pdo_mapping (PdoMapping pdo_mapping)
uint64_t get_raw_value () override
 Get the raw (64-bit unsigned integer) value of the OD entry.
uint64_t get_raw_value (bool force_refresh) override
 Get the raw (64-bit unsigned integer) value of the OD entry.
int32_t get_int_value () override
 Get the integer value of the parameter.
int32_t get_int_value (bool force_refresh) override
 Get the integer value of the parameter.
float get_float_value () override
 Get the float value of the parameter.
float get_float_value (bool force_refresh) override
 Get the float value of the parameter.
std::string get_string_value () override
 Get the string value of the parameter.
std::string get_string_value (bool force_refresh) override
 Get the string value of the parameter.
bool get_value_status () override
 Check the current status of the parameter value.
int32_t set_raw_value (uint64_t value) override
 Set a raw (64-bit unsigned integer) value.
int32_t set_value (int32_t value) override
 Set an integer value.
int32_t set_value (float value) override
 Set a float value.
int32_t set_value (const std::string &value) override
 Set a string value.
ValueType get_value_type () override
 Get the parameter value type.
std::string get_name () override
 Get the name of the parameter.
std::string get_parent_name () override
 Get the parameter parent name.
bool is_read () override
 Check if the parameter can be read.
bool is_write () override
 Check if the parameter can be written into.
std::string get_unit () override
 Get the defined unit of the parameter value.
int32_t get_min () override
 Get the minimum value the parameter should hold.
int32_t get_max () override
 Get the maximum value the parameter should hold.
bool is_value_fresh () override
 Check if the value is fresh.
int32_t refresh_value ()
Public Member Functions inherited from VirtualParameter
virtual ~VirtualParameter ()=default
virtual bool has_value ()
 Check if the parameter holds a value that was read at least once.
virtual bool is_read_attempted ()
 Check if a read of the value has finished, successfully or not.
virtual std::string get_last_error ()
 Get why the last read or write of the value failed.

Friends

class EthernetMaster
class EthernetSlave
class ParameterValueRefresher

Additional Inherited Members

Public Types inherited from VirtualParameter
enum class  Type {
  kNotDefined = 0 , kIghOdEntry , kSoemOdEntry , kMock ,
  kEthernetOdEntry
}
enum class  ValueType {
  kUnspecified = 0 , kBoolean , kInteger8 , kInteger16 ,
  kInteger32 , kUnsignedInteger8 , kUnsignedInteger16 , kUnsignedInteger32 ,
  kFloat , kString , kOctetString , kUnicodeString ,
  kEnum , kOther
}
enum class  PdoMapping { kNotPdoMapped , kRxPdoMapped , kTxPdoMapped }

Constructor & Destructor Documentation

◆ EthernetOdEntry() [1/2]

EthernetOdEntry::EthernetOdEntry ( mm::comm::spoe::Device & ed,
uint16_t index,
uint8_t subindex )

◆ EthernetOdEntry() [2/2]

EthernetOdEntry::EthernetOdEntry ( mm::comm::spoe::Device & ed,
uint16_t index,
uint8_t subindex,
const std::vector< uint8_t > & value )

Member Function Documentation

◆ get_float_value() [1/2]

float EthernetOdEntry::get_float_value ( )
overridevirtual

Get the float value of the parameter.

Returns
the float value

Implements VirtualParameter.

◆ get_float_value() [2/2]

float EthernetOdEntry::get_float_value ( bool force_refresh)
overridevirtual

Get the float value of the parameter.

Parameters
force_refreshforce the value refresh
Returns
the float value

Implements VirtualParameter.

◆ get_index()

uint16_t EthernetOdEntry::get_index ( )
overridevirtual

Get the index of the parameter.

Returns
index of the parameter

Implements VirtualParameter.

◆ get_int_value() [1/2]

int32_t EthernetOdEntry::get_int_value ( )
overridevirtual

Get the integer value of the parameter.

Returns
the integer value

Implements VirtualParameter.

◆ get_int_value() [2/2]

int32_t EthernetOdEntry::get_int_value ( bool force_refresh)
overridevirtual

Get the integer value of the parameter.

Parameters
force_refreshforce the value refresh
Returns
the integer value

Implements VirtualParameter.

◆ get_max()

int32_t EthernetOdEntry::get_max ( )
overridevirtual

Get the maximum value the parameter should hold.

IMPORTANT: Not being used currently

Returns
the maximum value

Reimplemented from VirtualParameter.

◆ get_min()

int32_t EthernetOdEntry::get_min ( )
overridevirtual

Get the minimum value the parameter should hold.

IMPORTANT: Not being used currently

Returns
the minimum value

Reimplemented from VirtualParameter.

◆ get_name()

std::string EthernetOdEntry::get_name ( )
overridevirtual

Get the name of the parameter.

Returns
name of the parameter

Implements VirtualParameter.

◆ get_parameter_type()

VirtualParameter::Type EthernetOdEntry::get_parameter_type ( )
overridevirtual

Get the type of the parameter.

Returns
type of the parameter (OD entry, MOCK, etc.)

Reimplemented from VirtualParameter.

◆ get_parent_name()

std::string EthernetOdEntry::get_parent_name ( )
overridevirtual

Get the parameter parent name.

This is the name of the group a (sub-)parameter is a part of (the name of the parent parameter if it is an array or a record)

Returns
the parent name if any, otherwise empty

Implements VirtualParameter.

◆ get_raw_value() [1/2]

uint64_t EthernetOdEntry::get_raw_value ( )
overridevirtual

Get the raw (64-bit unsigned integer) value of the OD entry.

Returns
the raw (64-bit unsigned integer) value

Implements VirtualParameter.

◆ get_raw_value() [2/2]

uint64_t EthernetOdEntry::get_raw_value ( bool force_refresh)
overridevirtual

Get the raw (64-bit unsigned integer) value of the OD entry.

Parameters
force_refreshforce the value refresh
Returns
the raw (64-bit unsigned integer) value

Implements VirtualParameter.

◆ get_string_value() [1/2]

std::string EthernetOdEntry::get_string_value ( )
overridevirtual

Get the string value of the parameter.

Parameters
force_refreshforce the value refresh
Returns
the string value

Implements VirtualParameter.

◆ get_string_value() [2/2]

std::string EthernetOdEntry::get_string_value ( bool force_refresh)
overridevirtual

Get the string value of the parameter.

Parameters
force_refreshforce the value refresh
Returns
the string value

Implements VirtualParameter.

◆ get_subindex()

uint8_t EthernetOdEntry::get_subindex ( )
overridevirtual

Get the subindex of the parameter.

Returns
subindex of the parameter

Implements VirtualParameter.

◆ get_unit()

std::string EthernetOdEntry::get_unit ( )
overridevirtual

Get the defined unit of the parameter value.

Returns
the unit as a string

Reimplemented from VirtualParameter.

◆ get_value_status()

bool EthernetOdEntry::get_value_status ( )
overridevirtual

Check the current status of the parameter value.

For example, the value of the parameter can fail to refresh.

Returns
true if status normal, false otherwise

Implements VirtualParameter.

◆ get_value_type()

VirtualParameter::ValueType EthernetOdEntry::get_value_type ( )
overridevirtual

Get the parameter value type.

Returns
the value type

Implements VirtualParameter.

◆ is_pdo_mapped()

bool EthernetOdEntry::is_pdo_mapped ( )
overridevirtual

Check if the parameter is PDO mapped.

IMPORTANT: Not available for all types of parameters

Returns
true if PDO mapped, false otherwise

Implements VirtualParameter.

◆ is_read()

bool EthernetOdEntry::is_read ( )
overridevirtual

Check if the parameter can be read.

Returns
true is can be read, false otherwise

Reimplemented from VirtualParameter.

◆ is_value_fresh()

bool EthernetOdEntry::is_value_fresh ( )
overridevirtual

Check if the value is fresh.

Returns
true if the value is fresh, false otherwise

Implements VirtualParameter.

◆ is_write()

bool EthernetOdEntry::is_write ( )
overridevirtual

Check if the parameter can be written into.

Returns
true is can be written into, false otherwise

Reimplemented from VirtualParameter.

◆ refresh_value()

int32_t EthernetOdEntry::refresh_value ( )

◆ set_pdo_mapping()

bool EthernetOdEntry::set_pdo_mapping ( PdoMapping pdo_mapping)

◆ set_raw_value()

int32_t EthernetOdEntry::set_raw_value ( uint64_t value)
overridevirtual

Set a raw (64-bit unsigned integer) value.

Parameters
valuevalue to set
Returns
zero if successful, non-zero otherwise

Implements VirtualParameter.

◆ set_value() [1/3]

int32_t EthernetOdEntry::set_value ( const std::string & value)
overridevirtual

Set a string value.

Parameters
valuevalue to set
Returns
zero if successful, non-zero otherwise

Implements VirtualParameter.

◆ set_value() [2/3]

int32_t EthernetOdEntry::set_value ( float value)
overridevirtual

Set a float value.

Parameters
valuevalue to set
Returns
zero if successful, non-zero otherwise

Implements VirtualParameter.

◆ set_value() [3/3]

int32_t EthernetOdEntry::set_value ( int32_t value)
overridevirtual

Set an integer value.

Parameters
valuevalue to set
Returns
zero if successful, non-zero otherwise

Implements VirtualParameter.

◆ EthernetMaster

friend class EthernetMaster
friend

◆ EthernetSlave

friend class EthernetSlave
friend

◆ ParameterValueRefresher

friend class ParameterValueRefresher
friend

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