mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
[sim] Add Java wrapper for getProgramStarted (#2566)
Also move SimHooks to wpilibj (to match wpilibc).
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -146,6 +146,18 @@ Java_edu_wpi_first_hal_simulation_SimulatorJNI_setProgramStarted
|
||||
HALSIM_SetProgramStarted();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_simulation_SimulatorJNI
|
||||
* Method: getProgramStarted
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_simulation_SimulatorJNI_getProgramStarted
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
return HALSIM_GetProgramStarted();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_simulation_SimulatorJNI
|
||||
* Method: restartTiming
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal.simulation;
|
||||
package edu.wpi.first.wpilibj.simulation;
|
||||
|
||||
import edu.wpi.first.hal.simulation.SimulatorJNI;
|
||||
|
||||
public final class SimHooks {
|
||||
private SimHooks() {
|
||||
@@ -23,6 +25,10 @@ public final class SimHooks {
|
||||
SimulatorJNI.setProgramStarted();
|
||||
}
|
||||
|
||||
public static boolean getProgramStarted() {
|
||||
return SimulatorJNI.getProgramStarted();
|
||||
}
|
||||
|
||||
public static void restartTiming() {
|
||||
SimulatorJNI.restartTiming();
|
||||
}
|
||||
Reference in New Issue
Block a user