Skip to content

Commit

Permalink
deprecation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
narmstro2020 committed Oct 10, 2024
1 parent f89bd2f commit 83a0ab9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 42 deletions.
16 changes: 4 additions & 12 deletions wpilibc/src/main/native/cpp/simulation/SolenoidSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,28 @@ SolenoidSim::SolenoidSim(PneumaticsModuleType type, int channel)
PneumaticsBase::GetDefaultForType(type), type)},
m_channel{channel} {}

bool SolenoidSim::Get() const {
return m_module->GetSolenoidOutput(m_channel);
}

bool SolenoidSim::GetOutput() const {
return m_module->GetSolenoidOutput(m_channel);
}

void SolenoidSim::Set(bool output) {
m_module->SetSolenoidOutput(m_channel, output);
}

void SolenoidSim::SetOutput(bool output) {
m_module->SetSolenoidOutput(m_channel, output);
}

bool SolenoidSim::IsOn() {
return Get();
return m_module->GetSolenoidOutput(m_channel);
}

bool SolenoidSim::IsOff() {
return !Get();
return !m_module->GetSolenoidOutput(m_channel);
}

void SolenoidSim::SetOn() {
Set(true);
m_module->SetSolenoidOutput(m_channel, true);
}

void SolenoidSim::SetOff() {
Set(false);
m_module->SetSolenoidOutput(m_channel, false);
}

std::unique_ptr<CallbackStore> SolenoidSim::RegisterOutputCallback(
Expand Down
16 changes: 2 additions & 14 deletions wpilibc/src/main/native/include/frc/simulation/SolenoidSim.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,14 @@ class SolenoidSim {
* Returns the solenoid output.
* @return the solenoid output.
*/
bool Get() const;

/**
* Returns the solenoid output.
* @return the solenoid output.
*/
[[deprecated("Use Get method instead.")]]
[[deprecated("Use IsOn or IsOff methods instead.")]]
bool GetOutput() const;

/**
* Sets the solenoid output.
* @param output The new solenoid output.
*/
void Set(bool output);

/**
* Sets the solenoid output.
* @param output The new solenoid output.
*/
[[deprecated("Use Set method instead.")]]
[[deprecated("Use SetOn or SetOff methods instead.")]]
void SetOutput(bool output);

/**
Expand Down
12 changes: 0 additions & 12 deletions wpilibj/src/main/java/edu/wpi/first/wpilibj/Solenoid.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,6 @@ public boolean get() {
return (currentAll & m_mask) != 0;
}

/**
* Read the current value of the solenoid.
*
* @return True if the solenoid output is on or false if the solenoid output is off.
* @deprecated Use get instead
*/
@Deprecated
public boolean getOutput() {
int currentAll = m_module.getSolenoids();
return (currentAll & m_mask) != 0;
}

/**
* Returns true if the solenoid is on.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ public SolenoidSim(PneumaticsModuleType moduleType, int channel) {
* Check the solenoid output.
*
* @return the solenoid output
* @deprecated Use isOn or isOff instead
*/
public boolean get() {
@Deprecated
public boolean getOutput() {
return m_module.getSolenoidOutput(m_channel);
}

Expand All @@ -74,20 +76,22 @@ public boolean isOff() {

/** Turns the solenoid on. */
public void setOn() {
set(true);
m_module.setSolenoidOutput(m_channel, true);
}

/** Turns the solenoid off. */
public void setOff() {
set(false);
m_module.setSolenoidOutput(m_channel, false);
}

/**
* Change the solenoid output.
*
* @param output the new solenoid output
* @deprecated Use setOn or setOff instead.
*/
public void set(boolean output) {
@Deprecated
public void setOutput(boolean output) {
m_module.setSolenoidOutput(m_channel, output);
}

Expand Down

0 comments on commit 83a0ab9

Please sign in to comment.