Hi all, we are developing a geometric restoration plugin here at Sirius for areaDetector
Im using NDWarp as a base just because it seems to work as a good example. Also, im unfortunately bound to EPICS 3.15.6, AreaDetector R3-7.
Taking NDWarp as a base, i basically stripped everything between NDPluginWarp::processCallbacks and NDPluginWarp::endProcessCallbacks, so the code is what i append at the end of this e-mail: it should only copy the original array that comes to it and pass it
to the other connected plugins.
By compiling and running an IOC with this plugin, when i enable its callbacks i get the following message in my ioc shell:
2023/08/16 17:29:51.666 NDPluginDriver::endProcessCallbacks: Couldn't allocate output array. Further processing terminated.
Although i tried reading the source code, using gdb and recompiling ADCore by adding -g to USR_CXXFLAGS_Linux ad stepping into each function, etc. etc. i couldnt figure out what am i doing wrong. Am i passing a NULL array to NDPluginDriver::endProcessCallbacks?
Are there any hints about this?
Thanks in advance,
Marco
CODE PART:
NDPluginWarp::processCallbacks(NDArray
*pArray)
{
// pArray is borrowed reference. Caller will release()
NDPluginDriver::beginProcessCallbacks(pArray);
NDArrayInfo info;
NDArray *pOutput;
(void)pArray->getInfo(&info);
if(pArray->ndims!=2 || info.xSize==0 || info.ySize==0)
{
asynPrint(pasynUserSelf, ASYN_TRACE_ERROR,
"%s::
2D non-empty expected",
this->portName);
return;
}
switch(pArray->dataType)
{
case NDInt8:
case NDUInt8:
case NDInt16:
case NDUInt16:
case NDInt32:
case NDUInt32:
case NDFloat32:
case NDFloat64:
break;
default:
asynPrint(pasynUserSelf, ASYN_TRACE_ERROR,
"%s::
Unsupported type %u",
this->portName,
(unsigned)pArray->dataType);
return;
}
asynPrint(pasynUserSelf, ASYN_TRACE_FLOW,
"%s:
%s ndarray=%p\n",
this->portName, __PRETTY_FUNCTION__, pArray);
printf("a\n");
this->pNDArrayPool->copy(pArray,
pOutput, true,
true,
true);
NDPluginDriver::endProcessCallbacks(pOutput,
false,
true);
}