mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[hal] Remove deprecated SimDevice functions (#4209)
This commit is contained in:
@@ -106,22 +106,6 @@ public class SimDevice implements AutoCloseable {
|
||||
return m_handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a value on the simulated device.
|
||||
*
|
||||
* <p>Returns null if not in simulation.
|
||||
*
|
||||
* @param name value name
|
||||
* @param readonly if the value should not be written from simulation side
|
||||
* @param initialValue initial value
|
||||
* @return simulated value object
|
||||
* @deprecated Use direction function instead
|
||||
*/
|
||||
@Deprecated
|
||||
public SimValue createValue(String name, boolean readonly, HALValue initialValue) {
|
||||
return createValue(name, readonly ? Direction.kOutput : Direction.kInput, initialValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a value on the simulated device.
|
||||
*
|
||||
@@ -176,22 +160,6 @@ public class SimDevice implements AutoCloseable {
|
||||
return new SimLong(handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a double value on the simulated device.
|
||||
*
|
||||
* <p>Returns null if not in simulation.
|
||||
*
|
||||
* @param name value name
|
||||
* @param readonly if the value should not be written from simulation side
|
||||
* @param initialValue initial value
|
||||
* @return simulated double value object
|
||||
* @deprecated Use direction function instead
|
||||
*/
|
||||
@Deprecated
|
||||
public SimDouble createDouble(String name, boolean readonly, double initialValue) {
|
||||
return createDouble(name, readonly ? Direction.kOutput : Direction.kInput, initialValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a double value on the simulated device.
|
||||
*
|
||||
@@ -210,25 +178,6 @@ public class SimDevice implements AutoCloseable {
|
||||
return new SimDouble(handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an enumerated value on the simulated device.
|
||||
*
|
||||
* <p>Enumerated values are always in the range 0 to numOptions-1.
|
||||
*
|
||||
* <p>Returns null if not in simulation.
|
||||
*
|
||||
* @param name value name
|
||||
* @param readonly if the value should not be written from simulation side
|
||||
* @param options array of option descriptions
|
||||
* @param initialValue initial value (selection)
|
||||
* @return simulated enum value object
|
||||
* @deprecated Use direction function instead
|
||||
*/
|
||||
@Deprecated
|
||||
public SimEnum createEnum(String name, boolean readonly, String[] options, int initialValue) {
|
||||
return createEnum(name, readonly ? Direction.kOutput : Direction.kInput, options, initialValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an enumerated value on the simulated device.
|
||||
*
|
||||
@@ -276,22 +225,6 @@ public class SimDevice implements AutoCloseable {
|
||||
return new SimEnum(handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a boolean value on the simulated device.
|
||||
*
|
||||
* <p>Returns null if not in simulation.
|
||||
*
|
||||
* @param name value name
|
||||
* @param readonly if the value should not be written from simulation side
|
||||
* @param initialValue initial value
|
||||
* @return simulated boolean value object
|
||||
* @deprecated Use direction function instead
|
||||
*/
|
||||
@Deprecated
|
||||
public SimBoolean createBoolean(String name, boolean readonly, boolean initialValue) {
|
||||
return createBoolean(name, readonly ? Direction.kOutput : Direction.kInput, initialValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a boolean value on the simulated device.
|
||||
*
|
||||
|
||||
@@ -36,30 +36,6 @@ public class SimDeviceJNI extends JNIWrapper {
|
||||
private static native int createSimValueNative(
|
||||
int device, String name, int direction, int type, long value1, double value2);
|
||||
|
||||
/**
|
||||
* Creates a value on a simulated device.
|
||||
*
|
||||
* <p>Returns 0 if not in simulation; this can be used to avoid calls to Set/Get functions.
|
||||
*
|
||||
* @param device simulated device handle
|
||||
* @param name value name
|
||||
* @param readonly if the value should not be written from simulation side
|
||||
* @param initialValue initial value
|
||||
* @return simulated value handle
|
||||
* @deprecated Use direction-taking function instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static int createSimValue(
|
||||
int device, String name, boolean readonly, HALValue initialValue) {
|
||||
return createSimValueNative(
|
||||
device,
|
||||
name,
|
||||
readonly ? kOutput : kInput,
|
||||
initialValue.getType(),
|
||||
initialValue.getNativeLong(),
|
||||
initialValue.getNativeDouble());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a value on a simulated device.
|
||||
*
|
||||
@@ -111,25 +87,6 @@ public class SimDeviceJNI extends JNIWrapper {
|
||||
return createSimValueNative(device, name, direction, HALValue.kLong, initialValue, 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a double value on a simulated device.
|
||||
*
|
||||
* <p>Returns 0 if not in simulation; this can be used to avoid calls to Set/Get functions.
|
||||
*
|
||||
* @param device simulated device handle
|
||||
* @param name value name
|
||||
* @param readonly if the value should not be written from simulation side
|
||||
* @param initialValue initial value
|
||||
* @return simulated value handle
|
||||
* @deprecated Use direction-taking function instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static int createSimValueDouble(
|
||||
int device, String name, boolean readonly, double initialValue) {
|
||||
return createSimValueNative(
|
||||
device, name, readonly ? kOutput : kInput, HALValue.kDouble, 0, initialValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a double value on a simulated device.
|
||||
*
|
||||
@@ -146,27 +103,6 @@ public class SimDeviceJNI extends JNIWrapper {
|
||||
return createSimValueNative(device, name, direction, HALValue.kDouble, 0, initialValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an enumerated value on a simulated device.
|
||||
*
|
||||
* <p>Enumerated values are always in the range 0 to numOptions-1.
|
||||
*
|
||||
* <p>Returns 0 if not in simulation; this can be used to avoid calls to Set/Get functions.
|
||||
*
|
||||
* @param device simulated device handle
|
||||
* @param name value name
|
||||
* @param readonly if the value should not be written from simulation side
|
||||
* @param options array of option descriptions
|
||||
* @param initialValue initial value (selection)
|
||||
* @return simulated value handle
|
||||
* @deprecated Use direction-taking function instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static int createSimValueEnum(
|
||||
int device, String name, boolean readonly, String[] options, int initialValue) {
|
||||
return createSimValueEnum(device, name, readonly ? kOutput : kInput, options, initialValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an enumerated value on a simulated device.
|
||||
*
|
||||
@@ -207,25 +143,6 @@ public class SimDeviceJNI extends JNIWrapper {
|
||||
double[] optionValues,
|
||||
int initialValue);
|
||||
|
||||
/**
|
||||
* Creates a boolean value on a simulated device.
|
||||
*
|
||||
* <p>Returns 0 if not in simulation; this can be used to avoid calls to Set/Get functions.
|
||||
*
|
||||
* @param device simulated device handle
|
||||
* @param name value name
|
||||
* @param readonly if the value should not be written from simulation side
|
||||
* @param initialValue initial value
|
||||
* @return simulated value handle
|
||||
* @deprecated Use direction-taking function instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static int createSimValueBoolean(
|
||||
int device, String name, boolean readonly, boolean initialValue) {
|
||||
return createSimValueNative(
|
||||
device, name, readonly ? kOutput : kInput, HALValue.kBoolean, initialValue ? 1 : 0, 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a boolean value on a simulated device.
|
||||
*
|
||||
|
||||
@@ -76,7 +76,6 @@ public class SimDeviceDataJNI extends JNIWrapper {
|
||||
String name, int handle, int direction, int type, long value1, double value2) {
|
||||
this.name = name;
|
||||
this.handle = handle;
|
||||
this.readonly = direction == 1;
|
||||
this.direction = direction;
|
||||
this.value = HALValue.fromNative(type, value1, value2);
|
||||
}
|
||||
@@ -87,10 +86,6 @@ public class SimDeviceDataJNI extends JNIWrapper {
|
||||
@SuppressWarnings("MemberName")
|
||||
public int handle;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
@Deprecated
|
||||
public boolean readonly;
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
public int direction;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user