Now you can download a copy of these docs so you can use them offline! Download now
Relay.h
1 /*----------------------------------------------------------------------------*/
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 RELAY_H_
8 #define RELAY_H_
9 
10 #include "SensorBase.h"
11 #include "tables/ITableListener.h"
12 #include "LiveWindow/LiveWindowSendable.h"
13 #include "tables/ITable.h"
14 
15 class DigitalModule;
16 
26 class Relay : public SensorBase, public ITableListener, public LiveWindowSendable {
27 public:
28  typedef enum {kOff, kOn, kForward, kReverse} Value;
29  typedef enum {kBothDirections, kForwardOnly, kReverseOnly} Direction;
30 
31  Relay(uint32_t channel, Direction direction = kBothDirections);
32  Relay(uint8_t moduleNumber, uint32_t channel, Direction direction = kBothDirections);
33  virtual ~Relay();
34 
35  void Set(Value value);
36  Value Get();
37 
38  void ValueChanged(ITable* source, const std::string& key, EntryValue value, bool isNew);
39  void UpdateTable();
40  void StartLiveWindowMode();
41  void StopLiveWindowMode();
42  std::string GetSmartDashboardType();
43  void InitTable(ITable *subTable);
44  ITable * GetTable();
45 
46  ITable *m_table;
47 
48 private:
49  void InitRelay(uint8_t moduleNumber);
50 
51  uint32_t m_channel;
52  Direction m_direction;
53  DigitalModule *m_module;
54 };
55 
56 #endif
Value Get()
Definition: Relay.cpp:199
std::string GetSmartDashboardType()
Definition: Relay.cpp:259
virtual ~Relay()
Definition: Relay.cpp:102
Definition: ITable.h:26
void StartLiveWindowMode()
Definition: Relay.cpp:247
void StopLiveWindowMode()
Definition: Relay.cpp:253
Relay(uint32_t channel, Direction direction=kBothDirections)
Definition: Relay.cpp:91
void UpdateTable()
Definition: Relay.cpp:230
Definition: Relay.h:26
void InitTable(ITable *subTable)
Definition: Relay.cpp:263
void ValueChanged(ITable *source, const std::string &key, EntryValue value, bool isNew)
Definition: Relay.cpp:223
ITable * GetTable()
Definition: Relay.cpp:268
void Set(Value value)
Definition: Relay.cpp:131
Definition: ITable.h:13

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6