13 #include "HAL/Types.h"
14 #include "LiveWindow/LiveWindowSendable.h"
15 #include "SensorBase.h"
16 #include "tables/ITableListener.h"
28 explicit Compressor(
int pcmID = GetDefaultSolenoidModule());
54 void InitTable(std::shared_ptr<ITable> subTable)
override;
55 std::shared_ptr<ITable>
GetTable()
const override;
57 std::shared_ptr<nt::Value> value,
bool isNew)
override;
60 HAL_CompressorHandle m_compressorHandle;
63 void SetCompressor(
bool on);
66 std::shared_ptr<ITable> m_table;
bool GetCompressorNotConnectedStickyFault() const
Query if the compressor output does not appear to be wired (sticky).
Definition: Compressor.cpp:246
A table whose values can be read and written to.
Definition: ITable.h:22
bool GetCompressorCurrentTooHighStickyFault() const
Query if the compressor output has been disabled due to high current draw (sticky).
Definition: Compressor.cpp:178
void SetClosedLoopControl(bool on)
Enables or disables automatically turning the compressor on when the pressure is low.
Definition: Compressor.cpp:116
Live Window Sendable is a special type of object sendable to the live window.
Definition: LiveWindowSendable.h:17
void StopLiveWindowMode() override
Stop having this sendable object automatically respond to value changes.
Definition: Compressor.cpp:310
bool GetClosedLoopControl() const
Returns true if the compressor will automatically turn on when the pressure is low.
Definition: Compressor.cpp:134
Base class for all sensors.
Definition: SensorBase.h:22
bool GetPressureSwitchValue() const
Check if the pressure switch is triggered.
Definition: Compressor.cpp:76
double GetCompressorCurrent() const
Query how much current the compressor is drawing.
Definition: Compressor.cpp:95
void InitTable(std::shared_ptr< ITable > subTable) override
Initializes a table for this sendable object.
Definition: Compressor.cpp:314
PCM compressor.
Definition: Compressor.h:23
bool GetCompressorCurrentTooHighFault() const
Query if the compressor output has been disabled due to high current draw.
Definition: Compressor.cpp:154
Compressor(int pcmID=GetDefaultSolenoidModule())
Constructor.
Definition: Compressor.cpp:23
void ValueChanged(ITable *source, llvm::StringRef key, std::shared_ptr< nt::Value > value, bool isNew) override
Called when a key-value pair is changed in a ITable.
Definition: Compressor.cpp:321
bool Enabled() const
Check if compressor output is active.
Definition: Compressor.cpp:57
bool GetCompressorShortedFault() const
Query if the compressor output has been disabled due to a short circuit.
Definition: Compressor.cpp:223
std::shared_ptr< ITable > GetTable() const override
Definition: Compressor.cpp:319
bool GetCompressorShortedStickyFault() const
Query if the compressor output has been disabled due to a short circuit (sticky). ...
Definition: Compressor.cpp:203
bool GetCompressorNotConnectedFault() const
Query if the compressor output does not appear to be wired.
Definition: Compressor.cpp:266
void StartLiveWindowMode() override
Start having this sendable object automatically respond to value changes reflect the value on the tab...
Definition: Compressor.cpp:308
A listener that listens to changes in values in a ITable.
Definition: ITableListener.h:18
void UpdateTable() override
Update the table for this sendable object with the latest values.
Definition: Compressor.cpp:301
std::string GetSmartDashboardType() const override
Definition: Compressor.cpp:312
void Start()
Starts closed-loop control.
Definition: Compressor.cpp:38
void ClearAllPCMStickyFaults()
Clear ALL sticky faults inside PCM that Compressor is wired to.
Definition: Compressor.cpp:290
void Stop()
Stops closed-loop control.
Definition: Compressor.cpp:47