mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Moved C++ comments from source files to headers (#1111)
Also sorted functions in C++ sources to match order in related headers.
This commit is contained in:
committed by
Peter Johnson
parent
d9971a705a
commit
8c680a26f8
@@ -17,11 +17,6 @@
|
||||
|
||||
using namespace frc;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param module The PCM ID to use (0-62)
|
||||
*/
|
||||
Compressor::Compressor(int pcmID) : m_module(pcmID) {
|
||||
int32_t status = 0;
|
||||
m_compressorHandle = HAL_InitializeCompressor(m_module, &status);
|
||||
@@ -36,29 +31,16 @@ Compressor::Compressor(int pcmID) : m_module(pcmID) {
|
||||
SetName("Compressor", pcmID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts closed-loop control. Note that closed loop control is enabled by
|
||||
* default.
|
||||
*/
|
||||
void Compressor::Start() {
|
||||
if (StatusIsFatal()) return;
|
||||
SetClosedLoopControl(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops closed-loop control. Note that closed loop control is enabled by
|
||||
* default.
|
||||
*/
|
||||
void Compressor::Stop() {
|
||||
if (StatusIsFatal()) return;
|
||||
SetClosedLoopControl(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if compressor output is active.
|
||||
*
|
||||
* @return true if the compressor is on
|
||||
*/
|
||||
bool Compressor::Enabled() const {
|
||||
if (StatusIsFatal()) return false;
|
||||
int32_t status = 0;
|
||||
@@ -73,11 +55,6 @@ bool Compressor::Enabled() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the pressure switch is triggered.
|
||||
*
|
||||
* @return true if pressure is low
|
||||
*/
|
||||
bool Compressor::GetPressureSwitchValue() const {
|
||||
if (StatusIsFatal()) return false;
|
||||
int32_t status = 0;
|
||||
@@ -92,11 +69,6 @@ bool Compressor::GetPressureSwitchValue() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query how much current the compressor is drawing.
|
||||
*
|
||||
* @return The current through the compressor, in amps
|
||||
*/
|
||||
double Compressor::GetCompressorCurrent() const {
|
||||
if (StatusIsFatal()) return 0;
|
||||
int32_t status = 0;
|
||||
@@ -111,13 +83,6 @@ double Compressor::GetCompressorCurrent() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables automatically turning the compressor on when the
|
||||
* pressure is low.
|
||||
*
|
||||
* @param on Set to true to enable closed loop control of the compressor. False
|
||||
* to disable.
|
||||
*/
|
||||
void Compressor::SetClosedLoopControl(bool on) {
|
||||
if (StatusIsFatal()) return;
|
||||
int32_t status = 0;
|
||||
@@ -129,13 +94,6 @@ void Compressor::SetClosedLoopControl(bool on) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the compressor will automatically turn on when the
|
||||
* pressure is low.
|
||||
*
|
||||
* @return True if closed loop control of the compressor is enabled. False if
|
||||
* disabled.
|
||||
*/
|
||||
bool Compressor::GetClosedLoopControl() const {
|
||||
if (StatusIsFatal()) return false;
|
||||
int32_t status = 0;
|
||||
@@ -150,12 +108,6 @@ bool Compressor::GetClosedLoopControl() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query if the compressor output has been disabled due to high current draw.
|
||||
*
|
||||
* @return true if PCM is in fault state : Compressor Drive is
|
||||
* disabled due to compressor current being too high.
|
||||
*/
|
||||
bool Compressor::GetCompressorCurrentTooHighFault() const {
|
||||
if (StatusIsFatal()) return false;
|
||||
int32_t status = 0;
|
||||
@@ -170,16 +122,6 @@ bool Compressor::GetCompressorCurrentTooHighFault() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query if the compressor output has been disabled due to high current draw
|
||||
* (sticky).
|
||||
*
|
||||
* A sticky fault will not clear on device reboot, it must be cleared through
|
||||
* code or the webdash.
|
||||
*
|
||||
* @return true if PCM sticky fault is set : Compressor Drive is
|
||||
* disabled due to compressor current being too high.
|
||||
*/
|
||||
bool Compressor::GetCompressorCurrentTooHighStickyFault() const {
|
||||
if (StatusIsFatal()) return false;
|
||||
int32_t status = 0;
|
||||
@@ -195,16 +137,6 @@ bool Compressor::GetCompressorCurrentTooHighStickyFault() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query if the compressor output has been disabled due to a short circuit
|
||||
* (sticky).
|
||||
*
|
||||
* A sticky fault will not clear on device reboot, it must be cleared through
|
||||
* code or the webdash.
|
||||
*
|
||||
* @return true if PCM sticky fault is set : Compressor output
|
||||
* appears to be shorted.
|
||||
*/
|
||||
bool Compressor::GetCompressorShortedStickyFault() const {
|
||||
if (StatusIsFatal()) return false;
|
||||
int32_t status = 0;
|
||||
@@ -219,12 +151,6 @@ bool Compressor::GetCompressorShortedStickyFault() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query if the compressor output has been disabled due to a short circuit.
|
||||
*
|
||||
* @return true if PCM is in fault state : Compressor output
|
||||
* appears to be shorted.
|
||||
*/
|
||||
bool Compressor::GetCompressorShortedFault() const {
|
||||
if (StatusIsFatal()) return false;
|
||||
int32_t status = 0;
|
||||
@@ -239,15 +165,6 @@ bool Compressor::GetCompressorShortedFault() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query if the compressor output does not appear to be wired (sticky).
|
||||
*
|
||||
* A sticky fault will not clear on device reboot, it must be cleared through
|
||||
* code or the webdash.
|
||||
*
|
||||
* @return true if PCM sticky fault is set : Compressor does not
|
||||
* appear to be wired, i.e. compressor is not drawing enough current.
|
||||
*/
|
||||
bool Compressor::GetCompressorNotConnectedStickyFault() const {
|
||||
if (StatusIsFatal()) return false;
|
||||
int32_t status = 0;
|
||||
@@ -262,12 +179,6 @@ bool Compressor::GetCompressorNotConnectedStickyFault() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query if the compressor output does not appear to be wired.
|
||||
*
|
||||
* @return true if PCM is in fault state : Compressor does not
|
||||
* appear to be wired, i.e. compressor is not drawing enough current.
|
||||
*/
|
||||
bool Compressor::GetCompressorNotConnectedFault() const {
|
||||
if (StatusIsFatal()) return false;
|
||||
int32_t status = 0;
|
||||
@@ -282,16 +193,6 @@ bool Compressor::GetCompressorNotConnectedFault() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear ALL sticky faults inside PCM that Compressor is wired to.
|
||||
*
|
||||
* If a sticky fault is set, then it will be persistently cleared. Compressor
|
||||
* drive maybe momentarily disable while flags are being cleared. Care should
|
||||
* be taken to not call this too frequently, otherwise normal compressor
|
||||
* functionality may be prevented.
|
||||
*
|
||||
* If no sticky faults are set then this call will have no effect.
|
||||
*/
|
||||
void Compressor::ClearAllPCMStickyFaults() {
|
||||
if (StatusIsFatal()) return;
|
||||
int32_t status = 0;
|
||||
|
||||
Reference in New Issue
Block a user