mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-06 03:31:43 +00:00
[sim] Add Java wrapper for getProgramStarted (#2566)
Also move SimHooks to wpilibj (to match wpilibc).
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user