8 #include "NetworkCommunication/UsageReporting.h"
10 #include "LiveWindow/LiveWindow.h"
15 void Solenoid::InitSolenoid()
22 wpi_setWPIErrorWithContext(ModuleIndexOutOfRange, buf);
27 snprintf(buf, 64,
"Solenoid Channel %d", m_channel);
28 wpi_setWPIErrorWithContext(ChannelIndexOutOfRange, buf);
33 snprintf(buf, 64,
"Solenoid %d (Module: %d)", m_channel,
m_moduleNumber);
36 CloneError(m_allocated);
41 nUsageReporting::report(nUsageReporting::kResourceType_Solenoid, m_channel,
m_moduleNumber - 1);
88 uint8_t value = on ? 0xFF : 0x00;
89 uint8_t mask = 1 << (m_channel - 1);
102 uint8_t value =
GetAll() & ( 1 << (m_channel - 1));
112 if (m_table != NULL) {
119 if (m_table != NULL) {
126 if (m_table != NULL) {
virtual void RemoveTableListener(ITableListener *listener)=0
void AddActuator(const char *subsystem, const char *name, LiveWindowSendable *component)
uint32_t m_moduleNumber
Slot number where the module is plugged into the chassis.
virtual void AddTableListener(ITableListener *listener)=0
void StartLiveWindowMode()
void ValueChanged(ITable *source, const std::string &key, EntryValue value, bool isNew)
Solenoid(uint32_t channel)
virtual void PutBoolean(std::string key, bool value)=0
void Free(uint32_t index)
uint32_t Allocate(const char *resourceDesc)
static LiveWindow * GetInstance()
void InitTable(ITable *subTable)
virtual bool StatusIsFatal() const
Check if the current error code represents a fatal error.
static bool CheckSolenoidModule(uint8_t moduleNumber)
virtual void Set(bool on)
static void CreateResourceObject(Resource **r, uint32_t elements)
void StopLiveWindowMode()
void Set(uint8_t value, uint8_t mask)
std::string GetSmartDashboardType()
static bool CheckSolenoidChannel(uint32_t channel)