10#include <units/time.h>
44 static ctre::phoenix::StatusCode
SetPath(
const char *path);
55 static ctre::phoenix::StatusCode
Start();
61 static ctre::phoenix::StatusCode
Stop();
83 static ctre::phoenix::StatusCode
WriteRaw(std::string_view name, uint8_t
const *data, uint8_t size, units::time::second_t latencySeconds = 0_s)
85 return WriteRaw_Impl(name, data, size, latencySeconds.value());
96 static ctre::phoenix::StatusCode
WriteBoolean(std::string_view name,
bool value, units::time::second_t latencySeconds = 0_s)
98 return WriteBoolean_Impl(name, value, latencySeconds.value());
110 static ctre::phoenix::StatusCode
WriteInteger(std::string_view name, int64_t value, std::string_view units =
"", units::time::second_t latencySeconds = 0_s)
112 return WriteInteger_Impl(name, value, units, latencySeconds.value());
124 static ctre::phoenix::StatusCode
WriteFloat(std::string_view name,
float value, std::string_view units =
"", units::time::second_t latencySeconds = 0_s)
126 return WriteFloat_Impl(name, value, units, latencySeconds.value());
138 static ctre::phoenix::StatusCode
WriteDouble(std::string_view name,
double value, std::string_view units =
"", units::time::second_t latencySeconds = 0_s)
140 return WriteDouble_Impl(name, value, units, latencySeconds.value());
151 static ctre::phoenix::StatusCode
WriteString(std::string_view name, std::string_view value, units::time::second_t latencySeconds = 0_s)
153 return WriteString_Impl(name, value, latencySeconds.value());
165 template <
typename U,
typename = std::enable_if_t<units::traits::is_unit_t_v<U>>>
166 static ctre::phoenix::StatusCode
WriteValue(std::string_view name, U value, units::time::second_t latencySeconds = 0_s)
168 return WriteDouble(name, value.value(), units::abbreviation(value), latencySeconds);
180 template <
size_t N,
typename = std::enable_if_t<(N <= 64U)>>
181 static ctre::phoenix::StatusCode WriteBooleanArray(std::
string_view name, std::array<
bool, N> const &values, units::time::second_t latencySeconds = 0_s)
183 static_assert(sizeof(
bool) == sizeof(u
int8_t), "
bool is not u
int8_t");
184 return WriteBooleanArray_Impl(name, values.data(), values.size(), latencySeconds.value());
195 template <
size_t N,
typename = std::enable_if_t<(N <= 64U)>>
196 static ctre::phoenix::StatusCode WriteBooleanArray(std::
string_view name, std::array<u
int8_t, N> const &values, units::time::second_t latencySeconds = 0_s)
198 return WriteBooleanArray_Impl(name, values.data(), values.size(), latencySeconds.value());
210 static ctre::phoenix::StatusCode WriteBooleanArray(std::
string_view name, std::vector<u
int8_t> const &values, units::time::second_t latencySeconds = 0_s)
212 if (values.size() > 64) {
215 return WriteBooleanArray_Impl(name, values.data(), values.size(), latencySeconds.value());
228 template <
size_t N,
typename = std::enable_if_t<(N <= 8U)>>
229 static ctre::phoenix::StatusCode WriteIntegerArray(std::
string_view name, std::array<
int64_t, N> const &values, std::
string_view units = "", units::time::second_t latencySeconds = 0_s)
231 return WriteIntegerArray_Impl(name, values.data(), values.size(), units, latencySeconds.value());
243 static ctre::phoenix::StatusCode WriteIntegerArray(std::
string_view name, std::vector<
int64_t> const &values, std::
string_view units = "", units::time::second_t latencySeconds = 0_s)
245 if (values.size() > 8) {
248 return WriteIntegerArray_Impl(name, values.data(), values.size(), units, latencySeconds.value());
261 template <
size_t N,
typename = std::enable_if_t<(N <= 16U)>>
262 static ctre::phoenix::StatusCode WriteFloatArray(std::
string_view name, std::array<
float, N> const &values, std::
string_view units = "", units::time::second_t latencySeconds = 0_s)
264 return WriteFloatArray_Impl(name, values.data(), values.size(), units, latencySeconds.value());
276 static ctre::phoenix::StatusCode WriteFloatArray(std::
string_view name, std::vector<
float> const &values, std::
string_view units = "", units::time::second_t latencySeconds = 0_s)
278 if (values.size() > 16) {
281 return WriteFloatArray_Impl(name, values.data(), values.size(), units, latencySeconds.value());
294 template <
size_t N,
typename = std::enable_if_t<(N <= 8U)>>
295 static ctre::phoenix::StatusCode WriteDoubleArray(std::
string_view name, std::array<
double, N> const &values, std::
string_view units = "", units::time::second_t latencySeconds = 0_s)
297 return WriteDoubleArray_Impl(name, values.data(), values.size(), units, latencySeconds.value());
309 static ctre::phoenix::StatusCode WriteDoubleArray(std::
string_view name, std::vector<
double> const &values, std::
string_view units = "", units::time::second_t latencySeconds = 0_s)
311 if (values.size() > 8) {
314 return WriteDoubleArray_Impl(name, values.data(), values.size(), units, latencySeconds.value());
318 static ctre::phoenix::StatusCode WriteRaw_Impl(std::string_view name, uint8_t
const *data, uint8_t size,
double latencySeconds);
319 static ctre::phoenix::StatusCode WriteBoolean_Impl(std::string_view name,
bool value,
double latencySeconds);
320 static ctre::phoenix::StatusCode WriteInteger_Impl(std::string_view name, int64_t value, std::string_view units,
double latencySeconds);
321 static ctre::phoenix::StatusCode WriteFloat_Impl(std::string_view name,
float value, std::string_view units,
double latencySeconds);
322 static ctre::phoenix::StatusCode WriteDouble_Impl(std::string_view name,
double value, std::string_view units,
double latencySeconds);
323 static ctre::phoenix::StatusCode WriteString_Impl(std::string_view name, std::string_view value,
double latencySeconds);
325 static ctre::phoenix::StatusCode WriteBooleanArray_Impl(std::string_view name, uint8_t
const *values, uint8_t count,
double latencySeconds);
326 static ctre::phoenix::StatusCode WriteIntegerArray_Impl(std::string_view name, int64_t
const *values, uint8_t count, std::string_view units,
double latencySeconds);
327 static ctre::phoenix::StatusCode WriteFloatArray_Impl(std::string_view name,
float const *values, uint8_t count, std::string_view units,
double latencySeconds);
328 static ctre::phoenix::StatusCode WriteDoubleArray_Impl(std::string_view name,
double const *values, uint8_t count, std::string_view units,
double latencySeconds);
@ InvalidSize
Size is invalid.
Definition: StatusCodes.h:1852
Static class for controlling the Phoenix 6 signal logger.
Definition: SignalLogger.hpp:29
static ctre::phoenix::StatusCode WriteBoolean(std::string_view name, bool value, units::time::second_t latencySeconds=0_s)
Writes the boolean to the log file.
Definition: SignalLogger.hpp:96
static ctre::phoenix::StatusCode WriteString(std::string_view name, std::string_view value, units::time::second_t latencySeconds=0_s)
Writes the string to the log file.
Definition: SignalLogger.hpp:151
static ctre::phoenix::StatusCode SetPath(const char *path)
Sets the destination for logging, restarting logger if the path changed.
static ctre::phoenix::StatusCode WriteValue(std::string_view name, U value, units::time::second_t latencySeconds=0_s)
Writes the unit value to the log file.
Definition: SignalLogger.hpp:166
static ctre::phoenix::StatusCode WriteRaw(std::string_view name, uint8_t const *data, uint8_t size, units::time::second_t latencySeconds=0_s)
Writes the raw data bytes to the log file.
Definition: SignalLogger.hpp:83
static ctre::phoenix::StatusCode WriteInteger(std::string_view name, int64_t value, std::string_view units="", units::time::second_t latencySeconds=0_s)
Writes the integer to the log file.
Definition: SignalLogger.hpp:110
static ctre::phoenix::StatusCode WriteDouble(std::string_view name, double value, std::string_view units="", units::time::second_t latencySeconds=0_s)
Writes the double to the log file.
Definition: SignalLogger.hpp:138
static ctre::phoenix::StatusCode Stop()
Stops logging status signals.
static ctre::phoenix::StatusCode WriteFloat(std::string_view name, float value, std::string_view units="", units::time::second_t latencySeconds=0_s)
Writes the float to the log file.
Definition: SignalLogger.hpp:124
static ctre::phoenix::StatusCode EnableAutoLogging(bool enable)
Enables or disables auto logging.
static ctre::phoenix::StatusCode Start()
Starts logging status signals.
Definition: string_util.hpp:15