1 #ifndef SAMPLEMECHANISM_H_
2 #define SAMPLEMECHANISM_H_
5 #include "storage/Index.h"
8 #include "engine/Named.h"
9 #include "engine/EngineConfig.h"
10 #include "engine/ProcessVariable.h"
11 #include "engine/DisableFilter.h"
35 public virtual Named {
75 virtual void addEvent(
Guard& guard,
short severity,
const epicsTime& when) = 0;
142 virtual const std::string&
getName()
const;
154 void disable(
const epicsTime& when);
158 void enable(
const epicsTime& when);
186 epicsTime last_stamp;
187 bool have_sample_after_connection;
void removeValueListener(ProcessVariableValueListener *listener)
Remove a listener from the underlying PV.
Definition: SampleMechanism.h:206
A filter to block samples while disabled.
Definition: DisableFilter.h:19
Listener for ProcessVariable info.
Definition: ProcessVariableListener.h:31
void addStateListener(ProcessVariableStateListener *listener)
Add a listener to the underlying PV.
Definition: SampleMechanism.h:191
A mutex with informational name and lock order.
Definition: OrderedMutex.h:34
virtual void start(Guard &guard)
Start the sample mechanism.
virtual const std::string & getName() const
Gets the ProcessVariable name.
void disable(const epicsTime &when)
Temporarily disable sampling.
void removeStateListener(ProcessVariableStateListener *listener)
Remove a ProcessVariableStateListener.
Definition: ProcessVariable.h:193
virtual std::string getInfo(Guard &guard)
void pvDisconnected(ProcessVariable &pv, const epicsTime &when)
ProcessVariableStateListener.
void addValueListener(ProcessVariableValueListener *listener)
Add a ProcessVariableValueListener.
Definition: ProcessVariable.h:199
bool isRunning(Guard &guard)
One process variable.
Definition: ProcessVariable.h:39
Global engine configuration parameters.
Definition: EngineConfig.h:14
virtual void pvValue(ProcessVariable &pv, const RawValue::Data *data)=0
ProcessVariableValueListener.
Listener for ProcessVariable state info.
Definition: ProcessVariableListener.h:10
void addStateListener(ProcessVariableStateListener *listener)
Add a ProcessVariableStateListener.
Definition: ProcessVariable.h:187
Abstract base for a named thingy, does not actually contain the name.
Definition: Named.h:15
virtual void addToFUX(Guard &guard, FUX::Element *doc)
Append this sample mechanism to a FUX document.
Automatically takes and releases an epicsMutex.
Definition: Guard.h:63
void removeStateListener(ProcessVariableStateListener *listener)
Remove a listener from the underlying PV.
Definition: SampleMechanism.h:196
Sample Mechanism base, has a ProcessVariable and filters its values.
Definition: SampleMechanism.h:33
Listener for ProcessVariable info.
Definition: ProcessVariableListener.h:47
void removeValueListener(ProcessVariableValueListener *listener)
Remove a ProcessVariableValueListener.
Definition: ProcessVariable.h:205
virtual OrderedMutex & getMutex()
virtual unsigned long write(Guard &guard, Index &index)=0
Write current buffer to index.
void enable(const epicsTime &when)
Re-enable sampling.
Interface for something that can be protected by a Guard.
Definition: Guard.h:49
Context for ProcessVariable instances.
Definition: ProcessVariableContext.h:18
SampleMechanism(const EngineConfig &config, ProcessVariableContext &ctx, const char *name, double period, ProcessVariableListener *disable_filt_listener)
Construct mechanism for given period.
void addValueListener(ProcessVariableValueListener *listener)
Add a listener to the underlying PV.
Definition: SampleMechanism.h:201
ProcessVariable::State getPVState()
virtual void pvConnected(ProcessVariable &pv, const epicsTime &when)=0
ProcessVariableStateListener.
virtual void stop(Guard &guard)
Stop sampling.
Base interface for the archiver's indices.
Definition: Index.h:16
One element in the FUX tree.
Definition: FUX.h:51
dbr_time_double Data
Type for accessing the raw data and its common fields.
Definition: RawValue.h:55
State
Possible states of a ProcessVariable.
Definition: ProcessVariable.h:52