Motion Master
Loading...
Searching...
No Matches
mock_parameter.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include "co_dictionary.h"
6#include "virtual_parameter.h"
7
9 public:
10 explicit MockParameter(COD_Subitem *cod_subitem);
11
18
19 uint16_t get_index() override;
20
21 uint8_t get_subindex() override;
22
23 bool is_pdo_mapped() override;
24
25 uint64_t get_raw_value() override;
26
27 uint64_t get_raw_value(bool force_refresh) override;
28
29 int32_t get_int_value() override;
30
31 int32_t get_int_value(bool force_refresh) override;
32
33 float get_float_value() override;
34
35 float get_float_value(bool force_refresh) override;
36
37 std::string get_string_value() override;
38
39 std::string get_string_value(bool force_refresh) override;
40
41 bool get_value_status() override;
42
43 int32_t set_raw_value(uint64_t value) override;
44
45 int32_t set_value(int32_t value) override;
46
47 int32_t set_value(float value) override;
48
49 int32_t set_value(const std::string &value) override;
50
51 ValueType get_value_type() override;
52
53 std::string get_name() override;
54
55 std::string get_parent_name() override;
56
57 void set_parent_name(const std::string &parent_name);
58
59 bool is_read() override;
60
61 bool is_write() override;
62
63 std::string get_unit() override;
64
65 int32_t get_min() override;
66
67 int32_t get_max() override;
68
69 bool is_value_fresh() override;
70
71 private:
72 uint16_t index_;
73 uint8_t subindex_;
74
75 uint64_t int_value_;
76 float float_value_;
77 std::string string_value_;
78
79 uint16_t entry_type_; // define(s) in co_dictionary.h
80 std::string name_;
81 std::string parent_name_;
82 bool read_;
83 bool write_;
84};
Definition: mock_parameter.h:8
ValueType get_value_type() override
Get the parameter value type.
Definition: mock_parameter.cc:127
int32_t get_min() override
Get the minimum value the parameter should hold.
Definition: mock_parameter.cc:175
std::string get_name() override
Get the name of the parameter.
Definition: mock_parameter.cc:158
bool is_value_fresh() override
Check if the value is fresh.
Definition: mock_parameter.cc:185
std::string get_string_value() override
Get the string value of the parameter.
Definition: mock_parameter.cc:95
float get_float_value() override
Get the float value of the parameter.
Definition: mock_parameter.cc:91
VirtualParameter::Type get_parameter_type() override
Get the type of the parameter.
Definition: mock_parameter.cc:68
bool get_value_status() override
Check the current status of the parameter value.
Definition: mock_parameter.cc:101
uint16_t get_index() override
Get the index of the parameter.
Definition: mock_parameter.cc:72
std::string get_parent_name() override
Get the parameter parent name.
Definition: mock_parameter.cc:160
bool is_read() override
Check if the parameter can be read.
Definition: mock_parameter.cc:166
uint64_t get_raw_value() override
Get the raw (64-bit unsigned integer) value of the OD entry.
Definition: mock_parameter.cc:81
int32_t get_max() override
Get the maximum value the parameter should hold.
Definition: mock_parameter.cc:180
uint8_t get_subindex() override
Get the subindex of the parameter.
Definition: mock_parameter.cc:74
bool is_pdo_mapped() override
Check if the parameter is PDO mapped.
Definition: mock_parameter.cc:76
int32_t set_raw_value(uint64_t value) override
Set a raw (64-bit unsigned integer) value.
Definition: mock_parameter.cc:106
bool is_write() override
Check if the parameter can be written into.
Definition: mock_parameter.cc:168
int32_t get_int_value() override
Get the integer value of the parameter.
Definition: mock_parameter.cc:85
int32_t set_value(int32_t value) override
Set an integer value.
Definition: mock_parameter.cc:111
void set_parent_name(const std::string &parent_name)
Definition: mock_parameter.cc:162
std::string get_unit() override
Get the defined unit of the parameter value.
Definition: mock_parameter.cc:170
Definition: virtual_parameter.h:9
Type
Definition: virtual_parameter.h:11
ValueType
Definition: virtual_parameter.h:13
uint8_t * value
Definition: co_dictionary.h:9
Definition: co_dictionary.h:165