Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: call start() after NDEdgePlugin object is created for plugin to work for ADCore >= 2.5, don't process plugin if input NDArray dimension > 2 (i.e. for Color modes) #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions edgeApp/edgeSrc/NDPluginEdge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,19 @@ void NDPluginEdge::processCallbacks(NDArray *pArray)
/* Call the base class method */
NDPluginDriver::processCallbacks(pArray);

/* This plugin currently only works for 1-D or 2-D arrays */
switch (pArray->ndims) {
case 1:
case 2:
break;
default:
asynPrint(pasynUserSelf, ASYN_TRACE_ERROR,
"%s::%s: error, input array dimensions must be 1 or 2\n",
driverName, functionName);
return;
break;
}

getDoubleParam( NDPluginEdgeLowThreshold, &lowThreshold);
getDoubleParam( NDPluginEdgeThresholdRatio, &thresholdRatio);

Expand Down Expand Up @@ -317,10 +330,9 @@ extern "C" int NDEdgeConfigure(const char *portName, int queueSize, int blocking
int maxBuffers, size_t maxMemory,
int priority, int stackSize)
{
new NDPluginEdge(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr,
maxBuffers, maxMemory, priority, stackSize);
return(asynSuccess);
}
NDPluginEdge *pPlugin = new NDPluginEdge(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr,
maxBuffers, maxMemory, priority, stackSize);
return pPlugin->start();

/* EPICS iocsh shell commands */
static const iocshArg initArg0 = { "portName",iocshArgString};
Expand Down