Merge branch 'frame_timestamp' into 'dev'
Add TimeStamp PV collect from camera removing the exp_time + readoutTime See merge request epics-modules/adhama!5
This commit is contained in:
@@ -109,6 +109,15 @@ record(calc, "$(P)$(R)EVRTime-R") {
|
||||
field(INPB, "$(P)$(R)#EVRTimeProc")
|
||||
}
|
||||
|
||||
record(ai, "$(P)$(R)TimeStamp-RB") {
|
||||
field(DESC, "DCAM Timestamp when trigger received")
|
||||
field(DTYP, "asynFloat64")
|
||||
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))H_TIMESTAMP")
|
||||
field(PREC, "3")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(PINI, "YES")
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
# General properties #
|
||||
##########################################################################
|
||||
|
||||
+10
-1
@@ -181,6 +181,7 @@ Hama::Hama(const char* portName, int cameraId, int maxBuffers, size_t maxMemory,
|
||||
createParam( hImageDetectorPixelNumVertString, asynParamInt32, &hImageDetectorPixelNumVert);
|
||||
createParam( hTimeStampProducerString, asynParamInt32, &hTimeStampProducer);
|
||||
createParam( hFrameStampProducerString, asynParamInt32, &hFrameStampProducer);
|
||||
createParam( hTimeStampString, asynParamFloat64, &hTimeStamp);
|
||||
|
||||
|
||||
setIntegerParam(NDArrayCallbacks, 1);
|
||||
@@ -672,7 +673,15 @@ void Hama::imageTask(){
|
||||
accessCapturedImage(m_hdcam, captransferinfo.nNewestFrameIndex, image,
|
||||
width * 2, width, height, ts_sec, ts_microsec);
|
||||
|
||||
// printf("Timestamp from camera: %d\n", ts_sec + ts_microsec);
|
||||
double exposure_time, readout_time, timestamp;
|
||||
dcamprop_getvalue(m_hdcam, DCAM_IDPROP_TIMING_READOUTTIME, &readout_time);
|
||||
dcamprop_getvalue(m_hdcam, DCAM_IDPROP_EXPOSURETIME, &exposure_time);
|
||||
timestamp = (ts_sec + ts_microsec / 1.0e6) - (exposure_time + readout_time);
|
||||
status = setDoubleParam(hTimeStamp, timestamp);
|
||||
|
||||
//printf("Timestamp from camera: %f\n", (ts_sec + ts_microsec / 1.0e6));
|
||||
//printf("Timestamp from camera with correction: %f\n", timestamp);
|
||||
|
||||
getIntegerParam(NDArrayCallbacks, &callback);
|
||||
if(callback) {
|
||||
|
||||
|
||||
@@ -128,6 +128,7 @@
|
||||
#define hImageDetectorPixelNumVertString "H_IMAGE_DETECTOR_PIXEL_NUM_VERT" /* asynInt32 ro */
|
||||
#define hTimeStampProducerString "H_TIMESTAMP_PRODUCER" /* asynInt32 ro */
|
||||
#define hFrameStampProducerString "H_FRAMESTAMP_PRODUCER" /* asynInt32 ro */
|
||||
#define hTimeStampString "H_TIMESTAMP" /* asynFloat64 ro */
|
||||
|
||||
// For some reason these two addresses are not defined in the dcamapi4 neither in dcamprop.h
|
||||
#define DETECTOR_PIXEL_NUM_HORZ 0x00420830
|
||||
@@ -249,7 +250,8 @@ protected:
|
||||
int hImageDetectorPixelNumVert;
|
||||
int hTimeStampProducer;
|
||||
int hFrameStampProducer;
|
||||
#define LAST_HAMA_PARAM hFrameStampProducer
|
||||
int hTimeStamp;
|
||||
#define LAST_HAMA_PARAM hTimeStamp
|
||||
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user