WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
SimHooks.hpp
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <stdint.h>
8
10#include "wpi/hal/HALBase.h"
11#include "wpi/units/time.hpp"
12
13namespace wpi::sim {
14
15/**
16 * Override the HAL runtime type (simulated/real).
17 *
18 * @param type runtime type
19 */
21
22/**
23 * Waits until the user program has started.
24 */
26
27/**
28 * Sets flag that indicates if the user program has started.
29 *
30 * @param started true if started
31 */
32void SetProgramStarted(bool started);
33
34/**
35 * Returns true if the user program has started.
36 *
37 * @return True if the user program has started.
38 */
40
41/**
42 * Sets the user program state (control word).
43 *
44 * @param controlWord control word
45 */
47
48/**
49 * Gets the user program state (control word).
50 *
51 * @return Control word
52 */
54
55/**
56 * Restart the simulator time.
57 */
59
60/**
61 * Pause the simulator time.
62 */
64
65/**
66 * Resume the simulator time.
67 */
69
70/**
71 * Check if the simulator time is paused.
72 *
73 * @return true if paused
74 */
76
77/**
78 * Advance the simulator time and wait for all notifiers to run.
79 *
80 * @param delta the amount to advance (in seconds)
81 */
82void StepTiming(wpi::units::second_t delta);
83
84/**
85 * Advance the simulator time and return immediately.
86 *
87 * @param delta the amount to advance (in seconds)
88 */
89void StepTimingAsync(wpi::units::second_t delta);
90
91} // namespace wpi::sim
A wrapper around Driver Station control word.
Definition DriverStationTypes.hpp:29
HAL_RuntimeType
Runtime type.
Definition HALBase.h:27
Definition CTREPCMSim.hpp:13
void SetRuntimeType(HAL_RuntimeType type)
Override the HAL runtime type (simulated/real).
wpi::hal::ControlWord GetProgramState()
Gets the user program state (control word).
void WaitForProgramStart()
Waits until the user program has started.
void StepTimingAsync(wpi::units::second_t delta)
Advance the simulator time and return immediately.
void SetProgramStarted(bool started)
Sets flag that indicates if the user program has started.
void RestartTiming()
Restart the simulator time.
bool GetProgramStarted()
Returns true if the user program has started.
void PauseTiming()
Pause the simulator time.
void ResumeTiming()
Resume the simulator time.
bool IsTimingPaused()
Check if the simulator time is paused.
void SetProgramState(wpi::hal::ControlWord controlWord)
Sets the user program state (control word).
void StepTiming(wpi::units::second_t delta)
Advance the simulator time and wait for all notifiers to run.