22 : span{options, options + len} {}
26 static_cast<span&
>(oth) = {};
35 static_cast<span&
>(*this) = oth;
36 static_cast<span&
>(oth) = {};
void HALSIM_FreeOpModeOptionsArray(struct HAL_OpModeOption *arr, size_t length)
@ name
Definition base.h:690
POVDirection
A controller POV direction.
Definition DriverStation.hpp:62
MatchType
The type of robot match that the robot is part of.
Definition DriverStation.hpp:48
Class to control a simulated driver station.
Definition DriverStationSim.hpp:50
static bool GetFmsAttached()
Check if the FMS is connected.
static void ResetData()
Reset all simulation data for the Driver Station.
static int GetJoystickRumble(int stick, int rumbleNum)
Gets the joystick rumble.
static void SetJoystickPOVsMaximumIndex(int stick, int maximumIndex)
Sets the number of POVs for a joystick.
static OpModeOptions GetOpModeOptions()
Gets the list of opmode options.
static void SetAllianceStationId(HAL_AllianceStationID allianceStationId)
Change the alliance station.
static int32_t GetJoystickLeds(int stick)
Gets the joystick outputs.
static void SetJoystickAxesAvailable(int stick, int available)
Sets the number of axes for a joystick.
static void SetJoystickName(int stick, std::string_view name)
Sets the name of a joystick.
static std::unique_ptr< CallbackStore > RegisterEnabledCallback(NotifyCallback callback, bool initialNotify)
Register a callback on whether the DS is enabled.
static std::unique_ptr< CallbackStore > RegisterFmsAttachedCallback(NotifyCallback callback, bool initialNotify)
Register a callback on whether the FMS is connected.
static std::unique_ptr< CallbackStore > RegisterRobotModeCallback(NotifyCallback callback, bool initialNotify)
Register a callback on DS robot mode changes.
static std::unique_ptr< CallbackStore > RegisterOpModeCallback(NotifyCallback callback, bool initialNotify)
Register a callback on DS opmode changes.
static std::unique_ptr< CallbackStore > RegisterAllianceStationIdCallback(NotifyCallback callback, bool initialNotify)
Register a callback on the alliance station ID.
static void SetMatchTime(double matchTime)
Sets the match timer.
static std::unique_ptr< CallbackStore > RegisterOpModeOptionsCallback(OpModeOptionsCallback callback, bool initialNotify)
Register a callback on opmode options changes.
static void SetMatchType(DriverStation::MatchType type)
Sets the match type.
static std::unique_ptr< CallbackStore > RegisterMatchTimeCallback(NotifyCallback callback, bool initialNotify)
Register a callback on match time.
static void SetReplayNumber(int replayNumber)
Sets the replay number.
static void SetJoystickIsGamepad(int stick, bool isGamepad)
Sets the value of isGamepad for a joystick.
static std::unique_ptr< CallbackStore > RegisterDsAttachedCallback(NotifyCallback callback, bool initialNotify)
Register a callback on whether the DS is connected.
static bool GetEnabled()
Check if the DS is enabled.
static void SetMatchNumber(int matchNumber)
Sets the match number.
static void NotifyNewData()
Updates DriverStation data so that new values are visible to the user program.
static double GetMatchTime()
Get the current value of the match timer.
static void SetGameData(std::string_view message)
Sets the game specific message.
static void SetJoystickButton(int stick, int button, bool state)
Sets the state of one joystick button.
static void SetJoystickSupportedOutputs(int stick, int supportedOutputs)
Sets the supported outputs for a joystick.
static int64_t GetOpMode()
Get the opmode set by the DS.
static void SetEStop(bool eStop)
Set whether eStop is active.
static void SetJoystickButtonsMaximumIndex(int stick, int count)
Sets the number of buttons for a joystick.
static void SetJoystickGamepadType(int stick, int type)
Sets the value of type for a joystick.
static void SetEnabled(bool enabled)
Change whether the DS is enabled.
static void SetJoystickAxesMaximumIndex(int stick, int maximumIndex)
Sets the number of axes for a joystick.
static void SetJoystickAxis(int stick, int axis, double value)
Gets the value of the axis on a joystick.
static bool GetDsAttached()
Check if the DS is attached.
static HAL_RobotMode GetRobotMode()
Get the robot mode set by the DS.
static void SetJoystickButtonsAvailable(int stick, uint64_t available)
static void SetJoystickPOVsAvailable(int stick, int available)
Sets the number of POVs for a joystick.
static void SetEventName(std::string_view name)
Sets the event name.
static void SetSendError(bool shouldSend)
Sets suppression of DriverStation::ReportError and ReportWarning messages.
static HAL_AllianceStationID GetAllianceStationId()
Get the alliance station ID (color + number).
static std::unique_ptr< CallbackStore > RegisterEStopCallback(NotifyCallback callback, bool initialNotify)
Register a callback on the eStop state.
static void SetJoystickPOV(int stick, int pov, DriverStation::POVDirection value)
Gets the state of a POV on a joystick.
static void SetRobotMode(HAL_RobotMode robotMode)
Change the robot mode set by the DS.
static void SetFmsAttached(bool fmsAttached)
Change whether the FMS is connected.
static bool GetEStop()
Check if eStop has been activated.
static void SetOpMode(int64_t opmode)
Change the opmode set by the DS.
static void SetDsAttached(bool dsAttached)
Change whether the DS is attached.
static void SetSendConsoleLine(bool shouldSend)
Sets suppression of DriverStation::SendConsoleLine messages.
Definition DriverStationSim.hpp:18
OpModeOptions(OpModeOptions &&oth)
Definition DriverStationSim.hpp:25
OpModeOptions(HAL_OpModeOption *options, int32_t len)
Definition DriverStationSim.hpp:21
~OpModeOptions()
Definition DriverStationSim.hpp:40
OpModeOptions(const OpModeOptions &)=delete
OpModeOptions & operator=(OpModeOptions &&oth)
Definition DriverStationSim.hpp:31
OpModeOptions & operator=(const OpModeOptions &)=delete
HAL_RobotMode
Definition DriverStationTypes.h:55
HAL_AllianceStationID
Definition DriverStationTypes.h:31
Definition CTREPCMSim.hpp:13
std::function< void(std::string_view, const HAL_Value *)> NotifyCallback
Definition CallbackStore.hpp:16
std::function< void(std::string_view, std::span< const HAL_OpModeOption >)> OpModeOptionsCallback
Definition CallbackStore.hpp:19
Definition DriverStationTypes.h:177