#include <mrmtimesrc.h>
Definition at line 16 of file mrmtimesrc.h.
◆ TimeStampSource()
TimeStampSource::TimeStampSource |
( |
double |
period | ) |
|
|
explicit |
Definition at line 143 of file mrmtimesrc.cpp.
144 :impl(
new Impl(
this, period))
void resyncSecond()
Call to re-initialize timestamp counter from system time.
◆ ~TimeStampSource()
TimeStampSource::~TimeStampSource |
( |
| ) |
|
|
virtual |
◆ deltaSeconds()
double TimeStampSource::deltaSeconds |
( |
| ) |
const |
last difference between
Definition at line 224 of file mrmtimesrc.cpp.
epicsGuard< epicsMutex > Guard
◆ isSoftSeconds()
bool TimeStampSource::isSoftSeconds |
( |
| ) |
const |
Definition at line 263 of file mrmtimesrc.cpp.
267 return !!impl->softsrc.get();
epicsGuard< epicsMutex > Guard
◆ nextSecond()
std::string TimeStampSource::nextSecond |
( |
| ) |
const |
Definition at line 273 of file mrmtimesrc.cpp.
278 raw.secPastEpoch = impl->
next - POSIX_TIME_AT_EPICS_EPOCH;
283 std::vector<char> buf(40);
285 buf.resize(time.strftime(&buf[0], buf.size(),
"%a, %d %b %Y %H:%M:%S"));
288 return std::string(&buf[0], buf.size());
epicsGuard< epicsMutex > Guard
◆ postSoftSecondsSrc()
virtual void TimeStampSource::postSoftSecondsSrc |
( |
| ) |
|
|
inlineprotectedvirtual |
Reimplemented in evgMrm.
Definition at line 45 of file mrmtimesrc.h.
void tickSecond()
Call just after the start of each second.
◆ resyncSecond()
void TimeStampSource::resyncSecond |
( |
| ) |
|
Call to re-initialize timestamp counter from system time.
Definition at line 154 of file mrmtimesrc.cpp.
epicsGuard< epicsMutex > Guard
◆ setEvtCode()
virtual void TimeStampSource::setEvtCode |
( |
epicsUInt32 |
evtCode | ) |
|
|
protectedpure virtual |
◆ softSecondsSrc()
void TimeStampSource::softSecondsSrc |
( |
bool |
enable | ) |
|
enable sending of event 125 by software timer. Simulation of external HW clock
Definition at line 231 of file mrmtimesrc.cpp.
234 mrf::auto_ptr<epicsThread> cleanup;
237 if(enable && !impl->softsrc.get()) {
239 impl->stopsrc =
false;
240 impl->softsrc.reset(
new epicsThread(impl->softsrcRun,
242 epicsThreadGetStackSize(epicsThreadStackSmall),
243 epicsThreadPriorityHigh));
244 impl->softsrc->start();
248 }
else if(!enable && impl->softsrc.get()) {
249 impl->stopsrc =
true;
250 cleanup = PTRMOVE(impl->softsrc);
259 throw std::runtime_error(
"Soft timestamp source not supported");
void resyncSecond()
Call to re-initialize timestamp counter from system time.
epicsGuard< epicsMutex > Guard
◆ tickSecond()
void TimeStampSource::tickSecond |
( |
| ) |
|
Call just after the start of each second.
Definition at line 160 of file mrmtimesrc.cpp.
162 epicsUInt32 tosend=0;
174 if(ok && valid && impl->
resync) {
175 impl->
next = ts.secPastEpoch+POSIX_TIME_AT_EPICS_EPOCH+1;
187 impl->
lastError = double(tosend) - (ts.secPastEpoch+POSIX_TIME_AT_EPICS_EPOCH);
196 epicsThreadGetStackSize(epicsThreadStackSmall)));
205 for(
unsigned i = 0; i < 32; tosend <<= 1, i++) {
207 if( tosend & 0x80000000 )
211 }
catch(std::exception& e){
212 errlogPrintf(
"Soft timestamp source can't send shift event: %s\n", e.what());
virtual void setEvtCode(epicsUInt32 evtCode)=0
mrf::auto_ptr< epicsThread > timeout
#define MRF_EVENT_TS_SHIFT_0
#define MRF_EVENT_TS_SHIFT_1
#define ER_PROVIDER_PRIORITY
Priority given to EVR's timestamp/event provider.
epicsThreadRunableMethod< Impl, &Impl::runTimeout > timeoutRun
epicsGuard< epicsMutex > Guard
◆ validSeconds()
bool TimeStampSource::validSeconds |
( |
| ) |
const |
The documentation for this class was generated from the following files: