2018-05-11 12:38:23 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2020-06-26 17:12:55 -07:00
|
|
|
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
2018-05-11 12:38:23 -07:00
|
|
|
/* 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. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#include <jni.h>
|
|
|
|
|
|
|
|
|
|
#include "CallbackStore.h"
|
2020-06-27 22:11:24 -07:00
|
|
|
#include "edu_wpi_first_hal_simulation_AnalogInDataJNI.h"
|
|
|
|
|
#include "hal/simulation/AnalogInData.h"
|
2018-05-11 12:38:23 -07:00
|
|
|
|
2020-06-26 17:12:55 -07:00
|
|
|
using namespace hal;
|
|
|
|
|
|
2018-05-11 12:38:23 -07:00
|
|
|
extern "C" {
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: registerInitializedCallback
|
|
|
|
|
* Signature: (ILjava/lang/Object;Z)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerInitializedCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::AllocateCallback(env, index, callback, initialNotify,
|
|
|
|
|
&HALSIM_RegisterAnalogInInitializedCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: cancelInitializedCallback
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelInitializedCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jint handle)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::FreeCallback(env, handle, index,
|
|
|
|
|
&HALSIM_CancelAnalogInInitializedCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: getInitialized
|
|
|
|
|
* Signature: (I)Z
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jboolean JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getInitialized
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return HALSIM_GetAnalogInInitialized(index);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: setInitialized
|
|
|
|
|
* Signature: (IZ)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setInitialized
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index, jboolean value)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
HALSIM_SetAnalogInInitialized(index, value);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: registerAverageBitsCallback
|
|
|
|
|
* Signature: (ILjava/lang/Object;Z)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerAverageBitsCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::AllocateCallback(env, index, callback, initialNotify,
|
|
|
|
|
&HALSIM_RegisterAnalogInAverageBitsCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: cancelAverageBitsCallback
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelAverageBitsCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jint handle)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::FreeCallback(env, handle, index,
|
|
|
|
|
&HALSIM_CancelAnalogInAverageBitsCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: getAverageBits
|
|
|
|
|
* Signature: (I)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getAverageBits
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return HALSIM_GetAnalogInAverageBits(index);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: setAverageBits
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setAverageBits
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index, jint value)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
HALSIM_SetAnalogInAverageBits(index, value);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: registerOversampleBitsCallback
|
|
|
|
|
* Signature: (ILjava/lang/Object;Z)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerOversampleBitsCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::AllocateCallback(env, index, callback, initialNotify,
|
|
|
|
|
&HALSIM_RegisterAnalogInOversampleBitsCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: cancelOversampleBitsCallback
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelOversampleBitsCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jint handle)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::FreeCallback(env, handle, index,
|
|
|
|
|
&HALSIM_CancelAnalogInOversampleBitsCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: getOversampleBits
|
|
|
|
|
* Signature: (I)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getOversampleBits
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return HALSIM_GetAnalogInOversampleBits(index);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: setOversampleBits
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setOversampleBits
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index, jint value)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
HALSIM_SetAnalogInOversampleBits(index, value);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: registerVoltageCallback
|
|
|
|
|
* Signature: (ILjava/lang/Object;Z)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerVoltageCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::AllocateCallback(env, index, callback, initialNotify,
|
|
|
|
|
&HALSIM_RegisterAnalogInVoltageCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: cancelVoltageCallback
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelVoltageCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jint handle)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::FreeCallback(env, handle, index,
|
|
|
|
|
&HALSIM_CancelAnalogInVoltageCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: getVoltage
|
|
|
|
|
* Signature: (I)D
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jdouble JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getVoltage
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return HALSIM_GetAnalogInVoltage(index);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: setVoltage
|
|
|
|
|
* Signature: (ID)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setVoltage
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index, jdouble value)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
HALSIM_SetAnalogInVoltage(index, value);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: registerAccumulatorInitializedCallback
|
|
|
|
|
* Signature: (ILjava/lang/Object;Z)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerAccumulatorInitializedCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::AllocateCallback(
|
|
|
|
|
env, index, callback, initialNotify,
|
|
|
|
|
&HALSIM_RegisterAnalogInAccumulatorInitializedCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: cancelAccumulatorInitializedCallback
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelAccumulatorInitializedCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jint handle)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::FreeCallback(
|
|
|
|
|
env, handle, index, &HALSIM_CancelAnalogInAccumulatorInitializedCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: getAccumulatorInitialized
|
|
|
|
|
* Signature: (I)Z
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jboolean JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getAccumulatorInitialized
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return HALSIM_GetAnalogInAccumulatorInitialized(index);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: setAccumulatorInitialized
|
|
|
|
|
* Signature: (IZ)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setAccumulatorInitialized
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index, jboolean value)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
HALSIM_SetAnalogInAccumulatorInitialized(index, value);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: registerAccumulatorValueCallback
|
|
|
|
|
* Signature: (ILjava/lang/Object;Z)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerAccumulatorValueCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::AllocateCallback(
|
|
|
|
|
env, index, callback, initialNotify,
|
|
|
|
|
&HALSIM_RegisterAnalogInAccumulatorValueCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: cancelAccumulatorValueCallback
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelAccumulatorValueCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jint handle)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::FreeCallback(env, handle, index,
|
|
|
|
|
&HALSIM_CancelAnalogInAccumulatorValueCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: getAccumulatorValue
|
|
|
|
|
* Signature: (I)J
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jlong JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getAccumulatorValue
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return HALSIM_GetAnalogInAccumulatorValue(index);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: setAccumulatorValue
|
|
|
|
|
* Signature: (IJ)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setAccumulatorValue
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index, jlong value)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
HALSIM_SetAnalogInAccumulatorValue(index, value);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: registerAccumulatorCountCallback
|
|
|
|
|
* Signature: (ILjava/lang/Object;Z)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerAccumulatorCountCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::AllocateCallback(
|
|
|
|
|
env, index, callback, initialNotify,
|
|
|
|
|
&HALSIM_RegisterAnalogInAccumulatorCountCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: cancelAccumulatorCountCallback
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelAccumulatorCountCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jint handle)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::FreeCallback(env, handle, index,
|
|
|
|
|
&HALSIM_CancelAnalogInAccumulatorCountCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: getAccumulatorCount
|
|
|
|
|
* Signature: (I)J
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jlong JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getAccumulatorCount
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return HALSIM_GetAnalogInAccumulatorCount(index);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: setAccumulatorCount
|
|
|
|
|
* Signature: (IJ)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setAccumulatorCount
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index, jlong value)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
HALSIM_SetAnalogInAccumulatorCount(index, value);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: registerAccumulatorCenterCallback
|
|
|
|
|
* Signature: (ILjava/lang/Object;Z)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerAccumulatorCenterCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::AllocateCallback(
|
|
|
|
|
env, index, callback, initialNotify,
|
|
|
|
|
&HALSIM_RegisterAnalogInAccumulatorCenterCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: cancelAccumulatorCenterCallback
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelAccumulatorCenterCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jint handle)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::FreeCallback(env, handle, index,
|
|
|
|
|
&HALSIM_CancelAnalogInAccumulatorCenterCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: getAccumulatorCenter
|
|
|
|
|
* Signature: (I)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getAccumulatorCenter
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return HALSIM_GetAnalogInAccumulatorCenter(index);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: setAccumulatorCenter
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setAccumulatorCenter
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index, jint value)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
HALSIM_SetAnalogInAccumulatorCenter(index, value);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: registerAccumulatorDeadbandCallback
|
|
|
|
|
* Signature: (ILjava/lang/Object;Z)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerAccumulatorDeadbandCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::AllocateCallback(
|
|
|
|
|
env, index, callback, initialNotify,
|
|
|
|
|
&HALSIM_RegisterAnalogInAccumulatorDeadbandCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: cancelAccumulatorDeadbandCallback
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelAccumulatorDeadbandCallback
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv* env, jclass, jint index, jint handle)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return sim::FreeCallback(env, handle, index,
|
|
|
|
|
&HALSIM_CancelAnalogInAccumulatorDeadbandCallback);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: getAccumulatorDeadband
|
|
|
|
|
* Signature: (I)I
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT jint JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getAccumulatorDeadband
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
return HALSIM_GetAnalogInAccumulatorDeadband(index);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: setAccumulatorDeadband
|
|
|
|
|
* Signature: (II)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setAccumulatorDeadband
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index, jint value)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
HALSIM_SetAnalogInAccumulatorDeadband(index, value);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-13 17:09:56 -07:00
|
|
|
/*
|
2020-06-27 22:11:24 -07:00
|
|
|
* Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
|
2018-05-13 17:09:56 -07:00
|
|
|
* Method: resetData
|
|
|
|
|
* Signature: (I)V
|
|
|
|
|
*/
|
2018-05-11 12:38:23 -07:00
|
|
|
JNIEXPORT void JNICALL
|
2020-06-27 22:11:24 -07:00
|
|
|
Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_resetData
|
2018-05-13 17:09:56 -07:00
|
|
|
(JNIEnv*, jclass, jint index)
|
|
|
|
|
{
|
2018-05-11 12:38:23 -07:00
|
|
|
HALSIM_ResetAnalogInData(index);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // extern "C"
|