mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[wpilib] Compressor: Rename enabled to isEnabled (#4147)
This is a less confusing name, as enabled() can imply it enables the compressor.
This commit is contained in:
@@ -43,6 +43,10 @@ void Compressor::Stop() {
|
||||
}
|
||||
|
||||
bool Compressor::Enabled() const {
|
||||
return IsEnabled();
|
||||
}
|
||||
|
||||
bool Compressor::IsEnabled() const {
|
||||
return m_module->GetCompressor();
|
||||
}
|
||||
|
||||
@@ -87,7 +91,7 @@ CompressorConfigType Compressor::GetConfigType() const {
|
||||
void Compressor::InitSendable(wpi::SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("Compressor");
|
||||
builder.AddBooleanProperty(
|
||||
"Enabled", [=] { return Enabled(); }, nullptr);
|
||||
"Enabled", [=] { return IsEnabled(); }, nullptr);
|
||||
builder.AddBooleanProperty(
|
||||
"Pressure switch", [=]() { return GetPressureSwitchValue(); }, nullptr);
|
||||
}
|
||||
|
||||
@@ -78,11 +78,24 @@ class Compressor : public wpi::Sendable,
|
||||
|
||||
/**
|
||||
* Check if compressor output is active.
|
||||
* To (re)enable the compressor use EnableDigital() or EnableAnalog(...).
|
||||
*
|
||||
* @return true if the compressor is on
|
||||
* @return true if the compressor is on.
|
||||
* @deprecated To avoid confusion in thinking this (re)enables the compressor
|
||||
* use IsEnabled().
|
||||
*/
|
||||
WPI_DEPRECATED(
|
||||
"To avoid confusion in thinking this (re)enables the compressor use "
|
||||
"IsEnabled()")
|
||||
bool Enabled() const;
|
||||
|
||||
/**
|
||||
* Returns whether the compressor is active or not.
|
||||
*
|
||||
* @return true if the compressor is on - otherwise false.
|
||||
*/
|
||||
bool IsEnabled() const;
|
||||
|
||||
/**
|
||||
* Check if the pressure switch is triggered.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user