pvDatabaseCPP  4.7.0
scalarAlarmSupport.h
Go to the documentation of this file.
1 
10 #ifndef SCALARALARMSUPPORT_H
11 #define SCALARALARMSUPPORT_H
12 
13 
14 #include <pv/pvDatabase.h>
15 #include <pv/pvSupport.h>
16 #include <pv/alarm.h>
17 #include <pv/pvAlarm.h>
18 #include <pv/pvStructureCopy.h>
19 
20 #include <shareLib.h>
21 
22 namespace epics { namespace pvDatabase {
23 
25 typedef std::tr1::shared_ptr<ScalarAlarmSupport> ScalarAlarmSupportPtr;
26 
31 class epicsShareClass ScalarAlarmSupport :
32  PVSupport
33 {
34 public:
35  POINTER_DEFINITIONS(ScalarAlarmSupport);
39  virtual ~ScalarAlarmSupport();
48  virtual bool init(
49  epics::pvData::PVFieldPtr const & pvValue,
50  epics::pvData::PVStructurePtr const & pvAlarm,
51  epics::pvData::PVFieldPtr const & pvSupport);
58  virtual bool process();
63  virtual void reset();
70  static ScalarAlarmSupportPtr create(PVRecordPtr const & pvRecord);
76  static epics::pvData::StructureConstPtr scalarAlarmField();
77 private:
78 
79  ScalarAlarmSupport(PVRecordPtr const & pvRecord);
80  enum {
81  range_Lolo = 0,
82  range_Low,
83  range_Normal,
84  range_High,
85  range_Hihi,
86  range_Invalid,
87  range_Undefined
88  } AlarmRange;
89  void setAlarm(
90  epics::pvData::PVStructurePtr const & pvAlarm,
91  int alarmRange);
92  PVRecordPtr pvRecord;
93  int prevAlarmRange;
94  epics::pvData::PVScalarPtr pvValue;
95  epics::pvData::PVStructurePtr pvAlarm;
96  epics::pvData::PVStructurePtr pvScalarAlarm;
97  epics::pvData::PVBooleanPtr pvActive;
98  epics::pvData::PVDoublePtr pvLowAlarmLimit;
99  epics::pvData::PVDoublePtr pvLowWarningLimit;
100  epics::pvData::PVDoublePtr pvHighWarningLimit;
101  epics::pvData::PVDoublePtr pvHighAlarmLimit;
102  epics::pvData::PVDoublePtr pvHysteresis;
103  double requestedValue;
104  double currentValue;
105  bool isHystersis;
106 };
107 
108 }}
109 
110 #endif /* SCALARALARMSUPPORT_H */
Base interface for a PVSupport.
Definition: pvSupport.h:32
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21
std::tr1::shared_ptr< ScalarAlarmSupport > ScalarAlarmSupportPtr
Base interface for a ScalarAlarmSupport.