[hal, wpilib] Incorporate pneumatic control type into wpilibc/j (#3728)

This commit is contained in:
Thad House
2021-11-23 20:32:02 -08:00
committed by GitHub
parent 9aba2b7583
commit b156db400d
35 changed files with 693 additions and 216 deletions

View File

@@ -96,7 +96,7 @@ TEST(CTREPCMSimTest, SetCompressorOn) {
EXPECT_TRUE(callback.GetLastValue());
}
TEST(CTREPCMSimTest, SetClosedLoopEnabled) {
TEST(CTREPCMSimTest, SetEnableDigital) {
PneumaticsControlModule pcm;
CTREPCMSim sim(pcm);
sim.ResetData();
@@ -105,12 +105,12 @@ TEST(CTREPCMSimTest, SetClosedLoopEnabled) {
auto cb =
sim.RegisterClosedLoopEnabledCallback(callback.GetCallback(), false);
pcm.SetClosedLoopControl(false);
EXPECT_FALSE(pcm.GetClosedLoopControl());
pcm.DisableCompressor();
EXPECT_EQ(pcm.GetCompressorConfigType(), CompressorConfigType::Disabled);
pcm.SetClosedLoopControl(true);
pcm.EnableCompressorDigital();
EXPECT_TRUE(sim.GetClosedLoopEnabled());
EXPECT_TRUE(pcm.GetClosedLoopControl());
EXPECT_EQ(pcm.GetCompressorConfigType(), CompressorConfigType::Digital);
EXPECT_TRUE(callback.WasTriggered());
EXPECT_TRUE(callback.GetLastValue());
}