Skip to content

Commit 1523c32

Browse files
committed
Upgrade to ADCore R3-0
Fix the plugin constructor arguments to the super constructor by removing numParams and adding maxThreads. (These ADCore changes were introduced in R3-0 in commit 3af87bd.) Fix the super call in processCallbacks to call NDPluginDriver's beginProcessCallbacks method since processCallbacks in NDPluginDriver was renamed to beginProcessCallbacks. (This ADCore change was introduced in R3-0 in commit 3af87bd.) Call start() in adPythonPluginConfigure, and rename the start variable in processCallbacks to startTime to avoid shadowing the start method. (The start method was added in ADCore in R2-5 in commit b1a2f13.)
1 parent a030175 commit 1523c32

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

adPythonApp/src/adPythonPlugin.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ adPythonPlugin::adPythonPlugin(const char *portNameArg, const char *filename,
4747
const char *NDArrayPort, int NDArrayAddr, int maxBuffers,
4848
size_t maxMemory, int priority, int stackSize)
4949
: NDPluginDriver(portNameArg, queueSize, blockingCallbacks,
50-
NDArrayPort, NDArrayAddr, 1, NUM_ADPYTHONPLUGIN_PARAMS,
50+
NDArrayPort, NDArrayAddr, 1,
5151
maxBuffers, maxMemory,
5252
asynGenericPointerMask|asynFloat64ArrayMask,
5353
asynGenericPointerMask|asynFloat64ArrayMask,
54-
ASYN_MULTIDEVICE, 1, priority, stackSize)
54+
ASYN_MULTIDEVICE, 1, priority, stackSize, 1)
5555
{
5656
// Initialise some params
5757
this->pInstance = NULL;
@@ -131,7 +131,7 @@ void adPythonPlugin::initThreads()
131131
*/
132132
void adPythonPlugin::processCallbacks(NDArray *pArray) {
133133
// First call the base class method
134-
NDPluginDriver::processCallbacks(pArray);
134+
NDPluginDriver::beginProcessCallbacks(pArray);
135135

136136
// Make sure we are in a good state, otherwise do nothing
137137
if (this->pluginState != GOOD) return;
@@ -148,8 +148,8 @@ void adPythonPlugin::processCallbacks(NDArray *pArray) {
148148
this->lock();
149149

150150
// Store the time at the beginning of processing for profiling
151-
epicsTimeStamp start, end;
152-
epicsTimeGetCurrent(&start);
151+
epicsTimeStamp startTime, endTime;
152+
epicsTimeGetCurrent(&startTime);
153153

154154
// Update the attribute dict
155155
this->updateAttrDict(pArray);
@@ -177,8 +177,8 @@ void adPythonPlugin::processCallbacks(NDArray *pArray) {
177177
this->updateAttrList(pArray);
178178

179179
// timestamp
180-
epicsTimeGetCurrent(&end);
181-
setDoubleParam(adPythonTime, epicsTimeDiffInSeconds(&end, &start)*1000);
180+
epicsTimeGetCurrent(&endTime);
181+
setDoubleParam(adPythonTime, epicsTimeDiffInSeconds(&endTime, &startTime)*1000);
182182
callParamCallbacks();
183183

184184
// release GIL and dict Mutex
@@ -848,6 +848,7 @@ static int adPythonPluginConfigure(const char *portNameArg, const char *filename
848848
NDArrayPort, NDArrayAddr, maxBuffers, maxMemory,
849849
priority, stackSize);
850850
adp->initThreads();
851+
adp->start();
851852
return(asynSuccess);
852853
}
853854

0 commit comments

Comments
 (0)