mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[sim] Add SimDeviceSim ctor overloads (#3134)
Better parallelism with SimDevice.create(), so teams don't have to mess with concatenating the index/channel themselves.
This commit is contained in:
@@ -28,6 +28,27 @@ public class SimDeviceSim {
|
||||
m_handle = SimDeviceDataJNI.getSimDeviceHandle(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a SimDeviceSim.
|
||||
*
|
||||
* @param name name of the SimDevice
|
||||
* @param index device index number to append to name
|
||||
*/
|
||||
public SimDeviceSim(String name, int index) {
|
||||
this(name + "[" + index + "]");
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a SimDeviceSim.
|
||||
*
|
||||
* @param name name of the SimDevice
|
||||
* @param index device index number to append to name
|
||||
* @param channel device channel number to append to name
|
||||
*/
|
||||
public SimDeviceSim(String name, int index, int channel) {
|
||||
this(name + "[" + index + "," + channel + "]");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the property object with the given name.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user