Motion Master
Loading...
Searching...
No Matches
si_unit_velocity.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <list>
5#include <map>
6
7class Cia402Drive;
10
12 public:
32
33 explicit SiUnitVelocity(Cia402Drive* cia402_drive);
34
35 Type get_type();
36
37 MotionMasterError set_type(Type type, bool scale_other_parameters = true,
38 bool restore_type = false);
39
41
42 double get_scale() const;
43
44 uint32_t get_code() const;
45
46 bool is_valid();
47
48 private:
49 static const std::map<uint32_t, Type> code_type_map_;
50 static const std::map<Type, double> type_scale_map_;
51
52 // List of parameters that need scaling as pairs of index/subindex
53 static const std::list<std::pair<uint16_t, uint8_t>> scaled_parameters_;
54
55 Cia402Drive* cia402_drive_ = nullptr;
56 VirtualParameter* si_unit_velocity_parameter_ = nullptr;
57 Type type_ = kUnspecified;
58 Type previous_type_ = kUnspecified;
59 bool scaling_other_parameters_done_ = false;
60 uint32_t code_ = 0;
61 double scale_ = 0;
62
71 MotionMasterError scale_si_unit_velocity_connected_parameters(double scale);
72};
Definition cia402_drive.h:48
Definition motion_master_error.h:6
uint32_t get_code() const
Definition si_unit_velocity.cc:189
Type get_type()
Definition si_unit_velocity.cc:96
double get_scale() const
Definition si_unit_velocity.cc:187
bool is_valid()
Definition si_unit_velocity.cc:191
MotionMasterError restore_type()
Definition si_unit_velocity.cc:179
SiUnitVelocity(Cia402Drive *cia402_drive)
Definition si_unit_velocity.cc:61
Type
Definition si_unit_velocity.h:13
@ kRps
Definition si_unit_velocity.h:27
@ kMilliRpm
Definition si_unit_velocity.h:22
@ kKiloRps
Definition si_unit_velocity.h:26
@ kGigaRps
Definition si_unit_velocity.h:24
@ kCentiRpm
Definition si_unit_velocity.h:21
@ kKiloRpm
Definition si_unit_velocity.h:18
@ kTeraRps
Definition si_unit_velocity.h:23
@ kGigaRpm
Definition si_unit_velocity.h:16
@ kRpm
Definition si_unit_velocity.h:19
@ kDeciRps
Definition si_unit_velocity.h:28
@ kCentiRps
Definition si_unit_velocity.h:29
@ kMegaRps
Definition si_unit_velocity.h:25
@ kUnspecified
Definition si_unit_velocity.h:14
@ kMilliRps
Definition si_unit_velocity.h:30
@ kTeraRpm
Definition si_unit_velocity.h:15
@ kDeciRpm
Definition si_unit_velocity.h:20
@ kMegaRpm
Definition si_unit_velocity.h:17
MotionMasterError set_type(Type type, bool scale_other_parameters=true, bool restore_type=false)
Definition si_unit_velocity.cc:98
Definition virtual_parameter.h:9
uint8_t type
Definition co_dictionary.h:1
@ kUnspecified
Definition global.h:34