streamlined time stamp usage
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
//
|
||||
// Example EPICS CA server
|
||||
//
|
||||
|
||||
#include "exServer.h"
|
||||
#include "gddApps.h"
|
||||
|
||||
@@ -68,11 +67,6 @@ void exPV::destroy()
|
||||
caStatus exPV::update(gdd &valueIn)
|
||||
{
|
||||
caServer *pCAS = this->getCAS();
|
||||
//
|
||||
// gettimeofday() is very slow under sunos4
|
||||
//
|
||||
osiTime cur (this->currentTime);
|
||||
struct timespec t;
|
||||
caStatus cas;
|
||||
|
||||
# if DEBUG
|
||||
@@ -85,9 +79,8 @@ caStatus exPV::update(gdd &valueIn)
|
||||
return cas;
|
||||
}
|
||||
|
||||
t.tv_sec = (time_t) cur.getSecTruncToLong ();
|
||||
t.tv_nsec = cur.getNSecTruncToLong ();
|
||||
this->pValue->setTimeStamp(&t);
|
||||
aitTimeStamp ts (this->currentTime);
|
||||
this->pValue->setTimeStamp (&ts);
|
||||
this->pValue->setStat (epicsAlarmNone);
|
||||
this->pValue->setSevr (epicsSevNone);
|
||||
|
||||
@@ -277,16 +270,15 @@ caStatus exPV::getSeverity(gdd &value)
|
||||
//
|
||||
inline aitTimeStamp exPV::getTS()
|
||||
{
|
||||
aitTimeStamp ts;
|
||||
if (this->pValue!=NULL) {
|
||||
aitTimeStamp ts;
|
||||
this->pValue->getTimeStamp(&ts);
|
||||
return ts;
|
||||
}
|
||||
else {
|
||||
osiTime cur(osiTime::getCurrentEPICS());
|
||||
ts.tv_sec = (time_t) cur.getSecTruncToLong ();
|
||||
ts.tv_nsec = cur.getNSecTruncToLong ();
|
||||
return osiTime::getCurrent();
|
||||
}
|
||||
return ts;
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -40,7 +40,7 @@ void exScalarPV::scan()
|
||||
// throughput under sunos4 because gettimeofday() is
|
||||
// slow)
|
||||
//
|
||||
this->currentTime = osiTime::getCurrentEPICS();
|
||||
this->currentTime = osiTime::getCurrent();
|
||||
|
||||
pDD = new gddScalar (gddAppType_value, aitEnumFloat32);
|
||||
if (pDD==NULL) {
|
||||
|
||||
@@ -63,7 +63,7 @@ void exVectorPV::scan()
|
||||
// throughput under sunos4 because gettimeofday() is
|
||||
// slow)
|
||||
//
|
||||
this->currentTime = osiTime::getCurrentEPICS();
|
||||
this->currentTime = osiTime::getCurrent();
|
||||
|
||||
pDD = new gddAtomic (gddAppType_value, aitEnumFloat32,
|
||||
1u, this->info.getElementCount());
|
||||
|
||||
Reference in New Issue
Block a user