# ========================================================
# Andor CMOS USB cameras, uisng the ADAndor3 AreaDetector module (which uses the Andor3 SDK)
# For help, see: https://areadetector.github.io/areaDetector/ADAndor3/ADAndorDoc.html
# ========================================================

# ********************************************************************************************
# andor3Config(const char *portName, const char *cameraSerial, int maxBuffers,
#              size_t maxMemory, int priority, int stackSize,
#              int maxFrames)
#
# The camera serial number may be printed on the camera.
# Alternatively, one can find the serial number by running the "andor3ListDevices" executable,
# which is included in this application.
# ********************************************************************************************
andor3Config("PS$(ID)", "$(CAMERA)", 0, 0, 0, 0, 100)

cd("db/")

########################################################################
# Andor3 camera (ADAndor3)
dbLoadRecords("andor3.template", "P=$(PREFIX)$(ID),R=:,PORT=PS$(ID),ADDR=0,TIMEOUT=1")
########################################################################

########################################################################
# Time stamp source
registerUserTimeStampSource("PS$(ID)", "TimeStampSource")
dbLoadRecords("timeStampSource.db", "DEV=$(PREFIX)$(ID),PORT=PS$(ID),SNAM=1000,EVNTC=$(EVENT)")
########################################################################

########################################################################
# Some extras

dbLoadRecords("profile.template","P=$(PREFIX), ID=$(ID), XSIZE=$(XSIZE), X_OFF=$(X_OFF), YSIZE=$(YSIZE), Y_OFF=$(Y_OFF), RESOLUTION=$(RESOLUTION), PREC=1, EGU=$(EGU)")
#dbLoadRecords("profile2.template","P=$(PREFIX), ID=$(ID), XSIZE=$(XSIZE), X_OFF=$(X_OFF), YSIZE=$(YSIZE), Y_OFF=$(Y_OFF), RESOLUTION=$(RESOLUTION), PREC=1, EGU=$(EGU)")
dbLoadRecords("camera_extras.db","P=$(PREFIX), ID=$(ID), XSIZE=$(XSIZE), X_OFF=$(X_OFF), YSIZE=$(YSIZE), Y_OFF=$(Y_OFF), RESOLUTION=$(RESOLUTION), PREC=1, EGU=$(EGU)")
########################################################################

< ../iocBoot/common/st.cmd.ad

cd("../")

# End of file

