13 #include "HAL/Types.h"
14 #include "LiveWindow/LiveWindowSendable.h"
15 #include "SolenoidBase.h"
16 #include "tables/ITableListener.h"
31 enum Value { kOff, kForward, kReverse };
34 DoubleSolenoid(
int moduleNumber,
int forwardChannel,
int reverseChannel);
36 virtual void Set(Value value);
37 virtual Value
Get()
const;
41 void ValueChanged(
ITable* source, llvm::StringRef key,
42 std::shared_ptr<nt::Value> value,
bool isNew);
47 void InitTable(std::shared_ptr<ITable> subTable);
48 std::shared_ptr<ITable>
GetTable()
const;
55 HAL_SolenoidHandle m_forwardHandle = HAL_kInvalidHandle;
56 HAL_SolenoidHandle m_reverseHandle = HAL_kInvalidHandle;
58 std::shared_ptr<ITable> m_table;
A table whose values can be read and written to.
Definition: ITable.h:22
Live Window Sendable is a special type of object sendable to the live window.
Definition: LiveWindowSendable.h:17
std::shared_ptr< ITable > GetTable() const
Definition: DoubleSolenoid.cpp:226
SolenoidBase class is the common base class for the Solenoid and DoubleSolenoid classes.
Definition: SolenoidBase.h:20
void UpdateTable()
Update the table for this sendable object with the latest values.
Definition: DoubleSolenoid.cpp:195
DoubleSolenoid class for running 2 channels of high voltage Digital Output (PCM). ...
Definition: DoubleSolenoid.h:27
virtual Value Get() const
Read the current value of the solenoid.
Definition: DoubleSolenoid.cpp:142
bool IsRevSolenoidBlackListed() const
Check if the reverse solenoid is blacklisted.
Definition: DoubleSolenoid.cpp:178
void StopLiveWindowMode()
Stop having this sendable object automatically respond to value changes.
Definition: DoubleSolenoid.cpp:210
DoubleSolenoid(int forwardChannel, int reverseChannel)
Constructor.
Definition: DoubleSolenoid.cpp:28
A listener that listens to changes in values in a ITable.
Definition: ITableListener.h:18
virtual ~DoubleSolenoid()
Destructor.
Definition: DoubleSolenoid.cpp:98
std::string GetSmartDashboardType() const
Definition: DoubleSolenoid.cpp:217
virtual void Set(Value value)
Set the value of a solenoid.
Definition: DoubleSolenoid.cpp:109
void StartLiveWindowMode()
Start having this sendable object automatically respond to value changes reflect the value on the tab...
Definition: DoubleSolenoid.cpp:203
void InitTable(std::shared_ptr< ITable > subTable)
Initializes a table for this sendable object.
Definition: DoubleSolenoid.cpp:221
bool IsFwdSolenoidBlackListed() const
Check if the forward solenoid is blacklisted.
Definition: DoubleSolenoid.cpp:165