WPILib  2014.0
WPIRoboticsLibraryforFRC
 All Classes Functions Variables Pages
Compressor.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 COMPRESSOR_H_
8 #define COMPRESSOR_H_
9 
10 #define COMPRESSOR_PRIORITY 90
11 
12 #include "SensorBase.h"
13 #include "Relay.h"
14 #include "Task.h"
15 #include "LiveWindow/LiveWindowSendable.h"
16 
17 class DigitalInput;
18 
26 class Compressor: public SensorBase, public LiveWindowSendable
27 {
28 public:
29  Compressor(uint32_t pressureSwitchChannel, uint32_t compressorRelayChannel);
30  Compressor(uint8_t pressureSwitchModuleNumber, uint32_t pressureSwitchChannel,
31  uint8_t compresssorRelayModuleNumber, uint32_t compressorRelayChannel);
32  ~Compressor();
33 
34  void Start();
35  void Stop();
36  bool Enabled();
37  uint32_t GetPressureSwitchValue();
38  void SetRelayValue(Relay::Value relayValue);
39 
40  void UpdateTable();
41  void StartLiveWindowMode();
42  void StopLiveWindowMode();
43  std::string GetSmartDashboardType();
44  void InitTable(ITable *subTable);
45  ITable * GetTable();
46 
47 private:
48  void InitCompressor(uint8_t pressureSwitchModuleNumber, uint32_t pressureSwitchChannel,
49  uint8_t compresssorRelayModuleNumber, uint32_t compressorRelayChannel);
50 
51  DigitalInput *m_pressureSwitch;
52  Relay *m_relay;
53  bool m_enabled;
54  Task m_task;
55 
56  ITable *m_table;
57 };
58 
59 #endif
60 
Definition: DigitalInput.h:22
uint32_t GetPressureSwitchValue()
Definition: Compressor.cpp:132
Definition: SensorBase.h:20
Definition: Compressor.h:26
void Stop()
Definition: Compressor.cpp:151
Compressor(uint32_t pressureSwitchChannel, uint32_t compressorRelayChannel)
Definition: Compressor.cpp:96
void SetRelayValue(Relay::Value relayValue)
Definition: Compressor.cpp:121
Definition: Relay.h:26
bool Enabled()
Definition: Compressor.cpp:163
Definition: Task.h:17
void Start()
Definition: Compressor.cpp:142
~Compressor()
Definition: Compressor.cpp:110