From 7641988b51bce42cfc7e2b2b0218a1afc28a9650 Mon Sep 17 00:00:00 2001 From: Hinko Kocevar Date: Tue, 18 Dec 2018 15:23:38 +0100 Subject: [PATCH] use device serial number to select the camera (0 for any camera) --- andorApp/src/andorCCD.cpp | 51 ++++++++++++++++++--------- andorApp/src/andorCCD.h | 2 +- iocs/andorIOC/iocBoot/iocAndor/st.cmd | 7 ++-- 3 files changed, 41 insertions(+), 19 deletions(-) diff --git a/andorApp/src/andorCCD.cpp b/andorApp/src/andorCCD.cpp index 83e842f..adb5b13 100755 --- a/andorApp/src/andorCCD.cpp +++ b/andorApp/src/andorCCD.cpp @@ -101,8 +101,7 @@ static void exitHandler(void *drvPvt); * \param[in] installPath The path to the Andor directory containing the detector INI files, etc. * This can be specified as an empty string ("") for new detectors that don't use the INI * files on Windows, but must be a valid path on Linux. - * \param[in] cameraID The index number of the desired camera. - * 0 is the first camera in the system. + * \param[in] cameraSerial The serial number of the desired camera. * \param[in] shamrockID The index number of the Shamrock spectrograph, if installed. * 0 is the first Shamrock in the system. Ignored if there are no Shamrocks. * \param[in] maxBuffers The maximum number of NDArray buffers that the NDArrayPool for this driver is @@ -112,7 +111,7 @@ static void exitHandler(void *drvPvt); * \param[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags. * \param[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags. */ -AndorCCD::AndorCCD(const char *portName, const char *installPath, int cameraID, int shamrockID, +AndorCCD::AndorCCD(const char *portName, const char *installPath, int cameraSerial, int shamrockID, int maxBuffers, size_t maxMemory, int priority, int stackSize) : ADDriver(portName, 1, NUM_ANDOR_DET_PARAMS, maxBuffers, maxMemory, @@ -195,18 +194,37 @@ AndorCCD::AndorCCD(const char *portName, const char *installPath, int cameraID, try { epicsInt32 numCameras; checkStatus(GetAvailableCameras(&numCameras)); - if (cameraID < numCameras) { - epicsInt32 cameraHandle; - checkStatus(GetCameraHandle(cameraID, &cameraHandle)); + bool cameraFound = false; + for (i=0; i