CTRE Phoenix C++ 5.33.1
AbsoluteSensorRange.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 {
7 namespace phoenix {
8 namespace sensors {
9
10 /**
11 * Enum for how to range the absolute sensor position.
12 *
13 * @deprecated This device's Phoenix 5 API is deprecated for removal in the
14 * 2025 season. Users should update to Phoenix 6 firmware and migrate to the
15 * Phoenix 6 API. A migration guide is available at
16 * https://v6.docs.ctr-electronics.com/en/stable/docs/migration/migration-guide/index.html.
17 *
18 * If the Phoenix 5 API must be used for this device, the device must have 22.X
19 * firmware. This firmware is available in Tuner X after selecting Phoenix 5 in
20 * the firmware year dropdown.
21 */
23 /**
24 * Express the absolute position as an unsigned value.
25 * E.g. [0,+1) rotations or [0,360) deg.
26 */
28 /**
29 * Express the absolute position as an signed value.
30 * E.g. [-0.5,+0.5) rotations or [-180,+180) deg.
31 */
33 };
34
35 /**
36 * Class to handle routines specific to AbsoluteSensorRange
37 *
38 * @deprecated This device's Phoenix 5 API is deprecated for removal in the
39 * 2025 season. Users should update to Phoenix 6 firmware and migrate to the
40 * Phoenix 6 API. A migration guide is available at
41 * https://v6.docs.ctr-electronics.com/en/stable/docs/migration/migration-guide/index.html.
42 *
43 * If the Phoenix 5 API must be used for this device, the device must have 22.X
44 * firmware. This firmware is available in Tuner X after selecting Phoenix 5 in
45 * the firmware year dropdown.
46 */
47 class [[deprecated("This device's Phoenix 5 API is deprecated for removal in the 2025 season."
48 "Users should update to Phoenix 6 firmware and migrate to the Phoenix 6 API."
49 "A migration guide is available at https://v6.docs.ctr-electronics.com/en/stable/docs/migration/migration-guide/index.html")]]
51 public:
52 /**
53 * String representation of specified AbsoluteSensorRange
54 * @param value AbsoluteSensorRange to convert to a string
55 * @return string representation of AbsoluteSensorRange
56 */
57 static std::string toString(AbsoluteSensorRange value) {
58 switch (value) {
59 case Unsigned_0_to_360: return "Unsigned: 0 to 360 deg (positive full rotation";
60 case Signed_PlusMinus180: return "Signed: -180 to 180 deg (plus/minus half a rotation)";
61 default: return "InvalidValue";
62 }
63 }
64 };
65
66 } // namespace sensors
67 } // namespace phoenix
68} // namespace ctre
Class to handle routines specific to AbsoluteSensorRange.
Definition: AbsoluteSensorRange.h:50
static std::string toString(AbsoluteSensorRange value)
String representation of specified AbsoluteSensorRange.
Definition: AbsoluteSensorRange.h:57
AbsoluteSensorRange
Enum for how to range the absolute sensor position.
Definition: AbsoluteSensorRange.h:22
@ Unsigned_0_to_360
Express the absolute position as an unsigned value.
Definition: AbsoluteSensorRange.h:27
@ Signed_PlusMinus180
Express the absolute position as an signed value.
Definition: AbsoluteSensorRange.h:32
namespace ctre
Definition: paramEnum.h:5