blob: e695a331df355c146e8f9bde10040878fc4607d7 [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 ANALOG_TRIGGER_H_
8#define ANALOG_TRIGGER_H_
9
10#include "AnalogTriggerOutput.h"
11#include "SensorBase.h"
12
13class AnalogChannel;
14class AnalogModule;
15
16class AnalogTrigger: public SensorBase
17{
18 friend class AnalogTriggerOutput;
19public:
20 AnalogTrigger(UINT8 moduleNumber, UINT32 channel);
21 explicit AnalogTrigger(UINT32 channel);
22 explicit AnalogTrigger(AnalogChannel *channel);
23 virtual ~AnalogTrigger();
24
25 void SetLimitsVoltage(float lower, float upper);
26 void SetLimitsRaw(INT32 lower, INT32 upper);
27 void SetAveraged(bool useAveragedValue);
28 void SetFiltered(bool useFilteredValue);
29 UINT32 GetIndex();
30 bool GetInWindow();
31 bool GetTriggerState();
32 AnalogTriggerOutput *CreateOutput(AnalogTriggerOutput::Type type);
33
34private:
35 void InitTrigger(UINT8 moduleNumber, UINT32 channel);
36
37 UINT8 m_index;
38 tAnalogTrigger *m_trigger;
39 AnalogModule *m_analogModule;
40 UINT32 m_channel;
41};
42
43#endif
44