diff --git a/andorApp/src/andorCCD.cpp b/andorApp/src/andorCCD.cpp index 6640276..fcb72d0 100755 --- a/andorApp/src/andorCCD.cpp +++ b/andorApp/src/andorCCD.cpp @@ -110,7 +110,7 @@ AndorCCD::AndorCCD(const char *portName, const char *installPath, int shamrockID : ADDriver(portName, 1, NUM_ANDOR_DET_PARAMS, maxBuffers, maxMemory, asynEnumMask, asynEnumMask, ASYN_CANBLOCK, 1, priority, stackSize), - mExiting(false), mShamrockId(shamrockID), mSPEDoc(0) + mExiting(false), mShamrockId(shamrockID), mSPEDoc(0), mInitOK(false) { int status = asynSuccess; @@ -156,6 +156,18 @@ AndorCCD::AndorCCD(const char *portName, const char *installPath, int shamrockID return; } + // Initialize ADC enums + for (i=0; ipasynUserSelf, ASYN_TRACE_FLOW, - "%s:%s:, SetShutter(%d,%d,%d,%d)\n", - driverName, functionName, shutterExTTL, shutterMode, closeTime, openTime); - checkStatus(SetShutter(shutterExTTL, shutterMode, closeTime, openTime)); - + capabilities.ulSize = sizeof(capabilities); + checkStatus(GetCapabilities(&capabilities)); + if (capabilities.ulFeatures & AC_FEATURES_SHUTTER) { + asynPrint(this->pasynUserSelf, ASYN_TRACE_FLOW, + "%s:%s:, SetShutter(%d,%d,%d,%d)\n", + driverName, functionName, shutterExTTL, shutterMode, closeTime, openTime); + checkStatus(SetShutter(shutterExTTL, shutterMode, closeTime, openTime)); + } } catch (const std::string &e) { asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s: %s\n", @@ -851,6 +856,8 @@ unsigned int AndorCCD::checkStatus(unsigned int returnStatus) throw std::string("ERROR: Problem communicating with camera."); } else if (returnStatus == DRV_LOAD_FIRMWARE_ERROR) { throw std::string("ERROR: Error loading firmware."); + } else if (returnStatus == DRV_NOT_SUPPORTED) { + throw std::string("ERROR: Feature not supported."); } else { sprintf(message, "ERROR: Unknown error code=%d returned from Andor SDK.", returnStatus); throw std::string(message); @@ -978,6 +985,10 @@ asynStatus AndorCCD::setupAcquisition() AndorADCSpeed_t *pSpeed; static const char *functionName = "setupAcquisition"; + if (!mInitOK) { + return asynDisabled; + } + getIntegerParam(ADImageMode, &imageMode); getIntegerParam(ADNumExposures, &numExposures); if (numExposures <= 0) { diff --git a/andorApp/src/andorCCD.h b/andorApp/src/andorCCD.h index 5ea19fe..a892e62 100755 --- a/andorApp/src/andorCCD.h +++ b/andorApp/src/andorCCD.h @@ -209,6 +209,8 @@ class AndorCCD : public ADDriver { tagCSMAHEAD *mSPEHeader; TiXmlDocument *mSPEDoc; + // Camera init status + bool mInitOK; }; #define NUM_ANDOR_DET_PARAMS ((int)(&LAST_ANDOR_PARAM - &FIRST_ANDOR_PARAM + 1))