From 2def84fd3791de78c40b8c086fe7861b85b3a5f4 Mon Sep 17 00:00:00 2001 From: apanna Date: Wed, 16 Nov 2016 11:29:13 -0500 Subject: [PATCH] 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) --- edgeApp/edgeSrc/NDPluginEdge.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/edgeApp/edgeSrc/NDPluginEdge.cpp b/edgeApp/edgeSrc/NDPluginEdge.cpp index fc2b38c..0489895 100644 --- a/edgeApp/edgeSrc/NDPluginEdge.cpp +++ b/edgeApp/edgeSrc/NDPluginEdge.cpp @@ -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); @@ -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};