6#include <condition_variable>
14class IghEthercatMaster;
18 friend class IghEthercatMaster;
19 friend class IghEthercatSlave;
25 Value &operator=(
const Value &other) {
33 bool operator==(
const Value &other)
const {
return i == other.i; }
52 IghOdEntry(IghEthercatMaster &master, uint16_t absolute_slave_position,
53 const ec_sdo_info_t &sdo_info,
54 const ec_sdo_info_entry_t &sdo_info_entry, uint8_t subindex);
56 IghOdEntry(IghEthercatMaster &master, uint16_t absolute_slave_position,
57 const ec_sdo_info_t &sdo_info, uint8_t subindex,
59 const std::string &description,
bool read_access,
97 bool set_pdo_mapping(PdoMapping pdo_mapping);
281 void set_value_stale();
288 IghOdEntry::Error refresh_value();
299 IghOdEntry::Error try_refresh_value();
302 IghEthercatMaster &master_;
303 uint16_t absolute_slave_position_;
309 std::string value_string_;
312 uint8_t object_type_;
313 uint16_t entry_type_;
315 std::string parent_name_;
319 int32_t min_value_ = INT32_MIN;
320 int32_t max_value_ = INT32_MAX;
322 ec_sdo_request_t *upload_sdo_request_ =
nullptr;
323 ec_request_state_t upload_sdo_request_state_ = EC_REQUEST_UNUSED;
325 ec_sdo_request_t *download_sdo_request_ =
nullptr;
326 ec_request_state_t download_sdo_request_state_ = EC_REQUEST_UNUSED;
328 std::atomic_bool value_status_ =
false;
329 std::atomic_bool value_initially_refreshed_ =
false;
330 std::atomic_bool value_fresh_ =
false;
331 std::atomic_int refresh_value_sync_timeout_counter_ = 0;
333 std::mutex set_value_sdo_mutex_;
344 int32_t set_value_sdo(uint64_t
value);
353 int32_t set_value_sdo(
const std::string &
value);
Error
Definition: motion_master_error.h:8
Definition: virtual_parameter.h:9
virtual std::string get_parent_name()=0
Get the parameter parent name.
virtual bool is_pdo_mapped()=0
Check if the parameter is PDO mapped.
virtual uint16_t get_index()=0
Get the index of the parameter.
virtual int32_t get_min()
Get the minimum value the parameter should hold.
Definition: virtual_parameter.h:227
virtual bool is_value_fresh()=0
Check if the value is fresh.
virtual Type get_parameter_type()
Get the type of the parameter.
Definition: virtual_parameter.h:39
virtual std::string get_name()=0
Get the name of the parameter.
virtual bool is_read()
Check if the parameter can be read.
Definition: virtual_parameter.h:204
virtual bool is_write()
Check if the parameter can be written into.
Definition: virtual_parameter.h:211
virtual bool get_value_status()=0
Check the current status of the parameter value.
virtual uint8_t get_subindex()=0
Get the subindex of the parameter.
Type
Definition: virtual_parameter.h:11
virtual int32_t set_value(int32_t value)=0
Set an integer value.
virtual std::string get_string_value()=0
Get the string value of the parameter.
virtual uint64_t get_raw_value()=0
Get the raw (64-bit unsigned integer) value of the OD entry.
virtual int32_t get_int_value()=0
Get the integer value of the parameter.
virtual int32_t get_max()
Get the maximum value the parameter should hold.
Definition: virtual_parameter.h:236
virtual float get_float_value()=0
Get the float value of the parameter.
virtual int32_t set_raw_value(uint64_t value)=0
Set a raw (64-bit unsigned integer) value.
virtual ValueType get_value_type()=0
Get the parameter value type.
virtual std::string get_unit()
Get the defined unit of the parameter value.
Definition: virtual_parameter.h:218
uint8_t * value
Definition: co_dictionary.h:9
uint16_t data_type
Definition: co_dictionary.h:2
bool operator==(uint32_t lhs, EtherCATVendorID rhs)
Compares a uint32_t value with an EtherCATVendorID enum value.
Definition: common.h:130