Class SimHooks

java.lang.Object
org.wpilib.simulation.SimHooks

public final class SimHooks extends Object
Simulation hooks.
  • Method Details

    • setHALRuntimeType

      public static void setHALRuntimeType(int type)
      Override the HAL runtime type (simulated/real).
      Parameters:
      type - runtime type
    • waitForProgramStart

      public static void waitForProgramStart()
      Waits until the user program has started.
    • setProgramStarted

      public static void setProgramStarted(boolean started)
      Sets flag that indicates if the user program has started.
      Parameters:
      started - true if started
    • getProgramStarted

      public static boolean getProgramStarted()
      Returns true if the user program has started.
      Returns:
      True if the user program has started.
    • setProgramState

      public static void setProgramState(ControlWord controlWord)
      Sets the user program state (control word).
      Parameters:
      controlWord - control word
    • getProgramState

      public static void getProgramState(ControlWord controlWord)
      Gets the user program state (control word).
      Parameters:
      controlWord - control word (output)
    • restartTiming

      public static void restartTiming()
      Restart the simulator time.
    • pauseTiming

      public static void pauseTiming()
      Pause the simulator time.
    • resumeTiming

      public static void resumeTiming()
      Resume the simulator time.
    • isTimingPaused

      public static boolean isTimingPaused()
      Check if the simulator time is paused.
      Returns:
      true if paused
    • stepTiming

      public static void stepTiming(double delta)
      Advance the simulator time and wait for all notifiers to run.
      Parameters:
      delta - the amount to advance in seconds
    • stepTimingAsync

      public static void stepTimingAsync(double delta)
      Advance the simulator time and return immediately.
      Parameters:
      delta - the amount to advance in seconds