Compare commits
61 Commits
before_mer
...
4.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8769aa0ca | ||
|
|
a938f2325c | ||
|
|
7743f3e3fd | ||
|
|
e9ce6a2f0b | ||
|
|
1ed48c15f1 | ||
|
|
d27f929595 | ||
|
|
b4e17f271b | ||
|
|
79f407486a | ||
|
|
3c359728f7 | ||
|
|
7b9693562a | ||
|
|
f1c39ca5d2 | ||
|
|
16b1775b98 | ||
|
|
f6ee7333bb | ||
|
|
9f45bdfa75 | ||
|
|
03aa15b5f7 | ||
|
|
8093952ca2 | ||
|
|
2bea54e218 | ||
|
|
e81230dba5 | ||
|
|
50b8f306c3 | ||
|
|
65be8e5678 | ||
|
|
dbb9310adc | ||
|
|
50fbb396e8 | ||
|
|
ff19fe1cd8 | ||
|
|
230938220e | ||
|
|
334ed3b70a | ||
|
|
4c7e51d8ad | ||
|
|
4973a6297e | ||
|
|
f0d1481a28 | ||
|
|
d5235db54c | ||
|
|
b125035a11 | ||
|
|
9551b0e4c6 | ||
|
|
d6aa03815e | ||
|
|
ce0d62fbbc | ||
|
|
2fe3e66047 | ||
|
|
fa53d72258 | ||
|
|
b010cf0849 | ||
|
|
7fd707cb4b | ||
|
|
5d823307f0 | ||
|
|
d41d5726d2 | ||
|
|
723f98bc44 | ||
|
|
1544147bdd | ||
|
|
0447441cfa | ||
|
|
8ce42ebb9a | ||
|
|
c39b966121 | ||
|
|
61edf17cdf | ||
|
|
39f537d7da | ||
|
|
ba496de2d3 | ||
|
|
38574ed76f | ||
|
|
92be294bbf | ||
|
|
35429bf4df | ||
|
|
552925dfe6 | ||
|
|
d1791393ad | ||
|
|
3dbad700f7 | ||
|
|
c06e33e197 | ||
|
|
1d8f01517a | ||
|
|
8c1b142e48 | ||
|
|
ca27cb5e3c | ||
|
|
a5fa17aca7 | ||
|
|
fe62a7181f | ||
|
|
342ab45dc8 | ||
|
|
127830e3c7 |
@@ -7,5 +7,5 @@ db/
|
|||||||
dbd/
|
dbd/
|
||||||
documentation/html
|
documentation/html
|
||||||
envPaths
|
envPaths
|
||||||
RELEASE.local
|
configure/.*\.local
|
||||||
/O\..*
|
/O\..*
|
||||||
|
|||||||
8
.hgtags
8
.hgtags
@@ -1 +1,9 @@
|
|||||||
bba6a2491bdf73681cef01caf0bd89c87d7989cd 0.9.1
|
bba6a2491bdf73681cef01caf0bd89c87d7989cd 0.9.1
|
||||||
|
abdc90bf52a0c31e24e2f9a079ef72350ee31686 before_merge_changesAfter3_0_2
|
||||||
|
395f48d5196dde5bf7f24a1849aee3f8d92e91b8 3.1.0
|
||||||
|
e2e041fa7d04a37836a4343589077001588ae031 4.0.0
|
||||||
|
e2e041fa7d04a37836a4343589077001588ae031 4.0.0
|
||||||
|
42dbe8a17f851861a16be7d426ef1206324aa197 4.0.0
|
||||||
|
42dbe8a17f851861a16be7d426ef1206324aa197 4.0.0
|
||||||
|
85d46a2614f925ccb423d6abd5dfe20d42fb5099 4.0.0
|
||||||
|
541b0a7a645c63d136e397994ed0ab7178cf02cf 4.0.1
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -2,7 +2,7 @@
|
|||||||
Copyright (c) 2008 Martin R. Kraimer
|
Copyright (c) 2008 Martin R. Kraimer
|
||||||
Copyright (c) 2006 The University of Chicago, as Operator of Argonne
|
Copyright (c) 2006 The University of Chicago, as Operator of Argonne
|
||||||
National Laboratory.
|
National Laboratory.
|
||||||
Copyright (c) 2006 Deutsches Elektronen-Synchroton,
|
Copyright (c) 2006 Deutsches Elektronen-Synchrotron,
|
||||||
Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY.
|
Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY.
|
||||||
Copyright (c) 2007 Control System Laboratory,
|
Copyright (c) 2007 Control System Laboratory,
|
||||||
(COSYLAB) Ljubljana Slovenia
|
(COSYLAB) Ljubljana Slovenia
|
||||||
|
|||||||
32
Makefile
32
Makefile
@@ -1,25 +1,27 @@
|
|||||||
# Makefile for the EPICS V4 pvDatabase module
|
#Makefile at top of application tree
|
||||||
|
|
||||||
TOP = .
|
TOP = .
|
||||||
include $(TOP)/configure/CONFIG
|
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
|
define DIR_template
|
||||||
src_DEPEND_DIRS = configure
|
$(1)_DEPEND_DIRS = configure
|
||||||
|
endef
|
||||||
|
$(foreach dir, $(filter-out configure,$(DIRS)),$(eval $(call DIR_template,$(dir))))
|
||||||
|
|
||||||
EMBEDDED_TOPS := $(wildcard *Top)
|
define EMB_template
|
||||||
EMBEDDED_TOPS += $(wildcard example*)
|
|
||||||
|
|
||||||
DIRS += $(EMBEDDED_TOPS)
|
|
||||||
|
|
||||||
define dir_DEP
|
|
||||||
$(1)_DEPEND_DIRS = src
|
$(1)_DEPEND_DIRS = src
|
||||||
endef
|
endef
|
||||||
|
$(foreach dir, $(EMBEDDED_TOPS),$(eval $(call EMB_template,$(dir))))
|
||||||
|
|
||||||
$(foreach dir, $(EMBEDDED_TOPS), $(eval $(call dir_DEP,$(dir))))
|
#exampleDatabase_DEPEND_DIRS += test
|
||||||
|
#examplePowerSupply_DEPEND_DIRS += test
|
||||||
exampleDatabase_DEPEND_DIRS += testTop
|
|
||||||
examplePowerSupply_DEPEND_DIRS += testTop
|
|
||||||
|
|
||||||
include $(TOP)/configure/RULES_TOP
|
include $(TOP)/configure/RULES_TOP
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# Makefile at top of application tree
|
#Makefile at top of application tree
|
||||||
|
|
||||||
TOP = .
|
TOP = .
|
||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
|
|
||||||
DIRS += configure
|
DIRS += configure
|
||||||
|
|
||||||
DIRS += src
|
DIRS += src
|
||||||
@@ -14,11 +14,26 @@
|
|||||||
# Set CHECK_RELEASE to NO to disable checking completely.
|
# Set CHECK_RELEASE to NO to disable checking completely.
|
||||||
# Set CHECK_RELEASE to WARN to perform consistency checking but
|
# Set CHECK_RELEASE to WARN to perform consistency checking but
|
||||||
# continue building anyway if conflicts are found.
|
# 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
|
# To install files into a location other than $(TOP) define
|
||||||
# INSTALL_LOCATION here.
|
# INSTALL_LOCATION here.
|
||||||
#INSTALL_LOCATION=</path/name/to/install/top>
|
#INSTALL_LOCATION=</path/name/to/install/top>
|
||||||
|
|
||||||
-include $(TOP)/../configure/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)/../../CONFIG_SITE.local
|
-include $(TOP)/../../CONFIG_SITE.local
|
||||||
|
-include $(TOP)/../configure/CONFIG_SITE.local
|
||||||
@@ -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
|
# IF YOU CHANGE this file or any file it includes you must
|
||||||
# subsequently do a "gnumake rebuild" in the application's
|
# subsequently do a "gnumake rebuild" in the application's
|
||||||
@@ -16,9 +16,8 @@
|
|||||||
|
|
||||||
# EPICS V4 Developers: Do not edit the locations in this file!
|
# EPICS V4 Developers: Do not edit the locations in this file!
|
||||||
#
|
#
|
||||||
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
|
# Create a file RELEASE.local pointing to your places
|
||||||
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
|
# for the dependencies, e.g.
|
||||||
# PVASRV = /path/to/epics/pvaSrvCPP
|
|
||||||
# PVACCESS = /path/to/epics/pvAccessCPP
|
# PVACCESS = /path/to/epics/pvAccessCPP
|
||||||
# PVDATA = /path/to/epics/pvDataCPP
|
# PVDATA = /path/to/epics/pvDataCPP
|
||||||
# PVCOMMON = /path/to/epics/pvCommonCPP
|
# PVCOMMON = /path/to/epics/pvCommonCPP
|
||||||
@@ -28,14 +27,14 @@
|
|||||||
# use the following definitions:
|
# use the following definitions:
|
||||||
|
|
||||||
PVDATABASE = $(TOP)/..
|
PVDATABASE = $(TOP)/..
|
||||||
|
|
||||||
-include $(TOP)/../configure/RELEASE.local
|
|
||||||
-include $(TOP)/../../RELEASE.local
|
-include $(TOP)/../../RELEASE.local
|
||||||
|
-include $(TOP)/../configure/RELEASE.local
|
||||||
|
|
||||||
# If you copied this example from pvDatabaseCPP to be built as a
|
# 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)/../RELEASE.local
|
||||||
|
#-include $(TOP)/configure/RELEASE.local
|
||||||
@@ -26,7 +26,7 @@ using std::endl;
|
|||||||
using std::ostringstream;
|
using std::ostringstream;
|
||||||
|
|
||||||
ArrayPerformancePtr ArrayPerformance::create(
|
ArrayPerformancePtr ArrayPerformance::create(
|
||||||
epics::pvData::String const & recordName,
|
std::string const & recordName,
|
||||||
size_t size,
|
size_t size,
|
||||||
double delay)
|
double delay)
|
||||||
{
|
{
|
||||||
@@ -39,7 +39,7 @@ ArrayPerformancePtr ArrayPerformance::create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArrayPerformance::ArrayPerformance(
|
ArrayPerformance::ArrayPerformance(
|
||||||
epics::pvData::String const & recordName,
|
std::string const & recordName,
|
||||||
epics::pvData::PVStructurePtr const & pvStructure,
|
epics::pvData::PVStructurePtr const & pvStructure,
|
||||||
size_t size,
|
size_t size,
|
||||||
double delay)
|
double delay)
|
||||||
@@ -60,7 +60,7 @@ bool ArrayPerformance::init()
|
|||||||
|
|
||||||
initPVRecord();
|
initPVRecord();
|
||||||
PVScalarArrayPtr pvScalarArray = getPVStructure()->getScalarArrayField("value",pvLong);
|
PVScalarArrayPtr pvScalarArray = getPVStructure()->getScalarArrayField("value",pvLong);
|
||||||
if(pvScalarArray==NULL) return false;
|
if(!pvScalarArray) return false;
|
||||||
pvValue = static_pointer_cast<PVLongArray>(pvScalarArray);
|
pvValue = static_pointer_cast<PVLongArray>(pvScalarArray);
|
||||||
ArrayPerformancePtr xxx = dynamic_pointer_cast<ArrayPerformance>(getPtrSelf());
|
ArrayPerformancePtr xxx = dynamic_pointer_cast<ArrayPerformance>(getPtrSelf());
|
||||||
arrayPerformanceThread = ArrayPerformanceThreadPtr(new ArrayPerformanceThread(xxx));
|
arrayPerformanceThread = ArrayPerformanceThreadPtr(new ArrayPerformanceThread(xxx));
|
||||||
@@ -182,14 +182,18 @@ void ArrayPerformanceThread::run()
|
|||||||
nSinceLastReport = 0;
|
nSinceLastReport = 0;
|
||||||
}
|
}
|
||||||
++nSinceLastReport;
|
++nSinceLastReport;
|
||||||
shared_vector<int64> xxx(arrayPerformance->size,value++);
|
|
||||||
shared_vector<const int64> data(freeze(xxx));
|
|
||||||
arrayPerformance->lock();
|
arrayPerformance->lock();
|
||||||
try {
|
try {
|
||||||
arrayPerformance->beginGroupPut();
|
if(arrayPerformance->getTraceLevel()>1) {
|
||||||
arrayPerformance->pvValue->replace(data);
|
cout << "arrayPerformance size " << arrayPerformance->size;
|
||||||
arrayPerformance->process();
|
cout << " value " << value +1 << endl;
|
||||||
arrayPerformance->endGroupPut();
|
}
|
||||||
|
shared_vector<int64> xxx(arrayPerformance->size,value++);
|
||||||
|
shared_vector<const int64> data(freeze(xxx));
|
||||||
|
arrayPerformance->beginGroupPut();
|
||||||
|
arrayPerformance->pvValue->replace(data);
|
||||||
|
arrayPerformance->process();
|
||||||
|
arrayPerformance->endGroupPut();
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
arrayPerformance->unlock();
|
arrayPerformance->unlock();
|
||||||
throw;
|
throw;
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
# undef epicsExportSharedSymbols
|
# undef epicsExportSharedSymbols
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <shareLib.h>
|
|
||||||
#include <epicsThread.h>
|
#include <epicsThread.h>
|
||||||
#include <pv/standardPVField.h>
|
#include <pv/standardPVField.h>
|
||||||
#include <pv/timeStamp.h>
|
#include <pv/timeStamp.h>
|
||||||
@@ -44,7 +43,7 @@ class epicsShareClass ArrayPerformance :
|
|||||||
public:
|
public:
|
||||||
POINTER_DEFINITIONS(ArrayPerformance);
|
POINTER_DEFINITIONS(ArrayPerformance);
|
||||||
static ArrayPerformancePtr create(
|
static ArrayPerformancePtr create(
|
||||||
epics::pvData::String const & recordName,
|
std::string const & recordName,
|
||||||
size_t size,
|
size_t size,
|
||||||
double delay);
|
double delay);
|
||||||
virtual ~ArrayPerformance();
|
virtual ~ArrayPerformance();
|
||||||
@@ -53,7 +52,7 @@ public:
|
|||||||
virtual void process();
|
virtual void process();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
private:
|
private:
|
||||||
ArrayPerformance(epics::pvData::String const & recordName,
|
ArrayPerformance(std::string const & recordName,
|
||||||
epics::pvData::PVStructurePtr const & pvStructure,
|
epics::pvData::PVStructurePtr const & pvStructure,
|
||||||
size_t size,
|
size_t size,
|
||||||
double delay);
|
double delay);
|
||||||
@@ -81,7 +80,7 @@ private:
|
|||||||
ArrayPerformancePtr arrayPerformance;
|
ArrayPerformancePtr arrayPerformance;
|
||||||
bool isDestroyed;
|
bool isDestroyed;
|
||||||
bool runReturned;
|
bool runReturned;
|
||||||
epics::pvData::String threadName;
|
std::string threadName;
|
||||||
epics::pvData::Mutex mutex;
|
epics::pvData::Mutex mutex;
|
||||||
epics::pvData::int64 value;
|
epics::pvData::int64 value;
|
||||||
std::auto_ptr<epicsThread> thread;
|
std::auto_ptr<epicsThread> thread;
|
||||||
@@ -39,15 +39,15 @@ using namespace epics::pvDatabase;
|
|||||||
int main(int argc,char *argv[])
|
int main(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
bool result(false);
|
bool result(false);
|
||||||
String recordName;
|
string recordName;
|
||||||
recordName = "arrayPerformance";
|
recordName = "arrayPerformance";
|
||||||
size_t size = 10000000;
|
size_t size = 10000000;
|
||||||
double delay = .0001;
|
double delay = .0001;
|
||||||
String providerName("local");
|
string providerName("local");
|
||||||
size_t nMonitor = 1;
|
size_t nMonitor = 1;
|
||||||
int queueSize = 2;
|
int queueSize = 2;
|
||||||
double waitTime = 0.0;
|
double waitTime = 0.0;
|
||||||
if(argc==2 && String(argv[1])==String("-help")) {
|
if(argc==2 && string(argv[1])==string("-help")) {
|
||||||
cout << "arrayPerformanceMain recordName size";
|
cout << "arrayPerformanceMain recordName size";
|
||||||
cout << " delay providerName nMonitor queueSize waitTime" << endl;
|
cout << " delay providerName nMonitor queueSize waitTime" << endl;
|
||||||
cout << "default" << endl;
|
cout << "default" << endl;
|
||||||
@@ -83,7 +83,7 @@ int main(int argc,char *argv[])
|
|||||||
pvRecord = ArrayPerformance::create(recordName,size,delay);
|
pvRecord = ArrayPerformance::create(recordName,size,delay);
|
||||||
result = master->addRecord(pvRecord);
|
result = master->addRecord(pvRecord);
|
||||||
PVRecordPtr arrayPreformance = pvRecord;
|
PVRecordPtr arrayPreformance = pvRecord;
|
||||||
arrayPreformance->setTraceLevel(1);
|
arrayPreformance->setTraceLevel(0);
|
||||||
pvRecord = TraceRecord::create("traceRecordPGRPC");
|
pvRecord = TraceRecord::create("traceRecordPGRPC");
|
||||||
result = master->addRecord(pvRecord);
|
result = master->addRecord(pvRecord);
|
||||||
if(!result) cout<< "record " << recordName << " not added" << endl;
|
if(!result) cout<< "record " << recordName << " not added" << endl;
|
||||||
@@ -24,9 +24,10 @@ using std::tr1::dynamic_pointer_cast;
|
|||||||
using std::cout;
|
using std::cout;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
using std::ostringstream;
|
using std::ostringstream;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
static String requesterName("longArrayGet");
|
static string requesterName("longArrayGet");
|
||||||
static String request("value,timeStamp,alarm");
|
static string request("value,timeStamp,alarm");
|
||||||
static epics::pvData::Mutex printMutex;
|
static epics::pvData::Mutex printMutex;
|
||||||
|
|
||||||
class LongArrayChannelRequester;
|
class LongArrayChannelRequester;
|
||||||
@@ -52,8 +53,8 @@ public:
|
|||||||
isDestroyed = true;
|
isDestroyed = true;
|
||||||
longArrayChannelGet.reset();
|
longArrayChannelGet.reset();
|
||||||
}
|
}
|
||||||
virtual String getRequesterName() { return requesterName;}
|
virtual string getRequesterName() { return requesterName;}
|
||||||
virtual void message(String const & message, MessageType messageType)
|
virtual void message(string const & message, MessageType messageType)
|
||||||
{
|
{
|
||||||
Lock guard(printMutex);
|
Lock guard(printMutex);
|
||||||
cout << requesterName << " message " << message << endl;
|
cout << requesterName << " message " << message << endl;
|
||||||
@@ -93,18 +94,21 @@ public:
|
|||||||
isDestroyed = true;
|
isDestroyed = true;
|
||||||
longArrayChannelGet.reset();
|
longArrayChannelGet.reset();
|
||||||
}
|
}
|
||||||
virtual String getRequesterName() { return requesterName;}
|
virtual string getRequesterName() { return requesterName;}
|
||||||
virtual void message(String const & message, MessageType messageType)
|
virtual void message(string const & message, MessageType messageType)
|
||||||
{
|
{
|
||||||
Lock guard(printMutex);
|
Lock guard(printMutex);
|
||||||
cout << requesterName << " message " << message << endl;
|
cout << requesterName << " message " << message << endl;
|
||||||
}
|
}
|
||||||
virtual void channelGetConnect(
|
virtual void channelGetConnect(
|
||||||
|
Status const & status,
|
||||||
|
ChannelGet::shared_pointer const & channelGet,
|
||||||
|
StructureConstPtr const &structure);
|
||||||
|
virtual void getDone(
|
||||||
Status const & status,
|
Status const & status,
|
||||||
ChannelGet::shared_pointer const & channelGet,
|
ChannelGet::shared_pointer const & channelGet,
|
||||||
PVStructurePtr const &pvStructure,
|
PVStructurePtr const &pvStructure,
|
||||||
BitSetPtr const &bitSet);
|
BitSetPtr const & bitSet);
|
||||||
virtual void getDone(Status const & status);
|
|
||||||
private:
|
private:
|
||||||
LongArrayChannelGetRequesterPtr getPtrSelf()
|
LongArrayChannelGetRequesterPtr getPtrSelf()
|
||||||
{
|
{
|
||||||
@@ -123,8 +127,8 @@ class LongArrayChannelGet :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LongArrayChannelGet(
|
LongArrayChannelGet(
|
||||||
String providerName,
|
string providerName,
|
||||||
String channelName,
|
string channelName,
|
||||||
int iterBetweenCreateChannel,
|
int iterBetweenCreateChannel,
|
||||||
int iterBetweenCreateChannelGet,
|
int iterBetweenCreateChannelGet,
|
||||||
double delayTime)
|
double delayTime)
|
||||||
@@ -141,7 +145,7 @@ public:
|
|||||||
bool init();
|
bool init();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
virtual void run();
|
virtual void run();
|
||||||
void message(String const & message, MessageType messageType)
|
void message(string const & message, MessageType messageType)
|
||||||
{
|
{
|
||||||
Lock guard(printMutex);
|
Lock guard(printMutex);
|
||||||
cout << requesterName << " message " << message << endl;
|
cout << requesterName << " message " << message << endl;
|
||||||
@@ -155,23 +159,26 @@ public:
|
|||||||
virtual void channelGetConnect(
|
virtual void channelGetConnect(
|
||||||
Status const & status,
|
Status const & status,
|
||||||
ChannelGet::shared_pointer const & channelGet,
|
ChannelGet::shared_pointer const & channelGet,
|
||||||
|
StructureConstPtr const &structure);
|
||||||
|
virtual void getDone(
|
||||||
|
Status const & status,
|
||||||
|
ChannelGet::shared_pointer channelGet,
|
||||||
PVStructurePtr const &pvStructure,
|
PVStructurePtr const &pvStructure,
|
||||||
BitSetPtr const &bitSet);
|
BitSetPtr const & bitSet);
|
||||||
virtual void getDone(Status const & status);
|
|
||||||
private:
|
private:
|
||||||
LongArrayChannelGetPtr getPtrSelf()
|
LongArrayChannelGetPtr getPtrSelf()
|
||||||
{
|
{
|
||||||
return shared_from_this();
|
return shared_from_this();
|
||||||
}
|
}
|
||||||
size_t checkResult();
|
size_t checkResult();
|
||||||
String providerName;
|
string providerName;
|
||||||
String channelName;
|
string channelName;
|
||||||
int iterBetweenCreateChannel;
|
int iterBetweenCreateChannel;
|
||||||
int iterBetweenCreateChannelGet;
|
int iterBetweenCreateChannelGet;
|
||||||
double delayTime;
|
double delayTime;
|
||||||
bool isDestroyed;
|
bool isDestroyed;
|
||||||
bool runReturned;
|
bool runReturned;
|
||||||
epics::pvData::String threadName;
|
std::string threadName;
|
||||||
Status status;
|
Status status;
|
||||||
Event event;
|
Event event;
|
||||||
Mutex mutex;
|
Mutex mutex;
|
||||||
@@ -197,7 +204,7 @@ void LongArrayChannelRequester::channelStateChange(
|
|||||||
Channel::shared_pointer const & channel,
|
Channel::shared_pointer const & channel,
|
||||||
Channel::ConnectionState connectionState)
|
Channel::ConnectionState connectionState)
|
||||||
{
|
{
|
||||||
String mess(Channel::ConnectionStateNames[connectionState]);
|
string mess(Channel::ConnectionStateNames[connectionState]);
|
||||||
message(mess,infoMessage);
|
message(mess,infoMessage);
|
||||||
Lock guard(mutex);
|
Lock guard(mutex);
|
||||||
if(isDestroyed) return;
|
if(isDestroyed) return;
|
||||||
@@ -206,21 +213,24 @@ void LongArrayChannelRequester::channelStateChange(
|
|||||||
|
|
||||||
void LongArrayChannelGetRequester::channelGetConnect(
|
void LongArrayChannelGetRequester::channelGetConnect(
|
||||||
Status const & status,
|
Status const & status,
|
||||||
ChannelGet::shared_pointer const & channelGet,
|
ChannelGet::shared_pointer const & channelGet,
|
||||||
PVStructurePtr const &pvStructure,
|
StructureConstPtr const &structure)
|
||||||
BitSetPtr const &bitSet)
|
|
||||||
{
|
{
|
||||||
Lock guard(mutex);
|
Lock guard(mutex);
|
||||||
if(isDestroyed) return;
|
if(isDestroyed) return;
|
||||||
longArrayChannelGet->channelGetConnect(
|
longArrayChannelGet->channelGetConnect(
|
||||||
status,channelGet,pvStructure,bitSet);
|
status,channelGet,structure);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LongArrayChannelGetRequester::getDone(Status const & status)
|
void LongArrayChannelGetRequester::getDone(
|
||||||
|
Status const & status,
|
||||||
|
ChannelGet::shared_pointer const & channelGet,
|
||||||
|
PVStructurePtr const &pvStructure,
|
||||||
|
BitSetPtr const & bitSet)
|
||||||
{
|
{
|
||||||
Lock guard(mutex);
|
Lock guard(mutex);
|
||||||
if(isDestroyed) return;
|
if(isDestroyed) return;
|
||||||
longArrayChannelGet->getDone(status);
|
longArrayChannelGet->getDone(status,channelGet,pvStructure,bitSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LongArrayChannelGet::channelCreated(
|
void LongArrayChannelGet::channelCreated(
|
||||||
@@ -241,12 +251,10 @@ void LongArrayChannelGet::channelStateChange(
|
|||||||
(connectionState==Channel::CONNECTED ? infoMessage : errorMessage);
|
(connectionState==Channel::CONNECTED ? infoMessage : errorMessage);
|
||||||
message("channelStateChange",messageType);
|
message("channelStateChange",messageType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LongArrayChannelGet::channelGetConnect(
|
void LongArrayChannelGet::channelGetConnect(
|
||||||
Status const & status,
|
Status const & status,
|
||||||
ChannelGet::shared_pointer const & channelGet,
|
ChannelGet::shared_pointer const & channelGet,
|
||||||
PVStructurePtr const &pvStructure,
|
StructureConstPtr const &structure)
|
||||||
BitSetPtr const &bitSet)
|
|
||||||
{
|
{
|
||||||
this->status = status;
|
this->status = status;
|
||||||
if(!status.isOK()) {
|
if(!status.isOK()) {
|
||||||
@@ -255,13 +263,12 @@ void LongArrayChannelGet::channelGetConnect(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->channelGet = channelGet;
|
this->channelGet = channelGet;
|
||||||
this->pvStructure = pvStructure;
|
|
||||||
this->bitSet = bitSet;
|
|
||||||
bool structureOK(true);
|
bool structureOK(true);
|
||||||
|
PVStructurePtr pvStructure = getPVDataCreate()->createPVStructure(structure);
|
||||||
PVFieldPtr pvField = pvStructure->getSubField("timeStamp");
|
PVFieldPtr pvField = pvStructure->getSubField("timeStamp");
|
||||||
if(pvField==NULL) structureOK = false;
|
if(!pvField) structureOK = false;
|
||||||
pvField = pvStructure->getSubField("value");
|
pvField = pvStructure->getSubField("value");
|
||||||
if(pvField==NULL) {
|
if(!pvField) {
|
||||||
structureOK = false;
|
structureOK = false;
|
||||||
} else {
|
} else {
|
||||||
FieldConstPtr field = pvField->getField();
|
FieldConstPtr field = pvField->getField();
|
||||||
@@ -273,7 +280,7 @@ void LongArrayChannelGet::channelGetConnect(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!structureOK) {
|
if(!structureOK) {
|
||||||
String mess("channelGetConnect: illegal structure");
|
string mess("channelGetConnect: illegal structure");
|
||||||
message(mess,errorMessage);
|
message(mess,errorMessage);
|
||||||
this->status = Status(Status::STATUSTYPE_ERROR,mess);
|
this->status = Status(Status::STATUSTYPE_ERROR,mess);
|
||||||
}
|
}
|
||||||
@@ -284,8 +291,8 @@ void LongArrayChannelGet::channelGetConnect(
|
|||||||
bool LongArrayChannelGet::init()
|
bool LongArrayChannelGet::init()
|
||||||
{
|
{
|
||||||
ChannelProvider::shared_pointer channelProvider =
|
ChannelProvider::shared_pointer channelProvider =
|
||||||
getChannelAccess()->getProvider(providerName);
|
getChannelProviderRegistry()->getProvider(providerName);
|
||||||
if(channelProvider==NULL) {
|
if(!channelProvider) {
|
||||||
cout << "provider " << providerName << " not found" << endl;
|
cout << "provider " << providerName << " not found" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -298,7 +305,7 @@ bool LongArrayChannelGet::init()
|
|||||||
if(!status.isOK()) return false;
|
if(!status.isOK()) return false;
|
||||||
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
||||||
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
||||||
if(pvRequest==NULL) {
|
if(!pvRequest) {
|
||||||
cout << "request logic error " << createRequest->getMessage() << endl;
|
cout << "request logic error " << createRequest->getMessage() << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -327,10 +334,10 @@ void LongArrayChannelGet::destroy()
|
|||||||
if(runReturned) break;
|
if(runReturned) break;
|
||||||
epicsThreadSleep(.01);
|
epicsThreadSleep(.01);
|
||||||
}
|
}
|
||||||
if(longArrayChannelRequester!=NULL) {
|
if(longArrayChannelRequester) {
|
||||||
longArrayChannelRequester->destroy();
|
longArrayChannelRequester->destroy();
|
||||||
}
|
}
|
||||||
if(longArrayChannelGetRequester!=NULL) {
|
if(longArrayChannelGetRequester) {
|
||||||
longArrayChannelGetRequester->destroy();
|
longArrayChannelGetRequester->destroy();
|
||||||
}
|
}
|
||||||
thread->exitWait();
|
thread->exitWait();
|
||||||
@@ -355,7 +362,7 @@ void LongArrayChannelGet::run()
|
|||||||
int numChannelCreate = 0;
|
int numChannelCreate = 0;
|
||||||
size_t nElements = 0;
|
size_t nElements = 0;
|
||||||
while(true) {
|
while(true) {
|
||||||
channelGet->get(false);
|
channelGet->get();
|
||||||
event.wait();
|
event.wait();
|
||||||
if(isDestroyed) {
|
if(isDestroyed) {
|
||||||
runReturned = true;
|
runReturned = true;
|
||||||
@@ -398,7 +405,7 @@ void LongArrayChannelGet::run()
|
|||||||
longArrayChannelRequester->destroy();
|
longArrayChannelRequester->destroy();
|
||||||
channel->destroy();
|
channel->destroy();
|
||||||
ChannelProvider::shared_pointer channelProvider =
|
ChannelProvider::shared_pointer channelProvider =
|
||||||
getChannelAccess()->getProvider(providerName);
|
getChannelProviderRegistry()->getProvider(providerName);
|
||||||
longArrayChannelRequester.reset(new LongArrayChannelRequester(getPtrSelf()));
|
longArrayChannelRequester.reset(new LongArrayChannelRequester(getPtrSelf()));
|
||||||
channel = channelProvider->createChannel(
|
channel = channelProvider->createChannel(
|
||||||
channelName,
|
channelName,
|
||||||
@@ -426,7 +433,7 @@ void LongArrayChannelGet::run()
|
|||||||
CreateRequest::create();
|
CreateRequest::create();
|
||||||
PVStructurePtr pvRequest =
|
PVStructurePtr pvRequest =
|
||||||
createRequest->createRequest(request);
|
createRequest->createRequest(request);
|
||||||
if(pvRequest==NULL) {
|
if(!pvRequest) {
|
||||||
cout << "request logic error " << createRequest->getMessage() << endl;
|
cout << "request logic error " << createRequest->getMessage() << endl;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
@@ -445,10 +452,14 @@ void LongArrayChannelGet::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LongArrayChannelGet::getDone(
|
||||||
|
Status const & status,
|
||||||
void LongArrayChannelGet::getDone(Status const & status)
|
ChannelGet::shared_pointer channelGet,
|
||||||
|
PVStructurePtr const &pvStructure,
|
||||||
|
BitSetPtr const & bitSet)
|
||||||
{
|
{
|
||||||
|
this->pvStructure = pvStructure;
|
||||||
|
this->bitSet = bitSet;
|
||||||
event.signal();
|
event.signal();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,8 +488,8 @@ size_t LongArrayChannelGet::checkResult()
|
|||||||
|
|
||||||
|
|
||||||
LongArrayGetPtr LongArrayGet::create(
|
LongArrayGetPtr LongArrayGet::create(
|
||||||
String const &providerName,
|
string const &providerName,
|
||||||
String const & channelName,
|
string const & channelName,
|
||||||
int iterBetweenCreateChannel,
|
int iterBetweenCreateChannel,
|
||||||
int iterBetweenCreateChannelGet,
|
int iterBetweenCreateChannelGet,
|
||||||
double delayTime)
|
double delayTime)
|
||||||
@@ -495,8 +506,8 @@ LongArrayGetPtr LongArrayGet::create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
LongArrayGet::LongArrayGet(
|
LongArrayGet::LongArrayGet(
|
||||||
String const &providerName,
|
string const &providerName,
|
||||||
String const & channelName,
|
string const & channelName,
|
||||||
int iterBetweenCreateChannel,
|
int iterBetweenCreateChannel,
|
||||||
int iterBetweenCreateChannelGet,
|
int iterBetweenCreateChannelGet,
|
||||||
double delayTime)
|
double delayTime)
|
||||||
@@ -17,8 +17,6 @@
|
|||||||
# undef epicsExportSharedSymbols
|
# undef epicsExportSharedSymbols
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <shareLib.h>
|
|
||||||
|
|
||||||
#include <pv/event.h>
|
#include <pv/event.h>
|
||||||
#include <pv/lock.h>
|
#include <pv/lock.h>
|
||||||
#include <pv/standardPVField.h>
|
#include <pv/standardPVField.h>
|
||||||
@@ -49,8 +47,8 @@ class epicsShareClass LongArrayGet :
|
|||||||
public:
|
public:
|
||||||
POINTER_DEFINITIONS(LongArrayGet);
|
POINTER_DEFINITIONS(LongArrayGet);
|
||||||
static LongArrayGetPtr create(
|
static LongArrayGetPtr create(
|
||||||
epics::pvData::String const & providerName,
|
std::string const & providerName,
|
||||||
epics::pvData::String const & channelName,
|
std::string const & channelName,
|
||||||
int iterBetweenCreateChannel = 0,
|
int iterBetweenCreateChannel = 0,
|
||||||
int iterBetweenCreateChannelGet = 0,
|
int iterBetweenCreateChannelGet = 0,
|
||||||
double delayTime = 0.0);
|
double delayTime = 0.0);
|
||||||
@@ -62,15 +60,15 @@ private:
|
|||||||
return shared_from_this();
|
return shared_from_this();
|
||||||
}
|
}
|
||||||
LongArrayGet(
|
LongArrayGet(
|
||||||
epics::pvData::String const & providerName,
|
std::string const & providerName,
|
||||||
epics::pvData::String const & channelName,
|
std::string const & channelName,
|
||||||
int iterBetweenCreateChannel = 0,
|
int iterBetweenCreateChannel = 0,
|
||||||
int iterBetweenCreateChannelGet = 0,
|
int iterBetweenCreateChannelGet = 0,
|
||||||
double delayTime = 0.0);
|
double delayTime = 0.0);
|
||||||
bool init();
|
bool init();
|
||||||
|
|
||||||
epics::pvData::String providerName;
|
std::string providerName;
|
||||||
epics::pvData::String channelName;
|
std::string channelName;
|
||||||
int iterBetweenCreateChannel;
|
int iterBetweenCreateChannel;
|
||||||
int iterBetweenCreateChannelGet;
|
int iterBetweenCreateChannelGet;
|
||||||
double delayTime;
|
double delayTime;
|
||||||
@@ -38,11 +38,11 @@ using namespace epics::pvDatabase;
|
|||||||
|
|
||||||
int main(int argc,char *argv[])
|
int main(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
String channelName("arrayPerformance");
|
string channelName("arrayPerformance");
|
||||||
int iterBetweenCreateChannel = 0;
|
int iterBetweenCreateChannel = 0;
|
||||||
int iterBetweenCreateChannelGet = 0;
|
int iterBetweenCreateChannelGet = 0;
|
||||||
double delayTime = 1.0;
|
double delayTime = 1.0;
|
||||||
if(argc==2 && String(argv[1])==String("-help")) {
|
if(argc==2 && string(argv[1])==string("-help")) {
|
||||||
cout << "longArrayGetMain channelName ";
|
cout << "longArrayGetMain channelName ";
|
||||||
cout << "iterBetweenCreateChannel iterBetweenCreateChannelGet delayTime" << endl;
|
cout << "iterBetweenCreateChannel iterBetweenCreateChannelGet delayTime" << endl;
|
||||||
cout << "default" << endl;
|
cout << "default" << endl;
|
||||||
@@ -25,11 +25,12 @@ using std::tr1::static_pointer_cast;
|
|||||||
using std::tr1::dynamic_pointer_cast;
|
using std::tr1::dynamic_pointer_cast;
|
||||||
using std::cout;
|
using std::cout;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
|
using std::string;
|
||||||
using std::ostringstream;
|
using std::ostringstream;
|
||||||
|
|
||||||
static String requesterName("longArrayMonitor");
|
static string requesterName("longArrayMonitor");
|
||||||
|
|
||||||
static void messagePvt(String const & message, MessageType messageType)
|
static void messagePvt(string const & message, MessageType messageType)
|
||||||
{
|
{
|
||||||
cout << requesterName << " message " << message << endl;
|
cout << requesterName << " message " << message << endl;
|
||||||
}
|
}
|
||||||
@@ -43,8 +44,8 @@ public:
|
|||||||
{}
|
{}
|
||||||
virtual ~LAMChannelRequester(){}
|
virtual ~LAMChannelRequester(){}
|
||||||
virtual void destroy(){longArrayMonitor.reset();}
|
virtual void destroy(){longArrayMonitor.reset();}
|
||||||
virtual String getRequesterName() { return requesterName;}
|
virtual string getRequesterName() { return requesterName;}
|
||||||
virtual void message(String const & message, MessageType messageType)
|
virtual void message(string const & message, MessageType messageType)
|
||||||
{ messagePvt(message,messageType);}
|
{ messagePvt(message,messageType);}
|
||||||
virtual void channelCreated(const Status& status, Channel::shared_pointer const & channel);
|
virtual void channelCreated(const Status& status, Channel::shared_pointer const & channel);
|
||||||
virtual void channelStateChange(Channel::shared_pointer const & channel, Channel::ConnectionState connectionState);
|
virtual void channelStateChange(Channel::shared_pointer const & channel, Channel::ConnectionState connectionState);
|
||||||
@@ -83,8 +84,8 @@ public:
|
|||||||
void init();
|
void init();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
virtual void run();
|
virtual void run();
|
||||||
virtual String getRequesterName() { return requesterName;}
|
virtual string getRequesterName() { return requesterName;}
|
||||||
virtual void message(String const & message, MessageType messageType)
|
virtual void message(string const & message, MessageType messageType)
|
||||||
{ messagePvt(message,messageType);}
|
{ messagePvt(message,messageType);}
|
||||||
virtual void monitorConnect(Status const & status,
|
virtual void monitorConnect(Status const & status,
|
||||||
MonitorPtr const & monitor, StructureConstPtr const & structure);
|
MonitorPtr const & monitor, StructureConstPtr const & structure);
|
||||||
@@ -95,7 +96,7 @@ private:
|
|||||||
double waitTime;
|
double waitTime;
|
||||||
bool isDestroyed;
|
bool isDestroyed;
|
||||||
bool runReturned;
|
bool runReturned;
|
||||||
epics::pvData::String threadName;
|
std::string threadName;
|
||||||
Event event;
|
Event event;
|
||||||
Mutex mutex;
|
Mutex mutex;
|
||||||
std::auto_ptr<epicsThread> thread;
|
std::auto_ptr<epicsThread> thread;
|
||||||
@@ -137,9 +138,9 @@ void LAMMonitorRequester::monitorConnect(Status const & status,
|
|||||||
}
|
}
|
||||||
bool structureOK(true);
|
bool structureOK(true);
|
||||||
FieldConstPtr field = structure->getField("timeStamp");
|
FieldConstPtr field = structure->getField("timeStamp");
|
||||||
if(field==NULL) structureOK = false;
|
if(!field) structureOK = false;
|
||||||
field = structure->getField("value");
|
field = structure->getField("value");
|
||||||
if(field==NULL) {
|
if(!field) {
|
||||||
structureOK = false;
|
structureOK = false;
|
||||||
} else {
|
} else {
|
||||||
if(field->getType()!=scalarArray) {
|
if(field->getType()!=scalarArray) {
|
||||||
@@ -150,7 +151,7 @@ void LAMMonitorRequester::monitorConnect(Status const & status,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!structureOK) {
|
if(!structureOK) {
|
||||||
String message("monitorConnect: illegal structure");
|
string message("monitorConnect: illegal structure");
|
||||||
messagePvt(message,errorMessage);
|
messagePvt(message,errorMessage);
|
||||||
longArrayMonitor->status = Status(Status::STATUSTYPE_ERROR,message);
|
longArrayMonitor->status = Status(Status::STATUSTYPE_ERROR,message);
|
||||||
}
|
}
|
||||||
@@ -178,9 +179,9 @@ void LAMMonitorRequester::run()
|
|||||||
{
|
{
|
||||||
Lock xx(mutex);
|
Lock xx(mutex);
|
||||||
monitorElement = longArrayMonitor->monitor->poll();
|
monitorElement = longArrayMonitor->monitor->poll();
|
||||||
if(monitorElement!=NULL) pvStructure = monitorElement->pvStructurePtr;
|
if(monitorElement) pvStructure = monitorElement->pvStructurePtr;
|
||||||
}
|
}
|
||||||
if(monitorElement==NULL) break;
|
if(!monitorElement) break;
|
||||||
if(waitTime>0.0) epicsThreadSleep(waitTime);
|
if(waitTime>0.0) epicsThreadSleep(waitTime);
|
||||||
pvTimeStamp.attach(pvStructure->getSubField("timeStamp"));
|
pvTimeStamp.attach(pvStructure->getSubField("timeStamp"));
|
||||||
pvTimeStamp.get(timeStamp);
|
pvTimeStamp.get(timeStamp);
|
||||||
@@ -200,12 +201,8 @@ void LAMMonitorRequester::run()
|
|||||||
out << "first " << first << " last " << last ;
|
out << "first " << first << " last " << last ;
|
||||||
BitSetPtr changed = monitorElement->changedBitSet;
|
BitSetPtr changed = monitorElement->changedBitSet;
|
||||||
BitSetPtr overrun = monitorElement->overrunBitSet;
|
BitSetPtr overrun = monitorElement->overrunBitSet;
|
||||||
String buffer;
|
out << " changed " << *changed;
|
||||||
changed->toString(&buffer);
|
out << " overrun " << *overrun;
|
||||||
out << " changed " << buffer;
|
|
||||||
buffer.clear();
|
|
||||||
overrun->toString(&buffer);
|
|
||||||
out << " overrun " << buffer;
|
|
||||||
double elementsPerSec = nElements;
|
double elementsPerSec = nElements;
|
||||||
elementsPerSec /= diff;
|
elementsPerSec /= diff;
|
||||||
if(elementsPerSec>10.0e9) {
|
if(elementsPerSec>10.0e9) {
|
||||||
@@ -246,8 +243,8 @@ void LAMMonitorRequester::unlisten(MonitorPtr const & monitor)
|
|||||||
|
|
||||||
|
|
||||||
LongArrayMonitorPtr LongArrayMonitor::create(
|
LongArrayMonitorPtr LongArrayMonitor::create(
|
||||||
String const &providerName,
|
string const &providerName,
|
||||||
String const & channelName,
|
string const & channelName,
|
||||||
int queueSize,
|
int queueSize,
|
||||||
double waitTime)
|
double waitTime)
|
||||||
{
|
{
|
||||||
@@ -261,30 +258,31 @@ LongArrayMonitor::LongArrayMonitor() {}
|
|||||||
LongArrayMonitor::~LongArrayMonitor() {}
|
LongArrayMonitor::~LongArrayMonitor() {}
|
||||||
|
|
||||||
bool LongArrayMonitor::init(
|
bool LongArrayMonitor::init(
|
||||||
String const &providerName,
|
string const &providerName,
|
||||||
String const &channelName,
|
string const &channelName,
|
||||||
int queueSize,
|
int queueSize,
|
||||||
double waitTime)
|
double waitTime)
|
||||||
{
|
{
|
||||||
channelRequester = LAMChannelRequesterPtr(new LAMChannelRequester(getPtrSelf()));
|
channelRequester = LAMChannelRequesterPtr(new LAMChannelRequester(getPtrSelf()));
|
||||||
monitorRequester = LAMMonitorRequesterPtr(new LAMMonitorRequester(getPtrSelf(),waitTime));
|
monitorRequester = LAMMonitorRequesterPtr(new LAMMonitorRequester(getPtrSelf(),waitTime));
|
||||||
monitorRequester->init();
|
monitorRequester->init();
|
||||||
ChannelProvider::shared_pointer channelProvider = getChannelAccess()->getProvider(providerName);
|
ChannelProvider::shared_pointer channelProvider =
|
||||||
if(channelProvider==NULL) {
|
getChannelProviderRegistry()->getProvider(providerName);
|
||||||
|
if(!channelProvider) {
|
||||||
cout << "provider " << providerName << " not found" << endl;
|
cout << "provider " << providerName << " not found" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
channel = channelProvider->createChannel(channelName,channelRequester,0);
|
channel = channelProvider->createChannel(channelName,channelRequester,0);
|
||||||
event.wait();
|
event.wait();
|
||||||
if(!status.isOK()) return false;
|
if(!status.isOK()) return false;
|
||||||
String request("record[queueSize=");
|
string request("record[queueSize=");
|
||||||
char buff[20];
|
char buff[20];
|
||||||
sprintf(buff,"%d",queueSize);
|
sprintf(buff,"%d",queueSize);
|
||||||
request += buff;
|
request += buff;
|
||||||
request += "]field(value,timeStamp,alarm)";
|
request += "]field(value,timeStamp,alarm)";
|
||||||
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
||||||
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
||||||
if(pvRequest==NULL) {
|
if(!pvRequest) {
|
||||||
cout << "request logic error " << createRequest->getMessage() << endl;
|
cout << "request logic error " << createRequest->getMessage() << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
# undef epicsExportSharedSymbols
|
# undef epicsExportSharedSymbols
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <shareLib.h>
|
|
||||||
#include <pv/event.h>
|
#include <pv/event.h>
|
||||||
#include <pv/lock.h>
|
#include <pv/lock.h>
|
||||||
#include <pv/standardPVField.h>
|
#include <pv/standardPVField.h>
|
||||||
@@ -49,8 +48,8 @@ class epicsShareClass LongArrayMonitor :
|
|||||||
public:
|
public:
|
||||||
POINTER_DEFINITIONS(LongArrayMonitor);
|
POINTER_DEFINITIONS(LongArrayMonitor);
|
||||||
static LongArrayMonitorPtr create(
|
static LongArrayMonitorPtr create(
|
||||||
epics::pvData::String const & providerName,
|
std::string const & providerName,
|
||||||
epics::pvData::String const & channelName,
|
std::string const & channelName,
|
||||||
int queueSize = 1,
|
int queueSize = 1,
|
||||||
double waitTime = 0.0);
|
double waitTime = 0.0);
|
||||||
~LongArrayMonitor();
|
~LongArrayMonitor();
|
||||||
@@ -60,8 +59,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
static epics::pvData::Mutex printMutex;
|
static epics::pvData::Mutex printMutex;
|
||||||
bool init(
|
bool init(
|
||||||
epics::pvData::String const & providerName,
|
std::string const & providerName,
|
||||||
epics::pvData::String const & channelName,
|
std::string const & channelName,
|
||||||
int queueSize,
|
int queueSize,
|
||||||
double waitTime);
|
double waitTime);
|
||||||
LongArrayMonitorPtr getPtrSelf()
|
LongArrayMonitorPtr getPtrSelf()
|
||||||
@@ -38,10 +38,10 @@ using namespace epics::pvDatabase;
|
|||||||
|
|
||||||
int main(int argc,char *argv[])
|
int main(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
String channelName("arrayPerformance");
|
string channelName("arrayPerformance");
|
||||||
int queueSize = 2;
|
int queueSize = 2;
|
||||||
double waitTime = 0.0;
|
double waitTime = 0.0;
|
||||||
if(argc==2 && String(argv[1])==String("-help")) {
|
if(argc==2 && string(argv[1])==string("-help")) {
|
||||||
cout << "longArrayMonitorMain channelName queueSize waitTime" << endl;
|
cout << "longArrayMonitorMain channelName queueSize waitTime" << endl;
|
||||||
cout << "default" << endl;
|
cout << "default" << endl;
|
||||||
cout << "longArrayMonitorMain " << channelName << " ";
|
cout << "longArrayMonitorMain " << channelName << " ";
|
||||||
@@ -24,9 +24,10 @@ using std::tr1::dynamic_pointer_cast;
|
|||||||
using std::cout;
|
using std::cout;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
using std::ostringstream;
|
using std::ostringstream;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
static String requesterName("longArrayPut");
|
static string requesterName("longArrayPut");
|
||||||
static String request("value");
|
static string request("value");
|
||||||
static epics::pvData::Mutex printMutex;
|
static epics::pvData::Mutex printMutex;
|
||||||
|
|
||||||
class LongArrayChannelPut :
|
class LongArrayChannelPut :
|
||||||
@@ -37,8 +38,8 @@ class LongArrayChannelPut :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LongArrayChannelPut(
|
LongArrayChannelPut(
|
||||||
String providerName,
|
string providerName,
|
||||||
String channelName,
|
string channelName,
|
||||||
size_t arraySize,
|
size_t arraySize,
|
||||||
int iterBetweenCreateChannel,
|
int iterBetweenCreateChannel,
|
||||||
int iterBetweenCreateChannelPut,
|
int iterBetweenCreateChannelPut,
|
||||||
@@ -57,8 +58,8 @@ public:
|
|||||||
bool init();
|
bool init();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
virtual void run();
|
virtual void run();
|
||||||
virtual String getRequesterName() { return requesterName;}
|
virtual string getRequesterName() { return requesterName;}
|
||||||
virtual void message(String const & message, MessageType messageType)
|
virtual void message(string const & message, MessageType messageType)
|
||||||
{
|
{
|
||||||
Lock guard(printMutex);
|
Lock guard(printMutex);
|
||||||
cout << requesterName << " message " << message << endl;
|
cout << requesterName << " message " << message << endl;
|
||||||
@@ -70,26 +71,31 @@ public:
|
|||||||
Channel::shared_pointer const & channel,
|
Channel::shared_pointer const & channel,
|
||||||
Channel::ConnectionState connectionState);
|
Channel::ConnectionState connectionState);
|
||||||
virtual void channelPutConnect(
|
virtual void channelPutConnect(
|
||||||
|
Status const & status,
|
||||||
|
ChannelPut::shared_pointer const & channelPut,
|
||||||
|
StructureConstPtr const &structure);
|
||||||
|
virtual void putDone(
|
||||||
|
Status const & status,
|
||||||
|
ChannelPut::shared_pointer const & channelPut);
|
||||||
|
virtual void getDone(
|
||||||
Status const & status,
|
Status const & status,
|
||||||
ChannelPut::shared_pointer const & channelPut,
|
ChannelPut::shared_pointer const & channelPut,
|
||||||
PVStructurePtr const &pvStructure,
|
PVStructurePtr const &pvStructure,
|
||||||
BitSetPtr const &bitSet);
|
BitSetPtr const & bitSet){}
|
||||||
virtual void putDone(Status const & status);
|
|
||||||
virtual void getDone(Status const & status){}
|
|
||||||
private:
|
private:
|
||||||
LongArrayChannelPutPtr getPtrSelf()
|
LongArrayChannelPutPtr getPtrSelf()
|
||||||
{
|
{
|
||||||
return shared_from_this();
|
return shared_from_this();
|
||||||
}
|
}
|
||||||
String providerName;
|
string providerName;
|
||||||
String channelName;
|
string channelName;
|
||||||
size_t arraySize;
|
size_t arraySize;
|
||||||
int iterBetweenCreateChannel;
|
int iterBetweenCreateChannel;
|
||||||
int iterBetweenCreateChannelPut;
|
int iterBetweenCreateChannelPut;
|
||||||
double delayTime;
|
double delayTime;
|
||||||
bool isDestroyed;
|
bool isDestroyed;
|
||||||
bool runReturned;
|
bool runReturned;
|
||||||
epics::pvData::String threadName;
|
std::string threadName;
|
||||||
Status status;
|
Status status;
|
||||||
Event event;
|
Event event;
|
||||||
Mutex mutex;
|
Mutex mutex;
|
||||||
@@ -103,8 +109,8 @@ private:
|
|||||||
|
|
||||||
bool LongArrayChannelPut::init()
|
bool LongArrayChannelPut::init()
|
||||||
{
|
{
|
||||||
ChannelProvider::shared_pointer channelProvider = getChannelAccess()->getProvider(providerName);
|
ChannelProvider::shared_pointer channelProvider = getChannelProviderRegistry()->getProvider(providerName);
|
||||||
if(channelProvider==NULL) {
|
if(!channelProvider) {
|
||||||
cout << "provider " << providerName << " not found" << endl;
|
cout << "provider " << providerName << " not found" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -113,7 +119,7 @@ bool LongArrayChannelPut::init()
|
|||||||
if(!status.isOK()) return false;
|
if(!status.isOK()) return false;
|
||||||
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
||||||
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
||||||
if(pvRequest==NULL) {
|
if(!pvRequest) {
|
||||||
cout << "request logic error " << createRequest->getMessage() << endl;
|
cout << "request logic error " << createRequest->getMessage() << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -168,8 +174,7 @@ void LongArrayChannelPut::channelStateChange(
|
|||||||
void LongArrayChannelPut::channelPutConnect(
|
void LongArrayChannelPut::channelPutConnect(
|
||||||
Status const & status,
|
Status const & status,
|
||||||
ChannelPut::shared_pointer const & channelPut,
|
ChannelPut::shared_pointer const & channelPut,
|
||||||
PVStructurePtr const &pvStructure,
|
StructureConstPtr const &structure)
|
||||||
BitSetPtr const &bitSet)
|
|
||||||
{
|
{
|
||||||
this->status = status;
|
this->status = status;
|
||||||
if(!status.isOK()) {
|
if(!status.isOK()) {
|
||||||
@@ -178,11 +183,11 @@ void LongArrayChannelPut::channelPutConnect(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->channelPut = channelPut;
|
this->channelPut = channelPut;
|
||||||
this->pvStructure = pvStructure;
|
pvStructure = getPVDataCreate()->createPVStructure(structure);
|
||||||
this->bitSet = bitSet;
|
bitSet = BitSetPtr(new BitSet(pvStructure->getNumberFields()));
|
||||||
bool structureOK(true);
|
bool structureOK(true);
|
||||||
PVFieldPtr pvField = pvStructure->getSubField("value");
|
PVFieldPtr pvField = pvStructure->getSubField("value");
|
||||||
if(pvField==NULL) {
|
if(!pvField) {
|
||||||
structureOK = false;
|
structureOK = false;
|
||||||
} else {
|
} else {
|
||||||
FieldConstPtr field = pvField->getField();
|
FieldConstPtr field = pvField->getField();
|
||||||
@@ -194,7 +199,7 @@ void LongArrayChannelPut::channelPutConnect(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!structureOK) {
|
if(!structureOK) {
|
||||||
String mess("channelPutConnect: illegal structure");
|
string mess("channelPutConnect: illegal structure");
|
||||||
message(mess,errorMessage);
|
message(mess,errorMessage);
|
||||||
this->status = Status(Status::STATUSTYPE_ERROR,mess);
|
this->status = Status(Status::STATUSTYPE_ERROR,mess);
|
||||||
}
|
}
|
||||||
@@ -222,7 +227,7 @@ void LongArrayChannelPut::run()
|
|||||||
shared_vector<const int64> data(freeze(xxx));
|
shared_vector<const int64> data(freeze(xxx));
|
||||||
pvLongArray->replace(data);
|
pvLongArray->replace(data);
|
||||||
bitSet->set(pvLongArray->getFieldOffset());
|
bitSet->set(pvLongArray->getFieldOffset());
|
||||||
channelPut->put(false);
|
channelPut->put(pvStructure,bitSet);
|
||||||
event.wait();
|
event.wait();
|
||||||
if(isDestroyed) {
|
if(isDestroyed) {
|
||||||
runReturned = true;
|
runReturned = true;
|
||||||
@@ -262,9 +267,8 @@ void LongArrayChannelPut::run()
|
|||||||
if(iterBetweenCreateChannel!=0) {
|
if(iterBetweenCreateChannel!=0) {
|
||||||
if(numChannelCreate>=iterBetweenCreateChannel) {
|
if(numChannelCreate>=iterBetweenCreateChannel) {
|
||||||
channel->destroy();
|
channel->destroy();
|
||||||
epicsThreadSleep(1.0);
|
|
||||||
ChannelProvider::shared_pointer channelProvider =
|
ChannelProvider::shared_pointer channelProvider =
|
||||||
getChannelAccess()->getProvider(providerName);
|
getChannelProviderRegistry()->getProvider(providerName);
|
||||||
channel = channelProvider->createChannel(
|
channel = channelProvider->createChannel(
|
||||||
channelName,getPtrSelf(),0);
|
channelName,getPtrSelf(),0);
|
||||||
event.wait();
|
event.wait();
|
||||||
@@ -290,7 +294,7 @@ void LongArrayChannelPut::run()
|
|||||||
channelPut->destroy();
|
channelPut->destroy();
|
||||||
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
||||||
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
||||||
if(pvRequest==NULL) {
|
if(!pvRequest) {
|
||||||
cout << "request logic error " << createRequest->getMessage() << endl;
|
cout << "request logic error " << createRequest->getMessage() << endl;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
@@ -310,15 +314,17 @@ void LongArrayChannelPut::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LongArrayChannelPut::putDone(Status const & status)
|
void LongArrayChannelPut::putDone(
|
||||||
|
Status const & status,
|
||||||
|
ChannelPut::shared_pointer const & channelPut)
|
||||||
{
|
{
|
||||||
event.signal();
|
event.signal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LongArrayPutPtr LongArrayPut::create(
|
LongArrayPutPtr LongArrayPut::create(
|
||||||
String const &providerName,
|
string const &providerName,
|
||||||
String const & channelName,
|
string const & channelName,
|
||||||
size_t arraySize,
|
size_t arraySize,
|
||||||
int iterBetweenCreateChannel,
|
int iterBetweenCreateChannel,
|
||||||
int iterBetweenCreateChannelPut,
|
int iterBetweenCreateChannelPut,
|
||||||
@@ -337,8 +343,8 @@ LongArrayPutPtr LongArrayPut::create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
LongArrayPut::LongArrayPut(
|
LongArrayPut::LongArrayPut(
|
||||||
String const &providerName,
|
string const &providerName,
|
||||||
String const & channelName,
|
string const & channelName,
|
||||||
size_t arraySize,
|
size_t arraySize,
|
||||||
int iterBetweenCreateChannel,
|
int iterBetweenCreateChannel,
|
||||||
int iterBetweenCreateChannelPut,
|
int iterBetweenCreateChannelPut,
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
# undef epicsExportSharedSymbols
|
# undef epicsExportSharedSymbols
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <shareLib.h>
|
|
||||||
#include <pv/event.h>
|
#include <pv/event.h>
|
||||||
#include <pv/lock.h>
|
#include <pv/lock.h>
|
||||||
#include <pv/standardPVField.h>
|
#include <pv/standardPVField.h>
|
||||||
@@ -48,8 +47,8 @@ class epicsShareClass LongArrayPut :
|
|||||||
public:
|
public:
|
||||||
POINTER_DEFINITIONS(LongArrayPut);
|
POINTER_DEFINITIONS(LongArrayPut);
|
||||||
static LongArrayPutPtr create(
|
static LongArrayPutPtr create(
|
||||||
epics::pvData::String const & providerName,
|
std::string const & providerName,
|
||||||
epics::pvData::String const & channelName,
|
std::string const & channelName,
|
||||||
size_t arraySize = 100,
|
size_t arraySize = 100,
|
||||||
int iterBetweenCreateChannel = 0,
|
int iterBetweenCreateChannel = 0,
|
||||||
int iterBetweenCreateChannelPut = 0,
|
int iterBetweenCreateChannelPut = 0,
|
||||||
@@ -62,16 +61,16 @@ private:
|
|||||||
return shared_from_this();
|
return shared_from_this();
|
||||||
}
|
}
|
||||||
LongArrayPut(
|
LongArrayPut(
|
||||||
epics::pvData::String const & providerName,
|
std::string const & providerName,
|
||||||
epics::pvData::String const & channelName,
|
std::string const & channelName,
|
||||||
size_t arraySize,
|
size_t arraySize,
|
||||||
int iterBetweenCreateChannel,
|
int iterBetweenCreateChannel,
|
||||||
int iterBetweenCreateChannelPut,
|
int iterBetweenCreateChannelPut,
|
||||||
double delayTime);
|
double delayTime);
|
||||||
bool init();
|
bool init();
|
||||||
|
|
||||||
epics::pvData::String providerName;
|
std::string providerName;
|
||||||
epics::pvData::String channelName;
|
std::string channelName;
|
||||||
size_t arraySize;
|
size_t arraySize;
|
||||||
int iterBetweenCreateChannel;
|
int iterBetweenCreateChannel;
|
||||||
int iterBetweenCreateChannelPut;
|
int iterBetweenCreateChannelPut;
|
||||||
@@ -38,12 +38,12 @@ using namespace epics::pvDatabase;
|
|||||||
|
|
||||||
int main(int argc,char *argv[])
|
int main(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
String channelName("arrayPerformance");
|
string channelName("arrayPerformance");
|
||||||
size_t arraySize = 10;
|
size_t arraySize = 10;
|
||||||
int iterBetweenCreateChannel = 0;
|
int iterBetweenCreateChannel = 0;
|
||||||
int iterBetweenCreateChannelPut = 0;
|
int iterBetweenCreateChannelPut = 0;
|
||||||
double delayTime = 1.0;
|
double delayTime = 1.0;
|
||||||
if(argc==2 && String(argv[1])==String("-help")) {
|
if(argc==2 && string(argv[1])==string("-help")) {
|
||||||
cout << "longArrayPutMain channelName arraySize ";
|
cout << "longArrayPutMain channelName arraySize ";
|
||||||
cout << "iterBetweenCreateChannel iterBetweenCreateChannelPut delayTime" << endl;
|
cout << "iterBetweenCreateChannel iterBetweenCreateChannelPut delayTime" << endl;
|
||||||
cout << "default" << endl;
|
cout << "default" << endl;
|
||||||
@@ -140,7 +140,7 @@ int main(int argc,char *argv[])
|
|||||||
size_t size = 50000000;
|
size_t size = 50000000;
|
||||||
double delay = .01;
|
double delay = .01;
|
||||||
size_t nThread = 1;
|
size_t nThread = 1;
|
||||||
if(argc==2 && String(argv[1])==String("-help")) {
|
if(argc==2 && string(argv[1])==string("-help")) {
|
||||||
cout << "vectorPerformanceMain size delay nThread" << endl;
|
cout << "vectorPerformanceMain size delay nThread" << endl;
|
||||||
cout << "default" << endl;
|
cout << "default" << endl;
|
||||||
cout << "vectorPerformance ";
|
cout << "vectorPerformance ";
|
||||||
@@ -14,11 +14,14 @@
|
|||||||
# Set CHECK_RELEASE to NO to disable checking completely.
|
# Set CHECK_RELEASE to NO to disable checking completely.
|
||||||
# Set CHECK_RELEASE to WARN to perform consistency checking but
|
# Set CHECK_RELEASE to WARN to perform consistency checking but
|
||||||
# continue building anyway if conflicts are found.
|
# continue building anyway if conflicts are found.
|
||||||
CHECK_RELEASE = YES
|
#CHECK_RELEASE = YES
|
||||||
|
|
||||||
# To install files into a location other than $(TOP) define
|
# To install files into a location other than $(TOP) define
|
||||||
# INSTALL_LOCATION here.
|
# INSTALL_LOCATION here.
|
||||||
#INSTALL_LOCATION=</path/name/to/install/top>
|
#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)/configure/CONFIG_SITE.local
|
||||||
-include $(TOP)/../CONFIG.local
|
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
# Sample RELEASE.local file
|
|
||||||
|
|
||||||
V4 = /home/install/epics/v4
|
TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top
|
||||||
|
|
||||||
PVASRV = $(V4)/pvaSrv
|
|
||||||
PVACCESS = $(V4)/pvAccessCPP
|
|
||||||
PVDATA = $(V4)/pvDataCPP
|
|
||||||
PVCOMMON = $(V4)/pvCommonCPP
|
|
||||||
|
|
||||||
EPICS_BASE = /home/install/epics/base-3.14.12.3
|
|
||||||
|
|
||||||
|
EPICS_BASE=/home/install/epics/base
|
||||||
|
PVCOMMON=/home/hg/pvCommonCPP
|
||||||
|
PVDATA=/home/hg/pvDataCPP
|
||||||
|
PVACCESS=/home/hg/pvAccessCPP
|
||||||
|
PVASRV=/home/hg/pvaSrv
|
||||||
|
|||||||
@@ -24,5 +24,5 @@
|
|||||||
# PVCOMMON = /path/to/epics/pvCommonCPP
|
# PVCOMMON = /path/to/epics/pvCommonCPP
|
||||||
# EPICS_BASE = /path/to/epics/base
|
# EPICS_BASE = /path/to/epics/base
|
||||||
|
|
||||||
-include $(TOP)/configure/RELEASE.local
|
|
||||||
-include $(TOP)/../RELEASE.local
|
-include $(TOP)/../RELEASE.local
|
||||||
|
-include $(TOP)/configure/RELEASE.local
|
||||||
|
|||||||
25
documentation/RELEASE_NOTES.html
Normal file
25
documentation/RELEASE_NOTES.html
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<h1>Release 4.0 IN DEVELOPMENT</h1>
|
||||||
|
<p>The main changes since release 3.0.2 are:</p>
|
||||||
|
<ul>
|
||||||
|
<li>array semantics now enforce Copy On Write.</li>
|
||||||
|
<li>String no longer defined.</li>
|
||||||
|
<li>toString replaced by stream I/O </li>
|
||||||
|
<li>union is new type.</li>
|
||||||
|
<li>copy and monitor use new code in pvDataCPP</li>
|
||||||
|
</ul>
|
||||||
|
<h2>New Semantics for Arrays</h2>
|
||||||
|
<p>pvDatabaseCPP has been changed to use the new array implementation from pvDataCPP.</p>
|
||||||
|
<h2>String no longer defined</h2>
|
||||||
|
<p>String is replaced by std::string.</p>
|
||||||
|
<h2>toString replaced by stream I/O</h2>
|
||||||
|
<p>All uses of toString have been changed to use the steam I/O that pvDataCPP implements.</p>
|
||||||
|
<h2>union is a new basic type.</h2>
|
||||||
|
<p>exampleDatabase now has example records for union and union array.
|
||||||
|
There are records for regular union and for variant union.</p>
|
||||||
|
<h2>copy</h2>
|
||||||
|
<p>The implementation of copy and monitor for pvAccess has been changed
|
||||||
|
to use the new monitor and copy support from pvDataCPP.</p>
|
||||||
|
<h2>monitorPlugin</h2>
|
||||||
|
<p>exampleDatabase now has a example plugin that implements onChange.</p>
|
||||||
|
<h1>Release 0.9.2</h1>
|
||||||
|
<p>This was the starting point for RELEASE_NOTES</p>
|
||||||
50
documentation/RELEASE_NOTES.md
Normal file
50
documentation/RELEASE_NOTES.md
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
Release 4.0 IN DEVELOPMENT
|
||||||
|
===========
|
||||||
|
|
||||||
|
The main changes since release 3.0.2 are:
|
||||||
|
|
||||||
|
* array semantics now enforce Copy On Write.
|
||||||
|
* String no longer defined.
|
||||||
|
* toString replaced by stream I/O
|
||||||
|
* union is new type.
|
||||||
|
* copy and monitor use new code in pvDataCPP
|
||||||
|
|
||||||
|
New Semantics for Arrays
|
||||||
|
--------
|
||||||
|
|
||||||
|
pvDatabaseCPP has been changed to use the new array implementation from pvDataCPP.
|
||||||
|
|
||||||
|
String no longer defined
|
||||||
|
---------
|
||||||
|
|
||||||
|
String is replaced by std::string.
|
||||||
|
|
||||||
|
|
||||||
|
toString replaced by stream I/O
|
||||||
|
---------
|
||||||
|
|
||||||
|
All uses of toString have been changed to use the steam I/O that pvDataCPP implements.
|
||||||
|
|
||||||
|
|
||||||
|
union is a new basic type.
|
||||||
|
------------
|
||||||
|
|
||||||
|
exampleDatabase now has example records for union and union array.
|
||||||
|
There are records for regular union and for variant union.
|
||||||
|
|
||||||
|
|
||||||
|
copy
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
|
The implementation of copy and monitor for pvAccess has been changed
|
||||||
|
to use the new monitor and copy support from pvDataCPP.
|
||||||
|
|
||||||
|
monitorPlugin
|
||||||
|
-------------
|
||||||
|
|
||||||
|
exampleDatabase now has a example plugin that implements onChange.
|
||||||
|
|
||||||
|
Release 0.9.2
|
||||||
|
==========
|
||||||
|
This was the starting point for RELEASE_NOTES
|
||||||
13
documentation/TODO.html
Normal file
13
documentation/TODO.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<h1>TODO</h1>
|
||||||
|
<h2>recordList</h2>
|
||||||
|
<p>This is putGet support that provides a list of all the records in an IOC.
|
||||||
|
Since pvAccess implements pvlist this is no longer needed.
|
||||||
|
Remove it from pvDatabaseCPP and pvIOCCPP.
|
||||||
|
Also remove channelList from swtshell.</p>
|
||||||
|
<h2>monitorPlugin</h2>
|
||||||
|
<p>A debate is on-going about what semantics should be.</p>
|
||||||
|
<h2>Must test record delete.</h2>
|
||||||
|
<p>Must test removing a record from the PVDatabase while a pvAccess client
|
||||||
|
is attached. Also why do both unlisten and detach exists?</p>
|
||||||
|
<h2>create more regression tests</h2>
|
||||||
|
<p>Currently only some simple tests exist. Most of the testing has been via the examples</p>
|
||||||
28
documentation/TODO.md
Normal file
28
documentation/TODO.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
TODO
|
||||||
|
===========
|
||||||
|
|
||||||
|
|
||||||
|
recordList
|
||||||
|
----------
|
||||||
|
|
||||||
|
This is putGet support that provides a list of all the records in an IOC.
|
||||||
|
Since pvAccess implements pvlist this is no longer needed.
|
||||||
|
Remove it from pvDatabaseCPP and pvIOCCPP.
|
||||||
|
Also remove channelList from swtshell.
|
||||||
|
|
||||||
|
monitorPlugin
|
||||||
|
-------------
|
||||||
|
|
||||||
|
A debate is on-going about what semantics should be.
|
||||||
|
|
||||||
|
Must test record delete.
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Must test removing a record from the PVDatabase while a pvAccess client
|
||||||
|
is attached. Also why do both unlisten and detach exists?
|
||||||
|
|
||||||
|
|
||||||
|
create more regression tests
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Currently only some simple tests exist. Most of the testing has been via the examples
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -46,7 +46,7 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href="pvDatabaseCPP.html">pvDatabaseCPP.html</a>
|
href="pvDatabaseCPP_20121127.html">pvDatabaseCPP_20121127.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd>None</dd>
|
<dd>None</dd>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href="pvDatabaseCPP_20121211.html">pvDatabaseCPP20121211.html</a>
|
href="pvDatabaseCPP_20121211.html">pvDatabaseCPP_20121211.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href="pvDatabaseCPP_20130417.html">pvDatabaseCPP20130417.html</a>
|
href="pvDatabaseCPP_20130417.html">pvDatabaseCPP_20130417.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href="pvDatabaseCPP_20121211.html">pvDatabaseCPP20121211.html</a>
|
href="pvDatabaseCPP_20121211.html">pvDatabaseCPP_20121211.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href="pvDatabaseCPP_20130516.html">pvDatabaseCPP20130516.html</a>
|
href="pvDatabaseCPP_20130516.html">pvDatabaseCPP_20130516.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href="pvDatabaseCPP_20130417.html">pvDatabaseCPP20130417.html</a>
|
href="pvDatabaseCPP_20130417.html">pvDatabaseCPP_20130417.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href="pvDatabaseCPP_20130523.html">pvDatabaseCPP20130523.html</a>
|
href="pvDatabaseCPP_20130523.html">pvDatabaseCPP_20130523.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href="pvDatabaseCPP_20130516.html">pvDatabaseCPP20130516.html</a>
|
href="pvDatabaseCPP_20130516.html">pvDatabaseCPP_20130516.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href="pvDatabaseCPP_20130627.html">pvDatabaseCPP20130627.html</a>
|
href="pvDatabaseCPP_20130627.html">pvDatabaseCPP_20130627.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href="pvDatabaseCPP_20130523.html">pvDatabaseCPP20130523.html</a>
|
href="pvDatabaseCPP_20130523.html">pvDatabaseCPP_20130523.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20130725.html">pvDatabaseCPP20130725.html</a>
|
href= "pvDatabaseCPP_20130725.html">pvDatabase_CPP20130725.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href="pvDatabaseCPP_20130627.html">pvDatabaseCPP20130627.html</a>
|
href="pvDatabaseCPP_20130627.html">pvDatabase_CPP20130627.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
@@ -46,10 +46,10 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20130828.html">pvDatabaseCPP20130828.html</a>
|
href= "pvDatabaseCPP_20130828.html">pvDatabase_CPP20130828.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a href="pvDatabaseCPP_20130725.html">pvDatabaseCPP20130725.html</a>
|
<dd><a href="pvDatabaseCPP_20130725.html">pvDatabase_CPP20130725.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20130904.html">pvDatabaseCPP20130904.html</a>
|
href= "pvDatabaseCPP_20130904.html">pvDatabaseCPP_20130904.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20130828.html">pvDatabaseCPP20130828.html</a>
|
href= "pvDatabaseCPP_20130828.html">pvDatabaseCPP_20130828.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20131112.html">pvDatabaseCPP20131112.html</a>
|
href= "pvDatabaseCPP_20131112.html">pvDatabaseCPP_20131112.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20130904.html">pvDatabaseCPP20130904.html</a>
|
href= "pvDatabaseCPP_20130904.html">pvDatabaseCPP_20130904.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20131113.html">pvDatabaseCPP20131113.html</a>
|
href= "pvDatabaseCPP_20131113.html">pvDatabaseCPP_20131113.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20131112.html">pvDatabaseCPP20131112.html</a>
|
href= "pvDatabaseCPP_20131112.html">pvDatabaseCPP_20131112.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20131120.html">pvDatabaseCPP20131120.html</a>
|
href= "pvDatabaseCPP_20131120.html">pvDatabaseCPP_20131120.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20131112.html">pvDatabaseCPP20131112.html</a>
|
href= "pvDatabaseCPP_20131112.html">pvDatabaseCPP_20131112.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20131121.html">pvDatabaseCPP20131121.html</a>
|
href= "pvDatabaseCPP_20131121.html">pvDatabaseCPP_20131121.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20131120.html">pvDatabaseCPP20131120.html</a>
|
href= "pvDatabaseCPP_20131120.html">pvDatabaseCPP_20131120.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20140207.html">pvDatabaseCPP20140207.html</a>
|
href= "pvDatabaseCPP_20140207.html">pvDatabaseCPP_20140207.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20131121.html">pvDatabaseCPP20131121.html</a>
|
href= "pvDatabaseCPP_20131121.html">pvDatabaseCPP_20131121.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
@@ -46,11 +46,11 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>This version:</dt>
|
<dt>This version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20140219.html">pvDatabaseCPP20140219.html</a>
|
href= "pvDatabaseCPP_20140219.html">pvDatabaseCPP_20140219.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Previous version:</dt>
|
<dt>Previous version:</dt>
|
||||||
<dd><a
|
<dd><a
|
||||||
href= "pvDatabaseCPP_20140207.html">pvDatabaseCPP20140207.html</a>
|
href= "pvDatabaseCPP_20140207.html">pvDatabaseCPP_20140207.html</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
|
|||||||
1940
documentation/pvDatabaseCPP_20140710.html
Normal file
1940
documentation/pvDatabaseCPP_20140710.html
Normal file
File diff suppressed because it is too large
Load Diff
2111
documentation/pvDatabaseCPP_20140811.html
Normal file
2111
documentation/pvDatabaseCPP_20140811.html
Normal file
File diff suppressed because it is too large
Load Diff
2114
documentation/pvDatabaseCPP_20141009.html
Normal file
2114
documentation/pvDatabaseCPP_20141009.html
Normal file
File diff suppressed because it is too large
Load Diff
@@ -20,5 +20,8 @@ CHECK_RELEASE = WARN
|
|||||||
# INSTALL_LOCATION here.
|
# INSTALL_LOCATION here.
|
||||||
#INSTALL_LOCATION=</path/name/to/install/top>
|
#INSTALL_LOCATION=</path/name/to/install/top>
|
||||||
|
|
||||||
-include $(TOP)/../configure/CONFIG_SITE.local
|
INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv
|
||||||
|
USR_INCLUDES += -I $(INSTALL_LOCATION)/include
|
||||||
|
|
||||||
-include $(TOP)/../../CONFIG_SITE.local
|
-include $(TOP)/../../CONFIG_SITE.local
|
||||||
|
-include $(TOP)/../configure/CONFIG_SITE.local
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
# If this example is built in a directory under pvDatabaseCPP,
|
# If this example is built in a directory under pvDatabaseCPP,
|
||||||
# use the following definitions:
|
# use the following definitions:
|
||||||
|
|
||||||
PVDATABASETEST = $(TOP)/../testTop
|
PVDATABASETEST = $(TOP)/../test
|
||||||
PVDATABASE = $(TOP)/..
|
PVDATABASE = $(TOP)/..
|
||||||
|
|
||||||
-include $(TOP)/../configure/RELEASE.local
|
-include $(TOP)/../configure/RELEASE.local
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ DB += dbString.db
|
|||||||
DB += dbStringArray.db
|
DB += dbStringArray.db
|
||||||
DB += dbEnum.db
|
DB += dbEnum.db
|
||||||
DB += dbCounter.db
|
DB += dbCounter.db
|
||||||
|
DB += dbDouble.db
|
||||||
|
|
||||||
#----------------------------------------------------
|
#----------------------------------------------------
|
||||||
# If <anyname>.db template is not named <anyname>*.template add
|
# If <anyname>.db template is not named <anyname>*.template add
|
||||||
|
|||||||
3
exampleDatabase/ioc/Db/dbDouble.db
Normal file
3
exampleDatabase/ioc/Db/dbDouble.db
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
record(ao, "$(name)")
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -3,23 +3,26 @@ TOP=../..
|
|||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
#----------------------------------------
|
#----------------------------------------
|
||||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||||
|
#=============================
|
||||||
|
|
||||||
|
#==================================================
|
||||||
|
# Build an IOC support library
|
||||||
|
#
|
||||||
|
|
||||||
DBD += exampleDatabase.dbd
|
DBD += exampleDatabase.dbd
|
||||||
|
|
||||||
exampleDatabase_DBD += base.dbd
|
#=============================
|
||||||
exampleDatabase_DBD += PVAServerRegister.dbd
|
# build an ioc application
|
||||||
exampleDatabase_DBD += registerChannelProviderLocal.dbd
|
|
||||||
exampleDatabase_DBD += dbPv.dbd
|
|
||||||
exampleDatabase_DBD += powerSupplyRegister.dbd
|
|
||||||
exampleDatabase_DBD += exampleDatabaseRegister.dbd
|
|
||||||
|
|
||||||
PROD_IOC += exampleDatabase
|
PROD_IOC += exampleDatabase
|
||||||
|
|
||||||
|
|
||||||
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
|
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
|
||||||
exampleDatabase_SRCS += exampleDatabase_registerRecordDeviceDriver.cpp
|
exampleDatabase_SRCS += exampleDatabase_registerRecordDeviceDriver.cpp
|
||||||
exampleDatabase_SRCS_DEFAULT += exampleDatabaseMain.cpp
|
exampleDatabase_SRCS_DEFAULT += exampleDatabaseMain.cpp
|
||||||
exampleDatabase_SRCS_vxWorks += -nil-
|
exampleDatabase_SRCS_vxWorks += -nil-
|
||||||
|
|
||||||
|
|
||||||
# The following adds support from base/src/vxWorks
|
# The following adds support from base/src/vxWorks
|
||||||
exampleDatabase_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
|
exampleDatabase_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
|
||||||
|
|
||||||
|
|||||||
7
exampleDatabase/ioc/src/exampleDatabaseInclude.dbd
Normal file
7
exampleDatabase/ioc/src/exampleDatabaseInclude.dbd
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
include "base.dbd"
|
||||||
|
include "PVAServerRegister.dbd"
|
||||||
|
include "registerChannelProviderLocal.dbd"
|
||||||
|
include "dbPv.dbd"
|
||||||
|
include "powerSupplyRegister.dbd"
|
||||||
|
registrar("exampleDatabaseRegister")
|
||||||
|
registrar("exampleMonitorPluginRegister")
|
||||||
@@ -7,15 +7,23 @@ dbLoadDatabase("dbd/exampleDatabase.dbd")
|
|||||||
exampleDatabase_registerRecordDeviceDriver(pdbbase)
|
exampleDatabase_registerRecordDeviceDriver(pdbbase)
|
||||||
|
|
||||||
## Load record instances
|
## Load record instances
|
||||||
dbLoadRecords("db/dbScalar.db","name=double01,type=ao")
|
dbLoadRecords("db/dbDouble.db","name=double00")
|
||||||
|
dbLoadRecords("db/dbDouble.db","name=double01")
|
||||||
|
dbLoadRecords("db/dbDouble.db","name=double02")
|
||||||
|
dbLoadRecords("db/dbDouble.db","name=double03")
|
||||||
|
dbLoadRecords("db/dbDouble.db","name=double04")
|
||||||
|
dbLoadRecords("db/dbDouble.db","name=double05")
|
||||||
dbLoadRecords("db/dbStringArray.db","name=stringArray01")
|
dbLoadRecords("db/dbStringArray.db","name=stringArray01")
|
||||||
dbLoadRecords("db/dbEnum.db","name=enum01")
|
dbLoadRecords("db/dbEnum.db","name=enum01")
|
||||||
dbLoadRecords("db/dbCounter.db","name=counter01");
|
dbLoadRecords("db/dbCounter.db","name=counter01");
|
||||||
|
dbLoadRecords("db/dbArray.db","name=doubleArray,type=DOUBLE");
|
||||||
|
|
||||||
|
|
||||||
cd ${TOP}/iocBoot/${IOC}
|
cd ${TOP}/iocBoot/${IOC}
|
||||||
iocInit()
|
iocInit()
|
||||||
dbl
|
dbl
|
||||||
epicsThreadSleep(2.0)
|
epicsThreadSleep(2.0)
|
||||||
exampleDatabase
|
exampleDatabase
|
||||||
|
exampleMonitorPlugin
|
||||||
startPVAServer
|
startPVAServer
|
||||||
pvdbl
|
pvdbl
|
||||||
|
|||||||
@@ -4,17 +4,21 @@ include $(TOP)/configure/CONFIG
|
|||||||
#----------------------------------------
|
#----------------------------------------
|
||||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||||
|
|
||||||
DBD += exampleDatabaseRegister.dbd
|
DBD += exampleDatabase.dbd
|
||||||
|
|
||||||
INC += exampleDatabase.h
|
INC += exampleDatabase.h
|
||||||
|
INC += exampleMonitorPlugin.h
|
||||||
|
|
||||||
LIBRARY += exampleDatabase
|
LIBRARY += exampleDatabase
|
||||||
exampleDatabase_SRCS += exampleDatabase.cpp
|
exampleDatabase_SRCS += exampleDatabase.cpp
|
||||||
|
exampleDatabase_SRCS += exampleMonitorPlugin.cpp
|
||||||
exampleDatabase_SRCS += exampleDatabaseRegister.cpp
|
exampleDatabase_SRCS += exampleDatabaseRegister.cpp
|
||||||
|
exampleDatabase_SRCS += exampleMonitorPluginRegister.cpp
|
||||||
exampleDatabase_LIBS += powerSupply
|
exampleDatabase_LIBS += powerSupply
|
||||||
exampleDatabase_LIBS += pvDatabase
|
exampleDatabase_LIBS += pvDatabase
|
||||||
exampleDatabase_LIBS += pvAccess
|
exampleDatabase_LIBS += pvAccess
|
||||||
exampleDatabase_LIBS += pvData
|
exampleDatabase_LIBS += pvData
|
||||||
|
exampleDatabase_LIBS += Com
|
||||||
exampleDatabase_LIBS += $(EPICS_BASE_IOC_LIBS)
|
exampleDatabase_LIBS += $(EPICS_BASE_IOC_LIBS)
|
||||||
|
|
||||||
PROD_HOST += exampleDatabaseMain
|
PROD_HOST += exampleDatabaseMain
|
||||||
|
|||||||
@@ -26,8 +26,10 @@
|
|||||||
#include <pv/recordList.h>
|
#include <pv/recordList.h>
|
||||||
#include <pv/traceRecord.h>
|
#include <pv/traceRecord.h>
|
||||||
|
|
||||||
#include <powerSupply.h>
|
#include <pv/powerSupply.h>
|
||||||
#include <exampleDatabase.h>
|
|
||||||
|
#define epicsExportSharedSymbols
|
||||||
|
#include <pv/exampleDatabase.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using std::tr1::static_pointer_cast;
|
using std::tr1::static_pointer_cast;
|
||||||
@@ -42,18 +44,57 @@ static StandardPVFieldPtr standardPVField = getStandardPVField();
|
|||||||
|
|
||||||
static void createStructureArrayRecord(
|
static void createStructureArrayRecord(
|
||||||
PVDatabasePtr const &master,
|
PVDatabasePtr const &master,
|
||||||
ScalarType scalarType,
|
string const &recordName)
|
||||||
String const &recordName)
|
|
||||||
{
|
{
|
||||||
StructureConstPtr structure = standardField->scalar(
|
|
||||||
pvDouble,
|
|
||||||
String("value,alarm,timeStamp"));
|
|
||||||
StringArray names(2);
|
StringArray names(2);
|
||||||
FieldConstPtrArray fields(2);
|
FieldConstPtrArray fields(2);
|
||||||
names[0] = "timeStamp";
|
names[0] = "name";
|
||||||
names[1] = "value";
|
names[1] = "value";
|
||||||
fields[0] = standardField->timeStamp();
|
fields[0] = fieldCreate->createScalar(pvString);
|
||||||
fields[1] = fieldCreate->createStructureArray(structure);
|
fields[1] = fieldCreate->createScalar(pvString);
|
||||||
|
|
||||||
|
StringArray topNames(1);
|
||||||
|
FieldConstPtrArray topFields(1);
|
||||||
|
topNames[0] = "value";
|
||||||
|
topFields[0] = fieldCreate->createStructureArray(
|
||||||
|
fieldCreate->createStructure(names, fields));
|
||||||
|
StructureConstPtr top = fieldCreate->createStructure(topNames,topFields);
|
||||||
|
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 createRegularUnionArrayRecord(
|
||||||
|
PVDatabasePtr const &master,
|
||||||
|
string const &recordName)
|
||||||
|
{
|
||||||
|
StringArray unionNames(2);
|
||||||
|
FieldConstPtrArray unionFields(2);
|
||||||
|
unionNames[0] = "string";
|
||||||
|
unionNames[1] = "stringArray";
|
||||||
|
unionFields[0] = fieldCreate->createScalar(pvString);
|
||||||
|
unionFields[1] = fieldCreate->createScalarArray(pvString);
|
||||||
|
|
||||||
|
StringArray names(1);
|
||||||
|
FieldConstPtrArray fields(1);
|
||||||
|
fields[0] = fieldCreate->createUnionArray(fieldCreate->createUnion(unionNames,unionFields));
|
||||||
|
names[0] = "value";
|
||||||
|
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 createVariantUnionArrayRecord(
|
||||||
|
PVDatabasePtr const &master,
|
||||||
|
string const &recordName)
|
||||||
|
{
|
||||||
|
StringArray names(1);
|
||||||
|
FieldConstPtrArray fields(1);
|
||||||
|
fields[0] = fieldCreate->createVariantUnionArray();
|
||||||
|
names[0] = "value";
|
||||||
StructureConstPtr top = fieldCreate->createStructure(names,fields);
|
StructureConstPtr top = fieldCreate->createStructure(names,fields);
|
||||||
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(top);
|
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(top);
|
||||||
PVRecordPtr pvRecord = PVRecord::create(recordName,pvStructure);
|
PVRecordPtr pvRecord = PVRecord::create(recordName,pvStructure);
|
||||||
@@ -64,10 +105,10 @@ static void createStructureArrayRecord(
|
|||||||
static void createRecords(
|
static void createRecords(
|
||||||
PVDatabasePtr const &master,
|
PVDatabasePtr const &master,
|
||||||
ScalarType scalarType,
|
ScalarType scalarType,
|
||||||
String const &recordNamePrefix,
|
string const &recordNamePrefix,
|
||||||
String const &properties)
|
string const &properties)
|
||||||
{
|
{
|
||||||
String recordName = recordNamePrefix;
|
string recordName = recordNamePrefix;
|
||||||
PVStructurePtr pvStructure = standardPVField->scalar(scalarType,properties);
|
PVStructurePtr pvStructure = standardPVField->scalar(scalarType,properties);
|
||||||
PVRecordPtr pvRecord = PVRecord::create(recordName,pvStructure);
|
PVRecordPtr pvRecord = PVRecord::create(recordName,pvStructure);
|
||||||
bool result = master->addRecord(pvRecord);
|
bool result = master->addRecord(pvRecord);
|
||||||
@@ -82,13 +123,13 @@ void ExampleDatabase::create()
|
|||||||
{
|
{
|
||||||
PVDatabasePtr master = PVDatabase::getMaster();
|
PVDatabasePtr master = PVDatabase::getMaster();
|
||||||
PVRecordPtr pvRecord;
|
PVRecordPtr pvRecord;
|
||||||
String recordName;
|
string recordName;
|
||||||
bool result(false);
|
bool result(false);
|
||||||
recordName = "traceRecordPGRPC";
|
recordName = "traceRecordPGRPC";
|
||||||
pvRecord = TraceRecord::create(recordName);
|
pvRecord = TraceRecord::create(recordName);
|
||||||
result = master->addRecord(pvRecord);
|
result = master->addRecord(pvRecord);
|
||||||
if(!result) cout<< "record " << recordName << " not added" << endl;
|
if(!result) cout<< "record " << recordName << " not added" << endl;
|
||||||
String properties;
|
string properties;
|
||||||
properties = "alarm,timeStamp";
|
properties = "alarm,timeStamp";
|
||||||
createRecords(master,pvBoolean,"exampleBoolean",properties);
|
createRecords(master,pvBoolean,"exampleBoolean",properties);
|
||||||
createRecords(master,pvByte,"exampleByte",properties);
|
createRecords(master,pvByte,"exampleByte",properties);
|
||||||
@@ -97,21 +138,31 @@ void ExampleDatabase::create()
|
|||||||
createRecords(master,pvLong,"exampleLong",properties);
|
createRecords(master,pvLong,"exampleLong",properties);
|
||||||
createRecords(master,pvFloat,"exampleFloat",properties);
|
createRecords(master,pvFloat,"exampleFloat",properties);
|
||||||
createRecords(master,pvDouble,"exampleDouble",properties);
|
createRecords(master,pvDouble,"exampleDouble",properties);
|
||||||
|
createRecords(master,pvDouble,"exampleDouble01",properties);
|
||||||
|
createRecords(master,pvDouble,"exampleDouble02",properties);
|
||||||
|
createRecords(master,pvDouble,"exampleDouble03",properties);
|
||||||
|
createRecords(master,pvDouble,"exampleDouble04",properties);
|
||||||
|
createRecords(master,pvDouble,"exampleDouble05",properties);
|
||||||
createRecords(master,pvString,"exampleString",properties);
|
createRecords(master,pvString,"exampleString",properties);
|
||||||
createStructureArrayRecord(master,pvDouble,"exampleStructureArray");
|
createStructureArrayRecord(master,"exampleStructureArray");
|
||||||
|
createRegularUnionArrayRecord(master,"exampleRegularUnionArray");
|
||||||
|
createVariantUnionArrayRecord(master,"exampleVariantUnionArray");
|
||||||
recordName = "examplePowerSupply";
|
recordName = "examplePowerSupply";
|
||||||
PVStructurePtr pvStructure = createPowerSupply();
|
PVStructurePtr pvStructure = createPowerSupply();
|
||||||
PowerSupplyPtr psr =
|
PowerSupplyPtr psr = PowerSupply::create(recordName,pvStructure);
|
||||||
PowerSupply::create(recordName,pvStructure);
|
if(!psr) {
|
||||||
if(psr.get()==NULL) {
|
cout << "PowerSupply::create failed" << endl;
|
||||||
cout << "PowerSupply::create failed" << endl;
|
} else {
|
||||||
return;
|
result = master->addRecord(psr);
|
||||||
|
if(!result) cout<< "record " << recordName << " not added" << endl;
|
||||||
}
|
}
|
||||||
result = master->addRecord(psr);
|
|
||||||
if(!result) cout<< "record " << recordName << " not added" << endl;
|
|
||||||
recordName = "laptoprecordListPGRPC";
|
recordName = "laptoprecordListPGRPC";
|
||||||
pvRecord = RecordListRecord::create(recordName);
|
pvRecord = RecordListRecord::create(recordName);
|
||||||
result = master->addRecord(pvRecord);
|
if(!pvRecord) {
|
||||||
if(!result) cout<< "record " << recordName << " not added" << endl;
|
cout << "RecordListRecord::create failed" << endl;
|
||||||
|
} else {
|
||||||
|
result = master->addRecord(pvRecord);
|
||||||
|
if(!result) cout<< "record " << recordName << " not added" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,15 +16,15 @@
|
|||||||
# undef epicsExportSharedSymbols
|
# undef epicsExportSharedSymbols
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <shareLib.h>
|
|
||||||
#include <pv/pvDatabase.h>
|
#include <pv/pvDatabase.h>
|
||||||
|
|
||||||
#ifdef exampledatabaseEpicsExportSharedSymbols
|
#ifdef exampledatabaseEpicsExportSharedSymbols
|
||||||
# define epicsExportSharedSymbols
|
# define epicsExportSharedSymbols
|
||||||
# undef exampledatabaseEpicsExportSharedSymbols
|
# undef exampledatabaseEpicsExportSharedSymbols
|
||||||
# include <shareLib.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <shareLib.h>
|
||||||
|
|
||||||
namespace epics { namespace pvDatabase {
|
namespace epics { namespace pvDatabase {
|
||||||
|
|
||||||
class epicsShareClass ExampleDatabase{
|
class epicsShareClass ExampleDatabase{
|
||||||
|
|||||||
2
exampleDatabase/src/exampleDatabaseInclude.dbd
Normal file
2
exampleDatabase/src/exampleDatabaseInclude.dbd
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
registrar("exampleDatabaseRegister")
|
||||||
|
registrar("exampleMonitorPluginRegister")
|
||||||
@@ -22,7 +22,8 @@
|
|||||||
#include <pv/channelProviderLocal.h>
|
#include <pv/channelProviderLocal.h>
|
||||||
#include <pv/serverContext.h>
|
#include <pv/serverContext.h>
|
||||||
|
|
||||||
#include <exampleDatabase.h>
|
#include <pv/exampleDatabase.h>
|
||||||
|
#include <pv/exampleMonitorPlugin.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using std::tr1::static_pointer_cast;
|
using std::tr1::static_pointer_cast;
|
||||||
@@ -36,13 +37,12 @@ int main(int argc,char *argv[])
|
|||||||
PVDatabasePtr master = PVDatabase::getMaster();
|
PVDatabasePtr master = PVDatabase::getMaster();
|
||||||
ChannelProviderLocalPtr channelProvider = getChannelProviderLocal();
|
ChannelProviderLocalPtr channelProvider = getChannelProviderLocal();
|
||||||
ExampleDatabase::create();
|
ExampleDatabase::create();
|
||||||
|
ExampleMonitorPlugin::create();
|
||||||
ServerContext::shared_pointer ctx =
|
ServerContext::shared_pointer ctx =
|
||||||
startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true);
|
startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true);
|
||||||
cout << "exampleDatabase\n";
|
cout << "exampleDatabase\n";
|
||||||
PVStringArrayPtr pvNames = master->getRecordNames();
|
PVStringArrayPtr pvNames = master->getRecordNames();
|
||||||
String buffer;
|
cout << "recordNames" << endl << *pvNames << endl;
|
||||||
pvNames->toString(&buffer);
|
|
||||||
cout << "recordNames" << endl << buffer << endl;
|
|
||||||
string str;
|
string str;
|
||||||
while(true) {
|
while(true) {
|
||||||
cout << "Type exit to stop: \n";
|
cout << "Type exit to stop: \n";
|
||||||
@@ -55,4 +55,3 @@ int main(int argc,char *argv[])
|
|||||||
channelProvider->destroy();
|
channelProvider->destroy();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,8 +32,7 @@
|
|||||||
#include <pv/pvDatabase.h>
|
#include <pv/pvDatabase.h>
|
||||||
|
|
||||||
#include <epicsExport.h>
|
#include <epicsExport.h>
|
||||||
|
#include <pv/exampleDatabase.h>
|
||||||
#include <exampleDatabase.h>
|
|
||||||
|
|
||||||
using namespace epics::pvData;
|
using namespace epics::pvData;
|
||||||
using namespace epics::pvAccess;
|
using namespace epics::pvAccess;
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
registrar("exampleDatabaseRegister")
|
|
||||||
101
exampleDatabase/src/exampleMonitorPlugin.cpp
Normal file
101
exampleDatabase/src/exampleMonitorPlugin.cpp
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
/* exampleMonitorPlugin.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 2014.04.16
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <pv/convert.h>
|
||||||
|
#include <pv/monitorPlugin.h>
|
||||||
|
|
||||||
|
#define epicsExportSharedSymbols
|
||||||
|
#include <pv/exampleMonitorPlugin.h>
|
||||||
|
|
||||||
|
using namespace epics::pvData;
|
||||||
|
using std::cout;
|
||||||
|
using std::endl;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
|
namespace epics { namespace pvDatabase {
|
||||||
|
|
||||||
|
static string pluginName("onChange");
|
||||||
|
static ConvertPtr convert(getConvert());
|
||||||
|
|
||||||
|
class OnChangePlugin;
|
||||||
|
typedef std::tr1::shared_ptr<OnChangePlugin> OnChangePluginPtr;
|
||||||
|
class OnChangePluginCreator;
|
||||||
|
typedef std::tr1::shared_ptr<OnChangePluginCreator> OnChangePluginCreatorPtr;
|
||||||
|
|
||||||
|
class OnChangePlugin : public MonitorPlugin
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~OnChangePlugin(){}
|
||||||
|
OnChangePlugin() {}
|
||||||
|
bool init(
|
||||||
|
FieldConstPtr const &field,
|
||||||
|
StructureConstPtr const &top,
|
||||||
|
PVStructurePtr const &pvFieldOptions)
|
||||||
|
{
|
||||||
|
pvField = getPVDataCreate()->createPVField(field);
|
||||||
|
raiseMonitor = true;
|
||||||
|
if(pvFieldOptions) {
|
||||||
|
PVStringPtr pvString =
|
||||||
|
pvFieldOptions->getSubField<PVString>("raiseMonitor");
|
||||||
|
if(pvString) {
|
||||||
|
string value = pvString->get();
|
||||||
|
if(value.compare("false")==0) raiseMonitor = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
virtual string &getName(){return pluginName;}
|
||||||
|
virtual bool causeMonitor(
|
||||||
|
PVFieldPtr const &pvNew,
|
||||||
|
PVStructurePtr const &pvTop,
|
||||||
|
MonitorElementPtr const &monitorElement)
|
||||||
|
{
|
||||||
|
bool isSame = convert->equals(pvNew,pvField);
|
||||||
|
if(isSame) return false;
|
||||||
|
convert->copy(pvNew,pvField);
|
||||||
|
return raiseMonitor;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
PVFieldPtr pvField;
|
||||||
|
bool raiseMonitor;
|
||||||
|
};
|
||||||
|
|
||||||
|
class OnChangePluginCreator : public MonitorPluginCreator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual string &getName(){return pluginName;}
|
||||||
|
virtual MonitorPluginPtr create(
|
||||||
|
FieldConstPtr const &field,
|
||||||
|
StructureConstPtr const &top,
|
||||||
|
PVStructurePtr const &pvFieldOptions)
|
||||||
|
{
|
||||||
|
OnChangePluginPtr plugin(new OnChangePlugin());
|
||||||
|
bool result = plugin->init(field,top,pvFieldOptions);
|
||||||
|
if(!result) return MonitorPluginPtr();
|
||||||
|
return plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void ExampleMonitorPlugin::create()
|
||||||
|
{
|
||||||
|
static OnChangePluginCreatorPtr plugin;
|
||||||
|
static Mutex mutex;
|
||||||
|
Lock xx(mutex);
|
||||||
|
if(!plugin) {
|
||||||
|
plugin = OnChangePluginCreatorPtr(new OnChangePluginCreator());
|
||||||
|
MonitorPluginManager::get()->addPlugin(pluginName,plugin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}}
|
||||||
|
|
||||||
40
exampleDatabase/src/exampleMonitorPlugin.h
Normal file
40
exampleDatabase/src/exampleMonitorPlugin.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/* exampleMonitorPlugin.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 2014.04.16
|
||||||
|
*/
|
||||||
|
#ifndef EXAMPLEMONITORPLUGIN_H
|
||||||
|
#define EXAMPLEMONITORPLUGIN_H
|
||||||
|
|
||||||
|
#ifdef epicsExportSharedSymbols
|
||||||
|
# define examplemonitorPluginEpicsExportSharedSymbols
|
||||||
|
# undef epicsExportSharedSymbols
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <pv/pvDatabase.h>
|
||||||
|
#include <pv/monitorPlugin.h>
|
||||||
|
|
||||||
|
#ifdef examplemonitorPluginEpicsExportSharedSymbols
|
||||||
|
# define epicsExportSharedSymbols
|
||||||
|
# undef examplemonitorPluginEpicsExportSharedSymbols
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <shareLib.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace epics { namespace pvDatabase {
|
||||||
|
|
||||||
|
class epicsShareClass ExampleMonitorPlugin{
|
||||||
|
public:
|
||||||
|
static void create();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}}
|
||||||
|
|
||||||
|
#endif /* EXAMPLEMONITORPLUGIN_H */
|
||||||
65
exampleDatabase/src/exampleMonitorPluginRegister.cpp
Normal file
65
exampleDatabase/src/exampleMonitorPluginRegister.cpp
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/*exampleMonitorPlugin.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 <cstddef>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cstddef>
|
||||||
|
#include <string>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <cantProceed.h>
|
||||||
|
#include <epicsStdio.h>
|
||||||
|
#include <epicsMutex.h>
|
||||||
|
#include <epicsEvent.h>
|
||||||
|
#include <epicsThread.h>
|
||||||
|
#include <iocsh.h>
|
||||||
|
|
||||||
|
#include <pv/pvIntrospect.h>
|
||||||
|
#include <pv/pvData.h>
|
||||||
|
#include <pv/pvAccess.h>
|
||||||
|
#include <pv/pvDatabase.h>
|
||||||
|
|
||||||
|
#include <epicsExport.h>
|
||||||
|
#include <pv/exampleMonitorPlugin.h>
|
||||||
|
|
||||||
|
|
||||||
|
using namespace epics::pvData;
|
||||||
|
using namespace epics::pvAccess;
|
||||||
|
using namespace epics::pvDatabase;
|
||||||
|
|
||||||
|
|
||||||
|
static const iocshFuncDef exampleMonitorPluginFuncDef = {
|
||||||
|
"exampleMonitorPlugin", 0,0 };
|
||||||
|
|
||||||
|
|
||||||
|
static void exampleMonitorPluginCallFunc(const iocshArgBuf *args)
|
||||||
|
{
|
||||||
|
ExampleMonitorPlugin::create();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void exampleMonitorPluginRegister(void)
|
||||||
|
{
|
||||||
|
std::cout << "exampleMonitorPluginRegister\n";
|
||||||
|
static int firstTime = 1;
|
||||||
|
if (firstTime) {
|
||||||
|
firstTime = 0;
|
||||||
|
iocshRegister(&exampleMonitorPluginFuncDef, exampleMonitorPluginCallFunc);
|
||||||
|
}
|
||||||
|
std::cout << "exampleMonitorPluginRegister returning\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
epicsExportRegistrar(exampleMonitorPluginRegister);
|
||||||
|
}
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
# Makefile at top of application tree
|
#Makefile at top of application tree
|
||||||
|
|
||||||
TOP = .
|
TOP = .
|
||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
|
|
||||||
DIRS += configure
|
DIRS += configure
|
||||||
|
|
||||||
DIRS += src
|
DIRS += src
|
||||||
@@ -12,7 +10,6 @@ DIRS += ioc
|
|||||||
ioc_DEPEND_DIRS = src
|
ioc_DEPEND_DIRS = src
|
||||||
|
|
||||||
DIRS += iocBoot
|
DIRS += iocBoot
|
||||||
iocBoot_DEPEND_DIRS = src
|
|
||||||
|
|
||||||
include $(TOP)/configure/RULES_TOP
|
include $(TOP)/configure/RULES_TOP
|
||||||
|
|
||||||
|
|||||||
@@ -14,11 +14,26 @@
|
|||||||
# Set CHECK_RELEASE to NO to disable checking completely.
|
# Set CHECK_RELEASE to NO to disable checking completely.
|
||||||
# Set CHECK_RELEASE to WARN to perform consistency checking but
|
# Set CHECK_RELEASE to WARN to perform consistency checking but
|
||||||
# continue building anyway if conflicts are found.
|
# 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
|
# To install files into a location other than $(TOP) define
|
||||||
# INSTALL_LOCATION here.
|
# INSTALL_LOCATION here.
|
||||||
#INSTALL_LOCATION=</path/name/to/install/top>
|
#INSTALL_LOCATION=</path/name/to/install/top>
|
||||||
|
|
||||||
-include $(TOP)/../configure/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)/../../CONFIG_SITE.local
|
-include $(TOP)/../../CONFIG_SITE.local
|
||||||
|
-include $(TOP)/../configure/CONFIG_SITE.local
|
||||||
|
|||||||
@@ -16,9 +16,8 @@
|
|||||||
|
|
||||||
# EPICS V4 Developers: Do not edit the locations in this file!
|
# EPICS V4 Developers: Do not edit the locations in this file!
|
||||||
#
|
#
|
||||||
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
|
# Create a file RELEASE.local pointing to your places
|
||||||
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
|
# for the dependencies, e.g.
|
||||||
# PVASRV = /path/to/epics/pvaSrvCPP
|
|
||||||
# PVACCESS = /path/to/epics/pvAccessCPP
|
# PVACCESS = /path/to/epics/pvAccessCPP
|
||||||
# PVDATA = /path/to/epics/pvDataCPP
|
# PVDATA = /path/to/epics/pvDataCPP
|
||||||
# PVCOMMON = /path/to/epics/pvCommonCPP
|
# PVCOMMON = /path/to/epics/pvCommonCPP
|
||||||
@@ -28,14 +27,14 @@
|
|||||||
# use the following definitions:
|
# use the following definitions:
|
||||||
|
|
||||||
PVDATABASE = $(TOP)/..
|
PVDATABASE = $(TOP)/..
|
||||||
|
|
||||||
-include $(TOP)/../configure/RELEASE.local
|
|
||||||
-include $(TOP)/../../RELEASE.local
|
-include $(TOP)/../../RELEASE.local
|
||||||
|
-include $(TOP)/../configure/RELEASE.local
|
||||||
|
|
||||||
# If you copied this example from pvDatabaseCPP to be built as a
|
# 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)/../RELEASE.local
|
||||||
|
#-include $(TOP)/configure/RELEASE.local
|
||||||
|
|||||||
@@ -3,22 +3,27 @@ TOP=../..
|
|||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
#----------------------------------------
|
#----------------------------------------
|
||||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||||
|
#=============================
|
||||||
|
|
||||||
|
#==================================================
|
||||||
|
# Build an IOC support library
|
||||||
|
#
|
||||||
|
|
||||||
|
#=============================
|
||||||
|
# build an ioc application
|
||||||
|
|
||||||
|
|
||||||
DBD += exampleLink.dbd
|
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
|
PROD_IOC += exampleLink
|
||||||
|
|
||||||
|
|
||||||
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
|
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
|
||||||
exampleLink_SRCS += exampleLink_registerRecordDeviceDriver.cpp
|
exampleLink_SRCS += exampleLink_registerRecordDeviceDriver.cpp
|
||||||
exampleLink_SRCS_DEFAULT += exampleLinkMain.cpp
|
exampleLink_SRCS_DEFAULT += exampleLinkMain.cpp
|
||||||
exampleLink_SRCS_vxWorks += -nil-
|
exampleLink_SRCS_vxWorks += -nil-
|
||||||
|
|
||||||
|
|
||||||
# The following adds support from base/src/vxWorks
|
# The following adds support from base/src/vxWorks
|
||||||
exampleLink_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
|
exampleLink_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
|
||||||
|
|
||||||
@@ -27,6 +32,7 @@ exampleLink_LIBS += pvDatabase
|
|||||||
exampleLink_LIBS += pvaSrv
|
exampleLink_LIBS += pvaSrv
|
||||||
exampleLink_LIBS += pvAccess
|
exampleLink_LIBS += pvAccess
|
||||||
exampleLink_LIBS += pvData
|
exampleLink_LIBS += pvData
|
||||||
|
exampleLink_LIBS += Com
|
||||||
exampleLink_LIBS += $(EPICS_BASE_IOC_LIBS)
|
exampleLink_LIBS += $(EPICS_BASE_IOC_LIBS)
|
||||||
|
|
||||||
#===========================
|
#===========================
|
||||||
|
|||||||
5
exampleLink/ioc/src/exampleLinkInclude.dbd
Normal file
5
exampleLink/ioc/src/exampleLinkInclude.dbd
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
include "base.dbd"
|
||||||
|
include "PVAServerRegister.dbd"
|
||||||
|
include "PVAClientRegister.dbd"
|
||||||
|
include "registerChannelProviderLocal.dbd"
|
||||||
|
registrar("exampleLinkRegister")
|
||||||
@@ -13,4 +13,4 @@ cd ${TOP}/iocBoot/${IOC}
|
|||||||
iocInit()
|
iocInit()
|
||||||
startPVAClient
|
startPVAClient
|
||||||
startPVAServer
|
startPVAServer
|
||||||
exampleLinkCreateRecord exampleLinkRemote pvAccess doubleArray
|
exampleLinkCreateRecord exampleLink pvAccess doubleArray
|
||||||
|
|||||||
@@ -3,8 +3,13 @@ TOP=..
|
|||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
#----------------------------------------
|
#----------------------------------------
|
||||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||||
|
#=============================
|
||||||
|
|
||||||
DBD += exampleLinkRegister.dbd
|
#==================================================
|
||||||
|
# Build an IOC support library
|
||||||
|
#
|
||||||
|
|
||||||
|
DBD += exampleLink.dbd
|
||||||
|
|
||||||
INC += exampleLink.h
|
INC += exampleLink.h
|
||||||
|
|
||||||
|
|||||||
@@ -13,21 +13,22 @@
|
|||||||
#include <pv/convert.h>
|
#include <pv/convert.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <exampleLink.h>
|
#include <pv/exampleLink.h>
|
||||||
|
|
||||||
|
|
||||||
namespace epics { namespace pvDatabase {
|
|
||||||
using namespace epics::pvData;
|
using namespace epics::pvData;
|
||||||
using namespace epics::pvAccess;
|
using namespace epics::pvAccess;
|
||||||
using std::tr1::static_pointer_cast;
|
using std::tr1::static_pointer_cast;
|
||||||
using std::tr1::dynamic_pointer_cast;
|
using std::tr1::dynamic_pointer_cast;
|
||||||
using std::cout;
|
using std::cout;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
|
namespace epics { namespace pvDatabase {
|
||||||
|
|
||||||
ExampleLinkPtr ExampleLink::create(
|
ExampleLinkPtr ExampleLink::create(
|
||||||
String const & recordName,
|
string const & recordName,
|
||||||
String const & providerName,
|
string const & providerName,
|
||||||
String const & channelName)
|
string const & channelName)
|
||||||
{
|
{
|
||||||
PVStructurePtr pvStructure = getStandardPVField()->scalarArray(
|
PVStructurePtr pvStructure = getStandardPVField()->scalarArray(
|
||||||
pvDouble,"alarm.timeStamp");
|
pvDouble,"alarm.timeStamp");
|
||||||
@@ -39,9 +40,9 @@ ExampleLinkPtr ExampleLink::create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ExampleLink::ExampleLink(
|
ExampleLink::ExampleLink(
|
||||||
String const & recordName,
|
string const & recordName,
|
||||||
String providerName,
|
string providerName,
|
||||||
String channelName,
|
string channelName,
|
||||||
PVStructurePtr const & pvStructure)
|
PVStructurePtr const & pvStructure)
|
||||||
: PVRecord(recordName,pvStructure),
|
: PVRecord(recordName,pvStructure),
|
||||||
providerName(providerName),
|
providerName(providerName),
|
||||||
@@ -64,13 +65,12 @@ bool ExampleLink::init()
|
|||||||
pvAlarm.attach(pvStructure->getSubField("alarm"));
|
pvAlarm.attach(pvStructure->getSubField("alarm"));
|
||||||
pvValue = static_pointer_cast<PVDoubleArray>(
|
pvValue = static_pointer_cast<PVDoubleArray>(
|
||||||
pvStructure->getScalarArrayField("value",pvDouble));
|
pvStructure->getScalarArrayField("value",pvDouble));
|
||||||
if(pvValue==NULL) {
|
if(!pvValue) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ChannelAccess::shared_pointer channelAccess = getChannelAccess();
|
|
||||||
ChannelProvider::shared_pointer provider =
|
ChannelProvider::shared_pointer provider =
|
||||||
channelAccess->getProvider(providerName);
|
getChannelProviderRegistry()->getProvider(providerName);
|
||||||
if(provider==NULL) {
|
if(!provider) {
|
||||||
cout << getRecordName() << " provider "
|
cout << getRecordName() << " provider "
|
||||||
<< providerName << " does not exist" << endl;
|
<< providerName << " does not exist" << endl;
|
||||||
return false;
|
return false;
|
||||||
@@ -97,7 +97,7 @@ bool ExampleLink::init()
|
|||||||
}
|
}
|
||||||
getPVValue = static_pointer_cast<PVDoubleArray>(
|
getPVValue = static_pointer_cast<PVDoubleArray>(
|
||||||
getPVStructure->getScalarArrayField("value",pvDouble));
|
getPVStructure->getScalarArrayField("value",pvDouble));
|
||||||
if(getPVValue==NULL) {
|
if(!getPVValue) {
|
||||||
cout << getRecordName() << " get value not PVDoubleArray" << endl;
|
cout << getRecordName() << " get value not PVDoubleArray" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ bool ExampleLink::init()
|
|||||||
void ExampleLink::process()
|
void ExampleLink::process()
|
||||||
{
|
{
|
||||||
status = Status::Ok;
|
status = Status::Ok;
|
||||||
channelGet->get(false);
|
channelGet->get();
|
||||||
event.wait();
|
event.wait();
|
||||||
timeStamp.getCurrent();
|
timeStamp.getCurrent();
|
||||||
pvTimeStamp.set(timeStamp);
|
pvTimeStamp.set(timeStamp);
|
||||||
@@ -145,20 +145,24 @@ void ExampleLink::channelStateChange(
|
|||||||
void ExampleLink::channelGetConnect(
|
void ExampleLink::channelGetConnect(
|
||||||
const Status& status,
|
const Status& status,
|
||||||
ChannelGet::shared_pointer const & channelGet,
|
ChannelGet::shared_pointer const & channelGet,
|
||||||
PVStructure::shared_pointer const & pvStructure,
|
StructureConstPtr const & structure)
|
||||||
BitSet::shared_pointer const & bitSet)
|
|
||||||
{
|
{
|
||||||
this->status = status;
|
this->status = status;
|
||||||
this->channelGet = channelGet;
|
this->channelGet = channelGet;
|
||||||
this->getPVStructure = pvStructure;
|
getPVStructure = getPVDataCreate()->createPVStructure(structure);
|
||||||
|
event.signal();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExampleLink::getDone(
|
||||||
|
const Status& status,
|
||||||
|
ChannelGet::shared_pointer const & channelGet,
|
||||||
|
PVStructurePtr const & pvStructure,
|
||||||
|
BitSetPtr const & bitSet)
|
||||||
|
{
|
||||||
|
this->status = status;
|
||||||
|
convert->copyStructure(pvStructure,getPVStructure);
|
||||||
this->bitSet = bitSet;
|
this->bitSet = bitSet;
|
||||||
event.signal();
|
event.signal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExampleLink::getDone(const Status& status)
|
|
||||||
{
|
|
||||||
this->status = status;
|
|
||||||
event.signal();
|
|
||||||
}
|
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -8,15 +8,14 @@
|
|||||||
* @author mrk
|
* @author mrk
|
||||||
* @date 2013.08.02
|
* @date 2013.08.02
|
||||||
*/
|
*/
|
||||||
#ifndef EXAMPLELINK_H
|
#ifndef EXAMPLEPVADOUBLEARRAYGET_H
|
||||||
#define EXAMPLELINK_H
|
#define EXAMPLEPVADOUBLEARRAYGET_H
|
||||||
|
|
||||||
#ifdef epicsExportSharedSymbols
|
#ifdef epicsExportSharedSymbols
|
||||||
# define examplelinkEpicsExportSharedSymbols
|
# define exampleLinkEpicsExportSharedSymbols
|
||||||
# undef epicsExportSharedSymbols
|
# undef epicsExportSharedSymbols
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#include <shareLib.h>
|
|
||||||
#include <pv/timeStamp.h>
|
#include <pv/timeStamp.h>
|
||||||
#include <pv/pvTimeStamp.h>
|
#include <pv/pvTimeStamp.h>
|
||||||
#include <pv/alarm.h>
|
#include <pv/alarm.h>
|
||||||
@@ -26,13 +25,12 @@
|
|||||||
#include <pv/pvAccess.h>
|
#include <pv/pvAccess.h>
|
||||||
#include <pv/serverContext.h>
|
#include <pv/serverContext.h>
|
||||||
|
|
||||||
|
#ifdef exampleLinkEpicsExportSharedSymbols
|
||||||
#ifdef examplelinkEpicsExportSharedSymbols
|
|
||||||
# define epicsExportSharedSymbols
|
# define epicsExportSharedSymbols
|
||||||
# undef examplelinkEpicsExportSharedSymbols
|
# undef exampleLinkEpicsExportSharedSymbols
|
||||||
# include <shareLib.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <shareLib.h>
|
||||||
|
|
||||||
namespace epics { namespace pvDatabase {
|
namespace epics { namespace pvDatabase {
|
||||||
|
|
||||||
@@ -48,9 +46,9 @@ class epicsShareClass ExampleLink :
|
|||||||
public:
|
public:
|
||||||
POINTER_DEFINITIONS(ExampleLink);
|
POINTER_DEFINITIONS(ExampleLink);
|
||||||
static ExampleLinkPtr create(
|
static ExampleLinkPtr create(
|
||||||
epics::pvData::String const & recordName,
|
std::string const & recordName,
|
||||||
epics::pvData::String const & providerName,
|
std::string const & providerName,
|
||||||
epics::pvData::String const & channelName
|
std::string const & channelName
|
||||||
);
|
);
|
||||||
virtual ~ExampleLink() {}
|
virtual ~ExampleLink() {}
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
@@ -65,23 +63,26 @@ public:
|
|||||||
virtual void channelGetConnect(
|
virtual void channelGetConnect(
|
||||||
const epics::pvData::Status& status,
|
const epics::pvData::Status& status,
|
||||||
epics::pvAccess::ChannelGet::shared_pointer const & channelGet,
|
epics::pvAccess::ChannelGet::shared_pointer const & channelGet,
|
||||||
epics::pvData::PVStructure::shared_pointer const & pvStructure,
|
epics::pvData::StructureConstPtr const & structure);
|
||||||
epics::pvData::BitSet::shared_pointer const & bitSet);
|
virtual void getDone(
|
||||||
virtual void getDone(const epics::pvData::Status& status);
|
const epics::pvData::Status& status,
|
||||||
virtual epics::pvData::String getRequesterName() {return channelName;}
|
epics::pvAccess::ChannelGet::shared_pointer const & channelGet,
|
||||||
|
epics::pvData::PVStructurePtr const & pvStructure,
|
||||||
|
epics::pvData::BitSetPtr const &bitSet);
|
||||||
|
virtual std::string getRequesterName() {return channelName;}
|
||||||
virtual void message(
|
virtual void message(
|
||||||
epics::pvData::String const & message,
|
std::string const & message,
|
||||||
epics::pvData::MessageType messageType)
|
epics::pvData::MessageType messageType)
|
||||||
{
|
{
|
||||||
std::cout << "Why is ExampleLink::message called\n";
|
std::cout << "Why is ExampleLink::message called\n";
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
ExampleLink(epics::pvData::String const & recordName,
|
ExampleLink(std::string const & recordName,
|
||||||
epics::pvData::String providerName,
|
std::string providerName,
|
||||||
epics::pvData::String channelName,
|
std::string channelName,
|
||||||
epics::pvData::PVStructurePtr const & pvStructure);
|
epics::pvData::PVStructurePtr const & pvStructure);
|
||||||
epics::pvData::String providerName;
|
std::string providerName;
|
||||||
epics::pvData::String channelName;
|
std::string channelName;
|
||||||
epics::pvData::ConvertPtr convert;
|
epics::pvData::ConvertPtr convert;
|
||||||
epics::pvData::PVDoubleArrayPtr pvValue;
|
epics::pvData::PVDoubleArrayPtr pvValue;
|
||||||
epics::pvData::PVTimeStamp pvTimeStamp;
|
epics::pvData::PVTimeStamp pvTimeStamp;
|
||||||
@@ -99,4 +100,4 @@ private:
|
|||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
#endif /* EXAMPLELINK_H */
|
#endif /* EXAMPLEPVADOUBLEARRAYGET_H */
|
||||||
|
|||||||
1
exampleLink/src/exampleLinkInclude.dbd
Normal file
1
exampleLink/src/exampleLinkInclude.dbd
Normal file
@@ -0,0 +1 @@
|
|||||||
|
registrar("exampleLinkRegister")
|
||||||
@@ -35,14 +35,14 @@
|
|||||||
#include <pv/pvDatabase.h>
|
#include <pv/pvDatabase.h>
|
||||||
|
|
||||||
#include <epicsExport.h>
|
#include <epicsExport.h>
|
||||||
|
#include <pv/exampleLink.h>
|
||||||
#include <exampleLink.h>
|
|
||||||
|
|
||||||
using namespace epics::pvData;
|
using namespace epics::pvData;
|
||||||
using namespace epics::pvAccess;
|
using namespace epics::pvAccess;
|
||||||
using namespace epics::pvDatabase;
|
using namespace epics::pvDatabase;
|
||||||
using std::cout;
|
using std::cout;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
static StandardPVFieldPtr standardPVField = getStandardPVField();
|
static StandardPVFieldPtr standardPVField = getStandardPVField();
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ static void exampleLinkCallFunc(const iocshArgBuf *args)
|
|||||||
PVDatabasePtr master = PVDatabase::getMaster();
|
PVDatabasePtr master = PVDatabase::getMaster();
|
||||||
PVRecordPtr pvRecord;
|
PVRecordPtr pvRecord;
|
||||||
bool result(false);
|
bool result(false);
|
||||||
String recordName;
|
string recordName;
|
||||||
PVStructurePtr pvStructure = standardPVField->scalarArray(
|
PVStructurePtr pvStructure = standardPVField->scalarArray(
|
||||||
pvDouble,"alarm,timeStamp");
|
pvDouble,"alarm,timeStamp");
|
||||||
pvRecord = PVRecord::create("doubleArray",pvStructure);
|
pvRecord = PVRecord::create("doubleArray",pvStructure);
|
||||||
@@ -70,8 +70,8 @@ static void exampleLinkCallFunc(const iocshArgBuf *args)
|
|||||||
char *providerName = args[1].sval;
|
char *providerName = args[1].sval;
|
||||||
char *channelName = args[2].sval;
|
char *channelName = args[2].sval;
|
||||||
ExampleLinkPtr record = ExampleLink::create(recordName,providerName,channelName);
|
ExampleLinkPtr record = ExampleLink::create(recordName,providerName,channelName);
|
||||||
if(record!=NULL)
|
if(record)
|
||||||
result = master->addRecord(record);
|
result = master->addRecord(record);
|
||||||
if(!result) cout << "recordname" << " not added" << endl;
|
if(!result) cout << "recordname" << " not added" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,11 +14,26 @@
|
|||||||
# Set CHECK_RELEASE to NO to disable checking completely.
|
# Set CHECK_RELEASE to NO to disable checking completely.
|
||||||
# Set CHECK_RELEASE to WARN to perform consistency checking but
|
# Set CHECK_RELEASE to WARN to perform consistency checking but
|
||||||
# continue building anyway if conflicts are found.
|
# 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
|
# To install files into a location other than $(TOP) define
|
||||||
# INSTALL_LOCATION here.
|
# INSTALL_LOCATION here.
|
||||||
#INSTALL_LOCATION=</path/name/to/install/top>
|
#INSTALL_LOCATION=</path/name/to/install/top>
|
||||||
|
|
||||||
-include $(TOP)/../configure/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)/../../CONFIG_SITE.local
|
-include $(TOP)/../../CONFIG_SITE.local
|
||||||
|
-include $(TOP)/../configure/CONFIG_SITE.local
|
||||||
|
|||||||
@@ -16,9 +16,8 @@
|
|||||||
|
|
||||||
# EPICS V4 Developers: Do not edit the locations in this file!
|
# EPICS V4 Developers: Do not edit the locations in this file!
|
||||||
#
|
#
|
||||||
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
|
# Create a file RELEASE.local pointing to your places
|
||||||
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
|
# for the dependencies, e.g.
|
||||||
# PVASRV = /path/to/epics/pvaSrvCPP
|
|
||||||
# PVACCESS = /path/to/epics/pvAccessCPP
|
# PVACCESS = /path/to/epics/pvAccessCPP
|
||||||
# PVDATA = /path/to/epics/pvDataCPP
|
# PVDATA = /path/to/epics/pvDataCPP
|
||||||
# PVCOMMON = /path/to/epics/pvCommonCPP
|
# PVCOMMON = /path/to/epics/pvCommonCPP
|
||||||
@@ -27,17 +26,17 @@
|
|||||||
# If this example is built in a directory under pvDatabaseCPP,
|
# If this example is built in a directory under pvDatabaseCPP,
|
||||||
# use the following definitions:
|
# use the following definitions:
|
||||||
|
|
||||||
PVDATABASETEST = $(TOP)/../testTop
|
|
||||||
PVDATABASE = $(TOP)/..
|
PVDATABASE = $(TOP)/..
|
||||||
|
PVDATABASETEST = $(TOP)/../test
|
||||||
-include $(TOP)/../configure/RELEASE.local
|
|
||||||
-include $(TOP)/../../RELEASE.local
|
-include $(TOP)/../../RELEASE.local
|
||||||
|
-include $(TOP)/../configure/RELEASE.local
|
||||||
|
|
||||||
# If you copied this example from pvDatabaseCPP to be built as a
|
# 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
|
||||||
#PVDATABASETEST = /path/to/epics/pvDatabaseCPP/testTop
|
# PVDATABASETEST = /path/to/epics/pvDatabaseCPP/test
|
||||||
#PVDATABASE = /path/to/epics/pvDatabaseCPP
|
# in the appropriate RELEASE[.local],
|
||||||
|
# and use the following definitions instead:
|
||||||
|
|
||||||
#-include $(TOP)/../RELEASE.local
|
#-include $(TOP)/../RELEASE.local
|
||||||
#-include $(TOP)/configure/RELEASE.local
|
#-include $(TOP)/configure/RELEASE.local
|
||||||
|
|||||||
@@ -3,22 +3,26 @@ TOP=../..
|
|||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
#----------------------------------------
|
#----------------------------------------
|
||||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||||
|
#=============================
|
||||||
|
|
||||||
|
#==================================================
|
||||||
|
# Build an IOC support library
|
||||||
|
#
|
||||||
|
|
||||||
DBD += powerSupply.dbd
|
DBD += powerSupply.dbd
|
||||||
|
|
||||||
powerSupply_DBD += base.dbd
|
#=============================
|
||||||
powerSupply_DBD += PVAServerRegister.dbd
|
# build an ioc application
|
||||||
powerSupply_DBD += registerChannelProviderLocal.dbd
|
|
||||||
powerSupply_DBD += dbPv.dbd
|
|
||||||
powerSupply_DBD += powerSupplyRegister.dbd
|
|
||||||
|
|
||||||
PROD_IOC += powerSupply
|
PROD_IOC += powerSupply
|
||||||
|
|
||||||
|
|
||||||
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
|
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
|
||||||
powerSupply_SRCS += powerSupply_registerRecordDeviceDriver.cpp
|
powerSupply_SRCS += powerSupply_registerRecordDeviceDriver.cpp
|
||||||
powerSupply_SRCS_DEFAULT += powerSupplyMain.cpp
|
powerSupply_SRCS_DEFAULT += powerSupplyMain.cpp
|
||||||
powerSupply_SRCS_vxWorks += -nil-
|
powerSupply_SRCS_vxWorks += -nil-
|
||||||
|
|
||||||
|
|
||||||
# The following adds support from base/src/vxWorks
|
# The following adds support from base/src/vxWorks
|
||||||
powerSupply_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
|
powerSupply_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
|
||||||
|
|
||||||
|
|||||||
5
examplePowerSupply/ioc/src/powerSupplyInclude.dbd
Normal file
5
examplePowerSupply/ioc/src/powerSupplyInclude.dbd
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
include "base.dbd"
|
||||||
|
include "PVAServerRegister.dbd"
|
||||||
|
include "registerChannelProviderLocal.dbd"
|
||||||
|
include "dbPv.dbd"
|
||||||
|
include "powerSupplyRegister.dbd"
|
||||||
@@ -3,14 +3,21 @@ TOP=..
|
|||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
#----------------------------------------
|
#----------------------------------------
|
||||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||||
|
#=============================
|
||||||
|
|
||||||
|
#==================================================
|
||||||
|
# Build an IOC support library
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
PROD_HOST += powerSupplyMain
|
PROD_HOST += powerSupplyMain
|
||||||
powerSupplyMain_SRCS += powerSupplyMain.cpp
|
powerSupplyMain_SRCS += powerSupplyMain.cpp
|
||||||
powerSupplyMain_LIBS += powerSupply
|
|
||||||
powerSupplyMain_LIBS += pvDatabase
|
powerSupplyMain_LIBS += pvDatabase
|
||||||
powerSupplyMain_LIBS += pvAccess
|
powerSupplyMain_LIBS += pvAccess
|
||||||
powerSupplyMain_LIBS += pvData
|
powerSupplyMain_LIBS += pvData
|
||||||
powerSupplyMain_LIBS += Com
|
powerSupplyMain_LIBS += Com
|
||||||
|
powerSupplyMain_LIBS += powerSupply
|
||||||
|
|
||||||
#===========================
|
#===========================
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,12 @@
|
|||||||
|
|
||||||
#include <pv/standardField.h>
|
#include <pv/standardField.h>
|
||||||
#include <pv/standardPVField.h>
|
#include <pv/standardPVField.h>
|
||||||
|
#include <pv/recordList.h>
|
||||||
|
#include <pv/powerSupply.h>
|
||||||
#include <pv/traceRecord.h>
|
#include <pv/traceRecord.h>
|
||||||
#include <pv/channelProviderLocal.h>
|
#include <pv/channelProviderLocal.h>
|
||||||
#include <pv/serverContext.h>
|
#include <pv/serverContext.h>
|
||||||
|
|
||||||
#include <powerSupply.h>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using std::tr1::static_pointer_cast;
|
using std::tr1::static_pointer_cast;
|
||||||
using namespace epics::pvData;
|
using namespace epics::pvData;
|
||||||
@@ -39,7 +39,7 @@ int main(int argc,char *argv[])
|
|||||||
ChannelProviderLocalPtr channelProvider = getChannelProviderLocal();
|
ChannelProviderLocalPtr channelProvider = getChannelProviderLocal();
|
||||||
PVRecordPtr pvRecord;
|
PVRecordPtr pvRecord;
|
||||||
bool result(false);
|
bool result(false);
|
||||||
String recordName;
|
string recordName;
|
||||||
recordName = "powerSupply";
|
recordName = "powerSupply";
|
||||||
PVStructurePtr pv = createPowerSupply();
|
PVStructurePtr pv = createPowerSupply();
|
||||||
pvRecord = PowerSupply::create(recordName,pv);
|
pvRecord = PowerSupply::create(recordName,pv);
|
||||||
@@ -49,7 +49,10 @@ int main(int argc,char *argv[])
|
|||||||
pvRecord = TraceRecord::create(recordName);
|
pvRecord = TraceRecord::create(recordName);
|
||||||
result = master->addRecord(pvRecord);
|
result = master->addRecord(pvRecord);
|
||||||
if(!result) cout<< "record " << recordName << " not added" << endl;
|
if(!result) cout<< "record " << recordName << " not added" << endl;
|
||||||
pvRecord.reset();
|
recordName = "laptoprecordListPGRPC";
|
||||||
|
pvRecord = RecordListRecord::create(recordName);
|
||||||
|
result = master->addRecord(pvRecord);
|
||||||
|
if(!result) cout<< "record " << recordName << " not added" << endl;
|
||||||
ServerContext::shared_pointer pvaServer =
|
ServerContext::shared_pointer pvaServer =
|
||||||
startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true);
|
startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true);
|
||||||
cout << "powerSupply\n";
|
cout << "powerSupply\n";
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# Makefile at top of application tree
|
#Makefile at top of application tree
|
||||||
|
|
||||||
TOP = .
|
TOP = .
|
||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
|
|
||||||
DIRS += configure
|
DIRS += configure
|
||||||
|
|
||||||
DIRS += src
|
DIRS += src
|
||||||
@@ -12,7 +10,6 @@ DIRS += ioc
|
|||||||
ioc_DEPEND_DIRS = src
|
ioc_DEPEND_DIRS = src
|
||||||
|
|
||||||
DIRS += iocBoot
|
DIRS += iocBoot
|
||||||
iocBoot_DEPEND_DIRS = src
|
|
||||||
|
|
||||||
include $(TOP)/configure/RULES_TOP
|
include $(TOP)/configure/RULES_TOP
|
||||||
|
|
||||||
|
|||||||
@@ -14,11 +14,26 @@
|
|||||||
# Set CHECK_RELEASE to NO to disable checking completely.
|
# Set CHECK_RELEASE to NO to disable checking completely.
|
||||||
# Set CHECK_RELEASE to WARN to perform consistency checking but
|
# Set CHECK_RELEASE to WARN to perform consistency checking but
|
||||||
# continue building anyway if conflicts are found.
|
# 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
|
# To install files into a location other than $(TOP) define
|
||||||
# INSTALL_LOCATION here.
|
# INSTALL_LOCATION here.
|
||||||
#INSTALL_LOCATION=</path/name/to/install/top>
|
#INSTALL_LOCATION=</path/name/to/install/top>
|
||||||
|
|
||||||
-include $(TOP)/../configure/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)/../../CONFIG_SITE.local
|
-include $(TOP)/../../CONFIG_SITE.local
|
||||||
|
-include $(TOP)/../configure/CONFIG_SITE.local
|
||||||
|
|||||||
@@ -16,9 +16,8 @@
|
|||||||
|
|
||||||
# EPICS V4 Developers: Do not edit the locations in this file!
|
# EPICS V4 Developers: Do not edit the locations in this file!
|
||||||
#
|
#
|
||||||
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
|
# Create a file RELEASE.local pointing to your places
|
||||||
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
|
# for the dependencies, e.g.
|
||||||
# PVASRV = /path/to/epics/pvaSrvCPP
|
|
||||||
# PVACCESS = /path/to/epics/pvAccessCPP
|
# PVACCESS = /path/to/epics/pvAccessCPP
|
||||||
# PVDATA = /path/to/epics/pvDataCPP
|
# PVDATA = /path/to/epics/pvDataCPP
|
||||||
# PVCOMMON = /path/to/epics/pvCommonCPP
|
# PVCOMMON = /path/to/epics/pvCommonCPP
|
||||||
@@ -28,14 +27,14 @@
|
|||||||
# use the following definitions:
|
# use the following definitions:
|
||||||
|
|
||||||
PVDATABASE = $(TOP)/..
|
PVDATABASE = $(TOP)/..
|
||||||
|
|
||||||
-include $(TOP)/../configure/RELEASE.local
|
|
||||||
-include $(TOP)/../../RELEASE.local
|
-include $(TOP)/../../RELEASE.local
|
||||||
|
-include $(TOP)/../configure/RELEASE.local
|
||||||
|
|
||||||
# If you copied this example from pvDatabaseCPP to be built as a
|
# 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)/../RELEASE.local
|
||||||
|
#-include $(TOP)/configure/RELEASE.local
|
||||||
|
|||||||
@@ -3,22 +3,26 @@ TOP=../..
|
|||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
#----------------------------------------
|
#----------------------------------------
|
||||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||||
|
#=============================
|
||||||
|
|
||||||
|
#==================================================
|
||||||
|
# Build an IOC support library
|
||||||
|
#
|
||||||
|
|
||||||
DBD += exampleServer.dbd
|
DBD += exampleServer.dbd
|
||||||
|
|
||||||
exampleServer_DBD += base.dbd
|
#=============================
|
||||||
exampleServer_DBD += PVAServerRegister.dbd
|
# build an ioc application
|
||||||
exampleServer_DBD += registerChannelProviderLocal.dbd
|
|
||||||
exampleServer_DBD += dbPv.dbd
|
|
||||||
exampleServer_DBD += exampleServerRegister.dbd
|
|
||||||
|
|
||||||
PROD_IOC += exampleServer
|
PROD_IOC += exampleServer
|
||||||
|
|
||||||
|
|
||||||
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
|
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
|
||||||
exampleServer_SRCS += exampleServer_registerRecordDeviceDriver.cpp
|
exampleServer_SRCS += exampleServer_registerRecordDeviceDriver.cpp
|
||||||
exampleServer_SRCS_DEFAULT += exampleServerMain.cpp
|
exampleServer_SRCS_DEFAULT += exampleServerMain.cpp
|
||||||
exampleServer_SRCS_vxWorks += -nil-
|
exampleServer_SRCS_vxWorks += -nil-
|
||||||
|
|
||||||
|
|
||||||
# The following adds support from base/src/vxWorks
|
# The following adds support from base/src/vxWorks
|
||||||
exampleServer_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
|
exampleServer_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
|
||||||
|
|
||||||
|
|||||||
6
exampleServer/ioc/src/exampleServerInclude.dbd
Normal file
6
exampleServer/ioc/src/exampleServerInclude.dbd
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
include "base.dbd"
|
||||||
|
include "PVAClientRegister.dbd"
|
||||||
|
include "PVAServerRegister.dbd"
|
||||||
|
include "registerChannelProviderLocal.dbd"
|
||||||
|
include "dbPv.dbd"
|
||||||
|
include "exampleServer.dbd"
|
||||||
@@ -3,8 +3,14 @@ TOP=..
|
|||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
#----------------------------------------
|
#----------------------------------------
|
||||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||||
|
#=============================
|
||||||
|
|
||||||
DBD += exampleServerRegister.dbd
|
#==================================================
|
||||||
|
# Build an IOC support library
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
DBD += exampleServer.dbd
|
||||||
|
|
||||||
INC += exampleServer.h
|
INC += exampleServer.h
|
||||||
|
|
||||||
@@ -14,6 +20,7 @@ exampleServer_SRCS += exampleServerRegister.cpp
|
|||||||
exampleServer_LIBS += pvDatabase
|
exampleServer_LIBS += pvDatabase
|
||||||
exampleServer_LIBS += pvAccess
|
exampleServer_LIBS += pvAccess
|
||||||
exampleServer_LIBS += pvData
|
exampleServer_LIBS += pvData
|
||||||
|
exampleServer_LIBS += Com
|
||||||
exampleServer_LIBS += $(EPICS_BASE_IOC_LIBS)
|
exampleServer_LIBS += $(EPICS_BASE_IOC_LIBS)
|
||||||
|
|
||||||
PROD_HOST += exampleServerMain
|
PROD_HOST += exampleServerMain
|
||||||
|
|||||||
@@ -9,34 +9,36 @@
|
|||||||
* @date 2013.04.02
|
* @date 2013.04.02
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <pv/standardPVField.h>
|
#include <pv/standardField.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
|
#include <pv/exampleServer.h>
|
||||||
|
|
||||||
#include <exampleServer.h>
|
|
||||||
|
|
||||||
namespace epics { namespace exampleServer {
|
|
||||||
using namespace epics::pvData;
|
using namespace epics::pvData;
|
||||||
using namespace epics::pvDatabase;
|
using namespace epics::pvDatabase;
|
||||||
using std::tr1::static_pointer_cast;
|
using std::tr1::static_pointer_cast;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
|
namespace epics { namespace exampleServer {
|
||||||
|
|
||||||
|
|
||||||
ExampleServerPtr ExampleServer::create(
|
ExampleServerPtr ExampleServer::create(
|
||||||
String const & recordName)
|
string const & recordName)
|
||||||
{
|
{
|
||||||
StandardPVFieldPtr standardPVField = getStandardPVField();
|
StandardFieldPtr standardField = getStandardField();
|
||||||
|
FieldCreatePtr fieldCreate = getFieldCreate();
|
||||||
PVDataCreatePtr pvDataCreate = getPVDataCreate();
|
PVDataCreatePtr pvDataCreate = getPVDataCreate();
|
||||||
PVStructurePtr pvArgument = standardPVField->scalar(pvString,"");
|
StructureConstPtr topStructure = fieldCreate->createFieldBuilder()->
|
||||||
PVStructurePtr pvResult = standardPVField->scalar(pvString,"timeStamp");
|
addNestedStructure("argument")->
|
||||||
StringArray names;
|
add("value",pvString)->
|
||||||
names.reserve(2);
|
endNested()->
|
||||||
PVFieldPtrArray fields;
|
addNestedStructure("result") ->
|
||||||
fields.reserve(2);
|
add("value",pvString) ->
|
||||||
names.push_back("argument");
|
add("timeStamp",standardField->timeStamp()) ->
|
||||||
fields.push_back(pvArgument);
|
endNested()->
|
||||||
names.push_back("result");
|
createStructure();
|
||||||
fields.push_back(pvResult);
|
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(topStructure);
|
||||||
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(names,fields);
|
|
||||||
ExampleServerPtr pvRecord(
|
ExampleServerPtr pvRecord(
|
||||||
new ExampleServer(recordName,pvStructure));
|
new ExampleServer(recordName,pvStructure));
|
||||||
if(!pvRecord->init()) pvRecord.reset();
|
if(!pvRecord->init()) pvRecord.reset();
|
||||||
@@ -44,7 +46,7 @@ ExampleServerPtr ExampleServer::create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ExampleServer::ExampleServer(
|
ExampleServer::ExampleServer(
|
||||||
String const & recordName,
|
string const & recordName,
|
||||||
PVStructurePtr const & pvStructure)
|
PVStructurePtr const & pvStructure)
|
||||||
: PVRecord(recordName,pvStructure)
|
: PVRecord(recordName,pvStructure)
|
||||||
{
|
{
|
||||||
@@ -74,7 +76,7 @@ bool ExampleServer::init()
|
|||||||
|
|
||||||
void ExampleServer::process()
|
void ExampleServer::process()
|
||||||
{
|
{
|
||||||
pvResultValue->put(String("Hello ") + pvArgumentValue->get());
|
pvResultValue->put(string("Hello ") + pvArgumentValue->get());
|
||||||
timeStamp.getCurrent();
|
timeStamp.getCurrent();
|
||||||
pvTimeStamp.set(timeStamp);
|
pvTimeStamp.set(timeStamp);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,15 +8,14 @@
|
|||||||
* @author mrk
|
* @author mrk
|
||||||
* @date 2013.04.02
|
* @date 2013.04.02
|
||||||
*/
|
*/
|
||||||
#ifndef EXAMPLESERVER_H
|
#ifndef EXAMPLECOUNTER_H
|
||||||
#define EXAMPLESERVER_H
|
#define EXAMPLECOUNTER_H
|
||||||
|
|
||||||
#ifdef epicsExportSharedSymbols
|
#ifdef epicsExportSharedSymbols
|
||||||
# define exampleServerEpicsExportSharedSymbols
|
# define exampleServerEpicsExportSharedSymbols
|
||||||
# undef epicsExportSharedSymbols
|
# undef epicsExportSharedSymbols
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <shareLib.h>
|
|
||||||
#include <pv/pvDatabase.h>
|
#include <pv/pvDatabase.h>
|
||||||
#include <pv/timeStamp.h>
|
#include <pv/timeStamp.h>
|
||||||
#include <pv/pvTimeStamp.h>
|
#include <pv/pvTimeStamp.h>
|
||||||
@@ -24,9 +23,10 @@
|
|||||||
#ifdef exampleServerEpicsExportSharedSymbols
|
#ifdef exampleServerEpicsExportSharedSymbols
|
||||||
# define epicsExportSharedSymbols
|
# define epicsExportSharedSymbols
|
||||||
# undef exampleServerEpicsExportSharedSymbols
|
# undef exampleServerEpicsExportSharedSymbols
|
||||||
# include <shareLib.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <shareLib.h>
|
||||||
|
|
||||||
|
|
||||||
namespace epics { namespace exampleServer {
|
namespace epics { namespace exampleServer {
|
||||||
|
|
||||||
@@ -40,13 +40,13 @@ class epicsShareClass ExampleServer :
|
|||||||
public:
|
public:
|
||||||
POINTER_DEFINITIONS(ExampleServer);
|
POINTER_DEFINITIONS(ExampleServer);
|
||||||
static ExampleServerPtr create(
|
static ExampleServerPtr create(
|
||||||
epics::pvData::String const & recordName);
|
std::string const & recordName);
|
||||||
virtual ~ExampleServer();
|
virtual ~ExampleServer();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
virtual bool init();
|
virtual bool init();
|
||||||
virtual void process();
|
virtual void process();
|
||||||
private:
|
private:
|
||||||
ExampleServer(epics::pvData::String const & recordName,
|
ExampleServer(std::string const & recordName,
|
||||||
epics::pvData::PVStructurePtr const & pvStructure);
|
epics::pvData::PVStructurePtr const & pvStructure);
|
||||||
|
|
||||||
epics::pvData::PVStringPtr pvArgumentValue;
|
epics::pvData::PVStringPtr pvArgumentValue;
|
||||||
@@ -58,4 +58,4 @@ private:
|
|||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
#endif /* EXAMPLESERVER_H */
|
#endif /* EXAMPLECOUNTER_H */
|
||||||
|
|||||||
1
exampleServer/src/exampleServerInclude.dbd
Normal file
1
exampleServer/src/exampleServerInclude.dbd
Normal file
@@ -0,0 +1 @@
|
|||||||
|
registrar("exampleServerRegister")
|
||||||
@@ -20,12 +20,12 @@
|
|||||||
|
|
||||||
#include <pv/standardField.h>
|
#include <pv/standardField.h>
|
||||||
#include <pv/standardPVField.h>
|
#include <pv/standardPVField.h>
|
||||||
|
#include <pv/exampleServer.h>
|
||||||
#include <pv/traceRecord.h>
|
#include <pv/traceRecord.h>
|
||||||
|
#include <pv/recordList.h>
|
||||||
#include <pv/channelProviderLocal.h>
|
#include <pv/channelProviderLocal.h>
|
||||||
#include <pv/serverContext.h>
|
#include <pv/serverContext.h>
|
||||||
|
|
||||||
#include <exampleServer.h>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using std::tr1::static_pointer_cast;
|
using std::tr1::static_pointer_cast;
|
||||||
using namespace epics::pvData;
|
using namespace epics::pvData;
|
||||||
@@ -39,19 +39,24 @@ int main(int argc,char *argv[])
|
|||||||
ChannelProviderLocalPtr channelProvider = getChannelProviderLocal();
|
ChannelProviderLocalPtr channelProvider = getChannelProviderLocal();
|
||||||
PVRecordPtr pvRecord;
|
PVRecordPtr pvRecord;
|
||||||
bool result(false);
|
bool result(false);
|
||||||
String recordName;
|
string recordName;
|
||||||
recordName = "exampleServer";
|
recordName = "exampleServer";
|
||||||
pvRecord = ExampleServer::create(recordName);
|
pvRecord = ExampleServer::create(recordName);
|
||||||
result = master->addRecord(pvRecord);
|
result = master->addRecord(pvRecord);
|
||||||
cout << "result of addRecord " << recordName << " " << result << endl;
|
if(!result) cout<< "record " << recordName << " not added" << endl;
|
||||||
recordName = "traceRecordPGRPC";
|
recordName = "traceRecordPGRPC";
|
||||||
pvRecord = TraceRecord::create(recordName);
|
pvRecord = TraceRecord::create(recordName);
|
||||||
result = master->addRecord(pvRecord);
|
result = master->addRecord(pvRecord);
|
||||||
if(!result) cout<< "record " << recordName << " not added" << endl;
|
if(!result) cout<< "record " << recordName << " not added" << endl;
|
||||||
pvRecord.reset();
|
recordName = "laptoprecordListPGRPC";
|
||||||
|
pvRecord = RecordListRecord::create(recordName);
|
||||||
|
result = master->addRecord(pvRecord);
|
||||||
|
if(!result) cout<< "record " << recordName << " not added" << endl;
|
||||||
ServerContext::shared_pointer pvaServer =
|
ServerContext::shared_pointer pvaServer =
|
||||||
startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true);
|
startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true);
|
||||||
cout << "exampleServer\n";
|
PVStringArrayPtr pvNames = master->getRecordNames();
|
||||||
|
shared_vector<const string> names = pvNames->view();
|
||||||
|
for(size_t i=0; i<names.size(); ++i) cout << names[i] << endl;
|
||||||
string str;
|
string str;
|
||||||
while(true) {
|
while(true) {
|
||||||
cout << "Type exit to stop: \n";
|
cout << "Type exit to stop: \n";
|
||||||
|
|||||||
@@ -31,10 +31,10 @@
|
|||||||
#include <pv/pvData.h>
|
#include <pv/pvData.h>
|
||||||
#include <pv/pvAccess.h>
|
#include <pv/pvAccess.h>
|
||||||
#include <pv/pvDatabase.h>
|
#include <pv/pvDatabase.h>
|
||||||
|
#include <pv/recordList.h>
|
||||||
|
|
||||||
#include <epicsExport.h>
|
#include <epicsExport.h>
|
||||||
|
#include <pv/exampleServer.h>
|
||||||
#include <exampleServer.h>
|
|
||||||
|
|
||||||
using namespace epics::pvData;
|
using namespace epics::pvData;
|
||||||
using namespace epics::pvAccess;
|
using namespace epics::pvAccess;
|
||||||
@@ -51,10 +51,19 @@ static const iocshFuncDef exampleServerFuncDef = {
|
|||||||
"exampleServerCreateRecord", 1, testArgs};
|
"exampleServerCreateRecord", 1, testArgs};
|
||||||
static void exampleServerCallFunc(const iocshArgBuf *args)
|
static void exampleServerCallFunc(const iocshArgBuf *args)
|
||||||
{
|
{
|
||||||
|
PVDatabasePtr master = PVDatabase::getMaster();
|
||||||
char *recordName = args[0].sval;
|
char *recordName = args[0].sval;
|
||||||
ExampleServerPtr record = ExampleServer::create(recordName);
|
ExampleServerPtr record = ExampleServer::create(recordName);
|
||||||
bool result = PVDatabase::getMaster()->addRecord(record);
|
bool result = master->addRecord(record);
|
||||||
if(!result) cout << "recordname" << " not added" << endl;
|
if(!result) cout << "recordname" << " not added" << endl;
|
||||||
|
PVRecordPtr pvRecord = RecordListRecord::create(
|
||||||
|
"laptoprecordListPGRPC");
|
||||||
|
if(!pvRecord) {
|
||||||
|
cout << "RecordListRecord::create failed" << endl;
|
||||||
|
} else {
|
||||||
|
result = master->addRecord(pvRecord);
|
||||||
|
if(!result) cout<< "record " << recordName << " not added" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void exampleServerRegister(void)
|
static void exampleServerRegister(void)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user