diff --git a/andorApp/src/andorCCD.cpp b/andorApp/src/andorCCD.cpp index cb32783..7efb253 100755 --- a/andorApp/src/andorCCD.cpp +++ b/andorApp/src/andorCCD.cpp @@ -627,18 +627,16 @@ asynStatus AndorCCD::writeInt32(asynUser *pasynUser, epicsInt32 value) asynStatus status = asynSuccess; static const char *functionName = "writeInt32"; - // Set in param lib so the user sees a readback straight away. Save a backup in case of errors. + //Set in param lib so the user sees a readback straight away. Save a backup in case of errors. getIntegerParam(function, &oldValue); status = setIntegerParam(function, value); if (function == ADAcquire) { getIntegerParam(ADStatus, &adstatus); - // Temporarily set ADAcquire back to 0 until Acquisition is started by dataTask - status = setIntegerParam(ADAcquire, 0); if (value && (adstatus == ADStatusIdle)) { try { mAcquiringData = 1; - // We send an event at the bottom of this function. + //We send an event at the bottom of this function. } catch (const std::string &e) { asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s: %s\n", @@ -726,6 +724,9 @@ asynStatus AndorCCD::writeInt32(asynUser *pasynUser, epicsInt32 value) status = ADDriver::writeInt32(pasynUser, value); } + //For a successful write, clear the error message. + setStringParam(AndorMessage, " "); + /* Do callbacks so higher layers see any changes */ callParamCallbacks(); @@ -736,22 +737,18 @@ asynStatus AndorCCD::writeInt32(asynUser *pasynUser, epicsInt32 value) asynPrint(this->pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s:, Sending dataEvent to dataTask ...\n", driverName, functionName); - // Also signal the data readout thread + //Also signal the data readout thread epicsEventSignal(dataEvent); } - if (status) { + if (status) asynPrint(pasynUser, ASYN_TRACE_ERROR, "%s:%s: error, status=%d function=%d, value=%d\n", driverName, functionName, status, function, value); - } - else { + else asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, "%s:%s: function=%d, value=%d\n", driverName, functionName, function, value); - /* For a successful write, clear the error message. */ - setStringParam(AndorMessage, " "); - } return status; } @@ -1482,7 +1479,7 @@ void AndorCCD::dataTask(void) epicsTimeStamp startTime; NDArray *pArray; int autoSave; - int readOutMode; + int readOutMode; static const char *functionName = "dataTask"; printf("%s:%s: Data thread started...\n", driverName, functionName); @@ -1518,16 +1515,13 @@ void AndorCCD::dataTask(void) driverName, functionName); checkStatus(StartAcquisition()); acquiring = 1; - asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, - "%s:%s: Acquisition started\n", - driverName, functionName); } catch (const std::string &e) { asynPrint(pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s: %s\n", driverName, functionName, e.c_str()); continue; } - // Read some parameters + //Read some parameters getIntegerParam(NDDataType, &itemp); dataType = (NDDataType_t)itemp; getIntegerParam(NDAutoSave, &autoSave); getIntegerParam(NDArrayCallbacks, &arrayCallbacks); @@ -1537,9 +1531,6 @@ void AndorCCD::dataTask(void) setIntegerParam(ADNumImagesCounter, 0); setIntegerParam(ADNumExposuresCounter, 0); callParamCallbacks(); - // Set ADAcquire to 1 - setIntegerParam(ADAcquire, 1); - callParamCallbacks(); } else { asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s:, Data thread is running but main thread thinks we are not acquiring.\n", @@ -1588,8 +1579,8 @@ void AndorCCD::dataTask(void) dims[0] = sizeX; dims[1] = sizeY; pArray = this->pNDArrayPool->alloc(nDims, dims, dataType, 0, NULL); - if (readOutMode == ARRandomTrack) - mMultiTrack.storeTrackAttributes(pArray->pAttributeList); + if (readOutMode == ARRandomTrack) + mMultiTrack.storeTrackAttributes(pArray->pAttributeList); // Read the oldest array // Is there still an image available? status = GetNumberNewImages(&firstImage, &lastImage);