merge feature/changesAfter3_0_2; resolve conflicts

This commit is contained in:
Marty Kraimer committed 2014-06-10 15:53:37 -04:00
1 parent 35429bf4df
commit 92be294bbf
87 files changed
+561 -445

No files matched your search

+17 -15
View File
@@ -1,25 +1,27 @@
# Makefile for the EPICS V4 pvDatabase module
#Makefile at top of application tree
TOP = .
include $(TOP)/configure/CONFIG
DIRS := $(DIRS) $(filter-out $(DIRS), configure)
DIRS := $(DIRS) $(filter-out $(DIRS), src)
DIRS := $(DIRS) $(filter-out $(DIRS), test)
DIRS := $(DIRS) $(filter-out $(DIRS), arrayPerformance)
DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard example*))
DIRS := configure
EMBEDDED_TOPS := $(EMBEDDED_TOPS) $(filter-out $(EMBEDDED_TOPS), test)
EMBEDDED_TOPS := $(EMBEDDED_TOPS) $(filter-out $(EMBEDDED_TOPS), arrayPerformance)
EMBEDDED_TOPS := $(EMBEDDED_TOPS) $(filter-out $(EMBEDDED_TOPS), $(wildcard example*))
DIRS += src
src_DEPEND_DIRS = configure
define DIR_template
$(1)_DEPEND_DIRS = configure
endef
$(foreach dir, $(filter-out configure,$(DIRS)),$(eval $(call DIR_template,$(dir))))
EMBEDDED_TOPS := $(wildcard *Top)
EMBEDDED_TOPS += $(wildcard example*)
DIRS += $(EMBEDDED_TOPS)
define dir_DEP
define EMB_template
$(1)_DEPEND_DIRS = src
endef
$(foreach dir, $(EMBEDDED_TOPS),$(eval $(call EMB_template,$(dir))))
$(foreach dir, $(EMBEDDED_TOPS), $(eval $(call dir_DEP,$(dir))))
exampleDatabase_DEPEND_DIRS += testTop
examplePowerSupply_DEPEND_DIRS += testTop
#exampleDatabase_DEPEND_DIRS += test
#examplePowerSupply_DEPEND_DIRS += test
include $(TOP)/configure/RULES_TOP
@@ -1,8 +1,6 @@
# Makefile at top of application tree
#Makefile at top of application tree
TOP = .
include $(TOP)/configure/CONFIG
DIRS += configure
DIRS += src
File renamed without changes.
@@ -14,11 +14,26 @@
# 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
#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=</path/name/to/install/top>
-include $(TOP)/../configure/CONFIG_SITE.local
-include $(TOP)/../../CONFIG.local
# 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 = </IOC/path/to/application/top>
INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv
USR_INCLUDES += -I $(INSTALL_LOCATION)/include
-include $(TOP)/configure/CONFIG_SITE.local
-include $(TOP)/../CONFIG.local
File renamed without changes.
@@ -1,4 +1,4 @@
# pvDatabaseCPP/arrayPerfTop RELEASE - Location of external support modules
# pvDatabaseCPP/arrayPerformance RELEASE - Location of external support modules
#
# IF YOU CHANGE this file or any file it includes you must
# subsequently do a "gnumake rebuild" in the application's
@@ -16,9 +16,8 @@
# EPICS V4 Developers: Do not edit the locations in this file!
#
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
# PVASRV = /path/to/epics/pvaSrvCPP
# Create a file RELEASE.local pointing to your places
# for the dependencies, e.g.
# PVACCESS = /path/to/epics/pvAccessCPP
# PVDATA = /path/to/epics/pvDataCPP
# PVCOMMON = /path/to/epics/pvCommonCPP
@@ -28,14 +27,14 @@
# use the following definitions:
PVDATABASE = $(TOP)/..
-include $(TOP)/../configure/RELEASE.local
-include $(TOP)/../../RELEASE.local
-include $(TOP)/../configure/RELEASE.local
# If you copied this example from pvDatabaseCPP to be built as a
# standalone TOP, adjust and use the following definitions:
# standalone TOP, define
# PVDATABASE = /path/to/epics/pvDatabaseCPP
# in the appropriate RELEASE[.local],
# and use the following definitions instead:
#PVDATABASE = /path/to/epics/pvDatabaseCPP
#-include $(TOP)/configure/RELEASE.local
#-include $(TOP)/../RELEASE.local
#-include $(TOP)/configure/RELEASE.local
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+6 -2
View File
@@ -14,11 +14,15 @@
# 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
#CHECK_RELEASE = YES
# To install files into a location other than $(TOP) define
# INSTALL_LOCATION here.
#INSTALL_LOCATION=</path/name/to/install/top>
INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv
USR_INCLUDES += -I $(INSTALL_LOCATION)/include
-include $(TOP)/../CONFIG_SITE.local
-include $(TOP)/configure/CONFIG_SITE.local
-include $(TOP)/../CONFIG.local
+6 -9
View File
@@ -1,11 +1,8 @@
# Sample RELEASE.local file
V4 = /home/install/epics/v4
PVASRV = $(V4)/pvaSrv
PVACCESS = $(V4)/pvAccessCPP
PVDATA = $(V4)/pvDataCPP
PVCOMMON = $(V4)/pvCommonCPP
EPICS_BASE = /home/install/epics/base-3.14.12.3
TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top
EPICS_BASE=/home/install/epics/base
PVCOMMON=/home/hg/pvCommonCPP
PVDATA=/home/hg/pvDataCPP
PVACCESS=/home/hg/pvAccessCPP
PVASRV=/home/hg/pvaSrv
+1 -1
View File
@@ -24,5 +24,5 @@
# PVCOMMON = /path/to/epics/pvCommonCPP
# EPICS_BASE = /path/to/epics/base
-include $(TOP)/configure/RELEASE.local
-include $(TOP)/../RELEASE.local
-include $(TOP)/configure/RELEASE.local
+4
View File
@@ -20,5 +20,9 @@ CHECK_RELEASE = WARN
# INSTALL_LOCATION here.
#INSTALL_LOCATION=</path/name/to/install/top>
INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv
USR_INCLUDES += -I $(INSTALL_LOCATION)/include
-include $(TOP)/../configure/CONFIG_SITE.local
-include $(TOP)/../../CONFIG_SITE.local
-include $(TOP)/../CONFIG.local
+1 -1
View File
@@ -27,7 +27,7 @@
# If this example is built in a directory under pvDatabaseCPP,
# use the following definitions:
PVDATABASETEST = $(TOP)/../testTop
PVDATABASETEST = $(TOP)/../test
PVDATABASE = $(TOP)/..
-include $(TOP)/../configure/RELEASE.local
+9 -6
View File
@@ -3,23 +3,26 @@ TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
#==================================================
# Build an IOC support library
#
DBD += exampleDatabase.dbd
exampleDatabase_DBD += base.dbd
exampleDatabase_DBD += PVAServerRegister.dbd
exampleDatabase_DBD += registerChannelProviderLocal.dbd
exampleDatabase_DBD += dbPv.dbd
exampleDatabase_DBD += powerSupplyRegister.dbd
exampleDatabase_DBD += exampleDatabaseRegister.dbd
#=============================
# build an ioc application
PROD_IOC += exampleDatabase
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
exampleDatabase_SRCS += exampleDatabase_registerRecordDeviceDriver.cpp
exampleDatabase_SRCS_DEFAULT += exampleDatabaseMain.cpp
exampleDatabase_SRCS_vxWorks += -nil-
# The following adds support from base/src/vxWorks
exampleDatabase_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
@@ -0,0 +1,7 @@
include "base.dbd"
include "PVAServerRegister.dbd"
include "registerChannelProviderLocal.dbd"
include "dbPv.dbd"
include "powerSupplyRegister.dbd"
registrar("exampleDatabaseRegister")
registrar("exampleMonitorPluginRegister")
+5 -2
View File
@@ -4,17 +4,20 @@ include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
DBD += exampleDatabaseRegister.dbd
DBD += exampleDatabase.dbd
INC += exampleDatabase.h
INC += exampleMonitorPlugin.h
LIBRARY += exampleDatabase
exampleDatabase_SRCS += exampleDatabase.cpp
exampleDatabase_SRCS += exampleMonitorPlugin.cpp
exampleDatabase_SRCS += exampleDatabaseRegister.cpp
exampleDatabase_LIBS += powerSupply
exampleDatabase_SRCS += exampleMonitorPluginRegister.cpp
exampleDatabase_LIBS += pvDatabase
exampleDatabase_LIBS += pvAccess
exampleDatabase_LIBS += pvData
exampleDatabase_LIBS += Com
exampleDatabase_LIBS += $(EPICS_BASE_IOC_LIBS)
PROD_HOST += exampleDatabaseMain
+2 -2
View File
@@ -26,8 +26,8 @@
#include <pv/recordList.h>
#include <pv/traceRecord.h>
#include <powerSupply.h>
#include <exampleDatabase.h>
#include <pv/powerSupply.h>
#include <pv/exampleDatabase.h>
using namespace std;
using std::tr1::static_pointer_cast;
+3 -2
View File
@@ -22,7 +22,8 @@
#include <pv/channelProviderLocal.h>
#include <pv/serverContext.h>
#include <exampleDatabase.h>
#include <pv/exampleDatabase.h>
#include <pv/exampleMonitorPlugin.h>
using namespace std;
using std::tr1::static_pointer_cast;
@@ -36,6 +37,7 @@ int main(int argc,char *argv[])
PVDatabasePtr master = PVDatabase::getMaster();
ChannelProviderLocalPtr channelProvider = getChannelProviderLocal();
ExampleDatabase::create();
ExampleMonitorPlugin::create();
ServerContext::shared_pointer ctx =
startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true);
cout << "exampleDatabase\n";
@@ -55,4 +57,3 @@ int main(int argc,char *argv[])
channelProvider->destroy();
return 0;
}
@@ -33,7 +33,7 @@
#include <epicsExport.h>
#include <exampleDatabase.h>
#include <pv/exampleDatabase.h>
using namespace epics::pvData;
using namespace epics::pvAccess;
+1 -4
View File
@@ -1,8 +1,6 @@
# Makefile at top of application tree
#Makefile at top of application tree
TOP = .
include $(TOP)/configure/CONFIG
DIRS += configure
DIRS += src
@@ -12,7 +10,6 @@ DIRS += ioc
ioc_DEPEND_DIRS = src
DIRS += iocBoot
iocBoot_DEPEND_DIRS = src
include $(TOP)/configure/RULES_TOP
+18 -3
View File
@@ -14,11 +14,26 @@
# 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 = WARN
#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=</path/name/to/install/top>
-include $(TOP)/../configure/CONFIG_SITE.local
-include $(TOP)/../../CONFIG_SITE.local
# 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 = </IOC/path/to/application/top>
INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv
USR_INCLUDES += -I $(INSTALL_LOCATION)/include
-include $(TOP)/configure/CONFIG_SITE.local
-include $(TOP)/../CONFIG.local
+8 -9
View File
@@ -16,9 +16,8 @@
# EPICS V4 Developers: Do not edit the locations in this file!
#
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
# PVASRV = /path/to/epics/pvaSrvCPP
# Create a file RELEASE.local pointing to your places
# for the dependencies, e.g.
# PVACCESS = /path/to/epics/pvAccessCPP
# PVDATA = /path/to/epics/pvDataCPP
# PVCOMMON = /path/to/epics/pvCommonCPP
@@ -28,14 +27,14 @@
# use the following definitions:
PVDATABASE = $(TOP)/..
-include $(TOP)/../configure/RELEASE.local
-include $(TOP)/../../RELEASE.local
-include $(TOP)/../configure/RELEASE.local
# If you copied this example from pvDatabaseCPP to be built as a
# standalone TOP, adjust and use the following definitions:
# standalone TOP, define
# PVDATABASE = /path/to/epics/pvDatabaseCPP
# in the appropriate RELEASE[.local],
# and use the following definitions instead:
#PVDATABASE = /path/to/epics/pvDatabaseCPP
#-include $(TOP)/configure/RELEASE.local
#-include $(TOP)/../RELEASE.local
#-include $(TOP)/configure/RELEASE.local
+12 -6
View File
@@ -3,22 +3,27 @@ TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
#==================================================
# Build an IOC support library
#
#=============================
# build an ioc application
DBD += exampleLink.dbd
exampleLink_DBD += base.dbd
exampleLink_DBD += PVAServerRegister.dbd
exampleLink_DBD += PVAClientRegister.dbd
exampleLink_DBD += registerChannelProviderLocal.dbd
exampleLink_DBD += exampleLinkRegister.dbd
PROD_IOC += exampleLink
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
exampleLink_SRCS += exampleLink_registerRecordDeviceDriver.cpp
exampleLink_SRCS_DEFAULT += exampleLinkMain.cpp
exampleLink_SRCS_vxWorks += -nil-
# The following adds support from base/src/vxWorks
exampleLink_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
@@ -27,6 +32,7 @@ exampleLink_LIBS += pvDatabase
exampleLink_LIBS += pvaSrv
exampleLink_LIBS += pvAccess
exampleLink_LIBS += pvData
exampleLink_LIBS += Com
exampleLink_LIBS += $(EPICS_BASE_IOC_LIBS)
#===========================
@@ -0,0 +1,5 @@
include "base.dbd"
include "PVAServerRegister.dbd"
include "PVAClientRegister.dbd"
include "registerChannelProviderLocal.dbd"
registrar("exampleLinkRegister")
+6 -1
View File
@@ -3,8 +3,13 @@ TOP=..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
DBD += exampleLinkRegister.dbd
#==================================================
# Build an IOC support library
#
DBD += exampleLink.dbd
INC += exampleLink.h
+1 -4
View File
@@ -9,13 +9,10 @@
* @date 2013.08.02
*/
#include <pv/exampleLink.h>
#include <pv/standardPVField.h>
#include <pv/convert.h>
#define epicsExportSharedSymbols
#include <exampleLink.h>
namespace epics { namespace pvDatabase {
using namespace epics::pvData;
using namespace epics::pvAccess;
+4 -16
View File
@@ -8,15 +8,11 @@
* @author mrk
* @date 2013.08.02
*/
#ifndef EXAMPLELINK_H
#define EXAMPLELINK_H
#ifndef EXAMPLEPVADOUBLEARRAYGET_H
#define EXAMPLEPVADOUBLEARRAYGET_H
#ifdef epicsExportSharedSymbols
# define examplelinkEpicsExportSharedSymbols
# undef epicsExportSharedSymbols
#endif
#include <shareLib.h>
//#include <shareLib.h>
#include <pv/timeStamp.h>
#include <pv/pvTimeStamp.h>
#include <pv/alarm.h>
@@ -26,14 +22,6 @@
#include <pv/pvAccess.h>
#include <pv/serverContext.h>
#ifdef examplelinkEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef examplelinkEpicsExportSharedSymbols
# include <shareLib.h>
#endif
namespace epics { namespace pvDatabase {
@@ -102,4 +90,4 @@ private:
}}
#endif /* EXAMPLELINK_H */
#endif /* EXAMPLEPVADOUBLEARRAYGET_H */
+1
View File
@@ -0,0 +1 @@
registrar("exampleLinkRegister")
+4 -8
View File
@@ -27,16 +27,15 @@
#include <epicsThread.h>
#include <iocsh.h>
#include <epicsExport.h>
#include <pv/pvIntrospect.h>
#include <pv/pvData.h>
#include <pv/standardField.h>
#include <pv/standardPVField.h>
#include <pv/pvAccess.h>
#include <pv/pvDatabase.h>
#include <epicsExport.h>
#include <exampleLink.h>
#include <pv/exampleLink.h>
using namespace epics::pvData;
using namespace epics::pvAccess;
@@ -83,7 +82,4 @@ static void exampleLinkRegister(void)
iocshRegister(&exampleLinkFuncDef, exampleLinkCallFunc);
}
}
extern "C" {
epicsExportRegistrar(exampleLinkRegister);
}
epicsExportRegistrar(exampleLinkRegister);
+18 -3
View File
@@ -14,11 +14,26 @@
# 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 = WARN
#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=</path/name/to/install/top>
-include $(TOP)/../configure/CONFIG_SITE.local
-include $(TOP)/../../CONFIG_SITE.local
# 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 = </IOC/path/to/application/top>
INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv
USR_INCLUDES += -I $(INSTALL_LOCATION)/include
-include $(TOP)/configure/CONFIG_SITE.local
-include $(TOP)/../CONFIG.local
+9 -10
View File
@@ -16,9 +16,8 @@
# EPICS V4 Developers: Do not edit the locations in this file!
#
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
# PVASRV = /path/to/epics/pvaSrvCPP
# Create a file RELEASE.local pointing to your places
# for the dependencies, e.g.
# PVACCESS = /path/to/epics/pvAccessCPP
# PVDATA = /path/to/epics/pvDataCPP
# PVCOMMON = /path/to/epics/pvCommonCPP
@@ -27,17 +26,17 @@
# If this example is built in a directory under pvDatabaseCPP,
# use the following definitions:
PVDATABASETEST = $(TOP)/../testTop
PVDATABASE = $(TOP)/..
-include $(TOP)/../configure/RELEASE.local
PVDATABASETEST = $(TOP)/../test
-include $(TOP)/../../RELEASE.local
-include $(TOP)/../configure/RELEASE.local
# If you copied this example from pvDatabaseCPP to be built as a
# standalone TOP, adjust and use the following definitions:
#PVDATABASETEST = /path/to/epics/pvDatabaseCPP/testTop
#PVDATABASE = /path/to/epics/pvDatabaseCPP
# standalone TOP, define
# PVDATABASE = /path/to/epics/pvDatabaseCPP
# PVDATABASETEST = /path/to/epics/pvDatabaseCPP/test
# in the appropriate RELEASE[.local],
# and use the following definitions instead:
#-include $(TOP)/../RELEASE.local
#-include $(TOP)/configure/RELEASE.local
+9 -5
View File
@@ -3,22 +3,26 @@ TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
#==================================================
# Build an IOC support library
#
DBD += powerSupply.dbd
powerSupply_DBD += base.dbd
powerSupply_DBD += PVAServerRegister.dbd
powerSupply_DBD += registerChannelProviderLocal.dbd
powerSupply_DBD += dbPv.dbd
powerSupply_DBD += powerSupplyRegister.dbd
#=============================
# build an ioc application
PROD_IOC += powerSupply
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
powerSupply_SRCS += powerSupply_registerRecordDeviceDriver.cpp
powerSupply_SRCS_DEFAULT += powerSupplyMain.cpp
powerSupply_SRCS_vxWorks += -nil-
# The following adds support from base/src/vxWorks
powerSupply_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
@@ -0,0 +1,5 @@
include "base.dbd"
include "PVAServerRegister.dbd"
include "registerChannelProviderLocal.dbd"
include "dbPv.dbd"
include "powerSupplyRegister.dbd"
+8 -1
View File
@@ -3,14 +3,21 @@ TOP=..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
#==================================================
# Build an IOC support library
#
PROD_HOST += powerSupplyMain
powerSupplyMain_SRCS += powerSupplyMain.cpp
powerSupplyMain_LIBS += powerSupply
powerSupplyMain_LIBS += pvDatabase
powerSupplyMain_LIBS += pvAccess
powerSupplyMain_LIBS += pvData
powerSupplyMain_LIBS += Com
powerSupplyMain_LIBS += powerSupply
#===========================
+1 -2
View File
@@ -20,12 +20,11 @@
#include <pv/standardField.h>
#include <pv/standardPVField.h>
#include <pv/powerSupply.h>
#include <pv/traceRecord.h>
#include <pv/channelProviderLocal.h>
#include <pv/serverContext.h>
#include <powerSupply.h>
using namespace std;
using std::tr1::static_pointer_cast;
using namespace epics::pvData;
+1 -4
View File
@@ -1,8 +1,6 @@
# Makefile at top of application tree
#Makefile at top of application tree
TOP = .
include $(TOP)/configure/CONFIG
DIRS += configure
DIRS += src
@@ -12,7 +10,6 @@ DIRS += ioc
ioc_DEPEND_DIRS = src
DIRS += iocBoot
iocBoot_DEPEND_DIRS = src
include $(TOP)/configure/RULES_TOP
+18 -3
View File
@@ -14,11 +14,26 @@
# 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 = WARN
#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=</path/name/to/install/top>
-include $(TOP)/../configure/CONFIG_SITE.local
-include $(TOP)/../../CONFIG_SITE.local
# 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 = </IOC/path/to/application/top>
INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv
USR_INCLUDES += -I $(INSTALL_LOCATION)/include
-include $(TOP)/configure/CONFIG_SITE.local
-include $(TOP)/../CONFIG.local
+8 -9
View File
@@ -16,9 +16,8 @@
# EPICS V4 Developers: Do not edit the locations in this file!
#
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
# PVASRV = /path/to/epics/pvaSrvCPP
# Create a file RELEASE.local pointing to your places
# for the dependencies, e.g.
# PVACCESS = /path/to/epics/pvAccessCPP
# PVDATA = /path/to/epics/pvDataCPP
# PVCOMMON = /path/to/epics/pvCommonCPP
@@ -28,14 +27,14 @@
# use the following definitions:
PVDATABASE = $(TOP)/..
-include $(TOP)/../configure/RELEASE.local
-include $(TOP)/../../RELEASE.local
-include $(TOP)/../configure/RELEASE.local
# If you copied this example from pvDatabaseCPP to be built as a
# standalone TOP, adjust and use the following definitions:
# standalone TOP, define
# PVDATABASE = /path/to/epics/pvDatabaseCPP
# in the appropriate RELEASE[.local],
# and use the following definitions instead:
#PVDATABASE = /path/to/epics/pvDatabaseCPP
#-include $(TOP)/configure/RELEASE.local
#-include $(TOP)/../RELEASE.local
#-include $(TOP)/configure/RELEASE.local
+9 -5
View File
@@ -3,22 +3,26 @@ TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
#==================================================
# Build an IOC support library
#
DBD += exampleServer.dbd
exampleServer_DBD += base.dbd
exampleServer_DBD += PVAServerRegister.dbd
exampleServer_DBD += registerChannelProviderLocal.dbd
exampleServer_DBD += dbPv.dbd
exampleServer_DBD += exampleServerRegister.dbd
#=============================
# build an ioc application
PROD_IOC += exampleServer
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
exampleServer_SRCS += exampleServer_registerRecordDeviceDriver.cpp
exampleServer_SRCS_DEFAULT += exampleServerMain.cpp
exampleServer_SRCS_vxWorks += -nil-
# The following adds support from base/src/vxWorks
exampleServer_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
@@ -0,0 +1,5 @@
include "base.dbd"
include "PVAServerRegister.dbd"
include "registerChannelProviderLocal.dbd"
include "dbPv.dbd"
include "exampleServer.dbd"
+8 -1
View File
@@ -3,8 +3,14 @@ TOP=..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
DBD += exampleServerRegister.dbd
#==================================================
# Build an IOC support library
#
DBD += exampleServer.dbd
INC += exampleServer.h
@@ -14,6 +20,7 @@ exampleServer_SRCS += exampleServerRegister.cpp
exampleServer_LIBS += pvDatabase
exampleServer_LIBS += pvAccess
exampleServer_LIBS += pvData
exampleServer_LIBS += Com
exampleServer_LIBS += $(EPICS_BASE_IOC_LIBS)
PROD_HOST += exampleServerMain
+1 -4
View File
@@ -10,10 +10,7 @@
*/
#include <pv/standardPVField.h>
#define epicsExportSharedSymbols
#include <exampleServer.h>
#include <pv/exampleServer.h>
namespace epics { namespace exampleServer {
using namespace epics::pvData;
+4 -15
View File
@@ -8,26 +8,15 @@
* @author mrk
* @date 2013.04.02
*/
#ifndef EXAMPLESERVER_H
#define EXAMPLESERVER_H
#ifdef epicsExportSharedSymbols
# define exampleServerEpicsExportSharedSymbols
# undef epicsExportSharedSymbols
#endif
#ifndef EXAMPLECOUNTER_H
#define EXAMPLECOUNTER_H
#include <shareLib.h>
#include <pv/pvDatabase.h>
#include <pv/timeStamp.h>
#include <pv/pvTimeStamp.h>
#ifdef exampleServerEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef exampleServerEpicsExportSharedSymbols
# include <shareLib.h>
#endif
namespace epics { namespace exampleServer {
@@ -58,4 +47,4 @@ private:
}}
#endif /* EXAMPLESERVER_H */
#endif /* EXAMPLECOUNTER_H */
@@ -0,0 +1 @@
registrar("exampleServerRegister")
+1 -2
View File
@@ -20,12 +20,11 @@
#include <pv/standardField.h>
#include <pv/standardPVField.h>
#include <pv/exampleServer.h>
#include <pv/traceRecord.h>
#include <pv/channelProviderLocal.h>
#include <pv/serverContext.h>
#include <exampleServer.h>
using namespace std;
using std::tr1::static_pointer_cast;
using namespace epics::pvData;
+4 -8
View File
@@ -27,14 +27,13 @@
#include <epicsThread.h>
#include <iocsh.h>
#include <epicsExport.h>
#include <pv/pvIntrospect.h>
#include <pv/pvData.h>
#include <pv/pvAccess.h>
#include <pv/pvDatabase.h>
#include <epicsExport.h>
#include <exampleServer.h>
#include <pv/exampleServer.h>
using namespace epics::pvData;
using namespace epics::pvAccess;
@@ -65,7 +64,4 @@ static void exampleServerRegister(void)
iocshRegister(&exampleServerFuncDef, exampleServerCallFunc);
}
}
extern "C" {
epicsExportRegistrar(exampleServerRegister);
}
epicsExportRegistrar(exampleServerRegister);
-3
View File
@@ -3,9 +3,6 @@
TOP = ..
include $(TOP)/configure/CONFIG
INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv
USR_INCLUDES += -I$(INSTALL_LOCATION)/include
PVDATABASE_SRC = $(TOP)/src
LIBRARY += pvDatabase
+4 -4
View File
@@ -3,13 +3,13 @@
SRC_DIRS += $(PVDATABASE_SRC)/pvAccess
INC += channelProviderLocal.h
INC += pvCopy.h
INC += monitorAlgorithm.h
INC += pvCopyMonitor.h
DBD += registerChannelProviderLocal.dbd
LIBSRCS += channelProviderLocal.cpp
LIBSRCS += pvCopy.cpp
LIBSRCS += monitorFactory.cpp
LIBSRCS += channelLocal.cpp
LIBSRCS += pvCopyMonitor.cpp
LIBSRCS += monitorFactory.cpp
LIBSRCS += registerChannelProviderLocal.cpp
+252 -186
View File
@@ -14,13 +14,10 @@
#include <epicsThread.h>
#include <pv/timeStamp.h>
#include <pv/channelProviderLocal.h>
#include <pv/convert.h>
#include <pv/pvSubArrayCopy.h>
#define epicsExportSharedSymbols
#include <pv/channelProviderLocal.h>
namespace epics { namespace pvDatabase {
using namespace epics::pvData;
using namespace epics::pvAccess;
@@ -30,6 +27,26 @@ using std::cout;
using std::endl;
static ConvertPtr convert = getConvert();
static StructureConstPtr nullStructure;
static PVStructurePtr nullPVStructure;
static BitSetPtr nullBitSet;
static Status channelDestroyedStatus(
Status::Status::STATUSTYPE_ERROR,
"was destroyed"
);
static Status illegalOffsetStatus(
Status::Status::STATUSTYPE_ERROR,
"count must be >0"
);
static Status illegalCountStatus(
Status::Status::STATUSTYPE_ERROR,
"count must be >0"
);
static Status illegalStrideStatus(
Status::Status::STATUSTYPE_ERROR,
"stride must be >0"
);
class ChannelProcessLocal;
typedef std::tr1::shared_ptr<ChannelProcessLocal> ChannelProcessLocalPtr;
@@ -49,7 +66,7 @@ typedef std::tr1::shared_ptr<ChannelArrayLocal> ChannelArrayLocalPtr;
static bool getProcess(PVStructurePtr pvRequest,bool processDefault)
{
PVFieldPtr pvField = pvRequest->getSubField("record._options.process");
if(pvField.get()==NULL || pvField->getField()->getType()!=scalar) {
if(pvField==NULL || pvField->getField()->getType()!=scalar) {
return processDefault;
}
ScalarConstPtr scalar = static_pointer_cast<const Scalar>(
@@ -82,8 +99,12 @@ public:
ChannelProcessRequester::shared_pointer const & channelProcessRequester,
PVStructurePtr const & pvRequest,
PVRecordPtr const &pvRecord);
virtual void process(bool lastRequest);
virtual void process();
virtual void destroy();
virtual std::tr1::shared_ptr<Channel> getChannel()
{return channelLocal;}
virtual void cancel(){}
virtual void lastRequest() {}
virtual void lock() {mutex.lock();}
virtual void unlock() {mutex.unlock();}
private:
@@ -105,7 +126,6 @@ private:
{
}
bool isDestroyed;
bool callProcess;
ChannelLocalPtr channelLocal;
ChannelProcessRequester::shared_pointer channelProcessRequester;
PVRecordPtr pvRecord;
@@ -167,13 +187,11 @@ void ChannelProcessLocal::destroy()
channelLocal.reset();
}
void ChannelProcessLocal::process(bool lastRequest)
void ChannelProcessLocal::process()
{
if(isDestroyed) {
Status status(
Status::STATUSTYPE_ERROR,
"was destroyed");
channelProcessRequester->processDone(status);
channelProcessRequester->processDone(channelDestroyedStatus,getPtrSelf());
return;
}
if(pvRecord->getTraceLevel()>1)
@@ -193,8 +211,7 @@ void ChannelProcessLocal::process(bool lastRequest)
}
pvRecord->unlock();
}
channelProcessRequester->processDone(Status::Ok);
if(lastRequest) destroy();
channelProcessRequester->processDone(Status::Ok,getPtrSelf());
}
class ChannelGetLocal :
@@ -215,8 +232,12 @@ public:
ChannelGetRequester::shared_pointer const & channelGetRequester,
PVStructurePtr const & pvRequest,
PVRecordPtr const &pvRecord);
virtual void get(bool lastRequest);
virtual void get();
virtual void destroy();
virtual std::tr1::shared_ptr<Channel> getChannel()
{return channelLocal;}
virtual void cancel(){}
virtual void lastRequest() {}
virtual void lock() {mutex.lock();}
virtual void unlock() {mutex.unlock();}
private:
@@ -263,21 +284,18 @@ ChannelGetLocalPtr ChannelGetLocal::create(
PVRecordPtr const &pvRecord)
{
PVCopyPtr pvCopy = PVCopy::create(
pvRecord,
pvRecord->getPVRecordStructure()->getPVStructure(),
pvRequest,
"");
if(pvCopy.get()==NULL) {
if(pvCopy==NULL) {
Status status(
Status::STATUSTYPE_ERROR,
Status::Status::STATUSTYPE_ERROR,
"invalid pvRequest");
ChannelGet::shared_pointer channelGet;
PVStructurePtr pvStructure;
BitSetPtr bitSet;
channelGetRequester->channelGetConnect(
status,
channelGet,
pvStructure,
bitSet);
nullStructure);
ChannelGetLocalPtr localGet;
return localGet;
}
@@ -296,7 +314,8 @@ ChannelGetLocalPtr ChannelGetLocal::create(
cout << "ChannelGetLocal::create";
cout << " recordName " << pvRecord->getRecordName() << endl;
}
channelGetRequester->channelGetConnect(Status::Ok, get, pvStructure,bitSet);
channelGetRequester->channelGetConnect(
Status::Ok,get,pvStructure->getStructure());
return get;
}
@@ -316,13 +335,11 @@ void ChannelGetLocal::destroy()
channelLocal.reset();
}
void ChannelGetLocal::get(bool lastRequest)
void ChannelGetLocal::get()
{
if(isDestroyed) {
Status status(
Status::STATUSTYPE_ERROR,
"was destroyed");
channelGetRequester->getDone(status);
channelGetRequester->getDone(
channelDestroyedStatus,getPtrSelf(),nullPVStructure,nullBitSet);
return;
}
bitSet->clear();
@@ -344,12 +361,15 @@ void ChannelGetLocal::get(bool lastRequest)
bitSet->set(0);
firstTime = false;
}
channelGetRequester->getDone(Status::Ok);
channelGetRequester->getDone(
Status::Ok,
getPtrSelf(),
pvStructure,
bitSet);
if(pvRecord->getTraceLevel()>1)
{
cout << "ChannelGetLocal::get" << endl;
}
if(lastRequest) destroy();
}
class ChannelPutLocal :
@@ -370,9 +390,13 @@ public:
ChannelPutRequester::shared_pointer const & channelPutRequester,
PVStructurePtr const & pvRequest,
PVRecordPtr const &pvRecord);
virtual void put(bool lastRequest);
virtual void put(PVStructurePtr const &pvStructure,BitSetPtr const &bitSet);
virtual void get();
virtual void destroy();
virtual std::tr1::shared_ptr<Channel> getChannel()
{return channelLocal;}
virtual void cancel(){}
virtual void lastRequest() {}
virtual void lock() {mutex.lock();}
virtual void unlock() {mutex.unlock();}
private:
@@ -385,8 +409,6 @@ private:
ChannelLocalPtr const &channelLocal,
ChannelPutRequester::shared_pointer const & channelPutRequester,
PVCopyPtr const &pvCopy,
PVStructurePtr const&pvStructure,
BitSetPtr const & bitSet,
PVRecordPtr const &pvRecord)
:
isDestroyed(false),
@@ -394,8 +416,6 @@ private:
channelLocal(channelLocal),
channelPutRequester(channelPutRequester),
pvCopy(pvCopy),
pvStructure(pvStructure),
bitSet(bitSet),
pvRecord(pvRecord)
{
}
@@ -404,8 +424,6 @@ private:
ChannelLocalPtr channelLocal;
ChannelPutRequester::shared_pointer channelPutRequester;
PVCopyPtr pvCopy;
PVStructurePtr pvStructure;
BitSetPtr bitSet;
PVRecordPtr pvRecord;
Mutex mutex;
};
@@ -417,12 +435,12 @@ ChannelPutLocalPtr ChannelPutLocal::create(
PVRecordPtr const &pvRecord)
{
PVCopyPtr pvCopy = PVCopy::create(
pvRecord,
pvRecord->getPVRecordStructure()->getPVStructure(),
pvRequest,
"");
if(pvCopy.get()==NULL) {
if(pvCopy==NULL) {
Status status(
Status::STATUSTYPE_ERROR,
Status::Status::STATUSTYPE_ERROR,
"invalid pvRequest");
ChannelPut::shared_pointer channelPut;
PVStructurePtr pvStructure;
@@ -430,22 +448,18 @@ ChannelPutLocalPtr ChannelPutLocal::create(
channelPutRequester->channelPutConnect(
status,
channelPut,
pvStructure,
bitSet);
nullStructure);
ChannelPutLocalPtr localPut;
return localPut;
}
PVStructurePtr pvStructure = pvCopy->createPVStructure();
BitSetPtr bitSet(new BitSet(pvStructure->getNumberFields()));
ChannelPutLocalPtr put(new ChannelPutLocal(
getProcess(pvRequest,true),
channelLocal,
channelPutRequester,
pvCopy,
pvStructure,
bitSet,
pvRecord));
channelPutRequester->channelPutConnect(Status::Ok, put, pvStructure,bitSet);
channelPutRequester->channelPutConnect(
Status::Ok, put, pvCopy->getStructure());
if(pvRecord->getTraceLevel()>0)
{
cout << "ChannelPutLocal::create";
@@ -472,12 +486,12 @@ void ChannelPutLocal::destroy()
void ChannelPutLocal::get()
{
if(isDestroyed) {
Status status(
Status::STATUSTYPE_ERROR,
"was destroyed");
channelPutRequester->getDone(status);
channelPutRequester->getDone(
channelDestroyedStatus,getPtrSelf(),nullPVStructure,nullBitSet);
return;
}
PVStructurePtr pvStructure = pvCopy->createPVStructure();
BitSetPtr bitSet(new BitSet(pvStructure->getNumberFields()));
bitSet->clear();
bitSet->set(0);
pvRecord->lock();
@@ -488,26 +502,25 @@ void ChannelPutLocal::get()
throw;
}
pvRecord->unlock();
channelPutRequester->getDone(Status::Ok);
channelPutRequester->getDone(
Status::Ok,getPtrSelf(),pvStructure,bitSet);
if(pvRecord->getTraceLevel()>1)
{
cout << "ChannelPutLocal::get" << endl;
}
}
void ChannelPutLocal::put(bool lastRequest)
void ChannelPutLocal::put(
PVStructurePtr const &pvStructure,BitSetPtr const &bitSet)
{
if(isDestroyed) {
Status status(
Status::STATUSTYPE_ERROR,
"was destroyed");
channelPutRequester->getDone(status);
channelPutRequester->putDone(channelDestroyedStatus,getPtrSelf());
return;
}
pvRecord->lock();
try {
pvRecord->beginGroupPut();
pvCopy->updateRecord(pvStructure, bitSet);
pvCopy->updateMaster(pvStructure, bitSet);
if(callProcess) {
pvRecord->process();
}
@@ -517,12 +530,11 @@ void ChannelPutLocal::put(bool lastRequest)
throw;
}
pvRecord->unlock();
channelPutRequester->putDone(Status::Ok);
channelPutRequester->putDone(Status::Ok,getPtrSelf());
if(pvRecord->getTraceLevel()>1)
{
cout << "ChannelPutLocal::put" << endl;
}
if(lastRequest) destroy();
}
@@ -544,10 +556,16 @@ public:
ChannelPutGetRequester::shared_pointer const & channelPutGetRequester,
PVStructurePtr const & pvRequest,
PVRecordPtr const &pvRecord);
virtual void putGet(bool lastRequest);
virtual void putGet(
PVStructurePtr const &pvPutStructure,
BitSetPtr const &putBitSet);
virtual void getPut();
virtual void getGet();
virtual void destroy();
virtual std::tr1::shared_ptr<Channel> getChannel()
{return channelLocal;}
virtual void cancel(){}
virtual void lastRequest() {}
virtual void lock() {mutex.lock();}
virtual void unlock() {mutex.unlock();}
private:
@@ -561,9 +579,7 @@ private:
ChannelPutGetRequester::shared_pointer const & channelPutGetRequester,
PVCopyPtr const &pvPutCopy,
PVCopyPtr const &pvGetCopy,
PVStructurePtr const&pvPutStructure,
PVStructurePtr const&pvGetStructure,
BitSetPtr const & putBitSet,
BitSetPtr const & getBitSet,
PVRecordPtr const &pvRecord)
:
@@ -573,9 +589,7 @@ private:
channelPutGetRequester(channelPutGetRequester),
pvPutCopy(pvPutCopy),
pvGetCopy(pvGetCopy),
pvPutStructure(pvPutStructure),
pvGetStructure(pvGetStructure),
putBitSet(putBitSet),
getBitSet(getBitSet),
pvRecord(pvRecord)
{
@@ -586,9 +600,7 @@ private:
ChannelPutGetRequester::shared_pointer channelPutGetRequester;
PVCopyPtr pvPutCopy;
PVCopyPtr pvGetCopy;
PVStructurePtr pvPutStructure;
PVStructurePtr pvGetStructure;
BitSetPtr putBitSet;
BitSetPtr getBitSet;
PVRecordPtr pvRecord;
Mutex mutex;
@@ -601,50 +613,35 @@ ChannelPutGetLocalPtr ChannelPutGetLocal::create(
PVRecordPtr const &pvRecord)
{
PVCopyPtr pvPutCopy = PVCopy::create(
pvRecord,
pvRecord->getPVRecordStructure()->getPVStructure(),
pvRequest,
"putField");
PVCopyPtr pvGetCopy = PVCopy::create(
pvRecord,
pvRecord->getPVRecordStructure()->getPVStructure(),
pvRequest,
"getField");
if(pvPutCopy.get()==NULL || pvGetCopy.get()==NULL) {
if(pvPutCopy==NULL || pvGetCopy==NULL) {
Status status(
Status::STATUSTYPE_ERROR,
Status::Status::STATUSTYPE_ERROR,
"invalid pvRequest");
ChannelPutGet::shared_pointer channelPutGet;
PVStructurePtr pvStructure;
BitSetPtr bitSet;
channelPutGetRequester->channelPutGetConnect(
status,
channelPutGet,
pvStructure,
pvStructure);
nullStructure,
nullStructure);
ChannelPutGetLocalPtr localPutGet;
return localPutGet;
}
PVStructurePtr pvPutStructure = pvPutCopy->createPVStructure();
PVStructurePtr pvGetStructure = pvGetCopy->createPVStructure();
BitSetPtr putBitSet(new BitSet(pvPutStructure->getNumberFields()));
BitSetPtr getBitSet(new BitSet(pvGetStructure->getNumberFields()));
pvRecord->lock();
try {
pvPutCopy->initCopy(pvPutStructure,putBitSet);
pvGetCopy->initCopy(pvGetStructure,getBitSet);
} catch(...) {
pvRecord->unlock();
throw;
}
pvRecord->unlock();
ChannelPutGetLocalPtr putGet(new ChannelPutGetLocal(
getProcess(pvRequest,true),
channelLocal,
channelPutGetRequester,
pvPutCopy,
pvGetCopy,
pvPutStructure,
pvGetStructure,
putBitSet,
getBitSet,
pvRecord));
if(pvRecord->getTraceLevel()>0)
@@ -653,7 +650,7 @@ ChannelPutGetLocalPtr ChannelPutGetLocal::create(
cout << " recordName " << pvRecord->getRecordName() << endl;
}
channelPutGetRequester->channelPutGetConnect(
Status::Ok, putGet, pvPutStructure,pvGetStructure);
Status::Ok, putGet, pvPutCopy->getStructure(),pvGetCopy->getStructure());
return putGet;
}
@@ -673,22 +670,20 @@ void ChannelPutGetLocal::destroy()
channelLocal.reset();
}
void ChannelPutGetLocal::putGet(bool lastRequest)
void ChannelPutGetLocal::putGet(
PVStructurePtr const &pvPutStructure,BitSetPtr const &putBitSet)
{
if(isDestroyed) {
Status status(
Status::STATUSTYPE_ERROR,
"was destroyed");
channelPutGetRequester->putGetDone(status);
channelPutGetRequester->putGetDone(
channelDestroyedStatus,getPtrSelf(),nullPVStructure,nullBitSet);
return;
}
putBitSet->clear();
putBitSet->set(0);
pvRecord->lock();
try {
pvRecord->beginGroupPut();
pvPutCopy->updateRecord(pvPutStructure, putBitSet);
pvPutCopy->updateMaster(pvPutStructure, putBitSet);
if(callProcess) pvRecord->process();
getBitSet->clear();
pvGetCopy->updateCopySetBitSet(pvGetStructure, getBitSet);
pvRecord->endGroupPut();
} catch(...) {
@@ -696,36 +691,33 @@ void ChannelPutGetLocal::putGet(bool lastRequest)
throw;
}
pvRecord->unlock();
getBitSet->clear();
getBitSet->set(0);
channelPutGetRequester->putGetDone(Status::Ok);
channelPutGetRequester->putGetDone(
Status::Ok,getPtrSelf(),pvGetStructure,getBitSet);
if(pvRecord->getTraceLevel()>1)
{
cout << "ChannelPutGetLocal::putGet" << endl;
}
if(lastRequest) destroy();
}
void ChannelPutGetLocal::getPut()
{
if(isDestroyed) {
Status status(
Status::STATUSTYPE_ERROR,
"was destroyed");
channelPutGetRequester->getPutDone(status);
channelPutGetRequester->getPutDone(
channelDestroyedStatus,getPtrSelf(),nullPVStructure,nullBitSet);
return;
}
PVStructurePtr pvPutStructure = pvPutCopy->createPVStructure();
BitSetPtr putBitSet(new BitSet(pvPutStructure->getNumberFields()));
pvRecord->lock();
try {
pvPutCopy->updateCopySetBitSet(pvPutStructure, putBitSet);
pvPutCopy->initCopy(pvPutStructure, putBitSet);
} catch(...) {
pvRecord->unlock();
throw;
}
pvRecord->unlock();
putBitSet->clear();
putBitSet->set(0);
channelPutGetRequester->getPutDone(Status::Ok);
channelPutGetRequester->getPutDone(
Status::Ok,getPtrSelf(),pvPutStructure,putBitSet);
if(pvRecord->getTraceLevel()>1)
{
cout << "ChannelPutGetLocal::getPut" << endl;
@@ -735,12 +727,11 @@ void ChannelPutGetLocal::getPut()
void ChannelPutGetLocal::getGet()
{
if(isDestroyed) {
Status status(
Status::STATUSTYPE_ERROR,
"was destroyed");
channelPutGetRequester->getGetDone(status);
channelPutGetRequester->getGetDone(
channelDestroyedStatus,getPtrSelf(),nullPVStructure,nullBitSet);
return;
}
getBitSet->clear();
pvRecord->lock();
try {
pvGetCopy->updateCopySetBitSet(pvGetStructure, getBitSet);
@@ -749,9 +740,8 @@ void ChannelPutGetLocal::getGet()
throw;
}
pvRecord->unlock();
getBitSet->clear();
getBitSet->set(0);
channelPutGetRequester->getGetDone(Status::Ok);
channelPutGetRequester->getGetDone(
Status::Ok,getPtrSelf(),pvGetStructure,getBitSet);
if(pvRecord->getTraceLevel()>1)
{
cout << "ChannelPutGetLocal::getGet" << endl;
@@ -778,10 +768,17 @@ public:
ChannelArrayRequester::shared_pointer const & channelArrayRequester,
PVStructurePtr const & pvRequest,
PVRecordPtr const &pvRecord);
virtual void getArray(bool lastRequest,int offset, int count);
virtual void putArray(bool lastRequest,int offset, int count);
virtual void setLength(bool lastRequest,int length, int capacity);
virtual void getArray(size_t offset, size_t count, size_t stride);
virtual void putArray(
PVArrayPtr const &putArray,
size_t offset, size_t count, size_t stride);
virtual void getLength();
virtual void setLength(size_t length, size_t capacity);
virtual void destroy();
virtual std::tr1::shared_ptr<Channel> getChannel()
{return channelLocal;}
virtual void cancel(){}
virtual void lastRequest() {}
virtual void lock() {mutex.lock();}
virtual void unlock() {mutex.unlock();}
private:
@@ -797,7 +794,6 @@ private:
PVRecordPtr const &pvRecord)
:
isDestroyed(false),
callProcess(callProcess),
channelLocal(channelLocal),
channelArrayRequester(channelArrayRequester),
pvArray(pvArray),
@@ -806,7 +802,6 @@ private:
{
}
bool isDestroyed;
bool callProcess;
ChannelLocalPtr channelLocal;
ChannelArrayRequester::shared_pointer channelArrayRequester;
PVArrayPtr pvArray;
@@ -825,10 +820,10 @@ ChannelArrayLocalPtr ChannelArrayLocal::create(
PVFieldPtrArray const & pvFields = pvRequest->getPVFields();
if(pvFields.size()!=1) {
Status status(
Status::STATUSTYPE_ERROR,"invalid pvRequest");
Status::Status::STATUSTYPE_ERROR,"invalid pvRequest");
ChannelArrayLocalPtr channelArray;
PVScalarArrayPtr pvArray;
channelArrayRequester->channelArrayConnect(status,channelArray,pvArray);
ArrayConstPtr array;
channelArrayRequester->channelArrayConnect(status,channelArray,array);
return channelArray;
}
PVFieldPtr pvField = pvFields[0];
@@ -845,19 +840,21 @@ ChannelArrayLocalPtr ChannelArrayLocal::create(
pvField = pvRecord->getPVRecordStructure()->getPVStructure()->getSubField(fieldName);
if(pvField==NULL) {
Status status(
Status::STATUSTYPE_ERROR,fieldName +" not found");
Status::Status::STATUSTYPE_ERROR,fieldName +" not found");
ChannelArrayLocalPtr channelArray;
PVScalarArrayPtr pvArray;
channelArrayRequester->channelArrayConnect(status,channelArray,pvArray);
ArrayConstPtr array;
channelArrayRequester->channelArrayConnect(
status,channelArray,array);
return channelArray;
}
if(pvField->getField()->getType()!=scalarArray && pvField->getField()->getType()!=structureArray)
{
Status status(
Status::STATUSTYPE_ERROR,fieldName +" not array");
Status::Status::STATUSTYPE_ERROR,fieldName +" not array");
ChannelArrayLocalPtr channelArray;
PVArrayPtr pvArray;
channelArrayRequester->channelArrayConnect(status,channelArray,pvArray);
ArrayConstPtr array;
channelArrayRequester->channelArrayConnect(
status,channelArray,array);
return channelArray;
}
PVArrayPtr pvArray = static_pointer_cast<PVArray>(pvField);
@@ -866,26 +863,47 @@ ChannelArrayLocalPtr ChannelArrayLocal::create(
PVScalarArrayPtr xxx = static_pointer_cast<PVScalarArray>(pvField);
pvCopy = getPVDataCreate()->createPVScalarArray(
xxx->getScalarArray()->getElementType());
} else {
ChannelArrayLocalPtr array(new ChannelArrayLocal(
channelLocal,
channelArrayRequester,
pvArray,
pvCopy,
pvRecord));
if(pvRecord->getTraceLevel()>0)
{
cout << "ChannelArrayLocal::create";
cout << " recordName " << pvRecord->getRecordName() << endl;
}
channelArrayRequester->channelArrayConnect(
Status::Ok, array, pvCopy->getArray());
return array;
}
if(pvField->getField()->getType()==structureArray) {
PVStructureArrayPtr xxx = static_pointer_cast<PVStructureArray>(pvField);
pvCopy = getPVDataCreate()->createPVStructureArray(
xxx->getStructureArray());
xxx->getStructureArray()->getStructure());
ChannelArrayLocalPtr array(new ChannelArrayLocal(
channelLocal,
channelArrayRequester,
pvArray,
pvCopy,
pvRecord));
if(pvRecord->getTraceLevel()>0)
{
cout << "ChannelArrayLocal::create";
cout << " recordName " << pvRecord->getRecordName() << endl;
}
channelArrayRequester->channelArrayConnect(
Status::Ok, array, pvCopy->getArray());
return array;
}
ChannelArrayLocalPtr array(new ChannelArrayLocal(
channelLocal,
channelArrayRequester,
pvArray,
pvCopy,
pvRecord));
if(pvRecord->getTraceLevel()>0)
{
cout << "ChannelArrayLocal::create";
cout << " recordName " << pvRecord->getRecordName() << endl;
}
channelArrayRequester->channelArrayConnect(
Status::Ok, array, pvCopy);
return array;
Status status(Status::Status::STATUSTYPE_ERROR,
"Sorry only ScalarArray and Structure Array are supported");
ChannelArrayLocalPtr channelArray;
ArrayConstPtr array;
channelArrayRequester->channelArrayConnect(status,channelArray,array);
return channelArray;
}
@@ -904,72 +922,120 @@ void ChannelArrayLocal::destroy()
channelLocal.reset();
}
void ChannelArrayLocal::getArray(bool lastRequest,int offset, int count)
void ChannelArrayLocal::getArray(size_t offset, size_t count, size_t stride)
{
if(isDestroyed) {
Status status(
Status::STATUSTYPE_ERROR,
"was destroyed");
channelArrayRequester->getArrayDone(status);
channelArrayRequester->getArrayDone(channelDestroyedStatus,getPtrSelf(),pvCopy);
return;
}
if(pvRecord->getTraceLevel()>1)
{
cout << "ChannelArrayLocal::getArray" << endl;
}
if(offset<0) {
channelArrayRequester->getArrayDone(illegalOffsetStatus,getPtrSelf(),pvCopy);
return;
}
if(stride<0) {
channelArrayRequester->getArrayDone(illegalStrideStatus,getPtrSelf(),pvCopy);
return;
}
const char *exceptionMessage = NULL;
pvRecord->lock();
try {
if(count<0) count = pvArray->getLength();
size_t capacity = pvArray->getCapacity();
if(capacity!=0) {
pvCopy->setCapacity(capacity);
pvCopy->setLength(count);
copy(*pvArray.get(),offset,*pvCopy.get(),0,count);
bool ok = false;
while(true) {
size_t length = pvArray->getLength();
if(length<=0) break;
if(count<=0) {
count = -offset + length/stride;
if(count>0) ok = true;
break;
}
size_t maxcount = -offset + length/stride;
if(count>maxcount) count = maxcount;
ok = true;
break;
}
} catch(...) {
pvRecord->unlock();
throw;
if(ok) {
pvCopy->setLength(count);
copy(pvArray,offset,stride,pvCopy,0,1,count);
}
} catch(std::exception e) {
exceptionMessage = e.what();
}
pvRecord->unlock();
channelArrayRequester->getArrayDone(Status::Ok);
if(lastRequest) destroy();
Status status = Status::Ok;
if(exceptionMessage!=NULL) {
status = Status(Status::Status::STATUSTYPE_ERROR,exceptionMessage);
}
channelArrayRequester->getArrayDone(status,getPtrSelf(),pvCopy);
}
void ChannelArrayLocal::putArray(bool lastRequest,int offset, int count)
void ChannelArrayLocal::putArray(
PVArrayPtr const & pvArray, size_t offset, size_t count, size_t stride)
{
if(isDestroyed) {
Status status(
Status::STATUSTYPE_ERROR,
"was destroyed");
channelArrayRequester->putArrayDone(status);
channelArrayRequester->putArrayDone(channelDestroyedStatus,getPtrSelf());
return;
}
if(pvRecord->getTraceLevel()>1)
{
cout << "ChannelArrayLocal::putArray" << endl;
}
if(offset<0) {
channelArrayRequester->putArrayDone(illegalOffsetStatus,getPtrSelf());
return;
}
if(count<0) {
channelArrayRequester->putArrayDone(illegalCountStatus,getPtrSelf());
return;
}
if(stride<0) {
channelArrayRequester->putArrayDone(illegalStrideStatus,getPtrSelf());
return;
}
size_t newLength = offset + count*stride;
pvArray->setLength(newLength);
const char *exceptionMessage = NULL;
pvRecord->lock();
try {
if(count<=0) count = pvCopy->getLength();
if(pvArray->getCapacity()<count) pvArray->setCapacity(count);
if(pvArray->getLength()<count) pvArray->setLength(count);
copy(*pvCopy.get(),0,*pvArray.get(),offset,count);
} catch(...) {
pvRecord->unlock();
throw;
copy(pvArray,0,1,this->pvArray,offset,stride,count);
} catch(std::exception e) {
exceptionMessage = e.what();
}
pvRecord->unlock();
channelArrayRequester->putArrayDone(Status::Ok);
if(lastRequest) destroy();
Status status = Status::Ok;
if(exceptionMessage!=NULL) {
status = Status(Status::Status::STATUSTYPE_ERROR,exceptionMessage);
}
channelArrayRequester->putArrayDone(status,getPtrSelf());
}
void ChannelArrayLocal::setLength(bool lastRequest,int length, int capacity)
void ChannelArrayLocal::getLength()
{
size_t length = 0;
size_t capacity = 0;
const char *exceptionMessage = NULL;
pvRecord->lock();
try {
length = pvArray->getLength();
capacity = pvArray->getCapacity();
} catch(std::exception e) {
exceptionMessage = e.what();
}
pvRecord->unlock();
Status status = Status::Ok;
if(exceptionMessage!=NULL) {
status = Status(Status::Status::STATUSTYPE_ERROR,exceptionMessage);
}
channelArrayRequester->getLengthDone(status,getPtrSelf(),length,capacity);
}
void ChannelArrayLocal::setLength(size_t length, size_t capacity)
{
if(isDestroyed) {
Status status(
Status::STATUSTYPE_ERROR,
"was destroyed");
channelArrayRequester->setLengthDone(status);
channelArrayRequester->setLengthDone(channelDestroyedStatus,getPtrSelf());
return;
}
if(pvRecord->getTraceLevel()>1)
@@ -980,16 +1046,16 @@ void ChannelArrayLocal::setLength(bool lastRequest,int length, int capacity)
try {
if(capacity>=0 && !pvArray->isCapacityMutable()) {
Status status(
Status::STATUSTYPE_ERROR,
Status::Status::STATUSTYPE_ERROR,
"capacityImnutable");
channelArrayRequester->setLengthDone(status);
channelArrayRequester->setLengthDone(status,getPtrSelf());
pvRecord->unlock();
return;
}
if(capacity>0) {
if(capacity>=0) {
if(pvArray->getCapacity()!=capacity) pvArray->setCapacity(capacity);
}
if(length>0) {
if(length>=0) {
if(pvArray->getLength()!=length) pvArray->setLength(length);
}
} catch(...) {
@@ -997,7 +1063,7 @@ void ChannelArrayLocal::setLength(bool lastRequest,int length, int capacity)
throw;
}
pvRecord->unlock();
channelArrayRequester->setLengthDone(Status::Ok);
channelArrayRequester->setLengthDone(Status::Ok,getPtrSelf());
}
+5 -22
View File
@@ -10,14 +10,6 @@
*/
#ifndef CHANNELPROVIDERLOCAL_H
#define CHANNELPROVIDERLOCAL_H
#ifdef epicsExportSharedSymbols
# define channelProviderLocalEpicsExportSharedSymbols
# undef epicsExportSharedSymbols
#endif
#include <string>
#include <cstring>
#include <stdexcept>
@@ -29,17 +21,11 @@
#include <pv/lock.h>
#include <pv/pvType.h>
#include <pv/pvData.h>
#include <pv/monitorPlugin.h>
#include <pv/pvCopy.h>
#include <pv/pvAccess.h>
#include <pv/status.h>
#ifdef channelProviderLocalEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef channelProviderLocalEpicsExportSharedSymbols
# include <shareLib.h>
#endif
#include <pv/pvDatabase.h>
#include <pv/monitorAlgorithm.h>
#include <pv/status.h>
namespace epics { namespace pvDatabase {
@@ -69,15 +55,10 @@ public:
PVRecordPtr const & pvRecord,
epics::pvData::MonitorRequester::shared_pointer const & monitorRequester,
epics::pvData::PVStructurePtr const & pvRequest);
void registerMonitorAlgorithmCreate(
MonitorAlgorithmCreatePtr const &monitorAlgorithmCreate);
MonitorAlgorithmCreatePtr getMonitorAlgorithmCreate(
epics::pvData::String algorithmName);
private:
MonitorFactory();
friend class MonitorLocal;
friend MonitorFactoryPtr getMonitorFactory();
std::multiset<MonitorAlgorithmCreatePtr> monitorAlgorithmCreateList;
bool isDestroyed;
epics::pvData::Mutex mutex;
};
@@ -97,6 +78,8 @@ public:
virtual epics::pvAccess::ChannelFind::shared_pointer channelFind(
epics::pvData::String const &channelName,
epics::pvAccess::ChannelFindRequester::shared_pointer const & channelFindRequester);
virtual epics::pvAccess::ChannelFind::shared_pointer channelList(
epics::pvAccess::ChannelListRequester::shared_pointer const & channelListRequester);
virtual epics::pvAccess::Channel::shared_pointer createChannel(
epics::pvData::String const &channelName,
epics::pvAccess::ChannelRequester::shared_pointer const &channelRequester,
+1
View File
@@ -17,6 +17,7 @@
#include <shareLib.h>
#include <pv/monitorPlugin.h>
#include <pv/pvCopy.h>
#include <pv/pvAccess.h>
#include <pv/pvDatabase.h>
+1 -3
View File
@@ -1,8 +1,6 @@
# Makefile at top of application tree
#Makefile at top of application tree
TOP = .
include $(TOP)/configure/CONFIG
DIRS += configure
DIRS += src
File renamed without changes.
@@ -14,11 +14,26 @@
# 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 = WARN
#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=</path/name/to/install/top>
-include $(TOP)/../configure/CONFIG_SITE.local
-include $(TOP)/../../CONFIG_SITE.local
# 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 = </IOC/path/to/application/top>
INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv
USR_INCLUDES += -I $(INSTALL_LOCATION)/include
-include $(TOP)/configure/CONFIG_SITE.local
-include $(TOP)/../CONFIG.local
@@ -6,4 +6,3 @@ TARGETS = $(CONFIG_TARGETS)
CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS)))
include $(TOP)/configure/RULES
@@ -1,4 +1,4 @@
# pvDatabaseCPP/testTop RELEASE - Location of external support modules
# pvDatabaseCPP/test RELEASE - Location of external support modules
#
# IF YOU CHANGE this file or any file it includes you must
# subsequently do a "gnumake rebuild" in the application's
@@ -16,9 +16,8 @@
# EPICS V4 Developers: Do not edit the locations in this file!
#
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
# PVASRV = /path/to/epics/pvaSrvCPP
# Create a file RELEASE.local pointing to your places
# for the dependencies, e.g.
# PVACCESS = /path/to/epics/pvAccessCPP
# PVDATA = /path/to/epics/pvDataCPP
# PVCOMMON = /path/to/epics/pvCommonCPP
@@ -28,14 +27,14 @@
# use the following definitions:
PVDATABASE = $(TOP)/..
-include $(TOP)/../configure/RELEASE.local
-include $(TOP)/../../RELEASE.local
-include $(TOP)/../configure/RELEASE.local
# If you copied these tests from pvDatabaseCPP to be built as a
# standalone TOP, adjust and use the following definitions:
# standalone TOP, define
# PVDATABASE = /path/to/epics/pvDatabaseCPP
# in the appropriate RELEASE[.local],
# and use the following definitions instead:
#PVDATABASE = /path/to/epics/pvDatabaseCPP
#-include $(TOP)/configure/RELEASE.local
#-include $(TOP)/../RELEASE.local
#-include $(TOP)/configure/RELEASE.local
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -9,13 +9,10 @@
* @date 2013.04.02
*/
#include "powerSupply.h"
#include <pv/standardField.h>
#include <pv/standardPVField.h>
#define epicsExportSharedSymbols
#include "powerSupply.h"
namespace epics { namespace pvDatabase {
using namespace epics::pvData;
@@ -11,32 +11,19 @@
#ifndef POWERSUPPLY_H
#define POWERSUPPLY_H
//#include <shareLib.h>
#include <shareLib.h>
#ifdef epicsExportSharedSymbols
# define powersupplyEpicsExportSharedSymbols
# undef epicsExportSharedSymbols
#endif
#include <pv/timeStamp.h>
#include <pv/pvTimeStamp.h>
#include <pv/pvDatabase.h>
#include <pv/timeStamp.h>
#include <pv/alarm.h>
#include <pv/pvTimeStamp.h>
#include <pv/pvAlarm.h>
#ifdef powersupplyEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef powersupplyEpicsExportSharedSymbols
# include <shareLib.h>
#endif
namespace epics { namespace pvDatabase {
epicsShareExtern epics::pvData::PVStructurePtr createPowerSupply();
class epicsShareClass PowerSupply;
class PowerSupply;
typedef std::tr1::shared_ptr<PowerSupply> PowerSupplyPtr;
class PowerSupply :
@@ -27,14 +27,13 @@
#include <epicsThread.h>
#include <iocsh.h>
#include <epicsExport.h>
#include <pv/pvIntrospect.h>
#include <pv/pvData.h>
#include <pv/pvAccess.h>
#include <pv/pvDatabase.h>
#include <epicsExport.h>
#include <powerSupply.h>
#include <pv/powerSupply.h>
using namespace epics::pvData;
using namespace epics::pvAccess;
@@ -67,7 +66,4 @@ static void powerSupplyRegister(void)
iocshRegister(&powerSupplyFuncDef, powerSupplyCallFunc);
}
}
extern "C" {
epicsExportRegistrar(powerSupplyRegister);
}
epicsExportRegistrar(powerSupplyRegister);
+1
View File
@@ -0,0 +1 @@
registrar("powerSupplyRegister")
@@ -23,6 +23,7 @@
#include <epicsEvent.h>
#include <epicsThread.h>
#include <epicsExport.h>
#include <pv/standardField.h>
#include <pv/standardPVField.h>
@@ -30,10 +31,6 @@
#include <pv/pvAccess.h>
#include "powerSupply.h"
#define epicsExportSharedSymbols
#include <epicsExport.h>
using namespace std;
using std::tr1::static_pointer_cast;
using namespace epics::pvData;
File renamed without changes.
File renamed without changes.