Class SimHooks
java.lang.Object
org.wpilib.simulation.SimHooks
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns true if the user program has started.static voidgetProgramState(ControlWord controlWord) Gets the user program state (control word).static booleanCheck if the simulator time is paused.static voidPause the simulator time.static voidRestart the simulator time.static voidResume the simulator time.static voidsetHALRuntimeType(int type) Override the HAL runtime type (simulated/real).static voidsetProgramStarted(boolean started) Sets flag that indicates if the user program has started.static voidsetProgramState(ControlWord controlWord) Sets the user program state (control word).static voidstepTiming(double delta) Advance the simulator time and wait for all notifiers to run.static voidstepTimingAsync(double delta) Advance the simulator time and return immediately.static voidWaits until the user program has started.
-
Method Details
-
setHALRuntimeType
Override the HAL runtime type (simulated/real).- Parameters:
type- runtime type
-
waitForProgramStart
Waits until the user program has started. -
setProgramStarted
Sets flag that indicates if the user program has started.- Parameters:
started- true if started
-
getProgramStarted
Returns true if the user program has started.- Returns:
- True if the user program has started.
-
setProgramState
Sets the user program state (control word).- Parameters:
controlWord- control word
-
getProgramState
Gets the user program state (control word).- Parameters:
controlWord- control word (output)
-
restartTiming
Restart the simulator time. -
pauseTiming
Pause the simulator time. -
resumeTiming
Resume the simulator time. -
isTimingPaused
Check if the simulator time is paused.- Returns:
- true if paused
-
stepTiming
Advance the simulator time and wait for all notifiers to run.- Parameters:
delta- the amount to advance in seconds
-
stepTimingAsync
Advance the simulator time and return immediately.- Parameters:
delta- the amount to advance in seconds
-