Skip to content

Commit 5d6917d

Browse files
committed
Upgrade to ADCore R3-0
Change the build files to use the ADCore R3-0 build files structure. 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 5d6917d

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

adPythonApp/src/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,6 @@ endif
5757

5858
USR_CXXFLAGS += -DDATADIRS=\"$(shell cd ..; pwd):$(shell cd ../../scripts; pwd)\"
5959

60+
include $(ADCORE)/ADApp/commonLibraryMakefile
61+
6062
include $(TOP)/configure/RULES

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

configure/CONFIG_SITE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,12 @@ CROSS_COMPILER_TARGET_ARCHS =
3131
# You must rebuild in the iocBoot directory for this to
3232
# take effect.
3333
#IOCS_APPL_TOP = </IOC/path/to/application/top>
34+
35+
# Get settings from AREA_DETECTOR, so that we only have to configure once
36+
-include $(AREA_DETECTOR)/configure/CONFIG_SITE
37+
-include $(AREA_DETECTOR)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH)
38+
-include $(AREA_DETECTOR)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common
39+
ifdef T_A
40+
-include $(AREA_DETECTOR)/configure/CONFIG_SITE.Common.$(T_A)
41+
-include $(AREA_DETECTOR)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
42+
endif

configure/RELEASE

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,15 @@
1919
# Build settings that are NOT module paths should appear in a
2020
# CONFIG_SITE file.
2121

22-
TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top
23-
SUPPORT=/dls_sw/prod/R3.14.12.3/support
22+
-include $(TOP)/../configure/RELEASE_LIBS_INCLUDE
23+
-include $(TOP)/RELEASE.local
24+
-include $(TOP)/configure/RELEASE.local
25+
2426
WORK=/dls_sw/work/R3.14.12.3/support
2527
TOOLS_BASE=/dls_sw/prod/tools/RHEL6-x86_64
2628

27-
ASYN=$(SUPPORT)/asyn/4-26
28-
ADCORE=$(SUPPORT)/ADCore/2-4dls8
2929
PYTHON_PREFIX=$(TOOLS_BASE)/Python/2-7-3/prefix
3030

31-
# EPICS_BASE usually appears last so other apps can override stuff:
32-
EPICS_BASE=/dls_sw/epics/R3.14.12.3/base
33-
3431
# Set RULES here if you want to take build rules from somewhere
3532
# other than EPICS_BASE:
3633
#RULES=/path/to/epics/support/module/rules/x-y

0 commit comments

Comments
 (0)