pvDatabaseCPP  4.5.3-dev
pvDeadbandPlugin.h
Go to the documentation of this file.
1 /* pvDeadbandPlugin.h */
2 /*
3  * The License for this software can be found in the file LICENSE that is included with the distribution.
4  */
5 
6 #ifndef PVDEADBANDPLUGIN_H
7 #define PVDEADBANDPLUGIN_H
8 
9 
10 #include <string>
11 #include <map>
12 #include <pv/lock.h>
13 #include <pv/pvData.h>
14 #include <pv/pvPlugin.h>
15 
16 #include <shareLib.h>
17 
18 namespace epics { namespace pvCopy{
19 
20 class PVDeadbandPlugin;
22 
23 typedef std::tr1::shared_ptr<PVDeadbandPlugin> PVDeadbandPluginPtr;
24 typedef std::tr1::shared_ptr<PVDeadbandFilter> PVDeadbandFilterPtr;
25 
26 
33 class epicsShareClass PVDeadbandPlugin : public PVPlugin
34 {
35 private:
37 public:
38  POINTER_DEFINITIONS(PVDeadbandPlugin);
39  virtual ~PVDeadbandPlugin();
43  static void create();
52  virtual PVFilterPtr create(
53  const std::string & requestValue,
54  const PVCopyPtr & pvCopy,
55  const epics::pvData::PVFieldPtr & master);
56 };
57 
61 class epicsShareClass PVDeadbandFilter : public PVFilter
62 {
63 private:
64  bool absolute;
65  double deadband;
66  epics::pvData::PVScalarPtr master;
67  bool firstTime;
68  double lastReportedValue;
69 
70 
71  PVDeadbandFilter(bool absolute,double deadband,epics::pvData::PVScalarPtr const & master);
72 public:
73  POINTER_DEFINITIONS(PVDeadbandFilter);
74  virtual ~PVDeadbandFilter();
82  static PVDeadbandFilterPtr create(
83  const std::string & requestValue,
84  const epics::pvData::PVFieldPtr & master);
93  bool filter(const epics::pvData::PVFieldPtr & pvCopy,const epics::pvData::BitSetPtr & bitSet,bool toCopy);
98  std::string getName();
99 };
100 
101 }}
102 #endif /* PVDEADBANDPLUGIN_H */
std::tr1::shared_ptr< PVFilter > PVFilterPtr
Definition: pvPlugin.h:29
std::tr1::shared_ptr< PVCopy > PVCopyPtr
Definition: pvPlugin.h:25
std::tr1::shared_ptr< PVDeadbandFilter > PVDeadbandFilterPtr
A Plugin for a filter that gets a sub array from a PVScalarDeadband.
A filter plugin that attaches to a field of a PVStrcture.
Definition: pvPlugin.h:44
A plugin for a filter that gets a sub array from a PVScalarDeadband.
std::tr1::shared_ptr< PVDeadbandPlugin > PVDeadbandPluginPtr
A Filter that is called when a copy PVStructure is being updated.
Definition: pvPlugin.h:68