blob: cfafb73b57402505b149de5368ab95fb94659b5a [file] [log] [blame]
jerrymf1579332013-02-07 01:56:28 +00001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2008. All Rights Reserved. */
3/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
5/*----------------------------------------------------------------------------*/
6
7#ifndef SOLENOID_H_
8#define SOLENOID_H_
9
10#include "SolenoidBase.h"
11#include "LiveWindow/LiveWindowSendable.h"
12#include "tables/ITableListener.h"
13
14
15/**
16 * Solenoid class for running high voltage Digital Output (9472 module).
17 *
18 * The Solenoid class is typically used for pneumatics solenoids, but could be used
19 * for any device within the current spec of the 9472 module.
20 */
21class Solenoid : public SolenoidBase, public LiveWindowSendable, public ITableListener {
22public:
23 explicit Solenoid(UINT32 channel);
24 Solenoid(UINT8 moduleNumber, UINT32 channel);
25 virtual ~Solenoid();
26 virtual void Set(bool on);
27 virtual bool Get();
28
29void ValueChanged(ITable* source, const std::string& key, EntryValue value, bool isNew);
30 void UpdateTable();
31 void StartLiveWindowMode();
32 void StopLiveWindowMode();
33 std::string GetSmartDashboardType();
34 void InitTable(ITable *subTable);
35 ITable * GetTable();
36
37
38private:
39 void InitSolenoid();
40
41 UINT32 m_channel; ///< The channel on the module to control.
42
43 ITable *m_table;
44};
45
46#endif