10#include "units/time.h"
137 return WaitForPlayingImpl(timeout.value());
160 return StepTimingImpl(stepTimeSeconds.value());
166 template <
typename T>
198 return GetRawImpl(name).ToSignalData();
208 return GetBooleanImpl(name).ToSignalData();
218 return GetIntegerImpl(name).ToSignalData();
228 return GetFloatImpl(name).ToSignalData();
238 return GetDoubleImpl(name).ToSignalData();
247 template <
typename U,
typename = std::enable_if_t<units::traits::is_unit_t_v<U>>>
253 std::move(doubleSig.
units),
268 return GetStringImpl(name).ToSignalData();
278 return GetBooleanArrayImpl(name).ToSignalData();
288 return GetIntegerArrayImpl(name).ToSignalData();
298 return GetFloatArrayImpl(name).ToSignalData();
308 return GetDoubleArrayImpl(name).ToSignalData();
312 static bool WaitForPlayingImpl(
double timeoutSeconds);
315 template <
typename T>
316 struct UnitlessSignalData {
317 std::string_view name;
323 SignalData<T> ToSignalData() &&
328 units::second_t{timestampSec},
335 static UnitlessSignalData<std::vector<uint8_t>> GetRawImpl(std::string_view name);
336 static UnitlessSignalData<bool> GetBooleanImpl(std::string_view name);
337 static UnitlessSignalData<int64_t> GetIntegerImpl(std::string_view name);
338 static UnitlessSignalData<float> GetFloatImpl(std::string_view name);
339 static UnitlessSignalData<double> GetDoubleImpl(std::string_view name);
340 static UnitlessSignalData<std::string> GetStringImpl(std::string_view name);
341 static UnitlessSignalData<std::vector<uint8_t>> GetBooleanArrayImpl(std::string_view name);
342 static UnitlessSignalData<std::vector<int64_t>> GetIntegerArrayImpl(std::string_view name);
343 static UnitlessSignalData<std::vector<float>> GetFloatArrayImpl(std::string_view name);
344 static UnitlessSignalData<std::vector<double>> GetDoubleArrayImpl(std::string_view name);
Static class for controlling Phoenix 6 hoot log replay.
Definition HootReplay.hpp:36
static ctre::phoenix::StatusCode Play()
Starts or resumes the hoot log replay.
static SignalData< float > GetFloat(std::string_view name)
Gets a float user signal.
Definition HootReplay.hpp:226
static SignalData< std::string > GetString(std::string_view name)
Gets a string user signal.
Definition HootReplay.hpp:266
static ctre::phoenix::StatusCode Stop()
Stops the hoot log replay.
static SignalData< std::vector< uint8_t > > GetRaw(std::string_view name)
Gets a raw-bytes user signal.
Definition HootReplay.hpp:196
static bool IsFileLoaded()
Gets whether a valid hoot log file is currently loaded.
static void CloseFile()
Ends the hoot log replay.
static void SetSpeed(double speed)
Sets the speed of the hoot log replay.
static bool WaitForPlaying(units::second_t timeout)
Waits until hoot log replay is actively playing.
Definition HootReplay.hpp:135
static SignalData< std::vector< double > > GetDoubleArray(std::string_view name)
Get a double array user signal.
Definition HootReplay.hpp:306
static ctre::phoenix::StatusCode StepTiming(units::time::second_t stepTimeSeconds)
Advances the hoot log replay time by the given value.
Definition HootReplay.hpp:158
static bool IsPlaying()
Gets whether hoot log replay is actively playing.
Definition HootReplay.hpp:114
static SignalData< std::vector< uint8_t > > GetBooleanArray(std::string_view name)
Get a boolean array user signal.
Definition HootReplay.hpp:276
static SignalData< std::vector< float > > GetFloatArray(std::string_view name)
Get a float array user signal.
Definition HootReplay.hpp:296
static ctre::phoenix::StatusCode LoadFile(char const *filepath)
Loads the given file and starts signal log replay.
static SignalData< bool > GetBoolean(std::string_view name)
Gets a boolean user signal.
Definition HootReplay.hpp:206
static SignalData< int64_t > GetInteger(std::string_view name)
Gets an integer user signal.
Definition HootReplay.hpp:216
static SignalData< double > GetDouble(std::string_view name)
Gets a double user signal.
Definition HootReplay.hpp:236
static SignalData< std::vector< int64_t > > GetIntegerArray(std::string_view name)
Get an integer array user signal.
Definition HootReplay.hpp:286
static SignalData< U > GetValue(std::string_view name)
Gets a unit value user signal.
Definition HootReplay.hpp:248
static ctre::phoenix::StatusCode Restart()
Restarts the hoot log replay from the start of the log.
Definition HootReplay.hpp:96
static ctre::phoenix::StatusCode Pause()
Pauses the hoot log replay.
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:27
Definition MotionMagicExpoTorqueCurrentFOC.hpp:18
Stores information about a user signal from replay.
Definition HootReplay.hpp:167
ctre::phoenix::StatusCode status
Status code response of getting the signal.
Definition HootReplay.hpp:183
std::string_view name
The name of the signal.
Definition HootReplay.hpp:171
std::string units
The units of the signal.
Definition HootReplay.hpp:175
units::second_t timestamp
The timestamp of the signal.
Definition HootReplay.hpp:179
T value
The value of the signal.
Definition HootReplay.hpp:187