42 throw std::invalid_argument(
"Can't capture with flush code or >255");
60 throw std::invalid_argument(
"Can't flush with capture code or >255");
116 if(prec && !readout.
ok) {
117 recGblSetSevr(prec, READ_ALARM, INVALID_ALARM);
119 recGblSetSevr(prec, READ_ALARM, INVALID_ALARM);
120 }
else if(prec && readout.
drop) {
121 recGblSetSevr(prec, READ_ALARM, MAJOR_ALARM);
124 double period=1e9/
self->evr->clockTS();
126 size_t len = std::min(readout.
pos,
size_t(count));
128 if(readout.
buf.size() < count) {
132 if(period<=0 || !
isfinite(period)) {
137 recGblSetSevr(prec, READ_ALARM, INVALID_ALARM);
148 for(
size_t i=0; i<len; i++) {
149 epicsTimeStamp ts = readout.
buf[i];
153 ts.secPastEpoch -= POSIX_TIME_AT_EPICS_EPOCH;
154 ts.nsec = epicsUInt32(ts.nsec*period);
160 double diff = epicsTimeDiffInSeconds(&ts, &tref);
161 arr[i] = epicsInt32(diff*1e9);
191 mrf::Object::create_args_t::const_iterator it;
193 if((it=args.find(
"PARENT"))==args.end())
194 throw std::runtime_error(
"No PARENT= (EVR) specified");
198 throw std::runtime_error(
"No such PARENT object");
202 throw std::runtime_error(
"PARENT is not a MRMEVR");
206 return ret.release();
std::map< std::string, std::string > create_args_t
epicsUInt32 getTimesRelFirst(epicsInt32 *arr, epicsUInt32 count) const
virtual bool interestedInEvent(epicsUInt32 event, bool set) OVERRIDE FINAL
OBJECT_FACTORY & buildInstance
OBJECT_PROP1("DropCnt", &EVRMRMTSBuffer::dropCount)
std::vector< epicsTimeStamp > buf
Modular Register Map Event Receivers.
virtual ~EVRMRMTSBuffer()
epicsUInt32 getTimesRelFlush(epicsInt32 *arr, epicsUInt32 count) const
void flushTimeSet(epicsUInt16 v)
EVRMRMTSBuffer(const std::string &n, EVRMRM *evr)
static Object * getObject(const std::string &name)
#define OBJECT_BEGIN(klass)
epicsUInt32 getTimesRelPrevFlush(epicsInt32 *arr, epicsUInt32 count) const
virtual void lock() const OVERRIDE FINAL
void flushEventSet(epicsUInt16 v)
#define OBJECT_END(klass)
epicsUInt16 flushEvent() const
epicsTimeStamp prevflushtime
const std::string & name() const
IOSCANPVT flushed() const
virtual bool TimeStampValid() const OVERRIDE FINAL
#define OBJECT_FACTORY(FN)
virtual void lock() const OVERRIDE FINAL
epicsUInt32 dropCount() const
OBJECT_PROP2("TimeEvent", &EVRMRMTSBuffer::timeEvent, &EVRMRMTSBuffer::flushTimeSet)
epicsUInt16 timeEvent() const
struct EVRMRMTSBuffer::ebuf_t ebufs[2]
virtual void unlock() const OVERRIDE FINAL
virtual void unlock() const OVERRIDE FINAL