001// Copyright (c) FIRST and other WPILib contributors. 002// Open Source Software; you can modify and/or share it under the terms of 003// the WPILib BSD license file in the root directory of this project. 004 005package org.wpilib.hardware.hal.simulation; 006 007import org.wpilib.hardware.hal.ControlWord; 008import org.wpilib.hardware.hal.JNIWrapper; 009 010/** JNI for simulator. */ 011public class SimulatorJNI extends JNIWrapper { 012 public static native void setRuntimeType(int type); 013 014 public static native void waitForProgramStart(); 015 016 public static native void setProgramStarted(boolean started); 017 018 public static native boolean getProgramStarted(); 019 020 public static native void setProgramState(long word); 021 022 public static native long nativeGetProgramState(); 023 024 public static void getProgramState(ControlWord controlWord) { 025 controlWord.update(nativeGetProgramState()); 026 } 027 028 public static native void restartTiming(); 029 030 public static native void pauseTiming(); 031 032 public static native void resumeTiming(); 033 034 public static native boolean isTimingPaused(); 035 036 public static native void stepTiming(long delta); 037 038 public static native void stepTimingAsync(long delta); 039 040 public static native void resetHandles(); 041 042 /** Utility class. */ 043 private SimulatorJNI() {} 044}