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:
@@ -88,7 +88,7 @@ void Compressor::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
builder.AddDoubleProperty(
|
||||
"Current (A)", [this] { return GetCurrent().value(); }, nullptr);
|
||||
// These are not supported by the CTRE PCM
|
||||
if (m_moduleType == PneumaticsModuleType::REVPH) {
|
||||
if (m_moduleType == PneumaticsModuleType::REV_PH) {
|
||||
builder.AddDoubleProperty(
|
||||
"Analog Voltage", [this] { return GetAnalogVoltage().value(); },
|
||||
nullptr);
|
||||
|
||||
@@ -419,17 +419,17 @@ wpi::units::pounds_per_square_inch_t PneumaticHub::GetPressure(
|
||||
}
|
||||
|
||||
Solenoid PneumaticHub::MakeSolenoid(int channel) {
|
||||
return Solenoid{m_module, PneumaticsModuleType::REVPH, channel};
|
||||
return Solenoid{m_module, PneumaticsModuleType::REV_PH, channel};
|
||||
}
|
||||
|
||||
DoubleSolenoid PneumaticHub::MakeDoubleSolenoid(int forwardChannel,
|
||||
int reverseChannel) {
|
||||
return DoubleSolenoid{m_module, PneumaticsModuleType::REVPH, forwardChannel,
|
||||
return DoubleSolenoid{m_module, PneumaticsModuleType::REV_PH, forwardChannel,
|
||||
reverseChannel};
|
||||
}
|
||||
|
||||
Compressor PneumaticHub::MakeCompressor() {
|
||||
return Compressor{m_module, PneumaticsModuleType::REVPH};
|
||||
return Compressor{m_module, PneumaticsModuleType::REV_PH};
|
||||
}
|
||||
|
||||
void PneumaticHub::ReportUsage(std::string_view device, std::string_view data) {
|
||||
|
||||
@@ -29,9 +29,9 @@ static_assert(
|
||||
|
||||
std::shared_ptr<PneumaticsBase> PneumaticsBase::GetForType(
|
||||
int busId, int module, PneumaticsModuleType moduleType) {
|
||||
if (moduleType == PneumaticsModuleType::CTREPCM) {
|
||||
if (moduleType == PneumaticsModuleType::CTRE_PCM) {
|
||||
return PneumaticsControlModule::GetForModule(busId, module);
|
||||
} else if (moduleType == PneumaticsModuleType::REVPH) {
|
||||
} else if (moduleType == PneumaticsModuleType::REV_PH) {
|
||||
return PneumaticHub::GetForModule(busId, module);
|
||||
}
|
||||
throw WPILIB_MakeError(err::InvalidParameter, "{}",
|
||||
@@ -39,9 +39,9 @@ std::shared_ptr<PneumaticsBase> PneumaticsBase::GetForType(
|
||||
}
|
||||
|
||||
int PneumaticsBase::GetDefaultForType(PneumaticsModuleType moduleType) {
|
||||
if (moduleType == PneumaticsModuleType::CTREPCM) {
|
||||
if (moduleType == PneumaticsModuleType::CTRE_PCM) {
|
||||
return SensorUtil::GetDefaultCTREPCMModule();
|
||||
} else if (moduleType == PneumaticsModuleType::REVPH) {
|
||||
} else if (moduleType == PneumaticsModuleType::REV_PH) {
|
||||
return SensorUtil::GetDefaultREVPHModule();
|
||||
}
|
||||
throw WPILIB_MakeError(err::InvalidParameter, "{}",
|
||||
|
||||
@@ -286,17 +286,17 @@ wpi::units::pounds_per_square_inch_t PneumaticsControlModule::GetPressure(
|
||||
}
|
||||
|
||||
Solenoid PneumaticsControlModule::MakeSolenoid(int channel) {
|
||||
return Solenoid{m_module, PneumaticsModuleType::CTREPCM, channel};
|
||||
return Solenoid{m_module, PneumaticsModuleType::CTRE_PCM, channel};
|
||||
}
|
||||
|
||||
DoubleSolenoid PneumaticsControlModule::MakeDoubleSolenoid(int forwardChannel,
|
||||
int reverseChannel) {
|
||||
return DoubleSolenoid{m_module, PneumaticsModuleType::CTREPCM, forwardChannel,
|
||||
reverseChannel};
|
||||
return DoubleSolenoid{m_module, PneumaticsModuleType::CTRE_PCM,
|
||||
forwardChannel, reverseChannel};
|
||||
}
|
||||
|
||||
Compressor PneumaticsControlModule::MakeCompressor() {
|
||||
return Compressor{m_module, PneumaticsModuleType::CTREPCM};
|
||||
return Compressor{m_module, PneumaticsModuleType::CTRE_PCM};
|
||||
}
|
||||
|
||||
void PneumaticsControlModule::ReportUsage(std::string_view device,
|
||||
|
||||
Reference in New Issue
Block a user