10#include "units/time.h"
125 return WaitForPlayingImpl(timeout.value());
148 return StepTimingImpl(stepTimeSeconds.value());
154 template <
typename T>
186 return GetRawImpl(name).ToSignalData();
196 return GetBooleanImpl(name).ToSignalData();
206 return GetIntegerImpl(name).ToSignalData();
216 return GetFloatImpl(name).ToSignalData();
226 return GetDoubleImpl(name).ToSignalData();
235 template <
typename U,
typename = std::enable_if_t<units::traits::is_unit_t_v<U>>>
241 std::move(doubleSig.
units),
256 return GetStringImpl(name).ToSignalData();
266 return GetBooleanArrayImpl(name).ToSignalData();
276 return GetIntegerArrayImpl(name).ToSignalData();
286 return GetFloatArrayImpl(name).ToSignalData();
296 return GetDoubleArrayImpl(name).ToSignalData();
300 static bool WaitForPlayingImpl(
double timeoutSeconds);
303 template <
typename T>
304 struct UnitlessSignalData {
305 std::string_view name;
311 SignalData<T> ToSignalData() &&
316 units::second_t{timestampSec},
323 static UnitlessSignalData<std::vector<uint8_t>> GetRawImpl(std::string_view name);
324 static UnitlessSignalData<bool> GetBooleanImpl(std::string_view name);
325 static UnitlessSignalData<int64_t> GetIntegerImpl(std::string_view name);
326 static UnitlessSignalData<float> GetFloatImpl(std::string_view name);
327 static UnitlessSignalData<double> GetDoubleImpl(std::string_view name);
328 static UnitlessSignalData<std::string> GetStringImpl(std::string_view name);
329 static UnitlessSignalData<std::vector<uint8_t>> GetBooleanArrayImpl(std::string_view name);
330 static UnitlessSignalData<std::vector<int64_t>> GetIntegerArrayImpl(std::string_view name);
331 static UnitlessSignalData<std::vector<float>> GetFloatArrayImpl(std::string_view name);
332 static UnitlessSignalData<std::vector<double>> GetDoubleArrayImpl(std::string_view name);
Static class for controlling Phoenix 6 hoot log replay.
Definition: HootReplay.hpp:28
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:214
static SignalData< std::string > GetString(std::string_view name)
Gets a string user signal.
Definition: HootReplay.hpp:254
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:184
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:123
static SignalData< std::vector< double > > GetDoubleArray(std::string_view name)
Get a double array user signal.
Definition: HootReplay.hpp:294
static ctre::phoenix::StatusCode StepTiming(units::time::second_t stepTimeSeconds)
Advances the hoot log replay time by the given value.
Definition: HootReplay.hpp:146
static bool IsPlaying()
Gets whether hoot log replay is actively playing.
Definition: HootReplay.hpp:102
static SignalData< std::vector< uint8_t > > GetBooleanArray(std::string_view name)
Get a boolean array user signal.
Definition: HootReplay.hpp:264
static SignalData< std::vector< float > > GetFloatArray(std::string_view name)
Get a float array user signal.
Definition: HootReplay.hpp:284
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:194
static SignalData< int64_t > GetInteger(std::string_view name)
Gets an integer user signal.
Definition: HootReplay.hpp:204
static SignalData< double > GetDouble(std::string_view name)
Gets a double user signal.
Definition: HootReplay.hpp:224
static SignalData< std::vector< int64_t > > GetIntegerArray(std::string_view name)
Get an integer array user signal.
Definition: HootReplay.hpp:274
static SignalData< U > GetValue(std::string_view name)
Gets a unit value user signal.
Definition: HootReplay.hpp:236
static ctre::phoenix::StatusCode Restart()
Restarts the hoot log replay from the start of the log.
Definition: HootReplay.hpp:84
static ctre::phoenix::StatusCode Pause()
Pauses the hoot log replay.
Status codes reported by APIs, including OK, warnings, and errors.
Definition: StatusCodes.h:27
Represents the state of one swerve module.
Definition: StatusCodes.h:18
Stores information about a user signal from replay.
Definition: HootReplay.hpp:155
ctre::phoenix::StatusCode status
Status code response of getting the signal.
Definition: HootReplay.hpp:171
std::string_view name
The name of the signal.
Definition: HootReplay.hpp:159
std::string units
The units of the signal.
Definition: HootReplay.hpp:163
units::second_t timestamp
The timestamp of the signal.
Definition: HootReplay.hpp:167
T value
The value of the signal.
Definition: HootReplay.hpp:175