CTRE Phoenix 6 C++ 26.0.0-beta-1
Loading...
Searching...
No Matches
CustomParamsConfigs.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
10
11
12namespace ctre {
13namespace phoenix6 {
14
15
16namespace configs {
17
18/**
19 * \brief Custom Params.
20 *
21 * \details Custom paramaters that have no real impact on controller.
22 */
24public:
25 constexpr CustomParamsConfigs() = default;
26
27 /**
28 * \brief Custom parameter 0. This is provided to allow
29 * end-applications to store persistent information in the device.
30 *
31 * - Minimum Value: -32768
32 * - Maximum Value: 32767
33 * - Default Value: 0
34 * - Units:
35 */
36 int CustomParam0 = 0;
37 /**
38 * \brief Custom parameter 1. This is provided to allow
39 * end-applications to store persistent information in the device.
40 *
41 * - Minimum Value: -32768
42 * - Maximum Value: 32767
43 * - Default Value: 0
44 * - Units:
45 */
46 int CustomParam1 = 0;
47
48 /**
49 * \brief Modifies this configuration's CustomParam0 parameter and returns itself for
50 * method-chaining and easier to use config API.
51 *
52 * Custom parameter 0. This is provided to allow end-applications to
53 * store persistent information in the device.
54 *
55 * - Minimum Value: -32768
56 * - Maximum Value: 32767
57 * - Default Value: 0
58 * - Units:
59 *
60 * \param newCustomParam0 Parameter to modify
61 * \returns Itself
62 */
63 constexpr CustomParamsConfigs &WithCustomParam0(int newCustomParam0)
64 {
65 CustomParam0 = std::move(newCustomParam0);
66 return *this;
67 }
68
69 /**
70 * \brief Modifies this configuration's CustomParam1 parameter and returns itself for
71 * method-chaining and easier to use config API.
72 *
73 * Custom parameter 1. This is provided to allow end-applications to
74 * store persistent information in the device.
75 *
76 * - Minimum Value: -32768
77 * - Maximum Value: 32767
78 * - Default Value: 0
79 * - Units:
80 *
81 * \param newCustomParam1 Parameter to modify
82 * \returns Itself
83 */
84 constexpr CustomParamsConfigs &WithCustomParam1(int newCustomParam1)
85 {
86 CustomParam1 = std::move(newCustomParam1);
87 return *this;
88 }
89
90
91
92 std::string ToString() const override;
93
94 std::string Serialize() const final;
95 ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final;
96};
97
98}
99}
100}
Custom Params.
Definition CustomParamsConfigs.hpp:23
std::string ToString() const override
int CustomParam0
Custom parameter 0.
Definition CustomParamsConfigs.hpp:36
int CustomParam1
Custom parameter 1.
Definition CustomParamsConfigs.hpp:46
ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final
constexpr CustomParamsConfigs & WithCustomParam0(int newCustomParam0)
Modifies this configuration's CustomParam0 parameter and returns itself for method-chaining and easie...
Definition CustomParamsConfigs.hpp:63
constexpr CustomParamsConfigs & WithCustomParam1(int newCustomParam1)
Modifies this configuration's CustomParam1 parameter and returns itself for method-chaining and easie...
Definition CustomParamsConfigs.hpp:84
Definition Configuration.hpp:17
Definition motor_constants.h:14