CTRE Phoenix C++ 5.33.1
CANifierVelocityMeasPeriod.h
Go to the documentation of this file.
1/* Copyright (C) Cross The Road Electronics 2024 */
2#pragma once
3
4#include <string>
5
6namespace ctre {
7namespace phoenix {
8
9/**
10* Enum for velocity periods used for CANifier
11*/
13 /**
14 * 1ms velocity measurement period
15 */
17 /**
18 * 2ms velocity measurement period
19 */
21 /**
22 * 5ms velocity measurement period
23 */
25 /**
26 * 10ms velocity measurement period
27 */
29 /**
30 * 20ms velocity measurement period
31 */
33 /**
34 * 25ms velocity measurement period
35 */
37 /**
38 * 50ms velocity measurement period
39 */
41 /**
42 * 100ms velocity measurement period
43 */
45};
46
47/**
48 * Class to handle routines specific to VelocityMeasPeriod
49 */
51public:
52 /**
53 * String representation of specified CANifierVelocityMeasPeriod
54 * @param value CANifierVelocityMeasPeriod to convert to a string
55 * @return string representation of CANifierVelocityMeasPeriod
56 */
57 static std::string toString(CANifierVelocityMeasPeriod value) {
58 switch(value) {
59 case CANifierVelocityMeasPeriod::Period_1Ms : return "CANifierVelocityMeasPeriod::Period_1Ms";
60 case CANifierVelocityMeasPeriod::Period_2Ms : return "CANifierVelocityMeasPeriod::Period_2Ms";
61 case CANifierVelocityMeasPeriod::Period_5Ms : return "CANifierVelocityMeasPeriod::Period_5Ms";
62 case CANifierVelocityMeasPeriod::Period_10Ms : return "CANifierVelocityMeasPeriod::Period_10Ms";
63 case CANifierVelocityMeasPeriod::Period_20Ms : return "CANifierVelocityMeasPeriod::Period_20Ms";
64 case CANifierVelocityMeasPeriod::Period_25Ms : return "CANifierVelocityMeasPeriod::Period_25Ms";
65 case CANifierVelocityMeasPeriod::Period_50Ms : return "CANifierVelocityMeasPeriod::Period_50Ms";
66 case CANifierVelocityMeasPeriod::Period_100Ms : return "CANifierVelocityMeasPeriod::Period_100Ms";
67 default : return "InvalidValue";
68 }
69 }
70};
71
72} // namespace phoenix
73} // namespace ctre
Class to handle routines specific to VelocityMeasPeriod.
Definition: CANifierVelocityMeasPeriod.h:50
static std::string toString(CANifierVelocityMeasPeriod value)
String representation of specified CANifierVelocityMeasPeriod.
Definition: CANifierVelocityMeasPeriod.h:57
CANifierVelocityMeasPeriod
Enum for velocity periods used for CANifier.
Definition: CANifierVelocityMeasPeriod.h:12
@ Period_20Ms
20ms velocity measurement period
Definition: CANifierVelocityMeasPeriod.h:32
@ Period_2Ms
2ms velocity measurement period
Definition: CANifierVelocityMeasPeriod.h:20
@ Period_25Ms
25ms velocity measurement period
Definition: CANifierVelocityMeasPeriod.h:36
@ Period_50Ms
50ms velocity measurement period
Definition: CANifierVelocityMeasPeriod.h:40
@ Period_5Ms
5ms velocity measurement period
Definition: CANifierVelocityMeasPeriod.h:24
@ Period_100Ms
100ms velocity measurement period
Definition: CANifierVelocityMeasPeriod.h:44
@ Period_10Ms
10ms velocity measurement period
Definition: CANifierVelocityMeasPeriod.h:28
@ Period_1Ms
1ms velocity measurement period
Definition: CANifierVelocityMeasPeriod.h:16
namespace ctre
Definition: paramEnum.h:5