diff --git a/.hgignore b/.hgignore index edb9c72..20e12e6 100644 --- a/.hgignore +++ b/.hgignore @@ -1,11 +1,11 @@ ^QtC- -^bin/ -^lib/ -^doc/ -^include/ -^db/ -^dbd/ -^documentation/html +bin/ +lib/ +doc/ +include/ +db/ +dbd/ +documentation/html envPaths configure/.*\.local /O\..* diff --git a/Makefile b/Makefile index db71505..927ea43 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,7 @@ DIRS += configure DIRS += src src_DEPEND_DIRS = configure -DIRS += example -test_DEPEND_DIRS = src - -DIRS += iocBoot +DIRS += test include $(TOP)/configure/RULES_TOP diff --git a/arrayPerformance/Makefile b/arrayPerformance/Makefile new file mode 100644 index 0000000..999631d --- /dev/null +++ b/arrayPerformance/Makefile @@ -0,0 +1,11 @@ +#Makefile at top of application tree +TOP = . +include $(TOP)/configure/CONFIG +DIRS += configure + +DIRS += src +src_DEPEND_DIRS = configure + +include $(TOP)/configure/RULES_TOP + + diff --git a/arrayPerformance/configure/CONFIG b/arrayPerformance/configure/CONFIG new file mode 100644 index 0000000..c1a4703 --- /dev/null +++ b/arrayPerformance/configure/CONFIG @@ -0,0 +1,29 @@ +# CONFIG - Load build configuration data +# +# Do not make changes to this file! + +# Allow user to override where the build rules come from +RULES = $(EPICS_BASE) + +# RELEASE files point to other application tops +include $(TOP)/configure/RELEASE +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common +ifdef T_A +-include $(TOP)/configure/RELEASE.Common.$(T_A) +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) +endif + +CONFIG = $(RULES)/configure +include $(CONFIG)/CONFIG + +# Override the Base definition: +INSTALL_LOCATION = $(TOP) + +# CONFIG_SITE files contain other build configuration settings +include $(TOP)/configure/CONFIG_SITE +-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common +ifdef T_A + -include $(TOP)/configure/CONFIG_SITE.Common.$(T_A) + -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) +endif + diff --git a/arrayPerformance/configure/CONFIG_SITE b/arrayPerformance/configure/CONFIG_SITE new file mode 100644 index 0000000..9e1ec9a --- /dev/null +++ b/arrayPerformance/configure/CONFIG_SITE @@ -0,0 +1,39 @@ +# CONFIG_SITE + +# Make any application-specific changes to the EPICS build +# configuration variables in this file. +# +# Host/target specific settings can be specified in files named +# CONFIG_SITE.$(EPICS_HOST_ARCH).Common +# CONFIG_SITE.Common.$(T_A) +# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) + +# CHECK_RELEASE controls the consistency checking of the support +# applications pointed to by the RELEASE* files. +# Normally CHECK_RELEASE should be set to YES. +# Set CHECK_RELEASE to NO to disable checking completely. +# Set CHECK_RELEASE to WARN to perform consistency checking but +# continue building anyway if conflicts are found. +#CHECK_RELEASE = YES + +# Set this when you only want to compile this application +# for a subset of the cross-compiled target architectures +# that Base is built for. +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 + +# To install files into a location other than $(TOP) define +# INSTALL_LOCATION here. +#INSTALL_LOCATION= + +# Set this when your IOC and the host use different paths +# to access the application. This will be needed to boot +# from a Microsoft FTP server or with some NFS mounts. +# You must rebuild in the iocBoot directory for this to +# take effect. +#IOCS_APPL_TOP = + +INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv +USR_INCLUDES += -I $(INSTALL_LOCATION)/include + +-include $(TOP)/configure/CONFIG_SITE.local +-include $(TOP)/../CONFIG.local diff --git a/arrayPerformance/configure/Makefile b/arrayPerformance/configure/Makefile new file mode 100644 index 0000000..9254309 --- /dev/null +++ b/arrayPerformance/configure/Makefile @@ -0,0 +1,8 @@ +TOP=.. + +include $(TOP)/configure/CONFIG + +TARGETS = $(CONFIG_TARGETS) +CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS))) + +include $(TOP)/configure/RULES diff --git a/arrayPerformance/configure/RELEASE b/arrayPerformance/configure/RELEASE new file mode 100644 index 0000000..15c3090 --- /dev/null +++ b/arrayPerformance/configure/RELEASE @@ -0,0 +1,44 @@ +# RELEASE - Location of external support modules +# +# IF YOU MAKE ANY CHANGES to this file you must subsequently +# do a "gnumake rebuild" in this application's top level +# directory. +# +# The build process does not check dependencies against files +# that are outside this application, thus you should do a +# "gnumake rebuild" in the top level directory after EPICS_BASE +# or any other external module pointed to below is rebuilt. +# +# Host- or target-specific settings can be given in files named +# RELEASE.$(EPICS_HOST_ARCH).Common +# RELEASE.Common.$(T_A) +# RELEASE.$(EPICS_HOST_ARCH).$(T_A) +# +# This file should ONLY define paths to other support modules, +# or include statements that pull in similar RELEASE files. +# Build settings that are NOT module paths should appear in a +# CONFIG_SITE file. + +TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top + +# If using the sequencer, point SNCSEQ at its top directory: +#SNCSEQ=$(EPICS_BASE)/../modules/soft/seq + +# EPICS_BASE usually appears last so other apps can override stuff: + +# do not edit the locations in this file +# create RELEASE.local with the paths to your EPICS_BASE, PVDATA, and PVACCESS +# these default locations are needed for the BNL Jenkins server to work + +# Set RULES here if you want to take build rules from somewhere +# other than EPICS_BASE: +#RULES=/path/to/epics/support/module/rules/x-y + +# Leave these in for the Jenkins build at BNL to work +EPICS_BASE=/home/install/epics/base +PVDATA=/home/mrk/hg/pvDataCPP +PVACCESS=/home/mrk/hg/pvAccessCPP + +# set your EPICS_BASE, PVDATA and PVACCESS paths in here +-include $(TOP)/../RELEASE.local +-include $(TOP)/configure/RELEASE.local diff --git a/arrayPerformance/configure/RELEASE.local b/arrayPerformance/configure/RELEASE.local new file mode 100644 index 0000000..95e3783 --- /dev/null +++ b/arrayPerformance/configure/RELEASE.local @@ -0,0 +1,8 @@ +EPICS_BASE=/home/install/epics/base +TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top +EPICSV4HOME=/home/hg +PVCOMMON=${EPICSV4HOME}/pvCommonCPP +PVDATA=${EPICSV4HOME}/pvDataCPP +PVACCESS=${EPICSV4HOME}/pvAccessCPP +PVDATABASE=${EPICSV4HOME}/pvDatabaseCPP +PVASRV=${EPICSV4HOME}/pvaSrv diff --git a/arrayPerformance/configure/RULES b/arrayPerformance/configure/RULES new file mode 100644 index 0000000..6d56e14 --- /dev/null +++ b/arrayPerformance/configure/RULES @@ -0,0 +1,6 @@ +# RULES + +include $(CONFIG)/RULES + +# Library should be rebuilt because LIBOBJS may have changed. +$(LIBNAME): ../Makefile diff --git a/arrayPerformance/configure/RULES.ioc b/arrayPerformance/configure/RULES.ioc new file mode 100644 index 0000000..901987c --- /dev/null +++ b/arrayPerformance/configure/RULES.ioc @@ -0,0 +1,2 @@ +#RULES.ioc +include $(CONFIG)/RULES.ioc diff --git a/arrayPerformance/configure/RULES_DIRS b/arrayPerformance/configure/RULES_DIRS new file mode 100644 index 0000000..3ba269d --- /dev/null +++ b/arrayPerformance/configure/RULES_DIRS @@ -0,0 +1,2 @@ +#RULES_DIRS +include $(CONFIG)/RULES_DIRS diff --git a/arrayPerformance/configure/RULES_TOP b/arrayPerformance/configure/RULES_TOP new file mode 100644 index 0000000..d09d668 --- /dev/null +++ b/arrayPerformance/configure/RULES_TOP @@ -0,0 +1,3 @@ +#RULES_TOP +include $(CONFIG)/RULES_TOP + diff --git a/example/arrayPerformance/Makefile b/arrayPerformance/src/Makefile similarity index 73% rename from example/arrayPerformance/Makefile rename to arrayPerformance/src/Makefile index 2e6ac94..a9cef9a 100644 --- a/example/arrayPerformance/Makefile +++ b/arrayPerformance/src/Makefile @@ -1,7 +1,20 @@ -TOP=../.. - +TOP = .. include $(TOP)/configure/CONFIG +LIBRARY_IOC += pvDatabaseExample +pvDatabaseExample_LIBS += $(EPICS_BASE_IOC_LIBS) +pvDatabaseExample_LIBS += Com pvData pvAccess pvDatabase + + +INC+= arrayPerformance.h +LIBSRCS += arrayPerformance.cpp +INC+= longArrayMonitor.h +LIBSRCS += longArrayMonitor.cpp +INC+= longArrayGet.h +LIBSRCS += longArrayGet.cpp +INC+= longArrayPut.h +LIBSRCS += longArrayPut.cpp + PROD_HOST += arrayPerformanceMain arrayPerformanceMain_SRCS += arrayPerformanceMain.cpp arrayPerformanceMain_LIBS += pvDatabase pvAccess pvData Com @@ -28,8 +41,5 @@ vectorPerformanceMain_LIBS += pvDatabase pvAccess pvData Com vectorPerformanceMain_LIBS += pvDatabaseExample - include $(TOP)/configure/RULES -#---------------------------------------- -# ADD RULES AFTER THIS LINE diff --git a/example/src/arrayPerformance/arrayPerformance.cpp b/arrayPerformance/src/arrayPerformance.cpp similarity index 100% rename from example/src/arrayPerformance/arrayPerformance.cpp rename to arrayPerformance/src/arrayPerformance.cpp diff --git a/example/src/arrayPerformance/arrayPerformance.h b/arrayPerformance/src/arrayPerformance.h similarity index 100% rename from example/src/arrayPerformance/arrayPerformance.h rename to arrayPerformance/src/arrayPerformance.h diff --git a/example/arrayPerformance/arrayPerformanceMain.cpp b/arrayPerformance/src/arrayPerformanceMain.cpp similarity index 100% rename from example/arrayPerformance/arrayPerformanceMain.cpp rename to arrayPerformance/src/arrayPerformanceMain.cpp diff --git a/example/src/arrayPerformance/longArrayGet.cpp b/arrayPerformance/src/longArrayGet.cpp similarity index 100% rename from example/src/arrayPerformance/longArrayGet.cpp rename to arrayPerformance/src/longArrayGet.cpp diff --git a/example/src/arrayPerformance/longArrayGet.h b/arrayPerformance/src/longArrayGet.h similarity index 100% rename from example/src/arrayPerformance/longArrayGet.h rename to arrayPerformance/src/longArrayGet.h diff --git a/example/arrayPerformance/longArrayGetMain.cpp b/arrayPerformance/src/longArrayGetMain.cpp similarity index 100% rename from example/arrayPerformance/longArrayGetMain.cpp rename to arrayPerformance/src/longArrayGetMain.cpp diff --git a/example/src/arrayPerformance/longArrayMonitor.cpp b/arrayPerformance/src/longArrayMonitor.cpp similarity index 100% rename from example/src/arrayPerformance/longArrayMonitor.cpp rename to arrayPerformance/src/longArrayMonitor.cpp diff --git a/example/src/arrayPerformance/longArrayMonitor.h b/arrayPerformance/src/longArrayMonitor.h similarity index 100% rename from example/src/arrayPerformance/longArrayMonitor.h rename to arrayPerformance/src/longArrayMonitor.h diff --git a/example/arrayPerformance/longArrayMonitorMain.cpp b/arrayPerformance/src/longArrayMonitorMain.cpp similarity index 100% rename from example/arrayPerformance/longArrayMonitorMain.cpp rename to arrayPerformance/src/longArrayMonitorMain.cpp diff --git a/example/src/arrayPerformance/longArrayPut.cpp b/arrayPerformance/src/longArrayPut.cpp similarity index 100% rename from example/src/arrayPerformance/longArrayPut.cpp rename to arrayPerformance/src/longArrayPut.cpp diff --git a/example/src/arrayPerformance/longArrayPut.h b/arrayPerformance/src/longArrayPut.h similarity index 100% rename from example/src/arrayPerformance/longArrayPut.h rename to arrayPerformance/src/longArrayPut.h diff --git a/example/arrayPerformance/longArrayPutMain.cpp b/arrayPerformance/src/longArrayPutMain.cpp similarity index 100% rename from example/arrayPerformance/longArrayPutMain.cpp rename to arrayPerformance/src/longArrayPutMain.cpp diff --git a/example/arrayPerformance/vectorPerformanceMain.cpp b/arrayPerformance/src/vectorPerformanceMain.cpp similarity index 100% rename from example/arrayPerformance/vectorPerformanceMain.cpp rename to arrayPerformance/src/vectorPerformanceMain.cpp diff --git a/example/Makefile b/example/Makefile deleted file mode 100644 index d1c10d4..0000000 --- a/example/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -TOP = .. -include $(TOP)/configure/CONFIG -DIRS += src -DIRS += record -DIRS += pvCopy -DIRS += exampleCounter -DIRS += exampleServer -DIRS += examplePVADoubleArrayGet -DIRS += arrayPerformance -DIRS += v3IOC -include $(TOP)/configure/RULES_DIRS - diff --git a/example/exampleCounter/Makefile b/example/exampleCounter/Makefile deleted file mode 100644 index 57a94ef..0000000 --- a/example/exampleCounter/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -TOP=../.. - -include $(TOP)/configure/CONFIG - -PROD_HOST += exampleCounterMain -exampleCounterMain_SRCS += exampleCounterMain.cpp -exampleCounterMain_LIBS += pvDatabase pvAccess pvData Com - - -include $(TOP)/configure/RULES -#---------------------------------------- -# ADD RULES AFTER THIS LINE - diff --git a/example/exampleCounter/exampleCounterMain.cpp b/example/exampleCounter/exampleCounterMain.cpp deleted file mode 100644 index 21ae041..0000000 --- a/example/exampleCounter/exampleCounterMain.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/*ExampleCounterMain.cpp */ -/** - * Copyright - See the COPYRIGHT that is included with this distribution. - * EPICS pvData is distributed subject to a Software License Agreement found - * in file LICENSE that is included with this distribution. - */ -/** - * @author mrk - */ - -/* Author: Marty Kraimer */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace std; -using std::tr1::static_pointer_cast; -using namespace epics::pvData; -using namespace epics::pvAccess; -using namespace epics::pvDatabase; - -int main(int argc,char *argv[]) -{ - PVDatabasePtr master = PVDatabase::getMaster(); - ChannelProviderLocalPtr channelProvider = getChannelProviderLocal(); - PVRecordPtr pvRecord; - bool result(false); - String recordName; - recordName = "exampleCounter"; - pvRecord = ExampleCounter::create(recordName); - result = master->addRecord(pvRecord); - cout << "result of addRecord " << recordName << " " << result << endl; - recordName = "traceRecordPGRPC"; - pvRecord = TraceRecord::create(recordName); - result = master->addRecord(pvRecord); - if(!result) cout<< "record " << recordName << " not added" << endl; - pvRecord.reset(); - ServerContext::shared_pointer pvaServer = - startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true); - cout << "exampleCounter\n"; - string str; - while(true) { - cout << "Type exit to stop: \n"; - getline(cin,str); - if(str.compare("exit")==0) break; - - } - pvaServer->shutdown(); - epicsThreadSleep(1.0); - pvaServer->destroy(); - channelProvider->destroy(); - return 0; -} - diff --git a/example/examplePVADoubleArrayGet/Makefile b/example/examplePVADoubleArrayGet/Makefile deleted file mode 100644 index c46cc81..0000000 --- a/example/examplePVADoubleArrayGet/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -TOP=../.. - -include $(TOP)/configure/CONFIG - -PROD_HOST += examplePVADoubleArrayGetMain -examplePVADoubleArrayGetMain_SRCS += examplePVADoubleArrayGetMain.cpp -examplePVADoubleArrayGetMain_LIBS += pvDatabase pvAccess pvData Com -examplePVADoubleArrayGetMain_LIBS += pvDatabaseExample - - -include $(TOP)/configure/RULES -#---------------------------------------- -# ADD RULES AFTER THIS LINE - diff --git a/example/examplePVADoubleArrayGet/examplePVADoubleArrayGetMain.cpp b/example/examplePVADoubleArrayGet/examplePVADoubleArrayGetMain.cpp deleted file mode 100644 index ba3a6ab..0000000 --- a/example/examplePVADoubleArrayGet/examplePVADoubleArrayGetMain.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/*ExamplePVADoubleArrayGetMain.cpp */ -/** - * Copyright - See the COPYRIGHT that is included with this distribution. - * EPICS pvData is distributed subject to a Software License Agreement found - * in file LICENSE that is included with this distribution. - */ -/** - * @author mrk - */ - -/* Author: Marty Kraimer */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using std::tr1::static_pointer_cast; -using namespace epics::pvData; -using namespace epics::pvAccess; -using namespace epics::pvDatabase; - -static StandardPVFieldPtr standardPVField = getStandardPVField(); - -int main(int argc,char *argv[]) -{ - PVDatabasePtr master = PVDatabase::getMaster(); - ClientFactory::start(); - ChannelProviderLocalPtr channelProvider = getChannelProviderLocal(); - PVRecordPtr pvRecord; - bool result(false); - String recordName; - PVStructurePtr pvStructure = standardPVField->scalarArray( - pvDouble,"alarm,timeStamp"); - recordName = "doubleArray"; - pvRecord = PVRecord::create(recordName,pvStructure); - result = master->addRecord(pvRecord); - if(!result) cout<< "record " << recordName << " not added" << endl; - ServerContext::shared_pointer serverContext = startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true); - recordName = "examplePVADoubleArrayGet"; - if(argc>1) recordName = argv[1]; - String providerName("local"); - if(argc>2) providerName = argv[2]; - String channelName("doubleArray"); - if(argc>3) channelName = argv[3]; - pvRecord = ExamplePVADoubleArrayGet::create( - recordName,providerName,channelName); - if(pvRecord!=NULL) { - result = master->addRecord(pvRecord); - cout << "result of addRecord " << recordName << " " << result << endl; - } else { - cout << "ExamplePVADoubleArrayGet::create failed" << endl; - } - string str; - while(true) { - cout << "Type exit to stop: \n"; - getline(cin,str); - if(str.compare("exit")==0) break; - - } - serverContext->shutdown(); - epicsThreadSleep(1.0); - serverContext->destroy(); - ClientFactory::stop(); - channelProvider->destroy(); - return 0; -} - diff --git a/example/exampleServer/Makefile b/example/exampleServer/Makefile deleted file mode 100644 index d581147..0000000 --- a/example/exampleServer/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -TOP=../.. - -include $(TOP)/configure/CONFIG - -PROD_HOST += exampleServerMain -exampleServerMain_SRCS += exampleServerMain.cpp -exampleServerMain_LIBS += pvDatabase pvDatabaseExample pvAccess pvData Com - -include $(TOP)/configure/RULES -#---------------------------------------- -# ADD RULES AFTER THIS LINE - diff --git a/example/exampleServer/exampleServerMain.cpp b/example/exampleServer/exampleServerMain.cpp deleted file mode 100644 index 41e5b9b..0000000 --- a/example/exampleServer/exampleServerMain.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/*exampleServerMain.cpp */ -/** - * Copyright - See the COPYRIGHT that is included with this distribution. - * EPICS pvData is distributed subject to a Software License Agreement found - * in file LICENSE that is included with this distribution. - */ -/** - * @author mrk - */ - -/* Author: Marty Kraimer */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -using namespace std; -using std::tr1::static_pointer_cast; -using namespace epics::pvData; -using namespace epics::pvAccess; -using namespace epics::pvDatabase; - - -int main(int argc,char *argv[]) -{ - PVDatabasePtr master = PVDatabase::getMaster(); - ChannelProviderLocalPtr channelProvider = getChannelProviderLocal(); - ExampleServerCreateRecords::create(); - ServerContext::shared_pointer ctx = - startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true); - cout << "exampleServer\n"; - PVStringArrayPtr pvNames = master->getRecordNames(); - String buffer; - pvNames->toString(&buffer); - cout << "recordNames" << endl << buffer << endl; - string str; - while(true) { - cout << "Type exit to stop: \n"; - getline(cin,str); - if(str.compare("exit")==0) break; - - } - ctx->destroy(); - epicsThreadSleep(1.0); - channelProvider->destroy(); - return 0; -} - diff --git a/example/record/Makefile b/example/record/Makefile deleted file mode 100644 index 0ee6714..0000000 --- a/example/record/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -TOP=../.. - -include $(TOP)/configure/CONFIG - -PROD_HOST += testExampleRecord -testExampleRecord_SRCS += testExampleRecordMain.cpp -testExampleRecord_LIBS += pvDatabase pvAccess pvData Com - - -include $(TOP)/configure/RULES -#---------------------------------------- -# ADD RULES AFTER THIS LINE - diff --git a/example/src/Makefile b/example/src/Makefile deleted file mode 100644 index 503c1fb..0000000 --- a/example/src/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -TOP = ../.. -include $(TOP)/configure/CONFIG - -EXAMPLESRC = $(TOP)/example/src/ - -LIBRARY_IOC += pvDatabaseExample -pvDatabaseExample_LIBS += $(EPICS_BASE_IOC_LIBS) -pvDatabaseExample_LIBS += Com pvData pvAccess pvDatabase - -SRC_DIRS += $(EXAMPLESRC)/exampleCounter -INC += exampleCounter.h - -SRC_DIRS += $(EXAMPLESRC)/exampleServer -INC+= exampleServerCreateRecords.h -LIBSRCS += exampleServerCreateRecords.cpp - -SRC_DIRS += $(EXAMPLESRC)/examplePVADoubleArrayGet -INC+= examplePVADoubleArrayGet.h -LIBSRCS += examplePVADoubleArrayGet.cpp - -SRC_DIRS += $(EXAMPLESRC)/arrayPerformance -INC+= arrayPerformance.h -LIBSRCS += arrayPerformance.cpp -INC+= longArrayMonitor.h -LIBSRCS += longArrayMonitor.cpp -INC+= longArrayGet.h -LIBSRCS += longArrayGet.cpp -INC+= longArrayPut.h -LIBSRCS += longArrayPut.cpp - - -include $(TOP)/configure/RULES - diff --git a/example/src/exampleCounter/exampleCounter.h b/example/src/exampleCounter/exampleCounter.h deleted file mode 100644 index 62a0825..0000000 --- a/example/src/exampleCounter/exampleCounter.h +++ /dev/null @@ -1,92 +0,0 @@ -/* exampleCounter.h */ -/** - * Copyright - See the COPYRIGHT that is included with this distribution. - * EPICS pvData is distributed subject to a Software License Agreement found - * in file LICENSE that is included with this distribution. - */ -/** - * @author mrk - * @date 2013.04.02 - */ -#ifndef EXAMPLECOUNTER_H -#define EXAMPLECOUNTER_H - - -#include -#include -#include -#include - -namespace epics { namespace pvDatabase { - - -class ExampleCounter; -typedef std::tr1::shared_ptr ExampleCounterPtr; - -class ExampleCounter : - public PVRecord -{ -public: - POINTER_DEFINITIONS(ExampleCounter); - static ExampleCounterPtr create( - epics::pvData::String const & recordName); - virtual ~ExampleCounter(); - virtual void destroy(); - virtual bool init(); - virtual void process(); -private: - ExampleCounter(epics::pvData::String const & recordName, - epics::pvData::PVStructurePtr const & pvStructure); - epics::pvData::PVLongPtr pvValue; - epics::pvData::PVTimeStamp pvTimeStamp; - epics::pvData::TimeStamp timeStamp; -}; - -ExampleCounterPtr ExampleCounter::create( - epics::pvData::String const & recordName) -{ - epics::pvData::PVStructurePtr pvStructure = - epics::pvData::getStandardPVField()->scalar(epics::pvData::pvLong,"timeStamp,alarm"); - ExampleCounterPtr pvRecord( - new ExampleCounter(recordName,pvStructure)); - if(!pvRecord->init()) pvRecord.reset(); - return pvRecord; -} - -ExampleCounter::ExampleCounter( - epics::pvData::String const & recordName, - epics::pvData::PVStructurePtr const & pvStructure) -: PVRecord(recordName,pvStructure) -{ - pvTimeStamp.attach(pvStructure->getSubField("timeStamp")); -} - -ExampleCounter::~ExampleCounter() -{ -} - -void ExampleCounter::destroy() -{ - PVRecord::destroy(); -} - -bool ExampleCounter::init() -{ - - initPVRecord(); - epics::pvData::PVFieldPtr pvField; - pvValue = getPVStructure()->getLongField("value"); - if(pvValue.get()==NULL) return false; - return true; -} - -void ExampleCounter::process() -{ - pvValue->put(pvValue->get() + 1.0); - timeStamp.getCurrent(); - pvTimeStamp.set(timeStamp); -} - -}} - -#endif /* EXAMPLECOUNTER_H */ diff --git a/example/src/exampleServer/exampleServerCreateRecords.cpp b/example/src/exampleServer/exampleServerCreateRecords.cpp deleted file mode 100644 index df82e2a..0000000 --- a/example/src/exampleServer/exampleServerCreateRecords.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/*exampleServerCreateRecords.cpp */ -/** - * Copyright - See the COPYRIGHT that is included with this distribution. - * EPICS pvData is distributed subject to a Software License Agreement found - * in file LICENSE that is included with this distribution. - */ -/** - * @author mrk - * @date 2013.07.24 - */ - -/* Author: Marty Kraimer */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using std::tr1::static_pointer_cast; -using namespace epics::pvData; -using namespace epics::pvAccess; -using namespace epics::pvDatabase; - -static FieldCreatePtr fieldCreate = getFieldCreate(); -static StandardFieldPtr standardField = getStandardField(); -static PVDataCreatePtr pvDataCreate = getPVDataCreate(); -static StandardPVFieldPtr standardPVField = getStandardPVField(); - -static PVStructurePtr createPowerSupply() -{ - size_t nfields = 5; - StringArray names; - names.reserve(nfields); - FieldConstPtrArray powerSupply; - powerSupply.reserve(nfields); - names.push_back("alarm"); - powerSupply.push_back(standardField->alarm()); - names.push_back("timeStamp"); - powerSupply.push_back(standardField->timeStamp()); - String properties("alarm,display"); - names.push_back("voltage"); - powerSupply.push_back(standardField->scalar(pvDouble,properties)); - names.push_back("power"); - powerSupply.push_back(standardField->scalar(pvDouble,properties)); - names.push_back("current"); - powerSupply.push_back(standardField->scalar(pvDouble,properties)); - return pvDataCreate->createPVStructure( - fieldCreate->createStructure(names,powerSupply)); -} - -static void createStructureArrayRecord( - PVDatabasePtr const &master, - ScalarType scalarType, - String const &recordName) -{ - StructureConstPtr structure = standardField->scalar( - pvDouble, - String("value,alarm,timeStamp")); - StringArray names(2); - FieldConstPtrArray fields(2); - names[0] = "timeStamp"; - names[1] = "value"; - fields[0] = standardField->timeStamp(); - fields[1] = fieldCreate->createStructureArray(structure); - StructureConstPtr top = fieldCreate->createStructure(names,fields); - PVStructurePtr pvStructure = pvDataCreate->createPVStructure(top); - PVRecordPtr pvRecord = PVRecord::create(recordName,pvStructure); - bool result = master->addRecord(pvRecord); - if(!result) cout<< "record " << recordName << " not added" << endl; -} - -static void createRecords( - PVDatabasePtr const &master, - ScalarType scalarType, - String const &recordNamePrefix, - String const &properties) -{ - String recordName = recordNamePrefix; - PVStructurePtr pvStructure = standardPVField->scalar(scalarType,properties); - PVRecordPtr pvRecord = PVRecord::create(recordName,pvStructure); - bool result = master->addRecord(pvRecord); - if(!result) cout<< "record " << recordName << " not added" << endl; - recordName += "Array"; - pvStructure = standardPVField->scalarArray(scalarType,properties); - pvRecord = PVRecord::create(recordName,pvStructure); - result = master->addRecord(pvRecord); -} - -void ExampleServerCreateRecords::create() -{ - PVDatabasePtr master = PVDatabase::getMaster(); - PVRecordPtr pvRecord; - String recordName; - bool result(false); - recordName = "traceRecordPGRPC"; - pvRecord = TraceRecord::create(recordName); - result = master->addRecord(pvRecord); - if(!result) cout<< "record " << recordName << " not added" << endl; - String properties; - recordName = "exampleCounter"; - pvRecord = ExampleCounter::create(recordName); - result = master->addRecord(pvRecord); - properties = "alarm,timeStamp"; - createRecords(master,pvBoolean,"exampleBoolean",properties); - createRecords(master,pvByte,"exampleByte",properties); - createRecords(master,pvShort,"exampleShort",properties); - createRecords(master,pvInt,"exampleInt",properties); - createRecords(master,pvLong,"exampleLong",properties); - createRecords(master,pvFloat,"exampleFloat",properties); - createRecords(master,pvDouble,"exampleDouble",properties); - createRecords(master,pvString,"exampleString",properties); - createStructureArrayRecord(master,pvDouble,"exampleStructureArray"); - recordName = "examplePowerSupply"; - PVStructurePtr pvStructure = createPowerSupply(); - PowerSupplyRecordTestPtr psr = - PowerSupplyRecordTest::create(recordName,pvStructure); - if(psr.get()==NULL) { - cout << "PowerSupplyRecordTest::create failed" << endl; - return; - } - result = master->addRecord(psr); - if(!result) cout<< "record " << recordName << " not added" << endl; - recordName = "laptoprecordListPGRPC"; - pvRecord = RecordListRecord::create(recordName); - result = master->addRecord(pvRecord); - if(!result) cout<< "record " << recordName << " not added" << endl; -} - diff --git a/example/src/exampleServer/exampleServerCreateRecords.h b/example/src/exampleServer/exampleServerCreateRecords.h deleted file mode 100644 index 98a4410..0000000 --- a/example/src/exampleServer/exampleServerCreateRecords.h +++ /dev/null @@ -1,27 +0,0 @@ -/* exampleServerCreateRecords.h */ -/** - * Copyright - See the COPYRIGHT that is included with this distribution. - * EPICS pvData is distributed subject to a Software License Agreement found - * in file LICENSE that is included with this distribution. - */ -/** - * @author mrk - * @date 2013.07.24 - */ -#ifndef EXAMPLESERVERCREATERECORDS_H -#define EXAMPLESERVERCREATERECORDS_H - - -#include - -namespace epics { namespace pvDatabase { - -class ExampleServerCreateRecords { -public: - static void create(); -}; - - -}} - -#endif /* EXAMPLESERVERCREATERECORDS_H */ diff --git a/example/v3IOC/Makefile b/example/v3IOC/Makefile deleted file mode 100644 index 27474c1..0000000 --- a/example/v3IOC/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -TOP = ../.. -include $(TOP)/configure/CONFIG -DIRS += exampleCounter -DIRS += exampleServer -DIRS += examplePVADoubleArrayGet -include $(TOP)/configure/RULES_DIRS - diff --git a/example/v3IOC/exampleCounter/Db/Makefile b/example/v3IOC/exampleCounter/Db/Makefile deleted file mode 100644 index 0872e39..0000000 --- a/example/v3IOC/exampleCounter/Db/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -TOP=../../../.. -include $(TOP)/configure/CONFIG -#---------------------------------------- -# ADD MACRO DEFINITIONS AFTER THIS LINE - -#---------------------------------------------------- -# Optimization of db files using dbst (DEFAULT: NO) -#DB_OPT = YES - -#---------------------------------------------------- -# Create and install (or just install) -# databases, templates, substitutions like this -DB += ai.db -#---------------------------------------------------- -# If .db template is not named *.template add -# _TEMPLATE = - -include $(TOP)/configure/RULES -#---------------------------------------- -# ADD RULES AFTER THIS LINE - diff --git a/example/v3IOC/exampleCounter/src/Makefile b/example/v3IOC/exampleCounter/src/Makefile deleted file mode 100644 index 708a68b..0000000 --- a/example/v3IOC/exampleCounter/src/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -TOP=../../../.. - -include $(TOP)/configure/CONFIG -#---------------------------------------- -# ADD MACRO DEFINITIONS AFTER THIS LINE -#============================= - -#================================================== -# Build an IOC support library -# - -DBD += exampleCounter.dbd - -LIBRARY_IOC += exampleCounterSupport -exampleCounterSupport_SRCS += exampleCounter.cpp -exampleCounterSupport_LIBS += pvData -exampleCounterSupport_LIBS += pvAccess -exampleCounterSupport_LIBS += pvDatabase -exampleCounterSupport_LIBS += pvDatabaseExample -exampleCounterSupport_LIBS += $(EPICS_BASE_IOC_LIBS) - -#============================= -# build an ioc application - -PROD_IOC += exampleCounter - - -# _registerRecordDeviceDriver.cpp will be created from .dbd -exampleCounter_SRCS += exampleCounter_registerRecordDeviceDriver.cpp -exampleCounter_SRCS_DEFAULT += exampleCounterMain.cpp -exampleCounter_SRCS_vxWorks += -nil- - - -# The following adds support from base/src/vxWorks -exampleCounter_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary - -exampleCounter_LIBS += pvData pvAccess -exampleCounter_LIBS += pvDatabase -exampleCounter_LIBS += pvDatabaseExample -exampleCounter_LIBS += exampleCounterSupport -exampleCounter_LIBS += $(EPICS_BASE_IOC_LIBS) - -#=========================== - -include $(TOP)/configure/RULES -#---------------------------------------- -# ADD RULES AFTER THIS LINE - diff --git a/example/v3IOC/exampleCounter/src/exampleCounterMain.cpp b/example/v3IOC/exampleCounter/src/exampleCounterMain.cpp deleted file mode 100644 index 4e3e324..0000000 --- a/example/v3IOC/exampleCounter/src/exampleCounterMain.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* exampleCounterMain.cpp */ -/** - * Copyright - See the COPYRIGHT that is included with this distribution. - * EPICS pvData is distributed subject to a Software License Agreement found - * in file LICENSE that is included with this distribution. - */ -/** - * @author mrk - * @date 2013.07.24 - */ - -#include -#include -#include -#include -#include - -#include "epicsExit.h" -#include "epicsThread.h" -#include "iocsh.h" - -int main(int argc,char *argv[]) -{ - if(argc>=2) { - iocsh(argv[1]); - epicsThreadSleep(.2); - } - iocsh(NULL); - epicsExit(0); - return(0); -} diff --git a/example/v3IOC/examplePVADoubleArrayGet/Db/ai.db b/example/v3IOC/examplePVADoubleArrayGet/Db/ai.db deleted file mode 100644 index f440264..0000000 --- a/example/v3IOC/examplePVADoubleArrayGet/Db/ai.db +++ /dev/null @@ -1,13 +0,0 @@ -record(ai, "$(name)") -{ - field(PREC, "1") - field(EGU, "amps") - field(HIHI, "8") - field(HIGH, "6") - field(LOW, "4") - field(LOLO, "2") - field(HHSV, "MAJOR") - field(HSV, "MINOR") - field(LSV, "MINOR") - field(LLSV, "MAJOR") -} diff --git a/example/v3IOC/examplePVADoubleArrayGet/Makefile b/example/v3IOC/examplePVADoubleArrayGet/Makefile deleted file mode 100644 index 79e50eb..0000000 --- a/example/v3IOC/examplePVADoubleArrayGet/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -TOP = ../../.. -include $(TOP)/configure/CONFIG -DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *src*)) -DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Src*)) -DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *db*)) -DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Db*)) -include $(TOP)/configure/RULES_DIRS - diff --git a/example/v3IOC/exampleServer/src/exampleServer.cpp b/example/v3IOC/exampleServer/src/exampleServer.cpp deleted file mode 100644 index 6a3847b..0000000 --- a/example/v3IOC/exampleServer/src/exampleServer.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/*exampleServer.cpp */ -/** - * Copyright - See the COPYRIGHT that is included with this distribution. - * EPICS pvData is distributed subject to a Software License Agreement found - * in file LICENSE that is included with this distribution. - */ -/** - * @author mrk - * @date 2013.07.24 - */ - - -/* Author: Marty Kraimer */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -using namespace epics::pvData; -using namespace epics::pvAccess; -using namespace epics::pvDatabase; - -static const iocshArg testArg0 = { "prefix", iocshArgString }; -static const iocshArg *testArgs[] = { - &testArg0}; - -static const iocshFuncDef exampleServerFuncDef = { - "exampleServerCreateRecords", 1, testArgs}; -static void exampleServerCallFunc(const iocshArgBuf *args) -{ - ExampleServerCreateRecords::create(); -} - -static void exampleServerRegister(void) -{ - static int firstTime = 1; - if (firstTime) { - firstTime = 0; - iocshRegister(&exampleServerFuncDef, exampleServerCallFunc); - } -} -epicsExportRegistrar(exampleServerRegister); diff --git a/exampleLink/Makefile b/exampleLink/Makefile new file mode 100644 index 0000000..db71505 --- /dev/null +++ b/exampleLink/Makefile @@ -0,0 +1,16 @@ +#Makefile at top of application tree +TOP = . +include $(TOP)/configure/CONFIG +DIRS += configure + +DIRS += src +src_DEPEND_DIRS = configure + +DIRS += example +test_DEPEND_DIRS = src + +DIRS += iocBoot + +include $(TOP)/configure/RULES_TOP + + diff --git a/exampleLink/configure/CONFIG b/exampleLink/configure/CONFIG new file mode 100644 index 0000000..c1a4703 --- /dev/null +++ b/exampleLink/configure/CONFIG @@ -0,0 +1,29 @@ +# CONFIG - Load build configuration data +# +# Do not make changes to this file! + +# Allow user to override where the build rules come from +RULES = $(EPICS_BASE) + +# RELEASE files point to other application tops +include $(TOP)/configure/RELEASE +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common +ifdef T_A +-include $(TOP)/configure/RELEASE.Common.$(T_A) +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) +endif + +CONFIG = $(RULES)/configure +include $(CONFIG)/CONFIG + +# Override the Base definition: +INSTALL_LOCATION = $(TOP) + +# CONFIG_SITE files contain other build configuration settings +include $(TOP)/configure/CONFIG_SITE +-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common +ifdef T_A + -include $(TOP)/configure/CONFIG_SITE.Common.$(T_A) + -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) +endif + diff --git a/exampleLink/configure/CONFIG_SITE b/exampleLink/configure/CONFIG_SITE new file mode 100644 index 0000000..9e1ec9a --- /dev/null +++ b/exampleLink/configure/CONFIG_SITE @@ -0,0 +1,39 @@ +# CONFIG_SITE + +# Make any application-specific changes to the EPICS build +# configuration variables in this file. +# +# Host/target specific settings can be specified in files named +# CONFIG_SITE.$(EPICS_HOST_ARCH).Common +# CONFIG_SITE.Common.$(T_A) +# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) + +# CHECK_RELEASE controls the consistency checking of the support +# applications pointed to by the RELEASE* files. +# Normally CHECK_RELEASE should be set to YES. +# Set CHECK_RELEASE to NO to disable checking completely. +# Set CHECK_RELEASE to WARN to perform consistency checking but +# continue building anyway if conflicts are found. +#CHECK_RELEASE = YES + +# Set this when you only want to compile this application +# for a subset of the cross-compiled target architectures +# that Base is built for. +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 + +# To install files into a location other than $(TOP) define +# INSTALL_LOCATION here. +#INSTALL_LOCATION= + +# Set this when your IOC and the host use different paths +# to access the application. This will be needed to boot +# from a Microsoft FTP server or with some NFS mounts. +# You must rebuild in the iocBoot directory for this to +# take effect. +#IOCS_APPL_TOP = + +INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv +USR_INCLUDES += -I $(INSTALL_LOCATION)/include + +-include $(TOP)/configure/CONFIG_SITE.local +-include $(TOP)/../CONFIG.local diff --git a/exampleLink/configure/Makefile b/exampleLink/configure/Makefile new file mode 100644 index 0000000..9254309 --- /dev/null +++ b/exampleLink/configure/Makefile @@ -0,0 +1,8 @@ +TOP=.. + +include $(TOP)/configure/CONFIG + +TARGETS = $(CONFIG_TARGETS) +CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS))) + +include $(TOP)/configure/RULES diff --git a/exampleLink/configure/RELEASE b/exampleLink/configure/RELEASE new file mode 100644 index 0000000..15c3090 --- /dev/null +++ b/exampleLink/configure/RELEASE @@ -0,0 +1,44 @@ +# RELEASE - Location of external support modules +# +# IF YOU MAKE ANY CHANGES to this file you must subsequently +# do a "gnumake rebuild" in this application's top level +# directory. +# +# The build process does not check dependencies against files +# that are outside this application, thus you should do a +# "gnumake rebuild" in the top level directory after EPICS_BASE +# or any other external module pointed to below is rebuilt. +# +# Host- or target-specific settings can be given in files named +# RELEASE.$(EPICS_HOST_ARCH).Common +# RELEASE.Common.$(T_A) +# RELEASE.$(EPICS_HOST_ARCH).$(T_A) +# +# This file should ONLY define paths to other support modules, +# or include statements that pull in similar RELEASE files. +# Build settings that are NOT module paths should appear in a +# CONFIG_SITE file. + +TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top + +# If using the sequencer, point SNCSEQ at its top directory: +#SNCSEQ=$(EPICS_BASE)/../modules/soft/seq + +# EPICS_BASE usually appears last so other apps can override stuff: + +# do not edit the locations in this file +# create RELEASE.local with the paths to your EPICS_BASE, PVDATA, and PVACCESS +# these default locations are needed for the BNL Jenkins server to work + +# Set RULES here if you want to take build rules from somewhere +# other than EPICS_BASE: +#RULES=/path/to/epics/support/module/rules/x-y + +# Leave these in for the Jenkins build at BNL to work +EPICS_BASE=/home/install/epics/base +PVDATA=/home/mrk/hg/pvDataCPP +PVACCESS=/home/mrk/hg/pvAccessCPP + +# set your EPICS_BASE, PVDATA and PVACCESS paths in here +-include $(TOP)/../RELEASE.local +-include $(TOP)/configure/RELEASE.local diff --git a/exampleLink/configure/RELEASE.local b/exampleLink/configure/RELEASE.local new file mode 100644 index 0000000..95e3783 --- /dev/null +++ b/exampleLink/configure/RELEASE.local @@ -0,0 +1,8 @@ +EPICS_BASE=/home/install/epics/base +TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top +EPICSV4HOME=/home/hg +PVCOMMON=${EPICSV4HOME}/pvCommonCPP +PVDATA=${EPICSV4HOME}/pvDataCPP +PVACCESS=${EPICSV4HOME}/pvAccessCPP +PVDATABASE=${EPICSV4HOME}/pvDatabaseCPP +PVASRV=${EPICSV4HOME}/pvaSrv diff --git a/exampleLink/configure/RULES b/exampleLink/configure/RULES new file mode 100644 index 0000000..6d56e14 --- /dev/null +++ b/exampleLink/configure/RULES @@ -0,0 +1,6 @@ +# RULES + +include $(CONFIG)/RULES + +# Library should be rebuilt because LIBOBJS may have changed. +$(LIBNAME): ../Makefile diff --git a/exampleLink/configure/RULES.ioc b/exampleLink/configure/RULES.ioc new file mode 100644 index 0000000..901987c --- /dev/null +++ b/exampleLink/configure/RULES.ioc @@ -0,0 +1,2 @@ +#RULES.ioc +include $(CONFIG)/RULES.ioc diff --git a/exampleLink/configure/RULES_DIRS b/exampleLink/configure/RULES_DIRS new file mode 100644 index 0000000..3ba269d --- /dev/null +++ b/exampleLink/configure/RULES_DIRS @@ -0,0 +1,2 @@ +#RULES_DIRS +include $(CONFIG)/RULES_DIRS diff --git a/exampleLink/configure/RULES_TOP b/exampleLink/configure/RULES_TOP new file mode 100644 index 0000000..d09d668 --- /dev/null +++ b/exampleLink/configure/RULES_TOP @@ -0,0 +1,3 @@ +#RULES_TOP +include $(CONFIG)/RULES_TOP + diff --git a/example/v3IOC/examplePVADoubleArrayGet/Db/Makefile b/exampleLink/example/Db/Makefile similarity index 97% rename from example/v3IOC/examplePVADoubleArrayGet/Db/Makefile rename to exampleLink/example/Db/Makefile index 0872e39..10bca52 100644 --- a/example/v3IOC/examplePVADoubleArrayGet/Db/Makefile +++ b/exampleLink/example/Db/Makefile @@ -1,4 +1,4 @@ -TOP=../../../.. +TOP=../.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE diff --git a/example/v3IOC/exampleCounter/Db/ai.db b/exampleLink/example/Db/ai.db similarity index 100% rename from example/v3IOC/exampleCounter/Db/ai.db rename to exampleLink/example/Db/ai.db diff --git a/example/v3IOC/exampleServer/Makefile b/exampleLink/example/Makefile similarity index 95% rename from example/v3IOC/exampleServer/Makefile rename to exampleLink/example/Makefile index 79e50eb..10e0126 100644 --- a/example/v3IOC/exampleServer/Makefile +++ b/exampleLink/example/Makefile @@ -1,4 +1,4 @@ -TOP = ../../.. +TOP = .. include $(TOP)/configure/CONFIG DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *src*)) DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Src*)) diff --git a/example/v3IOC/examplePVADoubleArrayGet/src/Makefile b/exampleLink/example/src/Makefile similarity index 71% rename from example/v3IOC/examplePVADoubleArrayGet/src/Makefile rename to exampleLink/example/src/Makefile index 7c2e0a2..b27ddcf 100644 --- a/example/v3IOC/examplePVADoubleArrayGet/src/Makefile +++ b/exampleLink/example/src/Makefile @@ -1,4 +1,4 @@ -TOP=../../../.. +TOP=../.. include $(TOP)/configure/CONFIG #---------------------------------------- @@ -9,19 +9,12 @@ include $(TOP)/configure/CONFIG # Build an IOC support library # -DBD += examplePVADoubleArrayGet.dbd - -LIBRARY_IOC += examplePVADoubleArrayGetSupport -examplePVADoubleArrayGetSupport_SRCS += examplePVADoubleArrayGet.cpp -examplePVADoubleArrayGetSupport_LIBS += pvData -examplePVADoubleArrayGetSupport_LIBS += pvAccess -examplePVADoubleArrayGetSupport_LIBS += pvDatabase -examplePVADoubleArrayGetSupport_LIBS += pvDatabaseExample -examplePVADoubleArrayGetSupport_LIBS += $(EPICS_BASE_IOC_LIBS) - #============================= # build an ioc application + +DBD += examplePVADoubleArrayGet.dbd + PROD_IOC += examplePVADoubleArrayGet @@ -36,7 +29,6 @@ examplePVADoubleArrayGet_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary examplePVADoubleArrayGet_LIBS += pvData pvAccess examplePVADoubleArrayGet_LIBS += pvDatabase -examplePVADoubleArrayGet_LIBS += pvDatabaseExample examplePVADoubleArrayGet_LIBS += examplePVADoubleArrayGetSupport examplePVADoubleArrayGet_LIBS += $(EPICS_BASE_IOC_LIBS) diff --git a/example/v3IOC/examplePVADoubleArrayGet/src/examplePVADoubleArrayGetInclude.dbd b/exampleLink/example/src/examplePVADoubleArrayGetInclude.dbd similarity index 100% rename from example/v3IOC/examplePVADoubleArrayGet/src/examplePVADoubleArrayGetInclude.dbd rename to exampleLink/example/src/examplePVADoubleArrayGetInclude.dbd diff --git a/example/v3IOC/examplePVADoubleArrayGet/src/examplePVADoubleArrayGetMain.cpp b/exampleLink/example/src/examplePVADoubleArrayGetMain.cpp similarity index 100% rename from example/v3IOC/examplePVADoubleArrayGet/src/examplePVADoubleArrayGetMain.cpp rename to exampleLink/example/src/examplePVADoubleArrayGetMain.cpp diff --git a/iocBoot/Makefile b/exampleLink/iocBoot/Makefile similarity index 100% rename from iocBoot/Makefile rename to exampleLink/iocBoot/Makefile diff --git a/iocBoot/exampleCounter/Makefile b/exampleLink/iocBoot/examplePVADoubleArrayGet/Makefile similarity index 100% rename from iocBoot/exampleCounter/Makefile rename to exampleLink/iocBoot/examplePVADoubleArrayGet/Makefile diff --git a/iocBoot/examplePVADoubleArrayGet/st.local b/exampleLink/iocBoot/examplePVADoubleArrayGet/st.local similarity index 100% rename from iocBoot/examplePVADoubleArrayGet/st.local rename to exampleLink/iocBoot/examplePVADoubleArrayGet/st.local diff --git a/iocBoot/examplePVADoubleArrayGet/st.remote b/exampleLink/iocBoot/examplePVADoubleArrayGet/st.remote similarity index 100% rename from iocBoot/examplePVADoubleArrayGet/st.remote rename to exampleLink/iocBoot/examplePVADoubleArrayGet/st.remote diff --git a/exampleLink/src/Makefile b/exampleLink/src/Makefile new file mode 100644 index 0000000..42f0c48 --- /dev/null +++ b/exampleLink/src/Makefile @@ -0,0 +1,29 @@ +TOP=.. + +include $(TOP)/configure/CONFIG +#---------------------------------------- +# ADD MACRO DEFINITIONS AFTER THIS LINE +#============================= + +#================================================== +# Build an IOC support library +# + +DBD += examplePVADoubleArrayGet.dbd + +INC += examplePVADoubleArrayGet.h + +LIBRARY_IOC += examplePVADoubleArrayGetSupport +examplePVADoubleArrayGetSupport_SRCS += examplePVADoubleArrayGet.cpp +examplePVADoubleArrayGetSupport_SRCS += examplePVADoubleArrayGetRegister.cpp +examplePVADoubleArrayGetSupport_LIBS += pvData +examplePVADoubleArrayGetSupport_LIBS += pvAccess +examplePVADoubleArrayGetSupport_LIBS += pvDatabase +examplePVADoubleArrayGetSupport_LIBS += $(EPICS_BASE_IOC_LIBS) + +#=========================== + +include $(TOP)/configure/RULES +#---------------------------------------- +# ADD RULES AFTER THIS LINE + diff --git a/example/src/examplePVADoubleArrayGet/examplePVADoubleArrayGet.cpp b/exampleLink/src/examplePVADoubleArrayGet.cpp similarity index 100% rename from example/src/examplePVADoubleArrayGet/examplePVADoubleArrayGet.cpp rename to exampleLink/src/examplePVADoubleArrayGet.cpp diff --git a/example/src/examplePVADoubleArrayGet/examplePVADoubleArrayGet.h b/exampleLink/src/examplePVADoubleArrayGet.h similarity index 100% rename from example/src/examplePVADoubleArrayGet/examplePVADoubleArrayGet.h rename to exampleLink/src/examplePVADoubleArrayGet.h diff --git a/example/v3IOC/exampleCounter/src/exampleCounterInclude.dbd b/exampleLink/src/examplePVADoubleArrayGetInclude.dbd similarity index 54% rename from example/v3IOC/exampleCounter/src/exampleCounterInclude.dbd rename to exampleLink/src/examplePVADoubleArrayGetInclude.dbd index cea7376..3b4e9f0 100644 --- a/example/v3IOC/exampleCounter/src/exampleCounterInclude.dbd +++ b/exampleLink/src/examplePVADoubleArrayGetInclude.dbd @@ -1,4 +1,5 @@ include "base.dbd" include "PVAServerRegister.dbd" +include "PVAClientRegister.dbd" include "registerChannelProviderLocal.dbd" -registrar("exampleCounterRegister") +registrar("examplePVADoubleArrayGetRegister") diff --git a/example/v3IOC/examplePVADoubleArrayGet/src/examplePVADoubleArrayGet.cpp b/exampleLink/src/examplePVADoubleArrayGetRegister.cpp similarity index 100% rename from example/v3IOC/examplePVADoubleArrayGet/src/examplePVADoubleArrayGet.cpp rename to exampleLink/src/examplePVADoubleArrayGetRegister.cpp diff --git a/exampleServer/Makefile b/exampleServer/Makefile new file mode 100644 index 0000000..db71505 --- /dev/null +++ b/exampleServer/Makefile @@ -0,0 +1,16 @@ +#Makefile at top of application tree +TOP = . +include $(TOP)/configure/CONFIG +DIRS += configure + +DIRS += src +src_DEPEND_DIRS = configure + +DIRS += example +test_DEPEND_DIRS = src + +DIRS += iocBoot + +include $(TOP)/configure/RULES_TOP + + diff --git a/exampleServer/configure/CONFIG b/exampleServer/configure/CONFIG new file mode 100644 index 0000000..c1a4703 --- /dev/null +++ b/exampleServer/configure/CONFIG @@ -0,0 +1,29 @@ +# CONFIG - Load build configuration data +# +# Do not make changes to this file! + +# Allow user to override where the build rules come from +RULES = $(EPICS_BASE) + +# RELEASE files point to other application tops +include $(TOP)/configure/RELEASE +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common +ifdef T_A +-include $(TOP)/configure/RELEASE.Common.$(T_A) +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) +endif + +CONFIG = $(RULES)/configure +include $(CONFIG)/CONFIG + +# Override the Base definition: +INSTALL_LOCATION = $(TOP) + +# CONFIG_SITE files contain other build configuration settings +include $(TOP)/configure/CONFIG_SITE +-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common +ifdef T_A + -include $(TOP)/configure/CONFIG_SITE.Common.$(T_A) + -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) +endif + diff --git a/exampleServer/configure/CONFIG_SITE b/exampleServer/configure/CONFIG_SITE new file mode 100644 index 0000000..9e1ec9a --- /dev/null +++ b/exampleServer/configure/CONFIG_SITE @@ -0,0 +1,39 @@ +# CONFIG_SITE + +# Make any application-specific changes to the EPICS build +# configuration variables in this file. +# +# Host/target specific settings can be specified in files named +# CONFIG_SITE.$(EPICS_HOST_ARCH).Common +# CONFIG_SITE.Common.$(T_A) +# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) + +# CHECK_RELEASE controls the consistency checking of the support +# applications pointed to by the RELEASE* files. +# Normally CHECK_RELEASE should be set to YES. +# Set CHECK_RELEASE to NO to disable checking completely. +# Set CHECK_RELEASE to WARN to perform consistency checking but +# continue building anyway if conflicts are found. +#CHECK_RELEASE = YES + +# Set this when you only want to compile this application +# for a subset of the cross-compiled target architectures +# that Base is built for. +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 + +# To install files into a location other than $(TOP) define +# INSTALL_LOCATION here. +#INSTALL_LOCATION= + +# Set this when your IOC and the host use different paths +# to access the application. This will be needed to boot +# from a Microsoft FTP server or with some NFS mounts. +# You must rebuild in the iocBoot directory for this to +# take effect. +#IOCS_APPL_TOP = + +INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv +USR_INCLUDES += -I $(INSTALL_LOCATION)/include + +-include $(TOP)/configure/CONFIG_SITE.local +-include $(TOP)/../CONFIG.local diff --git a/exampleServer/configure/Makefile b/exampleServer/configure/Makefile new file mode 100644 index 0000000..9254309 --- /dev/null +++ b/exampleServer/configure/Makefile @@ -0,0 +1,8 @@ +TOP=.. + +include $(TOP)/configure/CONFIG + +TARGETS = $(CONFIG_TARGETS) +CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS))) + +include $(TOP)/configure/RULES diff --git a/exampleServer/configure/RELEASE b/exampleServer/configure/RELEASE new file mode 100644 index 0000000..15c3090 --- /dev/null +++ b/exampleServer/configure/RELEASE @@ -0,0 +1,44 @@ +# RELEASE - Location of external support modules +# +# IF YOU MAKE ANY CHANGES to this file you must subsequently +# do a "gnumake rebuild" in this application's top level +# directory. +# +# The build process does not check dependencies against files +# that are outside this application, thus you should do a +# "gnumake rebuild" in the top level directory after EPICS_BASE +# or any other external module pointed to below is rebuilt. +# +# Host- or target-specific settings can be given in files named +# RELEASE.$(EPICS_HOST_ARCH).Common +# RELEASE.Common.$(T_A) +# RELEASE.$(EPICS_HOST_ARCH).$(T_A) +# +# This file should ONLY define paths to other support modules, +# or include statements that pull in similar RELEASE files. +# Build settings that are NOT module paths should appear in a +# CONFIG_SITE file. + +TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top + +# If using the sequencer, point SNCSEQ at its top directory: +#SNCSEQ=$(EPICS_BASE)/../modules/soft/seq + +# EPICS_BASE usually appears last so other apps can override stuff: + +# do not edit the locations in this file +# create RELEASE.local with the paths to your EPICS_BASE, PVDATA, and PVACCESS +# these default locations are needed for the BNL Jenkins server to work + +# Set RULES here if you want to take build rules from somewhere +# other than EPICS_BASE: +#RULES=/path/to/epics/support/module/rules/x-y + +# Leave these in for the Jenkins build at BNL to work +EPICS_BASE=/home/install/epics/base +PVDATA=/home/mrk/hg/pvDataCPP +PVACCESS=/home/mrk/hg/pvAccessCPP + +# set your EPICS_BASE, PVDATA and PVACCESS paths in here +-include $(TOP)/../RELEASE.local +-include $(TOP)/configure/RELEASE.local diff --git a/exampleServer/configure/RELEASE.local b/exampleServer/configure/RELEASE.local new file mode 100644 index 0000000..95e3783 --- /dev/null +++ b/exampleServer/configure/RELEASE.local @@ -0,0 +1,8 @@ +EPICS_BASE=/home/install/epics/base +TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top +EPICSV4HOME=/home/hg +PVCOMMON=${EPICSV4HOME}/pvCommonCPP +PVDATA=${EPICSV4HOME}/pvDataCPP +PVACCESS=${EPICSV4HOME}/pvAccessCPP +PVDATABASE=${EPICSV4HOME}/pvDatabaseCPP +PVASRV=${EPICSV4HOME}/pvaSrv diff --git a/exampleServer/configure/RULES b/exampleServer/configure/RULES new file mode 100644 index 0000000..6d56e14 --- /dev/null +++ b/exampleServer/configure/RULES @@ -0,0 +1,6 @@ +# RULES + +include $(CONFIG)/RULES + +# Library should be rebuilt because LIBOBJS may have changed. +$(LIBNAME): ../Makefile diff --git a/exampleServer/configure/RULES.ioc b/exampleServer/configure/RULES.ioc new file mode 100644 index 0000000..901987c --- /dev/null +++ b/exampleServer/configure/RULES.ioc @@ -0,0 +1,2 @@ +#RULES.ioc +include $(CONFIG)/RULES.ioc diff --git a/exampleServer/configure/RULES_DIRS b/exampleServer/configure/RULES_DIRS new file mode 100644 index 0000000..3ba269d --- /dev/null +++ b/exampleServer/configure/RULES_DIRS @@ -0,0 +1,2 @@ +#RULES_DIRS +include $(CONFIG)/RULES_DIRS diff --git a/exampleServer/configure/RULES_TOP b/exampleServer/configure/RULES_TOP new file mode 100644 index 0000000..d09d668 --- /dev/null +++ b/exampleServer/configure/RULES_TOP @@ -0,0 +1,3 @@ +#RULES_TOP +include $(CONFIG)/RULES_TOP + diff --git a/example/v3IOC/exampleServer/Db/Makefile b/exampleServer/example/Db/Makefile similarity index 97% rename from example/v3IOC/exampleServer/Db/Makefile rename to exampleServer/example/Db/Makefile index 9ff6ad0..1e9fd60 100644 --- a/example/v3IOC/exampleServer/Db/Makefile +++ b/exampleServer/example/Db/Makefile @@ -1,4 +1,4 @@ -TOP=../../../.. +TOP=../.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE diff --git a/example/v3IOC/exampleServer/Db/dbArray.db b/exampleServer/example/Db/dbArray.db similarity index 100% rename from example/v3IOC/exampleServer/Db/dbArray.db rename to exampleServer/example/Db/dbArray.db diff --git a/example/v3IOC/exampleServer/Db/dbCounter.db b/exampleServer/example/Db/dbCounter.db similarity index 100% rename from example/v3IOC/exampleServer/Db/dbCounter.db rename to exampleServer/example/Db/dbCounter.db diff --git a/example/v3IOC/exampleServer/Db/dbEnum.db b/exampleServer/example/Db/dbEnum.db similarity index 100% rename from example/v3IOC/exampleServer/Db/dbEnum.db rename to exampleServer/example/Db/dbEnum.db diff --git a/example/v3IOC/exampleServer/Db/dbInteger.db b/exampleServer/example/Db/dbInteger.db similarity index 100% rename from example/v3IOC/exampleServer/Db/dbInteger.db rename to exampleServer/example/Db/dbInteger.db diff --git a/example/v3IOC/exampleServer/Db/dbScalar.db b/exampleServer/example/Db/dbScalar.db similarity index 100% rename from example/v3IOC/exampleServer/Db/dbScalar.db rename to exampleServer/example/Db/dbScalar.db diff --git a/example/v3IOC/exampleServer/Db/dbString.db b/exampleServer/example/Db/dbString.db similarity index 100% rename from example/v3IOC/exampleServer/Db/dbString.db rename to exampleServer/example/Db/dbString.db diff --git a/example/v3IOC/exampleServer/Db/dbStringArray.db b/exampleServer/example/Db/dbStringArray.db similarity index 100% rename from example/v3IOC/exampleServer/Db/dbStringArray.db rename to exampleServer/example/Db/dbStringArray.db diff --git a/example/v3IOC/exampleCounter/Makefile b/exampleServer/example/Makefile similarity index 95% rename from example/v3IOC/exampleCounter/Makefile rename to exampleServer/example/Makefile index 79e50eb..10e0126 100644 --- a/example/v3IOC/exampleCounter/Makefile +++ b/exampleServer/example/Makefile @@ -1,4 +1,4 @@ -TOP = ../../.. +TOP = .. include $(TOP)/configure/CONFIG DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *src*)) DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Src*)) diff --git a/example/v3IOC/exampleServer/src/Makefile b/exampleServer/example/src/Makefile similarity index 73% rename from example/v3IOC/exampleServer/src/Makefile rename to exampleServer/example/src/Makefile index 301d834..6595bbb 100644 --- a/example/v3IOC/exampleServer/src/Makefile +++ b/exampleServer/example/src/Makefile @@ -1,4 +1,4 @@ -TOP=../../../.. +TOP=../.. include $(TOP)/configure/CONFIG #---------------------------------------- @@ -11,14 +11,6 @@ include $(TOP)/configure/CONFIG DBD += exampleServer.dbd -LIBRARY_IOC += exampleServerSupport -exampleServerSupport_SRCS += exampleServer.cpp -exampleServerSupport_LIBS += pvData -exampleServerSupport_LIBS += pvAccess -exampleServerSupport_LIBS += pvDatabase -exampleServerSupport_LIBS += pvDatabaseExample -exampleServerSupport_LIBS += $(EPICS_BASE_IOC_LIBS) - #============================= # build an ioc application @@ -36,7 +28,7 @@ exampleServer_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary exampleServer_LIBS += pvData pvAccess exampleServer_LIBS += pvDatabase -exampleServer_LIBS += pvDatabaseExample +exampleServer_LIBS += pvaSrv exampleServer_LIBS += exampleServerSupport exampleServer_LIBS += $(EPICS_BASE_IOC_LIBS) diff --git a/example/v3IOC/exampleServer/src/exampleServerInclude.dbd b/exampleServer/example/src/exampleServerInclude.dbd similarity index 66% rename from example/v3IOC/exampleServer/src/exampleServerInclude.dbd rename to exampleServer/example/src/exampleServerInclude.dbd index df23c3c..2aa17f9 100644 --- a/example/v3IOC/exampleServer/src/exampleServerInclude.dbd +++ b/exampleServer/example/src/exampleServerInclude.dbd @@ -1,4 +1,5 @@ include "base.dbd" include "PVAServerRegister.dbd" include "registerChannelProviderLocal.dbd" -registrar("exampleServerRegister") +include "dbPv.dbd" +include "exampleServer.dbd" diff --git a/example/v3IOC/exampleServer/src/exampleServerMain.cpp b/exampleServer/example/src/exampleServerMain.cpp similarity index 100% rename from example/v3IOC/exampleServer/src/exampleServerMain.cpp rename to exampleServer/example/src/exampleServerMain.cpp diff --git a/exampleServer/iocBoot/Makefile b/exampleServer/iocBoot/Makefile new file mode 100644 index 0000000..b6d6f07 --- /dev/null +++ b/exampleServer/iocBoot/Makefile @@ -0,0 +1,7 @@ +TOP = .. +include $(TOP)/configure/CONFIG +DIRS += $(wildcard *ioc*) +DIRS += $(wildcard as*) +DIRS += $(wildcard example*) +include $(EPICS_BASE)/configure/RULES_DIRS + diff --git a/iocBoot/examplePVADoubleArrayGet/Makefile b/exampleServer/iocBoot/exampleServer/Makefile similarity index 100% rename from iocBoot/examplePVADoubleArrayGet/Makefile rename to exampleServer/iocBoot/exampleServer/Makefile diff --git a/exampleServer/iocBoot/exampleServer/st.cmd b/exampleServer/iocBoot/exampleServer/st.cmd new file mode 100644 index 0000000..8528e92 --- /dev/null +++ b/exampleServer/iocBoot/exampleServer/st.cmd @@ -0,0 +1,23 @@ +< envPaths + +cd ${TOP} + +## Register all support components +dbLoadDatabase("dbd/exampleServer.dbd") +exampleServer_registerRecordDeviceDriver(pdbbase) + +## Load record instances +dbLoadRecords("db/dbScalar.db","name=pvdouble,type=ao") +dbLoadRecords("db/dbArray.db","name=pvdoubleArray,type=DOUBLE") +dbLoadRecords("db/dbStringArray.db","name=pvstringArray") +dbLoadRecords("db/dbEnum.db","name=pvenum") +dbLoadRecords("db/dbCounter.db","name=pvcounter"); + +cd ${TOP}/iocBoot/${IOC} +iocInit() +dbl +epicsThreadSleep(1.0) +exampleServerCreateRecord pvaServer +startPVAServer +pvdbl + diff --git a/exampleServer/src/Makefile b/exampleServer/src/Makefile new file mode 100644 index 0000000..aa91808 --- /dev/null +++ b/exampleServer/src/Makefile @@ -0,0 +1,29 @@ +TOP=.. + +include $(TOP)/configure/CONFIG +#---------------------------------------- +# ADD MACRO DEFINITIONS AFTER THIS LINE +#============================= + +#================================================== +# Build an IOC support library +# + +DBD += exampleServer.dbd + +INC += exampleServer.h + +LIBRARY_IOC += exampleServerSupport +exampleServerSupport_SRCS += exampleServer.cpp +exampleServerSupport_SRCS += exampleServerRegister.cpp +exampleServerSupport_LIBS += pvData +exampleServerSupport_LIBS += pvAccess +exampleServerSupport_LIBS += pvDatabase +exampleServerSupport_LIBS += $(EPICS_BASE_IOC_LIBS) + +#=========================== + +include $(TOP)/configure/RULES +#---------------------------------------- +# ADD RULES AFTER THIS LINE + diff --git a/exampleServer/src/exampleServer.cpp b/exampleServer/src/exampleServer.cpp new file mode 100644 index 0000000..0ed388b --- /dev/null +++ b/exampleServer/src/exampleServer.cpp @@ -0,0 +1,79 @@ +/* exampleServer.cpp */ +/** + * Copyright - See the COPYRIGHT that is included with this distribution. + * EPICS pvData is distributed subject to a Software License Agreement found + * in file LICENSE that is included with this distribution. + */ +/** + * @author mrk + * @date 2013.04.02 + */ + +#include +#include + +namespace epics { namespace exampleServer { +using namespace epics::pvData; +using namespace epics::pvDatabase; +using std::tr1::static_pointer_cast; + + +ExampleServerPtr ExampleServer::create( + String const & recordName) +{ + StandardPVFieldPtr standardPVField = getStandardPVField(); + PVDataCreatePtr pvDataCreate = getPVDataCreate(); + PVStructurePtr pvArgument = standardPVField->scalar(pvString,""); + PVStructurePtr pvResult = standardPVField->scalar(pvString,"timeStamp"); + StringArray names; + names.reserve(2); + PVFieldPtrArray fields; + fields.reserve(2); + names.push_back("argument"); + fields.push_back(pvArgument); + names.push_back("result"); + fields.push_back(pvResult); + PVStructurePtr pvStructure = pvDataCreate->createPVStructure(names,fields); + ExampleServerPtr pvRecord( + new ExampleServer(recordName,pvStructure)); + if(!pvRecord->init()) pvRecord.reset(); + return pvRecord; +} + +ExampleServer::ExampleServer( + String const & recordName, + PVStructurePtr const & pvStructure) +: PVRecord(recordName,pvStructure) +{ +} + +ExampleServer::~ExampleServer() +{ +} + +void ExampleServer::destroy() +{ + PVRecord::destroy(); +} + +bool ExampleServer::init() +{ + + initPVRecord(); + PVFieldPtr pvField; + pvArgumentValue = getPVStructure()->getStringField("argument.value"); + if(pvArgumentValue.get()==NULL) return false; + pvResultValue = getPVStructure()->getStringField("result.value"); + if(pvResultValue.get()==NULL) return false; + pvTimeStamp.attach(getPVStructure()->getSubField("result.timeStamp")); + return true; +} + +void ExampleServer::process() +{ + pvResultValue->put(String("Hello ") + pvArgumentValue->get()); + timeStamp.getCurrent(); + pvTimeStamp.set(timeStamp); +} + +}} diff --git a/exampleServer/src/exampleServer.h b/exampleServer/src/exampleServer.h new file mode 100644 index 0000000..e63d437 --- /dev/null +++ b/exampleServer/src/exampleServer.h @@ -0,0 +1,49 @@ +/* exampleServer.h */ +/** + * Copyright - See the COPYRIGHT that is included with this distribution. + * EPICS pvData is distributed subject to a Software License Agreement found + * in file LICENSE that is included with this distribution. + */ +/** + * @author mrk + * @date 2013.04.02 + */ +#ifndef EXAMPLECOUNTER_H +#define EXAMPLECOUNTER_H + + +#include +#include +#include + +namespace epics { namespace exampleServer { + + +class ExampleServer; +typedef std::tr1::shared_ptr ExampleServerPtr; + +class ExampleServer : + public epics::pvDatabase::PVRecord +{ +public: + POINTER_DEFINITIONS(ExampleServer); + static ExampleServerPtr create( + epics::pvData::String const & recordName); + virtual ~ExampleServer(); + virtual void destroy(); + virtual bool init(); + virtual void process(); +private: + ExampleServer(epics::pvData::String const & recordName, + epics::pvData::PVStructurePtr const & pvStructure); + + epics::pvData::PVStringPtr pvArgumentValue; + epics::pvData::PVStringPtr pvResultValue; + epics::pvData::PVTimeStamp pvTimeStamp; + epics::pvData::TimeStamp timeStamp; +}; + + +}} + +#endif /* EXAMPLECOUNTER_H */ diff --git a/exampleServer/src/exampleServerInclude.dbd b/exampleServer/src/exampleServerInclude.dbd new file mode 100644 index 0000000..cb97782 --- /dev/null +++ b/exampleServer/src/exampleServerInclude.dbd @@ -0,0 +1 @@ +registrar("exampleServerRegister") diff --git a/example/v3IOC/exampleCounter/src/exampleCounter.cpp b/exampleServer/src/exampleServerRegister.cpp similarity index 71% rename from example/v3IOC/exampleCounter/src/exampleCounter.cpp rename to exampleServer/src/exampleServerRegister.cpp index f90dc41..a20d62d 100644 --- a/example/v3IOC/exampleCounter/src/exampleCounter.cpp +++ b/exampleServer/src/exampleServerRegister.cpp @@ -1,4 +1,4 @@ -/*exampleCounter.cpp */ +/*exampleServerRegister.cpp */ /** * Copyright - See the COPYRIGHT that is included with this distribution. * EPICS pvData is distributed subject to a Software License Agreement found @@ -33,11 +33,12 @@ #include #include #include -#include +#include using namespace epics::pvData; using namespace epics::pvAccess; using namespace epics::pvDatabase; +using namespace epics::exampleServer; using std::cout; using std::endl; @@ -45,22 +46,22 @@ static const iocshArg testArg0 = { "recordName", iocshArgString }; static const iocshArg *testArgs[] = { &testArg0}; -static const iocshFuncDef exampleCounterFuncDef = { - "exampleCounterCreateRecord", 1, testArgs}; -static void exampleCounterCallFunc(const iocshArgBuf *args) +static const iocshFuncDef exampleServerFuncDef = { + "exampleServerCreateRecord", 1, testArgs}; +static void exampleServerCallFunc(const iocshArgBuf *args) { char *recordName = args[0].sval; - ExampleCounterPtr record = ExampleCounter::create(recordName); + ExampleServerPtr record = ExampleServer::create(recordName); bool result = PVDatabase::getMaster()->addRecord(record); if(!result) cout << "recordname" << " not added" << endl; } -static void exampleCounterRegister(void) +static void exampleServerRegister(void) { static int firstTime = 1; if (firstTime) { firstTime = 0; - iocshRegister(&exampleCounterFuncDef, exampleCounterCallFunc); + iocshRegister(&exampleServerFuncDef, exampleServerCallFunc); } } -epicsExportRegistrar(exampleCounterRegister); +epicsExportRegistrar(exampleServerRegister); diff --git a/iocBoot/exampleCounter/st.cmd b/iocBoot/exampleCounter/st.cmd deleted file mode 100644 index 74dbd98..0000000 --- a/iocBoot/exampleCounter/st.cmd +++ /dev/null @@ -1,17 +0,0 @@ -< envPaths - -cd ${TOP} - -## Register all support components -dbLoadDatabase("dbd/exampleCounter.dbd") -exampleCounter_registerRecordDeviceDriver(pdbbase) - -## Load record instances -dbLoadRecords("db/ai.db","name=double01") - -cd ${TOP}/iocBoot/${IOC} -iocInit() -epicsThreadSleep(2.0) -casr -exampleCounterCreateRecord exampleCounter -startPVAServer diff --git a/iocBoot/exampleServer/Makefile b/iocBoot/exampleServer/Makefile deleted file mode 100644 index e1b9aa4..0000000 --- a/iocBoot/exampleServer/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -TOP = ../.. -include $(TOP)/configure/CONFIG -ARCH = $(EPICS_HOST_ARCH) -TARGETS = envPaths -include $(TOP)/configure/RULES.ioc diff --git a/iocBoot/exampleServer/st.cmd b/iocBoot/exampleServer/st.cmd deleted file mode 100644 index 661f882..0000000 --- a/iocBoot/exampleServer/st.cmd +++ /dev/null @@ -1,20 +0,0 @@ -< envPaths - -cd ${TOP} - -## Register all support components -dbLoadDatabase("dbd/exampleServer.dbd") -exampleServer_registerRecordDeviceDriver(pdbbase) - -## Load record instances -dbLoadRecords("db/dbScalar.db","name=double01,type=ao") -dbLoadRecords("db/dbStringArray.db","name=stringArray01") -dbLoadRecords("db/dbEnum.db","name=enum01") -dbLoadRecords("db/dbCounter.db","name=counter01"); - -cd ${TOP}/iocBoot/${IOC} -iocInit() -epicsThreadSleep(2.0) -casr -exampleServerCreateRecords -startPVAServer diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..999631d --- /dev/null +++ b/test/Makefile @@ -0,0 +1,11 @@ +#Makefile at top of application tree +TOP = . +include $(TOP)/configure/CONFIG +DIRS += configure + +DIRS += src +src_DEPEND_DIRS = configure + +include $(TOP)/configure/RULES_TOP + + diff --git a/test/configure/CONFIG b/test/configure/CONFIG new file mode 100644 index 0000000..c1a4703 --- /dev/null +++ b/test/configure/CONFIG @@ -0,0 +1,29 @@ +# CONFIG - Load build configuration data +# +# Do not make changes to this file! + +# Allow user to override where the build rules come from +RULES = $(EPICS_BASE) + +# RELEASE files point to other application tops +include $(TOP)/configure/RELEASE +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common +ifdef T_A +-include $(TOP)/configure/RELEASE.Common.$(T_A) +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) +endif + +CONFIG = $(RULES)/configure +include $(CONFIG)/CONFIG + +# Override the Base definition: +INSTALL_LOCATION = $(TOP) + +# CONFIG_SITE files contain other build configuration settings +include $(TOP)/configure/CONFIG_SITE +-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common +ifdef T_A + -include $(TOP)/configure/CONFIG_SITE.Common.$(T_A) + -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) +endif + diff --git a/test/configure/CONFIG_SITE b/test/configure/CONFIG_SITE new file mode 100644 index 0000000..9e1ec9a --- /dev/null +++ b/test/configure/CONFIG_SITE @@ -0,0 +1,39 @@ +# CONFIG_SITE + +# Make any application-specific changes to the EPICS build +# configuration variables in this file. +# +# Host/target specific settings can be specified in files named +# CONFIG_SITE.$(EPICS_HOST_ARCH).Common +# CONFIG_SITE.Common.$(T_A) +# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) + +# CHECK_RELEASE controls the consistency checking of the support +# applications pointed to by the RELEASE* files. +# Normally CHECK_RELEASE should be set to YES. +# Set CHECK_RELEASE to NO to disable checking completely. +# Set CHECK_RELEASE to WARN to perform consistency checking but +# continue building anyway if conflicts are found. +#CHECK_RELEASE = YES + +# Set this when you only want to compile this application +# for a subset of the cross-compiled target architectures +# that Base is built for. +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 + +# To install files into a location other than $(TOP) define +# INSTALL_LOCATION here. +#INSTALL_LOCATION= + +# Set this when your IOC and the host use different paths +# to access the application. This will be needed to boot +# from a Microsoft FTP server or with some NFS mounts. +# You must rebuild in the iocBoot directory for this to +# take effect. +#IOCS_APPL_TOP = + +INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv +USR_INCLUDES += -I $(INSTALL_LOCATION)/include + +-include $(TOP)/configure/CONFIG_SITE.local +-include $(TOP)/../CONFIG.local diff --git a/test/configure/Makefile b/test/configure/Makefile new file mode 100644 index 0000000..9254309 --- /dev/null +++ b/test/configure/Makefile @@ -0,0 +1,8 @@ +TOP=.. + +include $(TOP)/configure/CONFIG + +TARGETS = $(CONFIG_TARGETS) +CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS))) + +include $(TOP)/configure/RULES diff --git a/test/configure/RELEASE b/test/configure/RELEASE new file mode 100644 index 0000000..0e393a9 --- /dev/null +++ b/test/configure/RELEASE @@ -0,0 +1,44 @@ +# RELEASE - Location of external support modules +# +# IF YOU MAKE ANY CHANGES to this file you must subsequently +# do a "gnumake rebuild" in this application's top level +# directory. +# +# The build process does not check dependencies against files +# that are outside this application, thus you should do a +# "gnumake rebuild" in the top level directory after EPICS_BASE +# or any other external module pointed to below is rebuilt. +# +# Host- or target-specific settings can be given in files named +# RELEASE.$(EPICS_HOST_ARCH).Common +# RELEASE.Common.$(T_A) +# RELEASE.$(EPICS_HOST_ARCH).$(T_A) +# +# This file should ONLY define paths to other support modules, +# or include statements that pull in similar RELEASE files. +# Build settings that are NOT module paths should appear in a +# CONFIG_SITE file. + +TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top + +# If using the sequencer, point SNCSEQ at its top directory: +#SNCSEQ=$(EPICS_BASE)/../modules/soft/seq + +# EPICS_BASE usually appears last so other apps can override stuff: + +# do not edit the locations in this file +# create RELEASE.local with the paths to your EPICS_BASE, PVDATA, and PVACCESS +# these default locations are needed for the BNL Jenkins server to work + +# Set RULES here if you want to take build rules from somewhere +# other than EPICS_BASE: +#RULES=/path/to/epics/support/module/rules/x-y + +# Leave these in for the Jenkins build at BNL to work +EPICS_BASE=/home/install/epics/base +PVDATA=/home/mrk/hg/pvDataCPP +PVACCESS=/home/mrk/hg/pvAccessCPP + +# set your EPICS_BASE, PVDATA and PVACCESS paths in here +-include $(TOP)/../configure/RELEASE.local +PVDATABASE=$(TOP)/.. diff --git a/test/configure/RULES b/test/configure/RULES new file mode 100644 index 0000000..6d56e14 --- /dev/null +++ b/test/configure/RULES @@ -0,0 +1,6 @@ +# RULES + +include $(CONFIG)/RULES + +# Library should be rebuilt because LIBOBJS may have changed. +$(LIBNAME): ../Makefile diff --git a/test/configure/RULES.ioc b/test/configure/RULES.ioc new file mode 100644 index 0000000..901987c --- /dev/null +++ b/test/configure/RULES.ioc @@ -0,0 +1,2 @@ +#RULES.ioc +include $(CONFIG)/RULES.ioc diff --git a/test/configure/RULES_DIRS b/test/configure/RULES_DIRS new file mode 100644 index 0000000..3ba269d --- /dev/null +++ b/test/configure/RULES_DIRS @@ -0,0 +1,2 @@ +#RULES_DIRS +include $(CONFIG)/RULES_DIRS diff --git a/test/configure/RULES_TOP b/test/configure/RULES_TOP new file mode 100644 index 0000000..d09d668 --- /dev/null +++ b/test/configure/RULES_TOP @@ -0,0 +1,3 @@ +#RULES_TOP +include $(CONFIG)/RULES_TOP + diff --git a/example/pvCopy/Makefile b/test/src/Makefile similarity index 71% rename from example/pvCopy/Makefile rename to test/src/Makefile index 8acd9da..1fd35d5 100644 --- a/example/pvCopy/Makefile +++ b/test/src/Makefile @@ -1,4 +1,4 @@ -TOP=../.. +TOP=.. include $(TOP)/configure/CONFIG @@ -10,6 +10,10 @@ PROD_HOST += testPVRecord testPVRecord_SRCS += testPVRecord.cpp testPVRecord_LIBS += pvDatabase pvAccess pvData Com +PROD_HOST += testExampleRecord +testExampleRecord_SRCS += testExampleRecord.cpp +testExampleRecord_LIBS += pvDatabase pvAccess pvData Com + include $(TOP)/configure/RULES #---------------------------------------- # ADD RULES AFTER THIS LINE diff --git a/example/record/testExampleRecordMain.cpp b/test/src/testExampleRecord.cpp similarity index 100% rename from example/record/testExampleRecordMain.cpp rename to test/src/testExampleRecord.cpp diff --git a/example/pvCopy/testPVCopy.cpp b/test/src/testPVCopy.cpp similarity index 100% rename from example/pvCopy/testPVCopy.cpp rename to test/src/testPVCopy.cpp diff --git a/example/pvCopy/testPVRecord.cpp b/test/src/testPVRecord.cpp similarity index 100% rename from example/pvCopy/testPVRecord.cpp rename to test/src/testPVRecord.cpp