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:
11 enum class Type {
12 kNotDefined = 0,
15 kMock,
17 };
18
19 enum class ValueType {
20 kUnspecified = 0,
28 kFloat,
29 kString,
32 kEnum,
33 kOther
34 };
35
37
38 virtual ~VirtualParameter() = default;
39
46
52 virtual uint16_t get_index() = 0;
53
59 virtual uint8_t get_subindex() = 0;
60
68 virtual bool is_pdo_mapped() = 0;
69
75 virtual uint64_t get_raw_value() = 0;
76
84 virtual uint64_t get_raw_value(bool force_refresh) = 0;
85
91 virtual int32_t get_int_value() = 0;
92
100 virtual int32_t get_int_value(bool force_refresh) = 0;
101
107 virtual float get_float_value() = 0;
108
116 virtual float get_float_value(bool force_refresh) = 0;
117
125 virtual std::string get_string_value() = 0;
126
134 virtual std::string get_string_value(bool force_refresh) = 0;
135
143 virtual bool get_value_status() = 0;
144
152 virtual int32_t set_raw_value(uint64_t value) = 0;
153
161 virtual int32_t set_value(int32_t value) = 0;
162
170 virtual int32_t set_value(float value) = 0;
171
179 virtual int32_t set_value(const std::string& value) = 0;
180
187
193 virtual std::string get_name() = 0;
194
203 virtual std::string get_parent_name() = 0;
204
210 virtual bool is_read() { return true; }
211
217 virtual bool is_write() { return true; }
218
224 virtual std::string get_unit() { return ""; }
225
233 virtual int32_t get_min() { return INT32_MAX; }
234
242 virtual int32_t get_max() { return INT32_MIN; }
243
249 virtual bool is_value_fresh() = 0;
250};
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:233
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:45
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:210
virtual bool is_write()
Check if the parameter can be written into.
Definition: virtual_parameter.h:217
PdoMapping
Definition: virtual_parameter.h:36
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:19
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:242
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:224
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