From 2dcff4cab11755b6871b26049caf622acae227ed Mon Sep 17 00:00:00 2001 From: Edmund Blomley Date: Sat, 14 Feb 2026 07:25:58 +0100 Subject: [PATCH 1/2] Fix section with different line endings. --- andorApp/src/andorCCD.cpp | 42 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/andorApp/src/andorCCD.cpp b/andorApp/src/andorCCD.cpp index 4ac57cb..1f585eb 100755 --- a/andorApp/src/andorCCD.cpp +++ b/andorApp/src/andorCCD.cpp @@ -904,25 +904,25 @@ void AndorCCD::setupTrackDefn(int minX, int sizeX, int binX) setIntegerParam(NDArraySizeY, mMultiTrack.DataHeight()); for (size_t TrackNo = 0; TrackNo < mMultiTrack.size(); TrackNo++) { - /* - Each track must be defined by a group of six integers. - - The top and bottom positions of the tracks. - - The left and right positions for the area of interest within each track - - The horizontal and vertical binning for each track. */ - /* - Andor use 1-based exclusive co-ordinates. - e.g. from SDK manual: - 1 2 1 1024 1 1 - 3 4 1 1024 1 1 - 5 6 1 1024 1 1 - 7 8 1 1024 1 1 - 9 10 1 1024 1 1 */ - TrackDefn[TrackNo * 6 + 0] = mMultiTrack.TrackStart(TrackNo) + 1; - TrackDefn[TrackNo * 6 + 1] = mMultiTrack.TrackEnd(TrackNo) + 2; // CCDMultiTrack uses 0-based inlcusive co-ordinates. - TrackDefn[TrackNo * 6 + 2] = minX + 1; - TrackDefn[TrackNo * 6 + 3] = minX + sizeX; - TrackDefn[TrackNo * 6 + 4] = binX; - TrackDefn[TrackNo * 6 + 5] = mMultiTrack.TrackBin(TrackNo); + /* + Each track must be defined by a group of six integers. + - The top and bottom positions of the tracks. + - The left and right positions for the area of interest within each track + - The horizontal and vertical binning for each track. */ + /* + Andor use 1-based exclusive co-ordinates. + e.g. from SDK manual: + 1 2 1 1024 1 1 + 3 4 1 1024 1 1 + 5 6 1 1024 1 1 + 7 8 1 1024 1 1 + 9 10 1 1024 1 1 */ + TrackDefn[TrackNo * 6 + 0] = mMultiTrack.TrackStart(TrackNo) + 1; + TrackDefn[TrackNo * 6 + 1] = mMultiTrack.TrackEnd(TrackNo) + 2; // CCDMultiTrack uses 0-based inlcusive co-ordinates. + TrackDefn[TrackNo * 6 + 2] = minX + 1; + TrackDefn[TrackNo * 6 + 3] = minX + sizeX; + TrackDefn[TrackNo * 6 + 4] = binX; + TrackDefn[TrackNo * 6 + 5] = mMultiTrack.TrackBin(TrackNo); } checkStatus(SetCustomTrackHBin(binX)); checkStatus(SetComplexImage(int(TrackDefn.size() / ValuesPerTrack), &TrackDefn[0])); @@ -1412,8 +1412,8 @@ asynStatus AndorCCD::setupAcquisition() driverName, functionName, verticalShiftPeriod); checkStatus(SetVSSpeed(verticalShiftPeriod)); - if ((mCapabilities.ulSetFunctions & AC_SETFUNCTION_VSAMPLITUDE) != 0) - { + if ((mCapabilities.ulSetFunctions & AC_SETFUNCTION_VSAMPLITUDE) != 0) + { asynPrint(this->pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s:, SetVSAmplitude(%d)\n", driverName, functionName, verticalShiftAmplitude); From 5da054dc175b69cc2bfd96eeed1880add992499a Mon Sep 17 00:00:00 2001 From: Edmund Blomley Date: Sat, 14 Feb 2026 07:35:25 +0100 Subject: [PATCH 2/2] Add safeguards for camera models with no vertical dimensions. This was introduced in commit 81138d5a18fed14a6c145aed53668826b4858d2d and realesed with version R2-7. --- andorApp/src/andorCCD.cpp | 67 +++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/andorApp/src/andorCCD.cpp b/andorApp/src/andorCCD.cpp index 1f585eb..a1533a9 100755 --- a/andorApp/src/andorCCD.cpp +++ b/andorApp/src/andorCCD.cpp @@ -240,7 +240,15 @@ AndorCCD::AndorCCD(const char *portName, const char *installPath, int cameraSeri checkStatus(SetReadMode(ARImage)); checkStatus(SetImage(binX, binY, minX+1, minX+sizeX, minY+1, minY+sizeY)); checkStatus(GetShutterMinTimes(&mMinShutterCloseTime, &mMinShutterOpenTime)); - checkStatus(GetFastestRecommendedVSSpeed(&mVSIndex, &mVSPeriod)); + try { + checkStatus(GetFastestRecommendedVSSpeed(&mVSIndex, &mVSPeriod)); + } catch (const std::string &e) { + asynPrint(pasynUserSelf, ASYN_TRACE_WARNING, + "%s:%s: GetFastestRecommendedVSSpeed is not available: %lu: %s\n", + driverName, functionName, e.c_str()); + mVSIndex = -1; + mVSPeriod = 0.0f; + } mCapabilities.ulSize = sizeof(mCapabilities); checkStatus(GetCapabilities(&mCapabilities)); @@ -529,18 +537,23 @@ void AndorCCD::setupVerticalShiftPeriods() int i, numVSPeriods; float VSPeriod; AndorVSPeriod_t *pPeriod = mVSPeriods; + static const char *functionName = "setupVerticalShiftPeriods"; mNumVSPeriods = 0; - checkStatus(GetNumberVSSpeeds(&numVSPeriods)); - for (i=0; iIndex = i; - pPeriod->Period = VSPeriod; - epicsSnprintf(pPeriod->EnumString, MAX_ENUM_STRING_SIZE, - "%.2f us", VSPeriod); - mNumVSPeriods++; - if (mNumVSPeriods >= MAX_VS_PERIODS) return; - pPeriod++; + unsigned int error = GetNumberVSSpeeds(&mNumVSPeriods); + if (error == DRV_SUCCESS && mNumVSPeriods > 0) { + for (i=0; iIndex = i; + pPeriod->Period = VSPeriod; + epicsSnprintf(pPeriod->EnumString, MAX_ENUM_STRING_SIZE, + "%.2f us", VSPeriod); + mNumVSPeriods++; + if (mNumVSPeriods >= MAX_VS_PERIODS) return; + pPeriod++; + } + } else { + printf("%s:%s: unable to set camera parameters\n", driverName, functionName); } } @@ -608,15 +621,19 @@ void AndorCCD::report(FILE *fp, int details) mPreAmpGains[i].EnumValue, mPreAmpGains[i].Gain); } - fprintf(fp, " Vertical Shift Periods available: %d\n", mNumVSPeriods); - for (i=0; ipasynUserSelf, ASYN_TRACE_FLOW, - "%s:%s:, SetVSSpeed(%d)\n", - driverName, functionName, verticalShiftPeriod); - checkStatus(SetVSSpeed(verticalShiftPeriod)); + float s = 0.0f; + unsigned int error = GetVSSpeed(0, &s); + if (error == DRV_SUCCESS ) { + asynPrint(this->pasynUserSelf, ASYN_TRACE_FLOW, + "%s:%s:, SetVSSpeed(%d)\n", + driverName, functionName, verticalShiftPeriod); + checkStatus(SetVSSpeed(verticalShiftPeriod)); + } if ((mCapabilities.ulSetFunctions & AC_SETFUNCTION_VSAMPLITUDE) != 0) {