WPILib 2012
WPILibRoboticsLibraryforFRC
|
00001 /*----------------------------------------------------------------------------*/ 00002 /* Copyright (c) FIRST 2008. All Rights Reserved. */ 00003 /* Open Source Software - may be modified and shared by FRC teams. The code */ 00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ 00005 /*----------------------------------------------------------------------------*/ 00006 00007 #ifndef ANALOG_TRIGGER_H_ 00008 #define ANALOG_TRIGGER_H_ 00009 00010 #include "AnalogTriggerOutput.h" 00011 #include "SensorBase.h" 00012 00013 class AnalogChannel; 00014 class AnalogModule; 00015 00016 class AnalogTrigger: public SensorBase 00017 { 00018 friend class AnalogTriggerOutput; 00019 public: 00020 AnalogTrigger(UINT8 moduleNumber, UINT32 channel); 00021 explicit AnalogTrigger(UINT32 channel); 00022 explicit AnalogTrigger(AnalogChannel *channel); 00023 virtual ~AnalogTrigger(); 00024 00025 void SetLimitsVoltage(float lower, float upper); 00026 void SetLimitsRaw(INT32 lower, INT32 upper); 00027 void SetAveraged(bool useAveragedValue); 00028 void SetFiltered(bool useFilteredValue); 00029 UINT32 GetIndex(); 00030 bool GetInWindow(); 00031 bool GetTriggerState(); 00032 AnalogTriggerOutput *CreateOutput(AnalogTriggerOutput::Type type); 00033 00034 private: 00035 void InitTrigger(UINT8 moduleNumber, UINT32 channel); 00036 00037 UINT8 m_index; 00038 tAnalogTrigger *m_trigger; 00039 AnalogModule *m_analogModule; 00040 UINT32 m_channel; 00041 }; 00042 00043 #endif 00044