Motion Master
Loading...
Searching...
No Matches
virtual_parameter.h
Go to the documentation of this file.
1#pragma once
2
3#include <atomic>
4#include <condition_variable>
5#include <cstdint>
6#include <mutex>
7#include <string>
8
10 public:
12
13 enum class ValueType {
14 kUnspecified = 0,
22 kFloat,
23 kString,
26 kEnum,
27 kOther
28 };
29
31
32 virtual ~VirtualParameter() = default;
33
40
46 virtual uint16_t get_index() = 0;
47
53 virtual uint8_t get_subindex() = 0;
54
62 virtual bool is_pdo_mapped() = 0;
63
69 virtual uint64_t get_raw_value() = 0;
70
78 virtual uint64_t get_raw_value(bool force_refresh) = 0;
79
85 virtual int32_t get_int_value() = 0;
86
94 virtual int32_t get_int_value(bool force_refresh) = 0;
95
101 virtual float get_float_value() = 0;
102
110 virtual float get_float_value(bool force_refresh) = 0;
111
119 virtual std::string get_string_value() = 0;
120
128 virtual std::string get_string_value(bool force_refresh) = 0;
129
137 virtual bool get_value_status() = 0;
138
146 virtual int32_t set_raw_value(uint64_t value) = 0;
147
155 virtual int32_t set_value(int32_t value) = 0;
156
164 virtual int32_t set_value(float value) = 0;
165
173 virtual int32_t set_value(const std::string& value) = 0;
174
181
187 virtual std::string get_name() = 0;
188
197 virtual std::string get_parent_name() = 0;
198
204 virtual bool is_read() { return true; }
205
211 virtual bool is_write() { return true; }
212
218 virtual std::string get_unit() { return ""; }
219
227 virtual int32_t get_min() { return INT32_MAX; }
228
236 virtual int32_t get_max() { return INT32_MIN; }
237
243 virtual bool is_value_fresh() = 0;
244};
Definition: virtual_parameter.h:9
virtual std::string get_parent_name()=0
Get the parameter parent name.
virtual ~VirtualParameter()=default
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 std::string get_string_value(bool force_refresh)=0
Get the string value of the parameter.
virtual int32_t set_value(const std::string &value)=0
Set a string value.
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
PdoMapping
Definition: virtual_parameter.h:30
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.
virtual int32_t set_value(float value)=0
Set a float value.
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.
ValueType
Definition: virtual_parameter.h:13
virtual int32_t get_int_value()=0
Get the integer value of the parameter.
virtual float get_float_value(bool force_refresh)=0
Get the float 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 get_int_value(bool force_refresh)=0
Get the integer 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
virtual uint64_t get_raw_value(bool force_refresh)=0
Get the raw (64-bit unsigned integer) value of the OD entry.
uint8_t * value
Definition: co_dictionary.h:9