Closed stuwilkins closed 8 years ago
case PSTimestampTypeIOC: { timespec ts; epicsTimeToTimespec(&ts, &pImage->epicsTS); pImage->timeStamp = (double)ts.tv_sec + ((double)ts.tv_nsec * 1.0e-9);
Would the above be simpler as: case PSTimestampTypeIOC: { pImage->timeStamp = (double)pImage->epicsTS.secPastEpoch + ((double)pImage->epicsTS.nsec * 1.0e-9);
Why convert to timespec? Do they have different epoch?
OK... that is my misunderstanding of the EPICS time routines, I thought converting back to a time spec always ensures that EPOCHs are handled correctly .... that being said what you propose is better modulo what the Epoch is for the pImage->epicsTS
is. Is this just the EPOCH for the platform that the system is running on? what does updatetimestamp()
do in pImage?
I made the changes you suggested ... tested and re-pushed.
On Nov 1, 2015, at 09:39, Mark Rivers notifications@github.com<mailto:notifications@github.com> wrote:
case PSTimestampTypeIOC: { timespec ts; epicsTimeToTimespec(&ts, &pImage->epicsTS); pImage->timeStamp = (double)ts.tv_sec + ((double)ts.tv_nsec * 1.0e-9);
Would the above be simpler as: case PSTimestampTypeIOC: { pImage->timeStamp = (double)pImage->epicsTS.secPastEpoch + ((double)pImage->epicsTS.nsec * 1.0e-9);
Why convert to timespec? Do they have different epoch?
— Reply to this email directly or view it on GitHubhttps://github.com/areaDetector/ADProsilica/pull/14#issuecomment-152830723.
This PR does come cleanup with the timestamping for the Prosilica.
1) The function
syncTimer()
is called on successful camera connect. This ensures that the synced timestamp options to set thepImage->timeStamp
are actually synced. Currently if the PV associated with syncing the timestamp is not set, this is uninitialized.2) Added a new option which is IOC time. This ensures that the EPICS timestamp and the
pImage->timeStamp
are in sync. For most users I can see this as being the default option.3) The other modes (sync the camera with IOC) can be used when absolute precision between frames is needed and these are left as is.
One consideration would be to now make the "IOC" option the default ..... Thoughts?