[sim] Add Java wrapper for getProgramStarted (#2566)

Also move SimHooks to wpilibj (to match wpilibc).
This commit is contained in:
Peter Johnson
2020-07-04 00:44:37 -07:00
committed by GitHub
parent a1d2d40ad3
commit c4b8a2505d
3 changed files with 20 additions and 1 deletions

View File

@@ -1,45 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package edu.wpi.first.hal.simulation;
public final class SimHooks {
private SimHooks() {
}
public static void setHALRuntimeType(int type) {
SimulatorJNI.setRuntimeType(type);
}
public static void waitForProgramStart() {
SimulatorJNI.waitForProgramStart();
}
public static void setProgramStarted() {
SimulatorJNI.setProgramStarted();
}
public static void restartTiming() {
SimulatorJNI.restartTiming();
}
public static void pauseTiming() {
SimulatorJNI.pauseTiming();
}
public static void resumeTiming() {
SimulatorJNI.resumeTiming();
}
public static boolean isTimingPaused() {
return SimulatorJNI.isTimingPaused();
}
public static void stepTiming(long delta) {
SimulatorJNI.stepTiming(delta);
}
}

View File

@@ -13,6 +13,7 @@ public class SimulatorJNI extends JNIWrapper {
public static native void setRuntimeType(int type);
public static native void waitForProgramStart();
public static native void setProgramStarted();
public static native boolean getProgramStarted();
public static native void restartTiming();
public static native void pauseTiming();
public static native void resumeTiming();