mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Reduced duplication between formatting scripts with Task base class (#80)
Also added scripts for EOF newline management and for removing trailing whitespace. configure.bat was rewritten to use CRLF line endings. Documentation for the existing scripts was also improved.
This commit is contained in:
committed by
Peter Johnson
parent
ea6876e81f
commit
aafca4ed7f
@@ -28,14 +28,14 @@ public class AnalogGyro extends GyroBase implements Gyro, PIDSource, LiveWindowS
|
||||
private static final float kDefaultVoltsPerDegreePerSecond = 0.007f;
|
||||
protected AnalogInput m_analog;
|
||||
private boolean m_channelAllocated = false;
|
||||
|
||||
|
||||
private int m_gyroHandle = 0;
|
||||
|
||||
/**
|
||||
* Initialize the gyro. Calibration is handled by calibrate().
|
||||
*/
|
||||
public void initGyro() {
|
||||
|
||||
|
||||
if (m_gyroHandle == 0) {
|
||||
m_gyroHandle = AnalogGyroJNI.initializeAnalogGyro(m_analog.m_port);
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public class AnalogGyro extends GyroBase implements Gyro, PIDSource, LiveWindowS
|
||||
throw new NullPointerException("AnalogInput supplied to Gyro constructor is null");
|
||||
}
|
||||
initGyro();
|
||||
AnalogGyroJNI.setAnalogGyroParameters(m_gyroHandle, kDefaultVoltsPerDegreePerSecond,
|
||||
AnalogGyroJNI.setAnalogGyroParameters(m_gyroHandle, kDefaultVoltsPerDegreePerSecond,
|
||||
(float)offset, center);
|
||||
reset();
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public class AnalogGyro extends GyroBase implements Gyro, PIDSource, LiveWindowS
|
||||
* @param voltsPerDegreePerSecond The sensitivity in Volts/degree/second.
|
||||
*/
|
||||
public void setSensitivity(double voltsPerDegreePerSecond) {
|
||||
AnalogGyroJNI.setAnalogGyroVoltsPerDegreePerSecond(m_gyroHandle,
|
||||
AnalogGyroJNI.setAnalogGyroVoltsPerDegreePerSecond(m_gyroHandle,
|
||||
(float)voltsPerDegreePerSecond);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public class AnalogTrigger {
|
||||
AnalogJNI.initializeAnalogTrigger(channel.m_port, index.asIntBuffer());
|
||||
m_index = index.asIntBuffer().get(0);
|
||||
|
||||
UsageReporting.report(tResourceType.kResourceType_AnalogTrigger, channel.getChannel());
|
||||
UsageReporting.report(tResourceType.kResourceType_AnalogTrigger, channel.getChannel());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -80,7 +80,7 @@ public class AnalogTriggerOutput extends DigitalSource {
|
||||
UsageReporting.report(tResourceType.kResourceType_AnalogTriggerOutput, trigger.getIndex(),
|
||||
outputType.m_value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Frees the resources for this output.
|
||||
*/
|
||||
@@ -88,7 +88,7 @@ public class AnalogTriggerOutput extends DigitalSource {
|
||||
if (m_interrupt != 0) {
|
||||
cancelInterrupts();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,12 +109,12 @@ public class AnalogTriggerOutput extends DigitalSource {
|
||||
public int getAnalogTriggerTypeForRouting() {
|
||||
return m_outputType.m_value;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getChannel() {
|
||||
return m_trigger.m_index;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isAnalogTrigger() {
|
||||
return true;
|
||||
|
||||
@@ -23,7 +23,7 @@ import edu.wpi.first.wpilibj.tables.ITable;
|
||||
public class DigitalInput extends DigitalSource implements LiveWindowSendable {
|
||||
private int m_channel = 0;
|
||||
private int m_handle = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Create an instance of a Digital Input class. Creates a digital input given a channel.
|
||||
*
|
||||
@@ -32,13 +32,13 @@ public class DigitalInput extends DigitalSource implements LiveWindowSendable {
|
||||
public DigitalInput(int channel) {
|
||||
checkDigitalChannel(channel);
|
||||
m_channel = channel;
|
||||
|
||||
|
||||
m_handle = DIOJNI.initializeDIOPort(DIOJNI.getPort((byte)channel), true);
|
||||
|
||||
LiveWindow.addSensor("DigitalInput", channel, this);
|
||||
UsageReporting.report(tResourceType.kResourceType_DigitalInput, channel);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Frees the resources for this output.
|
||||
*/
|
||||
@@ -46,7 +46,7 @@ public class DigitalInput extends DigitalSource implements LiveWindowSendable {
|
||||
if (m_interrupt != 0) {
|
||||
cancelInterrupts();
|
||||
}
|
||||
|
||||
|
||||
DIOJNI.freeDIOPort(m_handle);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class DigitalInput extends DigitalSource implements LiveWindowSendable {
|
||||
public int getAnalogTriggerTypeForRouting() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is this an analog trigger.
|
||||
*
|
||||
@@ -89,7 +89,7 @@ public class DigitalInput extends DigitalSource implements LiveWindowSendable {
|
||||
public boolean isAnalogTrigger() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the HAL Port Handle.
|
||||
*
|
||||
|
||||
@@ -36,7 +36,7 @@ public class DigitalOutput extends DigitalSource implements LiveWindowSendable {
|
||||
public DigitalOutput(int channel) {
|
||||
checkDigitalChannel(channel);
|
||||
m_channel = channel;
|
||||
|
||||
|
||||
m_handle = DIOJNI.initializeDIOPort(DIOJNI.getPort((byte)channel), false);
|
||||
|
||||
UsageReporting.report(tResourceType.kResourceType_DigitalOutput, channel);
|
||||
@@ -67,7 +67,7 @@ public class DigitalOutput extends DigitalSource implements LiveWindowSendable {
|
||||
/**
|
||||
* @return The GPIO channel number that this object represents.
|
||||
*/
|
||||
@Override
|
||||
@Override
|
||||
public int getChannel() {
|
||||
return m_channel;
|
||||
}
|
||||
@@ -181,7 +181,7 @@ public class DigitalOutput extends DigitalSource implements LiveWindowSendable {
|
||||
public int getAnalogTriggerTypeForRouting() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is this an analog trigger.
|
||||
*
|
||||
@@ -191,7 +191,7 @@ public class DigitalOutput extends DigitalSource implements LiveWindowSendable {
|
||||
public boolean isAnalogTrigger() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the HAL Port Handle.
|
||||
*
|
||||
|
||||
@@ -15,6 +15,6 @@ package edu.wpi.first.wpilibj;
|
||||
*/
|
||||
public abstract class DigitalSource extends InterruptableSensorBase {
|
||||
public abstract boolean isAnalogTrigger();
|
||||
|
||||
|
||||
public abstract int getChannel();
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class DoubleSolenoid extends SolenoidBase implements LiveWindowSendable {
|
||||
|
||||
int portHandle = SolenoidJNI.getPortWithModule((byte) m_moduleNumber, (byte) m_forwardChannel);
|
||||
m_forwardHandle = SolenoidJNI.initializeSolenoidPort(portHandle);
|
||||
|
||||
|
||||
try {
|
||||
portHandle = SolenoidJNI.getPortWithModule((byte) m_moduleNumber, (byte) m_reverseChannel);
|
||||
m_reverseHandle = SolenoidJNI.initializeSolenoidPort(portHandle);
|
||||
@@ -107,7 +107,7 @@ public class DoubleSolenoid extends SolenoidBase implements LiveWindowSendable {
|
||||
public void set(final Value value) {
|
||||
boolean forward = false;
|
||||
boolean reverse = false;
|
||||
|
||||
|
||||
switch (value) {
|
||||
case kOff:
|
||||
forward = false;
|
||||
@@ -138,7 +138,7 @@ public class DoubleSolenoid extends SolenoidBase implements LiveWindowSendable {
|
||||
public Value get() {
|
||||
boolean valueForward = SolenoidJNI.getSolenoid(m_forwardHandle);
|
||||
boolean valueReverse = SolenoidJNI.getSolenoid(m_reverseHandle);
|
||||
|
||||
|
||||
if (valueForward) {
|
||||
return Value.kForward;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class DriverStation implements RobotState.Interface {
|
||||
private HALJoystickPOVs[] m_joystickPOVsCache = new HALJoystickPOVs[kJoystickPorts];
|
||||
private HALJoystickButtons[] m_joystickButtonsCache = new HALJoystickButtons[kJoystickPorts];
|
||||
// preallocated byte buffer for button count
|
||||
private ByteBuffer m_buttonCountBuffer = ByteBuffer.allocateDirect(1);
|
||||
private ByteBuffer m_buttonCountBuffer = ByteBuffer.allocateDirect(1);
|
||||
|
||||
private int[] m_joystickIsXbox = new int[kJoystickPorts];
|
||||
private int[] m_joystickType = new int[kJoystickPorts];
|
||||
@@ -94,7 +94,7 @@ public class DriverStation implements RobotState.Interface {
|
||||
private final Object m_newControlDataMutex;
|
||||
private final Object m_joystickMutex;
|
||||
private volatile boolean m_threadKeepAlive = true;
|
||||
|
||||
|
||||
private boolean m_userInDisabled = false;
|
||||
private boolean m_userInAutonomous = false;
|
||||
private boolean m_userInTeleop = false;
|
||||
@@ -129,9 +129,9 @@ public class DriverStation implements RobotState.Interface {
|
||||
m_joystickPOVs[i] = new HALJoystickPOVs(FRCNetworkCommunicationsLibrary.kMaxJoystickPOVs);
|
||||
|
||||
m_joystickButtonsCache[i] = new HALJoystickButtons();
|
||||
m_joystickAxesCache[i] =
|
||||
m_joystickAxesCache[i] =
|
||||
new HALJoystickAxes(FRCNetworkCommunicationsLibrary.kMaxJoystickAxes);
|
||||
m_joystickPOVsCache[i] =
|
||||
m_joystickPOVsCache[i] =
|
||||
new HALJoystickPOVs(FRCNetworkCommunicationsLibrary.kMaxJoystickPOVs);
|
||||
}
|
||||
|
||||
@@ -216,11 +216,11 @@ public class DriverStation implements RobotState.Interface {
|
||||
protected void getData() {
|
||||
// Get the status of all of the joysticks
|
||||
for (byte stick = 0; stick < kJoystickPorts; stick++) {
|
||||
m_joystickAxesCache[stick].m_count =
|
||||
FRCNetworkCommunicationsLibrary.HALGetJoystickAxes(stick,
|
||||
m_joystickAxesCache[stick].m_count =
|
||||
FRCNetworkCommunicationsLibrary.HALGetJoystickAxes(stick,
|
||||
m_joystickAxesCache[stick].m_axes);
|
||||
m_joystickPOVsCache[stick].m_count =
|
||||
FRCNetworkCommunicationsLibrary.HALGetJoystickPOVs(stick,
|
||||
m_joystickPOVsCache[stick].m_count =
|
||||
FRCNetworkCommunicationsLibrary.HALGetJoystickPOVs(stick,
|
||||
m_joystickPOVsCache[stick].m_povs);
|
||||
m_joystickButtonsCache[stick].m_buttons =
|
||||
FRCNetworkCommunicationsLibrary.HALGetJoystickButtons(stick, m_buttonCountBuffer);
|
||||
@@ -295,7 +295,7 @@ public class DriverStation implements RobotState.Interface {
|
||||
if (axis < 0 || axis >= FRCNetworkCommunicationsLibrary.kMaxJoystickAxes) {
|
||||
throw new RuntimeException("Joystick axis is out of range");
|
||||
}
|
||||
|
||||
|
||||
boolean error = false;
|
||||
double retVal = 0.0;
|
||||
synchronized (m_joystickMutex) {
|
||||
@@ -306,7 +306,7 @@ public class DriverStation implements RobotState.Interface {
|
||||
} else {
|
||||
retVal = m_joystickAxes[stick].m_axes[axis];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (error) {
|
||||
reportJoystickUnpluggedWarning("Joystick axis " + axis + " on port " + stick
|
||||
+ " not available, check if controller is plugged in");
|
||||
@@ -504,7 +504,7 @@ public class DriverStation implements RobotState.Interface {
|
||||
throw new RuntimeException("Joystick index is out of range, should be 0-5");
|
||||
}
|
||||
boolean error = false;
|
||||
String retVal = "";
|
||||
String retVal = "";
|
||||
synchronized (m_joystickMutex) {
|
||||
// TODO: Remove this when calling for descriptor on empty stick no longer
|
||||
// crashes
|
||||
@@ -514,7 +514,7 @@ public class DriverStation implements RobotState.Interface {
|
||||
} else {
|
||||
retVal = FRCNetworkCommunicationsLibrary.HALGetJoystickName((byte) stick);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (error) {
|
||||
reportJoystickUnpluggedWarning("Joystick on port " + stick
|
||||
+ " not available, check if controller is plugged in");
|
||||
|
||||
@@ -33,10 +33,10 @@ import edu.wpi.first.wpilibj.util.AllocationException;
|
||||
public class Encoder extends SensorBase implements CounterBase, PIDSource, LiveWindowSendable {
|
||||
public enum IndexingType {
|
||||
kResetWhileHigh(0), kResetWhileLow(1), kResetOnFallingEdge(2), kResetOnRisingEdge(3);
|
||||
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public final int value;
|
||||
|
||||
|
||||
IndexingType(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
@@ -60,9 +60,9 @@ public class Encoder extends SensorBase implements CounterBase, PIDSource, LiveW
|
||||
private boolean m_allocatedB;
|
||||
private boolean m_allocatedI;
|
||||
private PIDSourceType m_pidSource;
|
||||
|
||||
|
||||
private int m_encoder; // the HAL encoder object
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Common initialization code for Encoders. This code allocates resources for Encoders and is
|
||||
@@ -73,10 +73,10 @@ public class Encoder extends SensorBase implements CounterBase, PIDSource, LiveW
|
||||
* @param reverseDirection If true, counts down instead of up (this is all relative)
|
||||
*/
|
||||
private void initEncoder(boolean reverseDirection, final EncodingType type) {
|
||||
m_encoder = EncoderJNI.initializeEncoder(m_aSource.getPortHandleForRouting(),
|
||||
m_aSource.getAnalogTriggerTypeForRouting(), m_bSource.getPortHandleForRouting(),
|
||||
m_encoder = EncoderJNI.initializeEncoder(m_aSource.getPortHandleForRouting(),
|
||||
m_aSource.getAnalogTriggerTypeForRouting(), m_bSource.getPortHandleForRouting(),
|
||||
m_bSource.getAnalogTriggerTypeForRouting(), reverseDirection, type.value);
|
||||
|
||||
|
||||
m_pidSource = PIDSourceType.kDisplacement;
|
||||
|
||||
UsageReporting.report(tResourceType.kResourceType_Encoder, getFPGAIndex(), type.value);
|
||||
@@ -580,7 +580,7 @@ public class Encoder extends SensorBase implements CounterBase, PIDSource, LiveW
|
||||
* @param type The state that will cause the encoder to reset
|
||||
*/
|
||||
public void setIndexSource(DigitalSource source, IndexingType type) {
|
||||
EncoderJNI.setEncoderIndexSource(m_encoder, source.getPortHandleForRouting(),
|
||||
EncoderJNI.setEncoderIndexSource(m_encoder, source.getPortHandleForRouting(),
|
||||
source.getAnalogTriggerTypeForRouting(), type.value);
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ public abstract class InterruptableSensorBase extends SensorBase {
|
||||
|
||||
assert (m_interrupt != 0);
|
||||
|
||||
InterruptJNI.requestInterrupts(m_interrupt, getPortHandleForRouting(),
|
||||
InterruptJNI.requestInterrupts(m_interrupt, getPortHandleForRouting(),
|
||||
getAnalogTriggerTypeForRouting());
|
||||
setUpSourceEdge(true, false);
|
||||
InterruptJNI.attachInterruptHandler(m_interrupt, handler.m_function,
|
||||
@@ -109,7 +109,7 @@ public abstract class InterruptableSensorBase extends SensorBase {
|
||||
|
||||
assert (m_interrupt != 0);
|
||||
|
||||
InterruptJNI.requestInterrupts(m_interrupt, getPortHandleForRouting(),
|
||||
InterruptJNI.requestInterrupts(m_interrupt, getPortHandleForRouting(),
|
||||
getAnalogTriggerTypeForRouting());
|
||||
setUpSourceEdge(true, false);
|
||||
|
||||
@@ -123,7 +123,7 @@ public abstract class InterruptableSensorBase extends SensorBase {
|
||||
*/
|
||||
protected void allocateInterrupts(boolean watcher) {
|
||||
m_isSynchronousInterrupt = watcher;
|
||||
|
||||
|
||||
m_interrupt = InterruptJNI.initializeInterrupts(watcher);
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ public class Relay extends SensorBase implements MotorSafety, LiveWindowSendable
|
||||
}
|
||||
|
||||
private final int m_channel;
|
||||
|
||||
|
||||
private int m_forwardHandle = 0;
|
||||
private int m_reverseHandle = 0;
|
||||
private long m_port;
|
||||
@@ -176,10 +176,10 @@ public class Relay extends SensorBase implements MotorSafety, LiveWindowSendable
|
||||
} catch (RuntimeException ex) {
|
||||
// do nothing. Ignore
|
||||
}
|
||||
|
||||
|
||||
RelayJNI.freeRelayPort(m_forwardHandle);
|
||||
RelayJNI.freeRelayPort(m_reverseHandle);
|
||||
|
||||
|
||||
m_forwardHandle = 0;
|
||||
m_reverseHandle = 0;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public abstract class SensorBase { // TODO: Refactor
|
||||
/**
|
||||
* Ticks per microsecond.
|
||||
*/
|
||||
public static final int kSystemClockTicksPerMicrosecond =
|
||||
public static final int kSystemClockTicksPerMicrosecond =
|
||||
ConstantsJNI.getSystemClockTicksPerMicrosecond();
|
||||
/**
|
||||
* Number of digital channels per roboRIO.
|
||||
|
||||
@@ -289,7 +289,7 @@ public class Ultrasonic extends SensorBase implements PIDSource, LiveWindowSenda
|
||||
// single sensor
|
||||
m_counter.reset(); // reset the counter to zero (invalid data now)
|
||||
// do the ping to start getting a single range
|
||||
m_pingChannel.pulse(m_pingChannel.getChannel(), (float) kPingTime);
|
||||
m_pingChannel.pulse(m_pingChannel.getChannel(), (float) kPingTime);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,29 +9,29 @@ package edu.wpi.first.wpilibj.hal;
|
||||
|
||||
public class AnalogGyroJNI extends JNIWrapper {
|
||||
public static native int initializeAnalogGyro(int halAnalogInputHandle);
|
||||
|
||||
|
||||
public static native void setupAnalogGyro(int handle);
|
||||
|
||||
|
||||
public static native void freeAnalogGyro(int handle);
|
||||
|
||||
public static native void setAnalogGyroParameters(int handle,
|
||||
float voltsPerDegreePerSecond,
|
||||
|
||||
public static native void setAnalogGyroParameters(int handle,
|
||||
float voltsPerDegreePerSecond,
|
||||
float offset, int center);
|
||||
|
||||
public static native void setAnalogGyroVoltsPerDegreePerSecond(int handle,
|
||||
float voltsPerDegreePerSecond);
|
||||
|
||||
|
||||
public static native void resetAnalogGyro(int handle);
|
||||
|
||||
|
||||
public static native void calibrateAnalogGyro(int handle);
|
||||
|
||||
|
||||
public static native void setAnalogGyroDeadband(int handle, float volts);
|
||||
|
||||
|
||||
public static native float getAnalogGyroAngle(int handle);
|
||||
|
||||
|
||||
public static native double getAnalogGyroRate(int handle);
|
||||
|
||||
|
||||
public static native float getAnalogGyroOffset(int handle);
|
||||
|
||||
|
||||
public static native int getAnalogGyroCenter(int handle);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CounterJNI extends JNIWrapper {
|
||||
|
||||
public static native void setCounterAverageSize(int counterHandle, int size);
|
||||
|
||||
public static native void setCounterUpSource(int counterHandle, int digitalSourceHandle,
|
||||
public static native void setCounterUpSource(int counterHandle, int digitalSourceHandle,
|
||||
int analogTriggerType);
|
||||
|
||||
public static native void setCounterUpSourceEdge(int counterHandle, boolean risingEdge,
|
||||
@@ -24,7 +24,7 @@ public class CounterJNI extends JNIWrapper {
|
||||
|
||||
public static native void clearCounterUpSource(int counterHandle);
|
||||
|
||||
public static native void setCounterDownSource(int counterHandle, int digitalSourceHandle,
|
||||
public static native void setCounterDownSource(int counterHandle, int digitalSourceHandle,
|
||||
int analogTriggerType);
|
||||
|
||||
public static native void setCounterDownSourceEdge(int counterHandle, boolean risingEdge,
|
||||
|
||||
@@ -26,7 +26,7 @@ public class DIOJNI extends JNIWrapper {
|
||||
public static native boolean isAnyPulsing();
|
||||
|
||||
public static native short getLoopTiming();
|
||||
|
||||
|
||||
public static native int allocateDigitalPWM();
|
||||
|
||||
public static native void freeDigitalPWM(int pwmGenerator);
|
||||
|
||||
@@ -10,19 +10,19 @@ package edu.wpi.first.wpilibj.hal;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
public class EncoderJNI extends JNIWrapper {
|
||||
|
||||
public static native int initializeEncoder(int digitalSourceHandleA, int analogTriggerTypeA,
|
||||
|
||||
public static native int initializeEncoder(int digitalSourceHandleA, int analogTriggerTypeA,
|
||||
int digitalSourceHandleB, int analogTriggerTypeB,
|
||||
boolean reverseDirection, int encodingType);
|
||||
|
||||
public static native void freeEncoder(int encoderHandle);
|
||||
|
||||
public static native int getEncoder(int encoderHandle);
|
||||
|
||||
|
||||
public static native int getEncoderRaw(int encoderHandle);
|
||||
|
||||
|
||||
public static native int getEncodingScaleFactor(int encoderHandle);
|
||||
|
||||
|
||||
public static native void resetEncoder(int encoderHandle);
|
||||
|
||||
public static native double getEncoderPeriod(int encoderHandle);
|
||||
@@ -32,13 +32,13 @@ public class EncoderJNI extends JNIWrapper {
|
||||
public static native boolean getEncoderStopped(int encoderHandle);
|
||||
|
||||
public static native boolean getEncoderDirection(int encoderHandle);
|
||||
|
||||
|
||||
public static native double getEncoderDistance(int encoderHandle);
|
||||
|
||||
|
||||
public static native double getEncoderRate(int encoderHandle);
|
||||
|
||||
|
||||
public static native void setEncoderMinRate(int encoderHandle, double minRate);
|
||||
|
||||
|
||||
public static native void setEncoderDistancePerPulse(int encoderHandle, double distancePerPulse);
|
||||
|
||||
public static native void setEncoderReverseDirection(int encoderHandle,
|
||||
@@ -49,12 +49,12 @@ public class EncoderJNI extends JNIWrapper {
|
||||
|
||||
public static native int getEncoderSamplesToAverage(int encoderHandle);
|
||||
|
||||
public static native void setEncoderIndexSource(int encoderHandle, int digitalSourceHandle,
|
||||
public static native void setEncoderIndexSource(int encoderHandle, int digitalSourceHandle,
|
||||
int analogTriggerType, int indexingType);
|
||||
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public static native int getEncoderFPGAIndex(int encoderHandle);
|
||||
|
||||
|
||||
public static native int getEncoderEncodingScale(int encoderHandle);
|
||||
|
||||
public static native double getEncoderDecodingScaleFactor(int encoderHandle);
|
||||
|
||||
@@ -9,7 +9,7 @@ package edu.wpi.first.wpilibj.hal;
|
||||
|
||||
public class InterruptJNI extends JNIWrapper {
|
||||
public static final int HalInvalidHandle = 0;
|
||||
|
||||
|
||||
public interface InterruptJNIHandlerFunction {
|
||||
void apply(int interruptAssertedMask, Object param);
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public class InterruptJNI extends JNIWrapper {
|
||||
|
||||
public static native double readInterruptFallingTimestamp(int interruptHandle);
|
||||
|
||||
public static native void requestInterrupts(int interruptHandle, int digitalSourceHandle,
|
||||
public static native void requestInterrupts(int interruptHandle, int digitalSourceHandle,
|
||||
int analogTriggerType);
|
||||
|
||||
public static native void attachInterruptHandler(int interruptHandle,
|
||||
|
||||
@@ -9,40 +9,40 @@ package edu.wpi.first.wpilibj.hal;
|
||||
|
||||
public class PortsJNI extends JNIWrapper {
|
||||
public static native int getNumAccumulators();
|
||||
|
||||
|
||||
public static native int getNumAnalogTriggers();
|
||||
|
||||
|
||||
public static native int getNumAnalogInputs();
|
||||
|
||||
|
||||
public static native int getNumAnalogOutputs();
|
||||
|
||||
|
||||
public static native int getNumCounters();
|
||||
|
||||
|
||||
public static native int getNumDigitalHeaders();
|
||||
|
||||
|
||||
public static native int getNumPWMHeaders();
|
||||
|
||||
|
||||
public static native int getNumDigitalPins();
|
||||
|
||||
|
||||
public static native int getNumPWMPins();
|
||||
|
||||
|
||||
public static native int getNumDigitalPWMOutputs();
|
||||
|
||||
|
||||
public static native int getNumEncoders();
|
||||
|
||||
|
||||
public static native int getNumInterrupts();
|
||||
|
||||
|
||||
public static native int getNumRelayPins();
|
||||
|
||||
|
||||
public static native int getNumRelayHeaders();
|
||||
|
||||
|
||||
public static native int getNumPCMModules();
|
||||
|
||||
|
||||
public static native int getNumSolenoidPins();
|
||||
|
||||
|
||||
public static native int getNumPDPModules();
|
||||
|
||||
|
||||
public static native int getNumPDPChannels();
|
||||
|
||||
|
||||
public static native int getNumCanTalons();
|
||||
}
|
||||
|
||||
@@ -9,11 +9,11 @@ package edu.wpi.first.wpilibj.hal;
|
||||
|
||||
public class RelayJNI extends DIOJNI {
|
||||
public static native int initializeRelayPort(int halPortHandle, boolean forward);
|
||||
|
||||
|
||||
public static native void freeRelayPort(int relayPortHandle);
|
||||
|
||||
|
||||
public static native boolean checkRelayChannel(int pin);
|
||||
|
||||
|
||||
public static native void setRelay(int relayPortHandle, boolean on);
|
||||
|
||||
public static native boolean getRelay(int relayPortHandle);
|
||||
|
||||
@@ -11,7 +11,7 @@ station, and a number of other utility functions like timing and field managemen
|
||||
The library is designed to:
|
||||
<ul>
|
||||
<li>Deal with all the low level interfacing to these components so you can concentrate on
|
||||
solving this yearÕs Òrobot problemÓ. This is a philosophical decision to let you focus
|
||||
solving this year's "robot problem". This is a philosophical decision to let you focus
|
||||
on the higher-level design of your robot rather than deal with the details of the
|
||||
processor and the operating system.
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user