bool PVTimeStamp::set(TimeStamp const & timeStamp) { if(pvSecs.get()==NULL) { throw std::logic_error(notAttached); } if(pvSecs->isImmutable() || pvNano->isImmutable()) return false; pvSecs->put(timeStamp.getSecondsPastEpoch()); pvUserTag->put(timeStamp.getUserTag()); pvNano->put(timeStamp.getNanoseconds()); return true; }
void NTNDArrayConverter::toTimeStamp (NDArray *dest) { PVStructurePtr src(m_array->getTimeStamp()); if(!src.get()) return; PVTimeStamp pvSrc; pvSrc.attach(src); TimeStamp ts; pvSrc.get(ts); dest->epicsTS.secPastEpoch = ts.getSecondsPastEpoch(); dest->epicsTS.nsec = ts.getNanoseconds(); }