diff --git a/aravisApp/Db/aravisCamera.template b/aravisApp/Db/aravisCamera.template index 21993ed..ff1034a 100644 --- a/aravisApp/Db/aravisCamera.template +++ b/aravisApp/Db/aravisCamera.template @@ -205,3 +205,24 @@ record(mbbo, "$(P)$(R)ARShiftBits") { field(PINI, "1") info(autosaveFields, "DESC ZRSV ONSV VAL") } + +record(mbbo, "$(P)$(R)TimeStampMode") { + field(DTYP, "asynInt32") + field(OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))ARAVIS_TIME_STAMP_MODE") + field(ZRST, "Camera") + field(ZRVL, "0") + field(ONST, "System") + field(ONVL, "1") + field(PINI, "1") + info(autosaveFields, "VAL") +} + +record(mbbi, "$(P)$(R)TimeStampMode_RBV") { + field(DTYP, "asynInt32") + field(INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))ARAVIS_TIME_STAMP_MODE") + field(ZRST, "Camera") + field(ZRVL, "0") + field(ONST, "System") + field(ONVL, "1") + field(SCAN, "I/O Intr") +} diff --git a/aravisApp/op/edl/aravisCamera.edl b/aravisApp/op/edl/aravisCamera.edl index 43880aa..2e28985 100644 --- a/aravisApp/op/edl/aravisCamera.edl +++ b/aravisApp/op/edl/aravisCamera.edl @@ -4,7 +4,7 @@ major 4 minor 0 release 1 x 1246 -y 481 +y 592 w 390 h 350 font "arial-bold-r-12.0" @@ -246,290 +246,6 @@ visMin "3" visMax "4" endObjectProperties -# (Group) -object activeGroupClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 195 -y 25 -w 185 -h 70 - -beginGroup - -# (Group) -object activeGroupClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 195 -y 75 -w 185 -h 20 - -beginGroup - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 290 -y 75 -w 90 -h 20 -fgColor index 25 -onColor index 3 -offColor index 3 -topShadowColor index 1 -botShadowColor index 11 -controlPv "$(P)$(R)ARResetCamera.PROC" -pressValue "1" -onLabel "Reconnect" -offLabel "Reconnect" -3d -font "arial-bold-r-12.0" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 205 -y 75 -w 85 -h 20 -font "arial-bold-r-12.0" -fgColor index 14 -bgColor index 3 -useDisplayBg -value { - "Reset Cam" -} -endObjectProperties - -# (Related Display) -object relatedDisplayClass -beginObjectProperties -major 4 -minor 4 -release 0 -x 195 -y 75 -w 10 -h 20 -fgColor index 14 -bgColor index 3 -topShadowColor index 1 -botShadowColor index 11 -font "arial-bold-r-10.0" -xPosOffset -100 -yPosOffset -85 -useFocus -buttonLabel "?" -numPvs 4 -numDsps 1 -displayFileName { - 0 "aravisHelp" -} -setPosition { - 0 "button" -} -symbols { - 0 "desc0=Click this button if your camera stops communicating or acquiring.,desc1=It will do a reconnect,desc2='',desc3='',desc4='',desc5=''" -} -endObjectProperties - -endGroup - -endObjectProperties - -# (Group) -object activeGroupClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 195 -y 50 -w 185 -h 20 - -beginGroup - -# (Menu Button) -object activeMenuButtonClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 290 -y 50 -w 90 -h 20 -fgColor index 25 -bgColor index 3 -inconsistentColor index 0 -topShadowColor index 1 -botShadowColor index 11 -controlPv "$(P)$(R)ARHWImageMode" -indicatorPv "$(P)$(R)ARHWImageMode_RBV" -font "arial-bold-r-12.0" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 205 -y 50 -w 85 -h 20 -font "arial-bold-r-12.0" -fgColor index 14 -bgColor index 3 -useDisplayBg -value { - "HW Img Mode" -} -endObjectProperties - -# (Related Display) -object relatedDisplayClass -beginObjectProperties -major 4 -minor 4 -release 0 -x 195 -y 50 -w 10 -h 20 -fgColor index 14 -bgColor index 3 -topShadowColor index 1 -botShadowColor index 11 -font "arial-bold-r-10.0" -xPosOffset -100 -yPosOffset -85 -useFocus -buttonLabel "?" -numPvs 4 -numDsps 1 -displayFileName { - 0 "aravisHelp" -} -setPosition { - 0 "button" -} -symbols { - 0 "desc0=When this is On the image mode is set on the camera directly. On Off a software ,desc1=implementation is used.,desc2=Software implementation does not guarantee that only the configured number of ,desc3=acquisitions is triggered on the camera but it is faster and does not cap the ,desc4=number of frames in multiple mode with the register size on the camera.,desc5=''" -} -endObjectProperties - -endGroup - -endObjectProperties - -# (Group) -object activeGroupClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 195 -y 25 -w 185 -h 20 - -beginGroup - -# (Menu Button) -object activeMenuButtonClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 290 -y 25 -w 90 -h 20 -fgColor index 25 -bgColor index 3 -inconsistentColor index 0 -topShadowColor index 1 -botShadowColor index 11 -controlPv "$(P)$(R)ARLeftShift" -indicatorPv "$(P)$(R)ARLeftShift_RBV" -font "arial-bold-r-12.0" -endObjectProperties - -# (Related Display) -object relatedDisplayClass -beginObjectProperties -major 4 -minor 4 -release 0 -x 195 -y 25 -w 10 -h 20 -fgColor index 14 -bgColor index 3 -topShadowColor index 1 -botShadowColor index 11 -font "arial-bold-r-10.0" -xPosOffset -100 -yPosOffset -85 -useFocus -buttonLabel "?" -numPvs 4 -numDsps 1 -displayFileName { - 0 "aravisHelp" -} -setPosition { - 0 "button" -} -symbols { - 0 "desc0=If set to Yes: 10 12 and 14 bit frames will be left shifted so they occupy the most,desc1=significant bits of the 16 bit frame,desc2='',desc3='',desc4='',desc5=''" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 205 -y 25 -w 85 -h 20 -font "arial-bold-r-12.0" -fgColor index 14 -bgColor index 3 -useDisplayBg -value { - "Left shift data" -} -endObjectProperties - -endGroup - -endObjectProperties - -endGroup - -endObjectProperties - # (Group) object activeGroupClass beginObjectProperties @@ -1092,8 +808,265 @@ beginObjectProperties major 4 minor 4 release 0 -x 10 -y 245 +x 10 +y 245 +w 10 +h 20 +fgColor index 14 +bgColor index 3 +topShadowColor index 1 +botShadowColor index 11 +font "arial-bold-r-10.0" +xPosOffset -100 +yPosOffset -85 +useFocus +buttonLabel "?" +numPvs 4 +numDsps 1 +displayFileName { + 0 "aravisHelp" +} +setPosition { + 0 "button" +} +symbols { + 0 "desc0=BalanceRatioSelector: Select the Red or Blue channel to adjust with ,desc1=BalanceRatioAbs. ,desc2='',desc3='',desc4='',desc5=''" +} +endObjectProperties + +# (Related Display) +object relatedDisplayClass +beginObjectProperties +major 4 +minor 4 +release 0 +x 10 +y 270 +w 10 +h 20 +fgColor index 14 +bgColor index 3 +topShadowColor index 1 +botShadowColor index 11 +font "arial-bold-r-10.0" +xPosOffset -100 +yPosOffset -85 +useFocus +buttonLabel "?" +numPvs 4 +numDsps 1 +displayFileName { + 0 "aravisHelp" +} +setPosition { + 0 "button" +} +symbols { + 0 "desc0=BalanceRatioAbs: Adjust the gain of the red or blue channel (see ,desc1=BalanceRatioSelector). The green channel gain is always 1.00. ,desc2='',desc3='',desc4='',desc5=''" +} +endObjectProperties + +# (Related Display) +object relatedDisplayClass +beginObjectProperties +major 4 +minor 4 +release 0 +x 205 +y 145 +w 10 +h 20 +fgColor index 14 +bgColor index 3 +topShadowColor index 1 +botShadowColor index 11 +font "arial-bold-r-10.0" +xPosOffset -100 +yPosOffset -85 +useFocus +buttonLabel "?" +numPvs 4 +numDsps 1 +displayFileName { + 0 "aravisHelp" +} +setPosition { + 0 "button" +} +symbols { + 0 "desc0=ExposureAuto: Automatic exposure mode. Off: automatic mode is off. Once: ,desc1=auto-exposure occurs until target is achieved; then ExposureAuto returns to Off. ,desc2=Continuous: auto-exposure always runs. ,desc3='',desc4='',desc5=''" +} +endObjectProperties + +# (Related Display) +object relatedDisplayClass +beginObjectProperties +major 4 +minor 4 +release 0 +x 205 +y 170 +w 10 +h 20 +fgColor index 14 +bgColor index 3 +topShadowColor index 1 +botShadowColor index 11 +font "arial-bold-r-10.0" +xPosOffset -100 +yPosOffset -85 +useFocus +buttonLabel "?" +numPvs 4 +numDsps 1 +displayFileName { + 0 "aravisHelp" +} +setPosition { + 0 "button" +} +symbols { + 0 "desc0=ExposureAutoTarget: When ExposureAutoAlg is Mean; this is the target image mean ,desc1=value; in percent. Higher values result in brighter images. ,desc2='',desc3='',desc4='',desc5=''" +} +endObjectProperties + +# (Related Display) +object relatedDisplayClass +beginObjectProperties +major 4 +minor 4 +release 0 +x 205 +y 220 +w 10 +h 20 +fgColor index 14 +bgColor index 3 +topShadowColor index 1 +botShadowColor index 11 +font "arial-bold-r-10.0" +xPosOffset -100 +yPosOffset -85 +useFocus +buttonLabel "?" +numPvs 4 +numDsps 1 +displayFileName { + 0 "aravisHelp" +} +setPosition { + 0 "button" +} +symbols { + 0 "desc0=TriggerSource: Source of trigger; when TriggerMode is On. This might be an ,desc1=hardware trigger; a fixed rate generator; or software trigger only. ,desc2='',desc3='',desc4='',desc5=''" +} +endObjectProperties + +# (Static Text) +object activeXTextClass +beginObjectProperties +major 4 +minor 1 +release 1 +x 215 +y 220 +w 110 +h 20 +font "arial-bold-r-10.0" +fgColor index 14 +bgColor index 3 +useDisplayBg +value { + "TriggerSource" +} +endObjectProperties + +# (Menu Button) +object activeMenuButtonClass +beginObjectProperties +major 4 +minor 0 +release 0 +x 285 +y 220 +w 95 +h 20 +fgColor index 25 +bgColor index 3 +inconsistentColor index 0 +topShadowColor index 1 +botShadowColor index 11 +controlPv "$(P)$(R)TriggerSource" +indicatorPv "$(P)$(R)TriggerSource_RBV" +font "arial-bold-r-12.0" +endObjectProperties + +# (Static Text) +object activeXTextClass +beginObjectProperties +major 4 +minor 1 +release 1 +x 200 +y 205 +w 53 +h 13 +font "arial-medium-r-12.0" +fontAlign "center" +fgColor index 14 +bgColor index 5 +value { + " Trigger " +} +autoSize +border +endObjectProperties + +endGroup + +endObjectProperties + +# (Group) +object activeGroupClass +beginObjectProperties +major 4 +minor 0 +release 0 +x 195 +y 100 +w 185 +h 20 + +beginGroup + +# (Menu Button) +object activeMenuButtonClass +beginObjectProperties +major 4 +minor 0 +release 0 +x 290 +y 100 +w 90 +h 20 +fgColor index 25 +bgColor index 3 +inconsistentColor index 0 +topShadowColor index 1 +botShadowColor index 11 +controlPv "$(P)$(R)TimeStampMode" +indicatorPv "$(P)$(R)TimeStampMode_RBV" +font "arial-bold-r-12.0" +endObjectProperties + +# (Related Display) +object relatedDisplayClass +beginObjectProperties +major 4 +minor 4 +release 0 +x 195 +y 100 w 10 h 20 fgColor index 14 @@ -1114,39 +1087,85 @@ setPosition { 0 "button" } symbols { - 0 "desc0=BalanceRatioSelector: Select the Red or Blue channel to adjust with ,desc1=BalanceRatioAbs. ,desc2='',desc3='',desc4='',desc5=''" + 0 "desc0=Whether the timestamp comes from the camera or from the system,desc2='',desc3='',desc4='',desc5=''" } endObjectProperties -# (Related Display) -object relatedDisplayClass +# (Static Text) +object activeXTextClass beginObjectProperties major 4 -minor 4 -release 0 -x 10 -y 270 -w 10 +minor 1 +release 1 +x 205 +y 100 +w 85 h 20 +font "arial-bold-r-12.0" fgColor index 14 bgColor index 3 +useDisplayBg +value { + "TS Mode" +} +endObjectProperties + +endGroup + +endObjectProperties + +# (Group) +object activeGroupClass +beginObjectProperties +major 4 +minor 0 +release 0 +x 195 +y 75 +w 185 +h 20 + +beginGroup + +# (Message Button) +object activeMessageButtonClass +beginObjectProperties +major 4 +minor 1 +release 0 +x 290 +y 75 +w 90 +h 20 +fgColor index 25 +onColor index 3 +offColor index 3 topShadowColor index 1 botShadowColor index 11 -font "arial-bold-r-10.0" -xPosOffset -100 -yPosOffset -85 -useFocus -buttonLabel "?" -numPvs 4 -numDsps 1 -displayFileName { - 0 "aravisHelp" -} -setPosition { - 0 "button" -} -symbols { - 0 "desc0=BalanceRatioAbs: Adjust the gain of the red or blue channel (see ,desc1=BalanceRatioSelector). The green channel gain is always 1.00. ,desc2='',desc3='',desc4='',desc5=''" +controlPv "$(P)$(R)ARResetCamera.PROC" +pressValue "1" +onLabel "Reconnect" +offLabel "Reconnect" +3d +font "arial-bold-r-12.0" +endObjectProperties + +# (Static Text) +object activeXTextClass +beginObjectProperties +major 4 +minor 1 +release 1 +x 205 +y 75 +w 85 +h 20 +font "arial-bold-r-12.0" +fgColor index 14 +bgColor index 3 +useDisplayBg +value { + "Reset Cam" } endObjectProperties @@ -1156,8 +1175,8 @@ beginObjectProperties major 4 minor 4 release 0 -x 205 -y 145 +x 195 +y 75 w 10 h 20 fgColor index 14 @@ -1178,7 +1197,63 @@ setPosition { 0 "button" } symbols { - 0 "desc0=ExposureAuto: Automatic exposure mode. Off: automatic mode is off. Once: ,desc1=auto-exposure occurs until target is achieved; then ExposureAuto returns to Off. ,desc2=Continuous: auto-exposure always runs. ,desc3='',desc4='',desc5=''" + 0 "desc0=Click this button if your camera stops communicating or acquiring.,desc1=It will do a reconnect,desc2='',desc3='',desc4='',desc5=''" +} +endObjectProperties + +endGroup + +endObjectProperties + +# (Group) +object activeGroupClass +beginObjectProperties +major 4 +minor 0 +release 0 +x 195 +y 50 +w 185 +h 20 + +beginGroup + +# (Menu Button) +object activeMenuButtonClass +beginObjectProperties +major 4 +minor 0 +release 0 +x 290 +y 50 +w 90 +h 20 +fgColor index 25 +bgColor index 3 +inconsistentColor index 0 +topShadowColor index 1 +botShadowColor index 11 +controlPv "$(P)$(R)ARHWImageMode" +indicatorPv "$(P)$(R)ARHWImageMode_RBV" +font "arial-bold-r-12.0" +endObjectProperties + +# (Static Text) +object activeXTextClass +beginObjectProperties +major 4 +minor 1 +release 1 +x 205 +y 50 +w 85 +h 20 +font "arial-bold-r-12.0" +fgColor index 14 +bgColor index 3 +useDisplayBg +value { + "HW Img Mode" } endObjectProperties @@ -1188,8 +1263,8 @@ beginObjectProperties major 4 minor 4 release 0 -x 205 -y 170 +x 195 +y 50 w 10 h 20 fgColor index 14 @@ -1210,18 +1285,55 @@ setPosition { 0 "button" } symbols { - 0 "desc0=ExposureAutoTarget: When ExposureAutoAlg is Mean; this is the target image mean ,desc1=value; in percent. Higher values result in brighter images. ,desc2='',desc3='',desc4='',desc5=''" + 0 "desc0=When this is On the image mode is set on the camera directly. On Off a software ,desc1=implementation is used.,desc2=Software implementation does not guarantee that only the configured number of ,desc3=acquisitions is triggered on the camera but it is faster and does not cap the ,desc4=number of frames in multiple mode with the register size on the camera.,desc5=''" } endObjectProperties +endGroup + +endObjectProperties + +# (Group) +object activeGroupClass +beginObjectProperties +major 4 +minor 0 +release 0 +x 195 +y 25 +w 185 +h 20 + +beginGroup + +# (Menu Button) +object activeMenuButtonClass +beginObjectProperties +major 4 +minor 0 +release 0 +x 290 +y 25 +w 90 +h 20 +fgColor index 25 +bgColor index 3 +inconsistentColor index 0 +topShadowColor index 1 +botShadowColor index 11 +controlPv "$(P)$(R)ARLeftShift" +indicatorPv "$(P)$(R)ARLeftShift_RBV" +font "arial-bold-r-12.0" +endObjectProperties + # (Related Display) object relatedDisplayClass beginObjectProperties major 4 minor 4 release 0 -x 205 -y 220 +x 195 +y 25 w 10 h 20 fgColor index 14 @@ -1242,7 +1354,7 @@ setPosition { 0 "button" } symbols { - 0 "desc0=TriggerSource: Source of trigger; when TriggerMode is On. This might be an ,desc1=hardware trigger; a fixed rate generator; or software trigger only. ,desc2='',desc3='',desc4='',desc5=''" + 0 "desc0=If set to Yes: 10 12 and 14 bit frames will be left shifted so they occupy the most,desc1=significant bits of the 16 bit frame,desc2='',desc3='',desc4='',desc5=''" } endObjectProperties @@ -1252,58 +1364,17 @@ beginObjectProperties major 4 minor 1 release 1 -x 215 -y 220 -w 110 +x 205 +y 25 +w 85 h 20 -font "arial-bold-r-10.0" +font "arial-bold-r-12.0" fgColor index 14 bgColor index 3 useDisplayBg value { - "TriggerSource" -} -endObjectProperties - -# (Menu Button) -object activeMenuButtonClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 285 -y 220 -w 95 -h 20 -fgColor index 25 -bgColor index 3 -inconsistentColor index 0 -topShadowColor index 1 -botShadowColor index 11 -controlPv "$(P)$(R)TriggerSource" -indicatorPv "$(P)$(R)TriggerSource_RBV" -font "arial-bold-r-12.0" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 200 -y 205 -w 53 -h 13 -font "arial-medium-r-12.0" -fontAlign "center" -fgColor index 14 -bgColor index 5 -value { - " Trigger " + "Left shift data" } -autoSize -border endObjectProperties endGroup diff --git a/aravisApp/src/ADAravis.cpp b/aravisApp/src/ADAravis.cpp index 6910fd3..9531147 100644 --- a/aravisApp/src/ADAravis.cpp +++ b/aravisApp/src/ADAravis.cpp @@ -185,7 +185,8 @@ class ADAravis : public ADGenICam, epicsThreadRunable { int AravisShiftBits; int AravisConnection; int AravisReset; - #define LAST_ARAVIS_CAMERA_PARAM AravisReset + int AravisTimestampMode; + #define LAST_ARAVIS_CAMERA_PARAM AravisTimestampMode private: asynStatus allocBuffer(); @@ -356,6 +357,7 @@ ADAravis::ADAravis(const char *portName, const char *cameraName, int enableCachi createParam("ARAVIS_SHIFT_BITS", asynParamInt32, &AravisShiftBits); createParam("ARAVIS_CONNECTION", asynParamInt32, &AravisConnection); createParam("ARAVIS_RESET", asynParamInt32, &AravisReset); + createParam("ARAVIS_TIME_STAMP_MODE", asynParamInt32, &AravisTimestampMode); /* Set some initial values for other parameters */ setStringParam(NDDriverVersion, DRIVER_VERSION); @@ -587,8 +589,11 @@ asynStatus ADAravis::writeInt32(asynUser *pasynUser, epicsInt32 value) status = asynError; } else if (function == AravisConnection) { if (this->connectionValid != 1) status = asynError; - } else if (function == AravisFrameRetention || function == AravisPktResend || function == AravisPktTimeout || - function == AravisShiftDir || function == AravisShiftBits || function == AravisConvertPixelFormat) { + } else if (function == AravisFrameRetention || + function == AravisPktResend || function == AravisPktTimeout || + function == AravisShiftDir || function == AravisShiftBits || + function == AravisConvertPixelFormat || + function == AravisTimestampMode) { /* just write the value for these as they get fetched via getIntegerParam when needed */ status = setIntegerParam(function, value); } else if ((function < FIRST_ARAVIS_CAMERA_PARAM) || (function > LAST_ARAVIS_CAMERA_PARAM)) { @@ -801,7 +806,13 @@ asynStatus ADAravis::processBuffer(ArvBuffer *buffer) { /* Put the frame number and time stamp into the buffer */ pRaw->uniqueId = imageCounter; - pRaw->timeStamp = arv_buffer_get_timestamp(buffer) / 1.e9; + int timestampMode; + getIntegerParam(AravisTimestampMode, ×tampMode); + if (timestampMode) { + pRaw->timeStamp = arv_buffer_get_system_timestamp(buffer) / 1.e9; + } else { + pRaw->timeStamp = arv_buffer_get_timestamp(buffer) / 1.e9; + } /* Update the areaDetector timeStamp */ updateTimeStamp(&pRaw->epicsTS);