mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilib] Rename PneumaticsModuleType constants
This commit is contained in:
@@ -13,7 +13,7 @@ import org.wpilib.hardware.hal.util.AllocationException;
|
||||
class DoubleSolenoidTestCTRE {
|
||||
@Test
|
||||
void testValidInitialization() {
|
||||
try (DoubleSolenoid solenoid = new DoubleSolenoid(0, 3, PneumaticsModuleType.CTREPCM, 2, 3)) {
|
||||
try (DoubleSolenoid solenoid = new DoubleSolenoid(0, 3, PneumaticsModuleType.CTRE_PCM, 2, 3)) {
|
||||
solenoid.set(DoubleSolenoid.Value.REVERSE);
|
||||
assertEquals(DoubleSolenoid.Value.REVERSE, solenoid.get());
|
||||
|
||||
@@ -29,10 +29,10 @@ class DoubleSolenoidTestCTRE {
|
||||
void testThrowForwardPortAlreadyInitialized() {
|
||||
try (
|
||||
// Single solenoid that is reused for forward port
|
||||
Solenoid solenoid = new Solenoid(0, 5, PneumaticsModuleType.CTREPCM, 2)) {
|
||||
Solenoid solenoid = new Solenoid(0, 5, PneumaticsModuleType.CTRE_PCM, 2)) {
|
||||
assertThrows(
|
||||
AllocationException.class,
|
||||
() -> new DoubleSolenoid(0, 5, PneumaticsModuleType.CTREPCM, 2, 3));
|
||||
() -> new DoubleSolenoid(0, 5, PneumaticsModuleType.CTRE_PCM, 2, 3));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ class DoubleSolenoidTestCTRE {
|
||||
void testThrowReversePortAlreadyInitialized() {
|
||||
try (
|
||||
// Single solenoid that is reused for forward port
|
||||
Solenoid solenoid = new Solenoid(0, 6, PneumaticsModuleType.CTREPCM, 3)) {
|
||||
Solenoid solenoid = new Solenoid(0, 6, PneumaticsModuleType.CTRE_PCM, 3)) {
|
||||
assertThrows(
|
||||
AllocationException.class,
|
||||
() -> new DoubleSolenoid(0, 6, PneumaticsModuleType.CTREPCM, 2, 3));
|
||||
() -> new DoubleSolenoid(0, 6, PneumaticsModuleType.CTRE_PCM, 2, 3));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,17 +51,17 @@ class DoubleSolenoidTestCTRE {
|
||||
void testThrowBothPortsAlreadyInitialized() {
|
||||
try (
|
||||
// Single solenoid that is reused for forward port
|
||||
Solenoid solenoid0 = new Solenoid(0, 6, PneumaticsModuleType.CTREPCM, 2);
|
||||
Solenoid solenoid1 = new Solenoid(0, 6, PneumaticsModuleType.CTREPCM, 3)) {
|
||||
Solenoid solenoid0 = new Solenoid(0, 6, PneumaticsModuleType.CTRE_PCM, 2);
|
||||
Solenoid solenoid1 = new Solenoid(0, 6, PneumaticsModuleType.CTRE_PCM, 3)) {
|
||||
assertThrows(
|
||||
AllocationException.class,
|
||||
() -> new DoubleSolenoid(0, 6, PneumaticsModuleType.CTREPCM, 2, 3));
|
||||
() -> new DoubleSolenoid(0, 6, PneumaticsModuleType.CTRE_PCM, 2, 3));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void testToggle() {
|
||||
try (DoubleSolenoid solenoid = new DoubleSolenoid(0, 4, PneumaticsModuleType.CTREPCM, 2, 3)) {
|
||||
try (DoubleSolenoid solenoid = new DoubleSolenoid(0, 4, PneumaticsModuleType.CTRE_PCM, 2, 3)) {
|
||||
// Bootstrap it into reverse
|
||||
solenoid.set(DoubleSolenoid.Value.REVERSE);
|
||||
|
||||
@@ -82,13 +82,13 @@ class DoubleSolenoidTestCTRE {
|
||||
void testInvalidForwardPort() {
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> new DoubleSolenoid(0, 0, PneumaticsModuleType.CTREPCM, 100, 1));
|
||||
() -> new DoubleSolenoid(0, 0, PneumaticsModuleType.CTRE_PCM, 100, 1));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testInvalidReversePort() {
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> new DoubleSolenoid(0, 0, PneumaticsModuleType.CTREPCM, 0, 100));
|
||||
() -> new DoubleSolenoid(0, 0, PneumaticsModuleType.CTRE_PCM, 0, 100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.wpilib.hardware.hal.util.AllocationException;
|
||||
class DoubleSolenoidTestREV {
|
||||
@Test
|
||||
void testValidInitialization() {
|
||||
try (DoubleSolenoid solenoid = new DoubleSolenoid(0, 3, PneumaticsModuleType.REVPH, 2, 3)) {
|
||||
try (DoubleSolenoid solenoid = new DoubleSolenoid(0, 3, PneumaticsModuleType.REV_PH, 2, 3)) {
|
||||
solenoid.set(DoubleSolenoid.Value.REVERSE);
|
||||
assertEquals(DoubleSolenoid.Value.REVERSE, solenoid.get());
|
||||
|
||||
@@ -29,10 +29,10 @@ class DoubleSolenoidTestREV {
|
||||
void testThrowForwardPortAlreadyInitialized() {
|
||||
try (
|
||||
// Single solenoid that is reused for forward port
|
||||
Solenoid solenoid = new Solenoid(0, 5, PneumaticsModuleType.REVPH, 2)) {
|
||||
Solenoid solenoid = new Solenoid(0, 5, PneumaticsModuleType.REV_PH, 2)) {
|
||||
assertThrows(
|
||||
AllocationException.class,
|
||||
() -> new DoubleSolenoid(0, 5, PneumaticsModuleType.REVPH, 2, 3));
|
||||
() -> new DoubleSolenoid(0, 5, PneumaticsModuleType.REV_PH, 2, 3));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ class DoubleSolenoidTestREV {
|
||||
void testThrowReversePortAlreadyInitialized() {
|
||||
try (
|
||||
// Single solenoid that is reused for forward port
|
||||
Solenoid solenoid = new Solenoid(0, 6, PneumaticsModuleType.REVPH, 3)) {
|
||||
Solenoid solenoid = new Solenoid(0, 6, PneumaticsModuleType.REV_PH, 3)) {
|
||||
assertThrows(
|
||||
AllocationException.class,
|
||||
() -> new DoubleSolenoid(0, 6, PneumaticsModuleType.REVPH, 2, 3));
|
||||
() -> new DoubleSolenoid(0, 6, PneumaticsModuleType.REV_PH, 2, 3));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,17 +51,17 @@ class DoubleSolenoidTestREV {
|
||||
void testThrowBothPortsAlreadyInitialized() {
|
||||
try (
|
||||
// Single solenoid that is reused for forward port
|
||||
Solenoid solenoid0 = new Solenoid(0, 6, PneumaticsModuleType.REVPH, 2);
|
||||
Solenoid solenoid1 = new Solenoid(0, 6, PneumaticsModuleType.REVPH, 3)) {
|
||||
Solenoid solenoid0 = new Solenoid(0, 6, PneumaticsModuleType.REV_PH, 2);
|
||||
Solenoid solenoid1 = new Solenoid(0, 6, PneumaticsModuleType.REV_PH, 3)) {
|
||||
assertThrows(
|
||||
AllocationException.class,
|
||||
() -> new DoubleSolenoid(0, 6, PneumaticsModuleType.REVPH, 2, 3));
|
||||
() -> new DoubleSolenoid(0, 6, PneumaticsModuleType.REV_PH, 2, 3));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void testToggle() {
|
||||
try (DoubleSolenoid solenoid = new DoubleSolenoid(0, 4, PneumaticsModuleType.REVPH, 2, 3)) {
|
||||
try (DoubleSolenoid solenoid = new DoubleSolenoid(0, 4, PneumaticsModuleType.REV_PH, 2, 3)) {
|
||||
// Bootstrap it into reverse
|
||||
solenoid.set(DoubleSolenoid.Value.REVERSE);
|
||||
|
||||
@@ -82,13 +82,13 @@ class DoubleSolenoidTestREV {
|
||||
void testInvalidForwardPort() {
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> new DoubleSolenoid(0, 1, PneumaticsModuleType.REVPH, 100, 1));
|
||||
() -> new DoubleSolenoid(0, 1, PneumaticsModuleType.REV_PH, 100, 1));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testInvalidReversePort() {
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> new DoubleSolenoid(0, 1, PneumaticsModuleType.REVPH, 0, 100));
|
||||
() -> new DoubleSolenoid(0, 1, PneumaticsModuleType.REV_PH, 0, 100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.wpilib.hardware.hal.util.AllocationException;
|
||||
class SolenoidTestCTRE {
|
||||
@Test
|
||||
void testValidInitialization() {
|
||||
try (Solenoid solenoid = new Solenoid(0, 3, PneumaticsModuleType.CTREPCM, 2)) {
|
||||
try (Solenoid solenoid = new Solenoid(0, 3, PneumaticsModuleType.CTRE_PCM, 2)) {
|
||||
assertEquals(2, solenoid.getChannel());
|
||||
|
||||
solenoid.set(true);
|
||||
@@ -28,17 +28,17 @@ class SolenoidTestCTRE {
|
||||
|
||||
@Test
|
||||
void testDoubleInitialization() {
|
||||
try (Solenoid solenoid = new Solenoid(0, 3, PneumaticsModuleType.CTREPCM, 2)) {
|
||||
try (Solenoid solenoid = new Solenoid(0, 3, PneumaticsModuleType.CTRE_PCM, 2)) {
|
||||
assertThrows(
|
||||
AllocationException.class, () -> new Solenoid(0, 3, PneumaticsModuleType.CTREPCM, 2));
|
||||
AllocationException.class, () -> new Solenoid(0, 3, PneumaticsModuleType.CTRE_PCM, 2));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDoubleInitializationFromDoubleSolenoid() {
|
||||
try (DoubleSolenoid solenoid = new DoubleSolenoid(0, 3, PneumaticsModuleType.CTREPCM, 2, 3)) {
|
||||
try (DoubleSolenoid solenoid = new DoubleSolenoid(0, 3, PneumaticsModuleType.CTRE_PCM, 2, 3)) {
|
||||
assertThrows(
|
||||
AllocationException.class, () -> new Solenoid(0, 3, PneumaticsModuleType.CTREPCM, 2));
|
||||
AllocationException.class, () -> new Solenoid(0, 3, PneumaticsModuleType.CTRE_PCM, 2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,12 +46,12 @@ class SolenoidTestCTRE {
|
||||
void testInvalidChannel() {
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> new Solenoid(0, 3, PneumaticsModuleType.CTREPCM, 100));
|
||||
() -> new Solenoid(0, 3, PneumaticsModuleType.CTRE_PCM, 100));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testToggle() {
|
||||
try (Solenoid solenoid = new Solenoid(0, 3, PneumaticsModuleType.CTREPCM, 2)) {
|
||||
try (Solenoid solenoid = new Solenoid(0, 3, PneumaticsModuleType.CTRE_PCM, 2)) {
|
||||
solenoid.set(true);
|
||||
assertTrue(solenoid.get());
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.wpilib.hardware.hal.util.AllocationException;
|
||||
class SolenoidTestREV {
|
||||
@Test
|
||||
void testValidInitialization() {
|
||||
try (Solenoid solenoid = new Solenoid(0, 3, PneumaticsModuleType.REVPH, 2)) {
|
||||
try (Solenoid solenoid = new Solenoid(0, 3, PneumaticsModuleType.REV_PH, 2)) {
|
||||
assertEquals(2, solenoid.getChannel());
|
||||
|
||||
solenoid.set(true);
|
||||
@@ -28,29 +28,29 @@ class SolenoidTestREV {
|
||||
|
||||
@Test
|
||||
void testDoubleInitialization() {
|
||||
try (Solenoid solenoid = new Solenoid(0, 3, PneumaticsModuleType.REVPH, 2)) {
|
||||
try (Solenoid solenoid = new Solenoid(0, 3, PneumaticsModuleType.REV_PH, 2)) {
|
||||
assertThrows(
|
||||
AllocationException.class, () -> new Solenoid(0, 3, PneumaticsModuleType.REVPH, 2));
|
||||
AllocationException.class, () -> new Solenoid(0, 3, PneumaticsModuleType.REV_PH, 2));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDoubleInitializationFromDoubleSolenoid() {
|
||||
try (DoubleSolenoid solenoid = new DoubleSolenoid(0, 3, PneumaticsModuleType.REVPH, 2, 3)) {
|
||||
try (DoubleSolenoid solenoid = new DoubleSolenoid(0, 3, PneumaticsModuleType.REV_PH, 2, 3)) {
|
||||
assertThrows(
|
||||
AllocationException.class, () -> new Solenoid(0, 3, PneumaticsModuleType.REVPH, 2));
|
||||
AllocationException.class, () -> new Solenoid(0, 3, PneumaticsModuleType.REV_PH, 2));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void testInvalidChannel() {
|
||||
assertThrows(
|
||||
IllegalArgumentException.class, () -> new Solenoid(0, 3, PneumaticsModuleType.REVPH, 100));
|
||||
IllegalArgumentException.class, () -> new Solenoid(0, 3, PneumaticsModuleType.REV_PH, 100));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testToggle() {
|
||||
try (Solenoid solenoid = new Solenoid(0, 3, PneumaticsModuleType.REVPH, 2)) {
|
||||
try (Solenoid solenoid = new Solenoid(0, 3, PneumaticsModuleType.REV_PH, 2)) {
|
||||
solenoid.set(true);
|
||||
assertTrue(solenoid.get());
|
||||
|
||||
|
||||
@@ -41,7 +41,8 @@ class CTREPCMSimTest {
|
||||
HAL.initialize(500, 0);
|
||||
|
||||
try (PneumaticsControlModule pcm = new PneumaticsControlModule(0);
|
||||
DoubleSolenoid doubleSolenoid = new DoubleSolenoid(0, PneumaticsModuleType.CTREPCM, 3, 4)) {
|
||||
DoubleSolenoid doubleSolenoid =
|
||||
new DoubleSolenoid(0, PneumaticsModuleType.CTRE_PCM, 3, 4)) {
|
||||
CTREPCMSim sim = new CTREPCMSim(0);
|
||||
sim.resetData();
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class REVPHSimTest {
|
||||
HAL.initialize(500, 0);
|
||||
|
||||
try (PneumaticHub ph = new PneumaticHub(1);
|
||||
DoubleSolenoid doubleSolenoid = new DoubleSolenoid(1, PneumaticsModuleType.REVPH, 3, 4)) {
|
||||
DoubleSolenoid doubleSolenoid = new DoubleSolenoid(1, PneumaticsModuleType.REV_PH, 3, 4)) {
|
||||
REVPHSim sim = new REVPHSim(ph);
|
||||
sim.resetData();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user