61 Commits

Author SHA1 Message Date
dhickin
b8769aa0ca Fixed filenames of previous versions in html docs. 2014-12-04 17:17:22 +00:00
dhickin
a938f2325c Created dated version (20141009) of latest html doc. 2014-12-04 17:13:04 +00:00
dhickin
7743f3e3fd make "local" *.local files take precedence over those in TOP/.. 2014-12-03 16:52:01 +00:00
dhickin
e9ce6a2f0b include CONFIG_SITE.local instead of CONFIG.local at top-level. 2014-12-03 16:10:25 +00:00
Marty Kraimer
1ed48c15f1 Added tag 4.0.1 for changeset 541b0a7a645c 2014-11-11 07:07:34 -05:00
Marty Kraimer
d27f929595 merge from default branch 2014-11-11 06:52:56 -05:00
Matej Sekoranja
b4e17f271b win32 vs2013 compilation fix 2014-11-11 09:05:25 +01:00
Marty Kraimer
79f407486a in the future remove recordList since pvAccess provides pvlist 2014-11-10 10:24:07 -05:00
Matej Sekoranja
3c359728f7 Added tag 4.0.0 for changeset 85d46a2614f9 2014-10-29 13:17:22 +01:00
Matej Sekoranja
7b9693562a merge 2014-10-29 13:15:33 +01:00
Matej Sekoranja
f1c39ca5d2 clang compilation fixes 2014-10-16 07:30:42 +02:00
Marty Kraimer
16b1775b98 Added tag 4.0.0 for changeset 42dbe8a17f85 2014-10-15 08:37:24 -04:00
Marty Kraimer
f6ee7333bb merge changes from default 2014-10-15 07:29:49 -04:00
Matej Sekoranja
9f45bdfa75 missing epicsShareClass PowerSupply 2014-10-14 21:26:07 +02:00
Matej Sekoranja
03aa15b5f7 added missing lib for win32 2014-10-14 20:41:36 +02:00
Matej Sekoranja
8093952ca2 win32 test dll linkage 2014-10-14 07:40:34 +02:00
Marty Kraimer
2bea54e218 updated pvDatabaseCPP.html and TODO 2014-10-09 09:33:13 -04:00
dhickin
e81230dba5 Corrected spelling of synchrotron in licence. 2014-10-04 02:45:53 +01:00
dhickin
50b8f306c3 Spelling and typos. 2014-10-04 01:39:14 +01:00
Marty Kraimer
65be8e5678 Added tag 4.0.0 for changeset e2e041fa7d04 2014-10-01 09:01:22 -04:00
Marty Kraimer
dbb9310adc flow: Created branch 'release/4.0'. 2014-10-01 08:58:34 -04:00
Matej Sekoranja
50fbb396e8 win32 compilation of test and examples 2014-09-13 23:40:41 +02:00
Matej Sekoranja
ff19fe1cd8 win32 linkage 2014-09-13 23:01:29 +02:00
Matej Sekoranja
230938220e win compilation 2014-09-13 00:18:25 +02:00
Matej Sekoranja
334ed3b70a hopefully fixed windows exports 2014-09-12 10:00:00 +02:00
Marty Kraimer
4c7e51d8ad prepare documentation for pre release 2014-09-03 09:13:45 -04:00
Marty Kraimer
4973a6297e fixed bug in creating implementation of channelArray 2014-08-29 09:33:42 -04:00
Marty Kraimer
f0d1481a28 nanoSecond => nanosecond 2014-08-20 06:36:40 -04:00
Marty Kraimer
d5235db54c mainly documentation changes; did much testing 2014-08-11 14:18:49 -04:00
Marty Kraimer
b125035a11 fixed connection problems 2014-08-07 14:36:35 -04:00
Marty Kraimer
9551b0e4c6 fixed bugs in implementation of montor; connection problems still exist 2014-08-07 08:02:53 -04:00
Marty Kraimer
d6aa03815e changes because of ChannelArray API change; update TODO.md; add RELEASE_NOTES.html and TODO.html 2014-07-22 08:53:32 -04:00
Marty Kraimer
ce0d62fbbc changed upcoming release number. 2014-07-10 13:38:06 -04:00
Marty Kraimer
2fe3e66047 updated documentation; fixed bugs while updating documentation 2014-07-10 13:25:58 -04:00
dhickin
fa53d72258 Corrected includes for CONFIG_SITE files. 2014-07-02 12:27:00 +01:00
Marty Kraimer
b010cf0849 add some records for testing easyPVAJava 2014-07-02 07:11:50 -04:00
Matej Sekoranja
7fd707cb4b Added tag 3.1.0 for changeset 395f48d5196d 2014-07-02 00:12:37 +02:00
Marty Kraimer
5d823307f0 make records double00, ..., double04 2014-06-25 09:16:31 -04:00
Marty Kraimer
d41d5726d2 add records for testing easyPVAJava multiChannel 2014-06-24 15:05:19 -04:00
Matej Sekoranja
723f98bc44 added extern C on epicsExportRegistrar 2014-06-20 09:16:35 +02:00
Matej Sekoranja
1544147bdd win dll linkage 2014-06-20 08:56:39 +02:00
Matej Sekoranja
0447441cfa toString replaced with <<operator 2014-06-20 08:38:54 +02:00
Matej Sekoranja
8ce42ebb9a String -> std::string, toString methods removed, take 2 2014-06-19 14:55:44 +02:00
Matej Sekoranja
c39b966121 String -> std::string, toString methods removed 2014-06-19 14:30:40 +02:00
Marty Kraimer
61edf17cdf fix bug related to stride 2014-06-13 09:53:46 -04:00
Matej Sekoranja
39f537d7da win port: visibility declarations added/fixed 2014-06-13 11:43:22 +02:00
Matej Sekoranja
ba496de2d3 VxWorks fix: there is no Status::Status type 2014-06-13 11:04:29 +02:00
Marty Kraimer
38574ed76f support for ChannelArray UnionArray 2014-06-12 15:27:26 -04:00
Marty Kraimer
92be294bbf merge feature/changesAfter3_0_2; resolve conflicts 2014-06-10 15:53:37 -04:00
Marty Kraimer
35429bf4df flow: Merged <feature> 'changesAfter3_0_2' to <develop> ('default'). 2014-06-10 09:05:48 -04:00
Marty Kraimer
552925dfe6 flow: Closed <feature> 'changesAfter3_0_2'. 2014-06-10 08:55:18 -04:00
Marty Kraimer
d1791393ad Added tag before_merge_changesAfter3_0_2 for changeset abdc90bf52a0 2014-06-10 08:53:33 -04:00
Matej Sekoranja
3dbad700f7 channelList implemented 2014-06-09 22:19:52 +02:00
Marty Kraimer
c06e33e197 better implementation of ChannelArray::getLength 2014-06-09 07:55:08 -04:00
Marty Kraimer
1d8f01517a more work on stride 2014-06-06 11:28:41 -04:00
Marty Kraimer
8c1b142e48 working on support for stride for ChannelArray 2014-06-05 10:23:51 -04:00
Marty Kraimer
ca27cb5e3c changes for new pvAccess API 2014-06-04 10:48:12 -04:00
Marty Kraimer
a5fa17aca7 pvAccess added method cancel 2014-04-23 11:01:14 -04:00
Marty Kraimer
fe62a7181f use copy and monitor from pvDataCPP; imlement example plugin; algorithm => plugin 2014-04-23 09:25:58 -04:00
Marty Kraimer
342ab45dc8 changes for changesAfter3_0_2
pvCopy modified and moved to pvDataCPP
2014-04-01 14:07:43 -04:00
Marty Kraimer
127830e3c7 flow: Created branch 'feature/changesAfter3_0_2'. 2014-03-25 07:18:10 -04:00
137 changed files with 8972 additions and 2648 deletions

View File

@@ -7,5 +7,5 @@ db/
dbd/
documentation/html
envPaths
RELEASE.local
configure/.*\.local
/O\..*

View File

@@ -1 +1,9 @@
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

View File

@@ -2,7 +2,7 @@
Copyright (c) 2008 Martin R. Kraimer
Copyright (c) 2006 The University of Chicago, as Operator of Argonne
National Laboratory.
Copyright (c) 2006 Deutsches Elektronen-Synchroton,
Copyright (c) 2006 Deutsches Elektronen-Synchrotron,
Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY.
Copyright (c) 2007 Control System Laboratory,
(COSYLAB) Ljubljana Slovenia

View File

@@ -1,25 +1,27 @@
# Makefile for the EPICS V4 pvDatabase module
#Makefile at top of application tree
TOP = .
include $(TOP)/configure/CONFIG
DIRS := $(DIRS) $(filter-out $(DIRS), configure)
DIRS := $(DIRS) $(filter-out $(DIRS), src)
DIRS := $(DIRS) $(filter-out $(DIRS), test)
DIRS := $(DIRS) $(filter-out $(DIRS), arrayPerformance)
DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard example*))
DIRS := configure
EMBEDDED_TOPS := $(EMBEDDED_TOPS) $(filter-out $(EMBEDDED_TOPS), test)
EMBEDDED_TOPS := $(EMBEDDED_TOPS) $(filter-out $(EMBEDDED_TOPS), arrayPerformance)
EMBEDDED_TOPS := $(EMBEDDED_TOPS) $(filter-out $(EMBEDDED_TOPS), $(wildcard example*))
DIRS += src
src_DEPEND_DIRS = configure
define DIR_template
$(1)_DEPEND_DIRS = configure
endef
$(foreach dir, $(filter-out configure,$(DIRS)),$(eval $(call DIR_template,$(dir))))
EMBEDDED_TOPS := $(wildcard *Top)
EMBEDDED_TOPS += $(wildcard example*)
DIRS += $(EMBEDDED_TOPS)
define dir_DEP
define EMB_template
$(1)_DEPEND_DIRS = src
endef
$(foreach dir, $(EMBEDDED_TOPS),$(eval $(call EMB_template,$(dir))))
$(foreach dir, $(EMBEDDED_TOPS), $(eval $(call dir_DEP,$(dir))))
exampleDatabase_DEPEND_DIRS += testTop
examplePowerSupply_DEPEND_DIRS += testTop
#exampleDatabase_DEPEND_DIRS += test
#examplePowerSupply_DEPEND_DIRS += test
include $(TOP)/configure/RULES_TOP

View File

@@ -1,8 +1,6 @@
# Makefile at top of application tree
#Makefile at top of application tree
TOP = .
include $(TOP)/configure/CONFIG
DIRS += configure
DIRS += src

View File

@@ -14,11 +14,26 @@
# Set CHECK_RELEASE to NO to disable checking completely.
# Set CHECK_RELEASE to WARN to perform consistency checking but
# continue building anyway if conflicts are found.
CHECK_RELEASE = WARN
#CHECK_RELEASE = YES
# Set this when you only want to compile this application
# for a subset of the cross-compiled target architectures
# that Base is built for.
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040
# To install files into a location other than $(TOP) define
# INSTALL_LOCATION here.
#INSTALL_LOCATION=</path/name/to/install/top>
-include $(TOP)/../configure/CONFIG_SITE.local
# 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)/../configure/CONFIG_SITE.local

View File

@@ -1,4 +1,4 @@
# pvDatabaseCPP/arrayPerfTop RELEASE - Location of external support modules
# pvDatabaseCPP/arrayPerformance RELEASE - Location of external support modules
#
# IF YOU CHANGE this file or any file it includes you must
# subsequently do a "gnumake rebuild" in the application's
@@ -16,9 +16,8 @@
# EPICS V4 Developers: Do not edit the locations in this file!
#
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
# PVASRV = /path/to/epics/pvaSrvCPP
# Create a file RELEASE.local pointing to your places
# for the dependencies, e.g.
# PVACCESS = /path/to/epics/pvAccessCPP
# PVDATA = /path/to/epics/pvDataCPP
# PVCOMMON = /path/to/epics/pvCommonCPP
@@ -28,14 +27,14 @@
# use the following definitions:
PVDATABASE = $(TOP)/..
-include $(TOP)/../configure/RELEASE.local
-include $(TOP)/../../RELEASE.local
-include $(TOP)/../configure/RELEASE.local
# If you copied this example from pvDatabaseCPP to be built as a
# standalone TOP, adjust and use the following definitions:
# standalone TOP, define
# PVDATABASE = /path/to/epics/pvDatabaseCPP
# in the appropriate RELEASE[.local],
# and use the following definitions instead:
#PVDATABASE = /path/to/epics/pvDatabaseCPP
#-include $(TOP)/configure/RELEASE.local
#-include $(TOP)/../RELEASE.local
#-include $(TOP)/configure/RELEASE.local

View File

@@ -26,7 +26,7 @@ using std::endl;
using std::ostringstream;
ArrayPerformancePtr ArrayPerformance::create(
epics::pvData::String const & recordName,
std::string const & recordName,
size_t size,
double delay)
{
@@ -39,7 +39,7 @@ ArrayPerformancePtr ArrayPerformance::create(
}
ArrayPerformance::ArrayPerformance(
epics::pvData::String const & recordName,
std::string const & recordName,
epics::pvData::PVStructurePtr const & pvStructure,
size_t size,
double delay)
@@ -60,7 +60,7 @@ bool ArrayPerformance::init()
initPVRecord();
PVScalarArrayPtr pvScalarArray = getPVStructure()->getScalarArrayField("value",pvLong);
if(pvScalarArray==NULL) return false;
if(!pvScalarArray) return false;
pvValue = static_pointer_cast<PVLongArray>(pvScalarArray);
ArrayPerformancePtr xxx = dynamic_pointer_cast<ArrayPerformance>(getPtrSelf());
arrayPerformanceThread = ArrayPerformanceThreadPtr(new ArrayPerformanceThread(xxx));
@@ -182,14 +182,18 @@ void ArrayPerformanceThread::run()
nSinceLastReport = 0;
}
++nSinceLastReport;
shared_vector<int64> xxx(arrayPerformance->size,value++);
shared_vector<const int64> data(freeze(xxx));
arrayPerformance->lock();
try {
arrayPerformance->beginGroupPut();
arrayPerformance->pvValue->replace(data);
arrayPerformance->process();
arrayPerformance->endGroupPut();
if(arrayPerformance->getTraceLevel()>1) {
cout << "arrayPerformance size " << arrayPerformance->size;
cout << " value " << value +1 << endl;
}
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(...) {
arrayPerformance->unlock();
throw;

View File

@@ -17,7 +17,6 @@
# undef epicsExportSharedSymbols
#endif
#include <shareLib.h>
#include <epicsThread.h>
#include <pv/standardPVField.h>
#include <pv/timeStamp.h>
@@ -44,7 +43,7 @@ class epicsShareClass ArrayPerformance :
public:
POINTER_DEFINITIONS(ArrayPerformance);
static ArrayPerformancePtr create(
epics::pvData::String const & recordName,
std::string const & recordName,
size_t size,
double delay);
virtual ~ArrayPerformance();
@@ -53,7 +52,7 @@ public:
virtual void process();
virtual void destroy();
private:
ArrayPerformance(epics::pvData::String const & recordName,
ArrayPerformance(std::string const & recordName,
epics::pvData::PVStructurePtr const & pvStructure,
size_t size,
double delay);
@@ -81,7 +80,7 @@ private:
ArrayPerformancePtr arrayPerformance;
bool isDestroyed;
bool runReturned;
epics::pvData::String threadName;
std::string threadName;
epics::pvData::Mutex mutex;
epics::pvData::int64 value;
std::auto_ptr<epicsThread> thread;

View File

@@ -39,15 +39,15 @@ using namespace epics::pvDatabase;
int main(int argc,char *argv[])
{
bool result(false);
String recordName;
string recordName;
recordName = "arrayPerformance";
size_t size = 10000000;
double delay = .0001;
String providerName("local");
string providerName("local");
size_t nMonitor = 1;
int queueSize = 2;
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 << " delay providerName nMonitor queueSize waitTime" << endl;
cout << "default" << endl;
@@ -83,7 +83,7 @@ int main(int argc,char *argv[])
pvRecord = ArrayPerformance::create(recordName,size,delay);
result = master->addRecord(pvRecord);
PVRecordPtr arrayPreformance = pvRecord;
arrayPreformance->setTraceLevel(1);
arrayPreformance->setTraceLevel(0);
pvRecord = TraceRecord::create("traceRecordPGRPC");
result = master->addRecord(pvRecord);
if(!result) cout<< "record " << recordName << " not added" << endl;

View File

@@ -24,9 +24,10 @@ using std::tr1::dynamic_pointer_cast;
using std::cout;
using std::endl;
using std::ostringstream;
using std::string;
static String requesterName("longArrayGet");
static String request("value,timeStamp,alarm");
static string requesterName("longArrayGet");
static string request("value,timeStamp,alarm");
static epics::pvData::Mutex printMutex;
class LongArrayChannelRequester;
@@ -52,8 +53,8 @@ public:
isDestroyed = true;
longArrayChannelGet.reset();
}
virtual String getRequesterName() { return requesterName;}
virtual void message(String const & message, MessageType messageType)
virtual string getRequesterName() { return requesterName;}
virtual void message(string const & message, MessageType messageType)
{
Lock guard(printMutex);
cout << requesterName << " message " << message << endl;
@@ -93,18 +94,21 @@ public:
isDestroyed = true;
longArrayChannelGet.reset();
}
virtual String getRequesterName() { return requesterName;}
virtual void message(String const & message, MessageType messageType)
virtual string getRequesterName() { return requesterName;}
virtual void message(string const & message, MessageType messageType)
{
Lock guard(printMutex);
cout << requesterName << " message " << message << endl;
}
virtual void channelGetConnect(
Status const & status,
ChannelGet::shared_pointer const & channelGet,
StructureConstPtr const &structure);
virtual void getDone(
Status const & status,
ChannelGet::shared_pointer const & channelGet,
PVStructurePtr const &pvStructure,
BitSetPtr const &bitSet);
virtual void getDone(Status const & status);
BitSetPtr const & bitSet);
private:
LongArrayChannelGetRequesterPtr getPtrSelf()
{
@@ -123,8 +127,8 @@ class LongArrayChannelGet :
{
public:
LongArrayChannelGet(
String providerName,
String channelName,
string providerName,
string channelName,
int iterBetweenCreateChannel,
int iterBetweenCreateChannelGet,
double delayTime)
@@ -141,7 +145,7 @@ public:
bool init();
virtual void destroy();
virtual void run();
void message(String const & message, MessageType messageType)
void message(string const & message, MessageType messageType)
{
Lock guard(printMutex);
cout << requesterName << " message " << message << endl;
@@ -155,23 +159,26 @@ public:
virtual void channelGetConnect(
Status const & status,
ChannelGet::shared_pointer const & channelGet,
StructureConstPtr const &structure);
virtual void getDone(
Status const & status,
ChannelGet::shared_pointer channelGet,
PVStructurePtr const &pvStructure,
BitSetPtr const &bitSet);
virtual void getDone(Status const & status);
BitSetPtr const & bitSet);
private:
LongArrayChannelGetPtr getPtrSelf()
{
return shared_from_this();
}
size_t checkResult();
String providerName;
String channelName;
string providerName;
string channelName;
int iterBetweenCreateChannel;
int iterBetweenCreateChannelGet;
double delayTime;
bool isDestroyed;
bool runReturned;
epics::pvData::String threadName;
std::string threadName;
Status status;
Event event;
Mutex mutex;
@@ -197,7 +204,7 @@ void LongArrayChannelRequester::channelStateChange(
Channel::shared_pointer const & channel,
Channel::ConnectionState connectionState)
{
String mess(Channel::ConnectionStateNames[connectionState]);
string mess(Channel::ConnectionStateNames[connectionState]);
message(mess,infoMessage);
Lock guard(mutex);
if(isDestroyed) return;
@@ -206,21 +213,24 @@ void LongArrayChannelRequester::channelStateChange(
void LongArrayChannelGetRequester::channelGetConnect(
Status const & status,
ChannelGet::shared_pointer const & channelGet,
PVStructurePtr const &pvStructure,
BitSetPtr const &bitSet)
ChannelGet::shared_pointer const & channelGet,
StructureConstPtr const &structure)
{
Lock guard(mutex);
if(isDestroyed) return;
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);
if(isDestroyed) return;
longArrayChannelGet->getDone(status);
longArrayChannelGet->getDone(status,channelGet,pvStructure,bitSet);
}
void LongArrayChannelGet::channelCreated(
@@ -241,12 +251,10 @@ void LongArrayChannelGet::channelStateChange(
(connectionState==Channel::CONNECTED ? infoMessage : errorMessage);
message("channelStateChange",messageType);
}
void LongArrayChannelGet::channelGetConnect(
Status const & status,
ChannelGet::shared_pointer const & channelGet,
PVStructurePtr const &pvStructure,
BitSetPtr const &bitSet)
StructureConstPtr const &structure)
{
this->status = status;
if(!status.isOK()) {
@@ -255,13 +263,12 @@ void LongArrayChannelGet::channelGetConnect(
return;
}
this->channelGet = channelGet;
this->pvStructure = pvStructure;
this->bitSet = bitSet;
bool structureOK(true);
PVStructurePtr pvStructure = getPVDataCreate()->createPVStructure(structure);
PVFieldPtr pvField = pvStructure->getSubField("timeStamp");
if(pvField==NULL) structureOK = false;
if(!pvField) structureOK = false;
pvField = pvStructure->getSubField("value");
if(pvField==NULL) {
if(!pvField) {
structureOK = false;
} else {
FieldConstPtr field = pvField->getField();
@@ -273,7 +280,7 @@ void LongArrayChannelGet::channelGetConnect(
}
}
if(!structureOK) {
String mess("channelGetConnect: illegal structure");
string mess("channelGetConnect: illegal structure");
message(mess,errorMessage);
this->status = Status(Status::STATUSTYPE_ERROR,mess);
}
@@ -284,8 +291,8 @@ void LongArrayChannelGet::channelGetConnect(
bool LongArrayChannelGet::init()
{
ChannelProvider::shared_pointer channelProvider =
getChannelAccess()->getProvider(providerName);
if(channelProvider==NULL) {
getChannelProviderRegistry()->getProvider(providerName);
if(!channelProvider) {
cout << "provider " << providerName << " not found" << endl;
return false;
}
@@ -298,7 +305,7 @@ bool LongArrayChannelGet::init()
if(!status.isOK()) return false;
CreateRequest::shared_pointer createRequest = CreateRequest::create();
PVStructurePtr pvRequest = createRequest->createRequest(request);
if(pvRequest==NULL) {
if(!pvRequest) {
cout << "request logic error " << createRequest->getMessage() << endl;
return false;
}
@@ -327,10 +334,10 @@ void LongArrayChannelGet::destroy()
if(runReturned) break;
epicsThreadSleep(.01);
}
if(longArrayChannelRequester!=NULL) {
if(longArrayChannelRequester) {
longArrayChannelRequester->destroy();
}
if(longArrayChannelGetRequester!=NULL) {
if(longArrayChannelGetRequester) {
longArrayChannelGetRequester->destroy();
}
thread->exitWait();
@@ -355,7 +362,7 @@ void LongArrayChannelGet::run()
int numChannelCreate = 0;
size_t nElements = 0;
while(true) {
channelGet->get(false);
channelGet->get();
event.wait();
if(isDestroyed) {
runReturned = true;
@@ -398,7 +405,7 @@ void LongArrayChannelGet::run()
longArrayChannelRequester->destroy();
channel->destroy();
ChannelProvider::shared_pointer channelProvider =
getChannelAccess()->getProvider(providerName);
getChannelProviderRegistry()->getProvider(providerName);
longArrayChannelRequester.reset(new LongArrayChannelRequester(getPtrSelf()));
channel = channelProvider->createChannel(
channelName,
@@ -426,7 +433,7 @@ void LongArrayChannelGet::run()
CreateRequest::create();
PVStructurePtr pvRequest =
createRequest->createRequest(request);
if(pvRequest==NULL) {
if(!pvRequest) {
cout << "request logic error " << createRequest->getMessage() << endl;
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();
}
@@ -477,8 +488,8 @@ size_t LongArrayChannelGet::checkResult()
LongArrayGetPtr LongArrayGet::create(
String const &providerName,
String const & channelName,
string const &providerName,
string const & channelName,
int iterBetweenCreateChannel,
int iterBetweenCreateChannelGet,
double delayTime)
@@ -495,8 +506,8 @@ LongArrayGetPtr LongArrayGet::create(
}
LongArrayGet::LongArrayGet(
String const &providerName,
String const & channelName,
string const &providerName,
string const & channelName,
int iterBetweenCreateChannel,
int iterBetweenCreateChannelGet,
double delayTime)

View File

@@ -17,8 +17,6 @@
# undef epicsExportSharedSymbols
#endif
#include <shareLib.h>
#include <pv/event.h>
#include <pv/lock.h>
#include <pv/standardPVField.h>
@@ -49,8 +47,8 @@ class epicsShareClass LongArrayGet :
public:
POINTER_DEFINITIONS(LongArrayGet);
static LongArrayGetPtr create(
epics::pvData::String const & providerName,
epics::pvData::String const & channelName,
std::string const & providerName,
std::string const & channelName,
int iterBetweenCreateChannel = 0,
int iterBetweenCreateChannelGet = 0,
double delayTime = 0.0);
@@ -62,15 +60,15 @@ private:
return shared_from_this();
}
LongArrayGet(
epics::pvData::String const & providerName,
epics::pvData::String const & channelName,
std::string const & providerName,
std::string const & channelName,
int iterBetweenCreateChannel = 0,
int iterBetweenCreateChannelGet = 0,
double delayTime = 0.0);
bool init();
epics::pvData::String providerName;
epics::pvData::String channelName;
std::string providerName;
std::string channelName;
int iterBetweenCreateChannel;
int iterBetweenCreateChannelGet;
double delayTime;

View File

@@ -38,11 +38,11 @@ using namespace epics::pvDatabase;
int main(int argc,char *argv[])
{
String channelName("arrayPerformance");
string channelName("arrayPerformance");
int iterBetweenCreateChannel = 0;
int iterBetweenCreateChannelGet = 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 << "iterBetweenCreateChannel iterBetweenCreateChannelGet delayTime" << endl;
cout << "default" << endl;

View File

@@ -25,11 +25,12 @@ using std::tr1::static_pointer_cast;
using std::tr1::dynamic_pointer_cast;
using std::cout;
using std::endl;
using std::string;
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;
}
@@ -43,8 +44,8 @@ public:
{}
virtual ~LAMChannelRequester(){}
virtual void destroy(){longArrayMonitor.reset();}
virtual String getRequesterName() { return requesterName;}
virtual void message(String const & message, MessageType messageType)
virtual string getRequesterName() { return requesterName;}
virtual void message(string const & message, MessageType messageType)
{ messagePvt(message,messageType);}
virtual void channelCreated(const Status& status, Channel::shared_pointer const & channel);
virtual void channelStateChange(Channel::shared_pointer const & channel, Channel::ConnectionState connectionState);
@@ -83,8 +84,8 @@ public:
void init();
virtual void destroy();
virtual void run();
virtual String getRequesterName() { return requesterName;}
virtual void message(String const & message, MessageType messageType)
virtual string getRequesterName() { return requesterName;}
virtual void message(string const & message, MessageType messageType)
{ messagePvt(message,messageType);}
virtual void monitorConnect(Status const & status,
MonitorPtr const & monitor, StructureConstPtr const & structure);
@@ -95,7 +96,7 @@ private:
double waitTime;
bool isDestroyed;
bool runReturned;
epics::pvData::String threadName;
std::string threadName;
Event event;
Mutex mutex;
std::auto_ptr<epicsThread> thread;
@@ -137,9 +138,9 @@ void LAMMonitorRequester::monitorConnect(Status const & status,
}
bool structureOK(true);
FieldConstPtr field = structure->getField("timeStamp");
if(field==NULL) structureOK = false;
if(!field) structureOK = false;
field = structure->getField("value");
if(field==NULL) {
if(!field) {
structureOK = false;
} else {
if(field->getType()!=scalarArray) {
@@ -150,7 +151,7 @@ void LAMMonitorRequester::monitorConnect(Status const & status,
}
}
if(!structureOK) {
String message("monitorConnect: illegal structure");
string message("monitorConnect: illegal structure");
messagePvt(message,errorMessage);
longArrayMonitor->status = Status(Status::STATUSTYPE_ERROR,message);
}
@@ -178,9 +179,9 @@ void LAMMonitorRequester::run()
{
Lock xx(mutex);
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);
pvTimeStamp.attach(pvStructure->getSubField("timeStamp"));
pvTimeStamp.get(timeStamp);
@@ -200,12 +201,8 @@ void LAMMonitorRequester::run()
out << "first " << first << " last " << last ;
BitSetPtr changed = monitorElement->changedBitSet;
BitSetPtr overrun = monitorElement->overrunBitSet;
String buffer;
changed->toString(&buffer);
out << " changed " << buffer;
buffer.clear();
overrun->toString(&buffer);
out << " overrun " << buffer;
out << " changed " << *changed;
out << " overrun " << *overrun;
double elementsPerSec = nElements;
elementsPerSec /= diff;
if(elementsPerSec>10.0e9) {
@@ -246,8 +243,8 @@ void LAMMonitorRequester::unlisten(MonitorPtr const & monitor)
LongArrayMonitorPtr LongArrayMonitor::create(
String const &providerName,
String const & channelName,
string const &providerName,
string const & channelName,
int queueSize,
double waitTime)
{
@@ -261,30 +258,31 @@ LongArrayMonitor::LongArrayMonitor() {}
LongArrayMonitor::~LongArrayMonitor() {}
bool LongArrayMonitor::init(
String const &providerName,
String const &channelName,
string const &providerName,
string const &channelName,
int queueSize,
double waitTime)
{
channelRequester = LAMChannelRequesterPtr(new LAMChannelRequester(getPtrSelf()));
monitorRequester = LAMMonitorRequesterPtr(new LAMMonitorRequester(getPtrSelf(),waitTime));
monitorRequester->init();
ChannelProvider::shared_pointer channelProvider = getChannelAccess()->getProvider(providerName);
if(channelProvider==NULL) {
ChannelProvider::shared_pointer channelProvider =
getChannelProviderRegistry()->getProvider(providerName);
if(!channelProvider) {
cout << "provider " << providerName << " not found" << endl;
return false;
}
channel = channelProvider->createChannel(channelName,channelRequester,0);
event.wait();
if(!status.isOK()) return false;
String request("record[queueSize=");
string request("record[queueSize=");
char buff[20];
sprintf(buff,"%d",queueSize);
request += buff;
request += "]field(value,timeStamp,alarm)";
CreateRequest::shared_pointer createRequest = CreateRequest::create();
PVStructurePtr pvRequest = createRequest->createRequest(request);
if(pvRequest==NULL) {
if(!pvRequest) {
cout << "request logic error " << createRequest->getMessage() << endl;
return false;
}

View File

@@ -16,7 +16,6 @@
# undef epicsExportSharedSymbols
#endif
#include <shareLib.h>
#include <pv/event.h>
#include <pv/lock.h>
#include <pv/standardPVField.h>
@@ -49,8 +48,8 @@ class epicsShareClass LongArrayMonitor :
public:
POINTER_DEFINITIONS(LongArrayMonitor);
static LongArrayMonitorPtr create(
epics::pvData::String const & providerName,
epics::pvData::String const & channelName,
std::string const & providerName,
std::string const & channelName,
int queueSize = 1,
double waitTime = 0.0);
~LongArrayMonitor();
@@ -60,8 +59,8 @@ public:
private:
static epics::pvData::Mutex printMutex;
bool init(
epics::pvData::String const & providerName,
epics::pvData::String const & channelName,
std::string const & providerName,
std::string const & channelName,
int queueSize,
double waitTime);
LongArrayMonitorPtr getPtrSelf()

View File

@@ -38,10 +38,10 @@ using namespace epics::pvDatabase;
int main(int argc,char *argv[])
{
String channelName("arrayPerformance");
string channelName("arrayPerformance");
int queueSize = 2;
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 << "default" << endl;
cout << "longArrayMonitorMain " << channelName << " ";

View File

@@ -24,9 +24,10 @@ using std::tr1::dynamic_pointer_cast;
using std::cout;
using std::endl;
using std::ostringstream;
using std::string;
static String requesterName("longArrayPut");
static String request("value");
static string requesterName("longArrayPut");
static string request("value");
static epics::pvData::Mutex printMutex;
class LongArrayChannelPut :
@@ -37,8 +38,8 @@ class LongArrayChannelPut :
{
public:
LongArrayChannelPut(
String providerName,
String channelName,
string providerName,
string channelName,
size_t arraySize,
int iterBetweenCreateChannel,
int iterBetweenCreateChannelPut,
@@ -57,8 +58,8 @@ public:
bool init();
virtual void destroy();
virtual void run();
virtual String getRequesterName() { return requesterName;}
virtual void message(String const & message, MessageType messageType)
virtual string getRequesterName() { return requesterName;}
virtual void message(string const & message, MessageType messageType)
{
Lock guard(printMutex);
cout << requesterName << " message " << message << endl;
@@ -70,26 +71,31 @@ public:
Channel::shared_pointer const & channel,
Channel::ConnectionState connectionState);
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,
ChannelPut::shared_pointer const & channelPut,
PVStructurePtr const &pvStructure,
BitSetPtr const &bitSet);
virtual void putDone(Status const & status);
virtual void getDone(Status const & status){}
BitSetPtr const & bitSet){}
private:
LongArrayChannelPutPtr getPtrSelf()
{
return shared_from_this();
}
String providerName;
String channelName;
string providerName;
string channelName;
size_t arraySize;
int iterBetweenCreateChannel;
int iterBetweenCreateChannelPut;
double delayTime;
bool isDestroyed;
bool runReturned;
epics::pvData::String threadName;
std::string threadName;
Status status;
Event event;
Mutex mutex;
@@ -103,8 +109,8 @@ private:
bool LongArrayChannelPut::init()
{
ChannelProvider::shared_pointer channelProvider = getChannelAccess()->getProvider(providerName);
if(channelProvider==NULL) {
ChannelProvider::shared_pointer channelProvider = getChannelProviderRegistry()->getProvider(providerName);
if(!channelProvider) {
cout << "provider " << providerName << " not found" << endl;
return false;
}
@@ -113,7 +119,7 @@ bool LongArrayChannelPut::init()
if(!status.isOK()) return false;
CreateRequest::shared_pointer createRequest = CreateRequest::create();
PVStructurePtr pvRequest = createRequest->createRequest(request);
if(pvRequest==NULL) {
if(!pvRequest) {
cout << "request logic error " << createRequest->getMessage() << endl;
return false;
}
@@ -168,8 +174,7 @@ void LongArrayChannelPut::channelStateChange(
void LongArrayChannelPut::channelPutConnect(
Status const & status,
ChannelPut::shared_pointer const & channelPut,
PVStructurePtr const &pvStructure,
BitSetPtr const &bitSet)
StructureConstPtr const &structure)
{
this->status = status;
if(!status.isOK()) {
@@ -178,11 +183,11 @@ void LongArrayChannelPut::channelPutConnect(
return;
}
this->channelPut = channelPut;
this->pvStructure = pvStructure;
this->bitSet = bitSet;
pvStructure = getPVDataCreate()->createPVStructure(structure);
bitSet = BitSetPtr(new BitSet(pvStructure->getNumberFields()));
bool structureOK(true);
PVFieldPtr pvField = pvStructure->getSubField("value");
if(pvField==NULL) {
if(!pvField) {
structureOK = false;
} else {
FieldConstPtr field = pvField->getField();
@@ -194,7 +199,7 @@ void LongArrayChannelPut::channelPutConnect(
}
}
if(!structureOK) {
String mess("channelPutConnect: illegal structure");
string mess("channelPutConnect: illegal structure");
message(mess,errorMessage);
this->status = Status(Status::STATUSTYPE_ERROR,mess);
}
@@ -222,7 +227,7 @@ void LongArrayChannelPut::run()
shared_vector<const int64> data(freeze(xxx));
pvLongArray->replace(data);
bitSet->set(pvLongArray->getFieldOffset());
channelPut->put(false);
channelPut->put(pvStructure,bitSet);
event.wait();
if(isDestroyed) {
runReturned = true;
@@ -262,9 +267,8 @@ void LongArrayChannelPut::run()
if(iterBetweenCreateChannel!=0) {
if(numChannelCreate>=iterBetweenCreateChannel) {
channel->destroy();
epicsThreadSleep(1.0);
ChannelProvider::shared_pointer channelProvider =
getChannelAccess()->getProvider(providerName);
getChannelProviderRegistry()->getProvider(providerName);
channel = channelProvider->createChannel(
channelName,getPtrSelf(),0);
event.wait();
@@ -290,7 +294,7 @@ void LongArrayChannelPut::run()
channelPut->destroy();
CreateRequest::shared_pointer createRequest = CreateRequest::create();
PVStructurePtr pvRequest = createRequest->createRequest(request);
if(pvRequest==NULL) {
if(!pvRequest) {
cout << "request logic error " << createRequest->getMessage() << endl;
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();
}
LongArrayPutPtr LongArrayPut::create(
String const &providerName,
String const & channelName,
string const &providerName,
string const & channelName,
size_t arraySize,
int iterBetweenCreateChannel,
int iterBetweenCreateChannelPut,
@@ -337,8 +343,8 @@ LongArrayPutPtr LongArrayPut::create(
}
LongArrayPut::LongArrayPut(
String const &providerName,
String const & channelName,
string const &providerName,
string const & channelName,
size_t arraySize,
int iterBetweenCreateChannel,
int iterBetweenCreateChannelPut,

View File

@@ -17,7 +17,6 @@
# undef epicsExportSharedSymbols
#endif
#include <shareLib.h>
#include <pv/event.h>
#include <pv/lock.h>
#include <pv/standardPVField.h>
@@ -48,8 +47,8 @@ class epicsShareClass LongArrayPut :
public:
POINTER_DEFINITIONS(LongArrayPut);
static LongArrayPutPtr create(
epics::pvData::String const & providerName,
epics::pvData::String const & channelName,
std::string const & providerName,
std::string const & channelName,
size_t arraySize = 100,
int iterBetweenCreateChannel = 0,
int iterBetweenCreateChannelPut = 0,
@@ -62,16 +61,16 @@ private:
return shared_from_this();
}
LongArrayPut(
epics::pvData::String const & providerName,
epics::pvData::String const & channelName,
std::string const & providerName,
std::string const & channelName,
size_t arraySize,
int iterBetweenCreateChannel,
int iterBetweenCreateChannelPut,
double delayTime);
bool init();
epics::pvData::String providerName;
epics::pvData::String channelName;
std::string providerName;
std::string channelName;
size_t arraySize;
int iterBetweenCreateChannel;
int iterBetweenCreateChannelPut;

View File

@@ -38,12 +38,12 @@ using namespace epics::pvDatabase;
int main(int argc,char *argv[])
{
String channelName("arrayPerformance");
string channelName("arrayPerformance");
size_t arraySize = 10;
int iterBetweenCreateChannel = 0;
int iterBetweenCreateChannelPut = 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 << "iterBetweenCreateChannel iterBetweenCreateChannelPut delayTime" << endl;
cout << "default" << endl;

View File

@@ -140,7 +140,7 @@ int main(int argc,char *argv[])
size_t size = 50000000;
double delay = .01;
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 << "default" << endl;
cout << "vectorPerformance ";

View File

@@ -14,11 +14,14 @@
# Set CHECK_RELEASE to NO to disable checking completely.
# Set CHECK_RELEASE to WARN to perform consistency checking but
# continue building anyway if conflicts are found.
CHECK_RELEASE = YES
#CHECK_RELEASE = YES
# To install files into a location other than $(TOP) define
# INSTALL_LOCATION here.
#INSTALL_LOCATION=</path/name/to/install/top>
INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv
USR_INCLUDES += -I $(INSTALL_LOCATION)/include
-include $(TOP)/../CONFIG_SITE.local
-include $(TOP)/configure/CONFIG_SITE.local
-include $(TOP)/../CONFIG.local

View File

@@ -1,11 +1,8 @@
# Sample RELEASE.local file
V4 = /home/install/epics/v4
PVASRV = $(V4)/pvaSrv
PVACCESS = $(V4)/pvAccessCPP
PVDATA = $(V4)/pvDataCPP
PVCOMMON = $(V4)/pvCommonCPP
EPICS_BASE = /home/install/epics/base-3.14.12.3
TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top
EPICS_BASE=/home/install/epics/base
PVCOMMON=/home/hg/pvCommonCPP
PVDATA=/home/hg/pvDataCPP
PVACCESS=/home/hg/pvAccessCPP
PVASRV=/home/hg/pvaSrv

View File

@@ -24,5 +24,5 @@
# PVCOMMON = /path/to/epics/pvCommonCPP
# EPICS_BASE = /path/to/epics/base
-include $(TOP)/configure/RELEASE.local
-include $(TOP)/../RELEASE.local
-include $(TOP)/configure/RELEASE.local

View 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>

View 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
View 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
View 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

View File

@@ -46,7 +46,7 @@
</dd>
<dt>This version:</dt>
<dd><a
href="pvDatabaseCPP.html">pvDatabaseCPP.html</a>
href="pvDatabaseCPP_20121127.html">pvDatabaseCPP_20121127.html</a>
</dd>
<dt>Previous version:</dt>
<dd>None</dd>

View File

@@ -46,7 +46,7 @@
</dd>
<dt>This version:</dt>
<dd><a
href="pvDatabaseCPP_20121211.html">pvDatabaseCPP20121211.html</a>
href="pvDatabaseCPP_20121211.html">pvDatabaseCPP_20121211.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a

View File

@@ -46,11 +46,11 @@
</dd>
<dt>This version:</dt>
<dd><a
href="pvDatabaseCPP_20130417.html">pvDatabaseCPP20130417.html</a>
href="pvDatabaseCPP_20130417.html">pvDatabaseCPP_20130417.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href="pvDatabaseCPP_20121211.html">pvDatabaseCPP20121211.html</a>
href="pvDatabaseCPP_20121211.html">pvDatabaseCPP_20121211.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

View File

@@ -46,11 +46,11 @@
</dd>
<dt>This version:</dt>
<dd><a
href="pvDatabaseCPP_20130516.html">pvDatabaseCPP20130516.html</a>
href="pvDatabaseCPP_20130516.html">pvDatabaseCPP_20130516.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href="pvDatabaseCPP_20130417.html">pvDatabaseCPP20130417.html</a>
href="pvDatabaseCPP_20130417.html">pvDatabaseCPP_20130417.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

View File

@@ -46,11 +46,11 @@
</dd>
<dt>This version:</dt>
<dd><a
href="pvDatabaseCPP_20130523.html">pvDatabaseCPP20130523.html</a>
href="pvDatabaseCPP_20130523.html">pvDatabaseCPP_20130523.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href="pvDatabaseCPP_20130516.html">pvDatabaseCPP20130516.html</a>
href="pvDatabaseCPP_20130516.html">pvDatabaseCPP_20130516.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

View File

@@ -46,11 +46,11 @@
</dd>
<dt>This version:</dt>
<dd><a
href="pvDatabaseCPP_20130627.html">pvDatabaseCPP20130627.html</a>
href="pvDatabaseCPP_20130627.html">pvDatabaseCPP_20130627.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href="pvDatabaseCPP_20130523.html">pvDatabaseCPP20130523.html</a>
href="pvDatabaseCPP_20130523.html">pvDatabaseCPP_20130523.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

View File

@@ -46,11 +46,11 @@
</dd>
<dt>This version:</dt>
<dd><a
href= "pvDatabaseCPP_20130725.html">pvDatabaseCPP20130725.html</a>
href= "pvDatabaseCPP_20130725.html">pvDatabase_CPP20130725.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href="pvDatabaseCPP_20130627.html">pvDatabaseCPP20130627.html</a>
href="pvDatabaseCPP_20130627.html">pvDatabase_CPP20130627.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

View File

@@ -46,10 +46,10 @@
</dd>
<dt>This version:</dt>
<dd><a
href= "pvDatabaseCPP_20130828.html">pvDatabaseCPP20130828.html</a>
href= "pvDatabaseCPP_20130828.html">pvDatabase_CPP20130828.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a href="pvDatabaseCPP_20130725.html">pvDatabaseCPP20130725.html</a>
<dd><a href="pvDatabaseCPP_20130725.html">pvDatabase_CPP20130725.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

View File

@@ -46,11 +46,11 @@
</dd>
<dt>This version:</dt>
<dd><a
href= "pvDatabaseCPP_20130904.html">pvDatabaseCPP20130904.html</a>
href= "pvDatabaseCPP_20130904.html">pvDatabaseCPP_20130904.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href= "pvDatabaseCPP_20130828.html">pvDatabaseCPP20130828.html</a>
href= "pvDatabaseCPP_20130828.html">pvDatabaseCPP_20130828.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

View File

@@ -46,11 +46,11 @@
</dd>
<dt>This version:</dt>
<dd><a
href= "pvDatabaseCPP_20131112.html">pvDatabaseCPP20131112.html</a>
href= "pvDatabaseCPP_20131112.html">pvDatabaseCPP_20131112.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href= "pvDatabaseCPP_20130904.html">pvDatabaseCPP20130904.html</a>
href= "pvDatabaseCPP_20130904.html">pvDatabaseCPP_20130904.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

View File

@@ -46,11 +46,11 @@
</dd>
<dt>This version:</dt>
<dd><a
href= "pvDatabaseCPP_20131113.html">pvDatabaseCPP20131113.html</a>
href= "pvDatabaseCPP_20131113.html">pvDatabaseCPP_20131113.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href= "pvDatabaseCPP_20131112.html">pvDatabaseCPP20131112.html</a>
href= "pvDatabaseCPP_20131112.html">pvDatabaseCPP_20131112.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

View File

@@ -46,11 +46,11 @@
</dd>
<dt>This version:</dt>
<dd><a
href= "pvDatabaseCPP_20131120.html">pvDatabaseCPP20131120.html</a>
href= "pvDatabaseCPP_20131120.html">pvDatabaseCPP_20131120.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href= "pvDatabaseCPP_20131112.html">pvDatabaseCPP20131112.html</a>
href= "pvDatabaseCPP_20131112.html">pvDatabaseCPP_20131112.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

View File

@@ -46,11 +46,11 @@
</dd>
<dt>This version:</dt>
<dd><a
href= "pvDatabaseCPP_20131121.html">pvDatabaseCPP20131121.html</a>
href= "pvDatabaseCPP_20131121.html">pvDatabaseCPP_20131121.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href= "pvDatabaseCPP_20131120.html">pvDatabaseCPP20131120.html</a>
href= "pvDatabaseCPP_20131120.html">pvDatabaseCPP_20131120.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

View File

@@ -46,11 +46,11 @@
</dd>
<dt>This version:</dt>
<dd><a
href= "pvDatabaseCPP_20140207.html">pvDatabaseCPP20140207.html</a>
href= "pvDatabaseCPP_20140207.html">pvDatabaseCPP_20140207.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href= "pvDatabaseCPP_20131121.html">pvDatabaseCPP20131121.html</a>
href= "pvDatabaseCPP_20131121.html">pvDatabaseCPP_20131121.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

View File

@@ -46,11 +46,11 @@
</dd>
<dt>This version:</dt>
<dd><a
href= "pvDatabaseCPP_20140219.html">pvDatabaseCPP20140219.html</a>
href= "pvDatabaseCPP_20140219.html">pvDatabaseCPP_20140219.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href= "pvDatabaseCPP_20140207.html">pvDatabaseCPP20140207.html</a>
href= "pvDatabaseCPP_20140207.html">pvDatabaseCPP_20140207.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -20,5 +20,8 @@ CHECK_RELEASE = WARN
# INSTALL_LOCATION here.
#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)/../configure/CONFIG_SITE.local

View File

@@ -27,7 +27,7 @@
# If this example is built in a directory under pvDatabaseCPP,
# use the following definitions:
PVDATABASETEST = $(TOP)/../testTop
PVDATABASETEST = $(TOP)/../test
PVDATABASE = $(TOP)/..
-include $(TOP)/../configure/RELEASE.local

View File

@@ -17,6 +17,7 @@ DB += dbString.db
DB += dbStringArray.db
DB += dbEnum.db
DB += dbCounter.db
DB += dbDouble.db
#----------------------------------------------------
# If <anyname>.db template is not named <anyname>*.template add

View File

@@ -0,0 +1,3 @@
record(ao, "$(name)")
{
}

View File

@@ -3,23 +3,26 @@ TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
#==================================================
# Build an IOC support library
#
DBD += exampleDatabase.dbd
exampleDatabase_DBD += base.dbd
exampleDatabase_DBD += PVAServerRegister.dbd
exampleDatabase_DBD += registerChannelProviderLocal.dbd
exampleDatabase_DBD += dbPv.dbd
exampleDatabase_DBD += powerSupplyRegister.dbd
exampleDatabase_DBD += exampleDatabaseRegister.dbd
#=============================
# build an ioc application
PROD_IOC += exampleDatabase
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
exampleDatabase_SRCS += exampleDatabase_registerRecordDeviceDriver.cpp
exampleDatabase_SRCS_DEFAULT += exampleDatabaseMain.cpp
exampleDatabase_SRCS_vxWorks += -nil-
# The following adds support from base/src/vxWorks
exampleDatabase_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary

View File

@@ -0,0 +1,7 @@
include "base.dbd"
include "PVAServerRegister.dbd"
include "registerChannelProviderLocal.dbd"
include "dbPv.dbd"
include "powerSupplyRegister.dbd"
registrar("exampleDatabaseRegister")
registrar("exampleMonitorPluginRegister")

View File

@@ -7,15 +7,23 @@ dbLoadDatabase("dbd/exampleDatabase.dbd")
exampleDatabase_registerRecordDeviceDriver(pdbbase)
## 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/dbEnum.db","name=enum01")
dbLoadRecords("db/dbCounter.db","name=counter01");
dbLoadRecords("db/dbArray.db","name=doubleArray,type=DOUBLE");
cd ${TOP}/iocBoot/${IOC}
iocInit()
dbl
epicsThreadSleep(2.0)
exampleDatabase
exampleMonitorPlugin
startPVAServer
pvdbl

View File

@@ -4,17 +4,21 @@ include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
DBD += exampleDatabaseRegister.dbd
DBD += exampleDatabase.dbd
INC += exampleDatabase.h
INC += exampleMonitorPlugin.h
LIBRARY += exampleDatabase
exampleDatabase_SRCS += exampleDatabase.cpp
exampleDatabase_SRCS += exampleMonitorPlugin.cpp
exampleDatabase_SRCS += exampleDatabaseRegister.cpp
exampleDatabase_SRCS += exampleMonitorPluginRegister.cpp
exampleDatabase_LIBS += powerSupply
exampleDatabase_LIBS += pvDatabase
exampleDatabase_LIBS += pvAccess
exampleDatabase_LIBS += pvData
exampleDatabase_LIBS += Com
exampleDatabase_LIBS += $(EPICS_BASE_IOC_LIBS)
PROD_HOST += exampleDatabaseMain

View File

@@ -26,8 +26,10 @@
#include <pv/recordList.h>
#include <pv/traceRecord.h>
#include <powerSupply.h>
#include <exampleDatabase.h>
#include <pv/powerSupply.h>
#define epicsExportSharedSymbols
#include <pv/exampleDatabase.h>
using namespace std;
using std::tr1::static_pointer_cast;
@@ -42,18 +44,57 @@ static StandardPVFieldPtr standardPVField = getStandardPVField();
static void createStructureArrayRecord(
PVDatabasePtr const &master,
ScalarType scalarType,
String const &recordName)
string const &recordName)
{
StructureConstPtr structure = standardField->scalar(
pvDouble,
String("value,alarm,timeStamp"));
StringArray names(2);
FieldConstPtrArray fields(2);
names[0] = "timeStamp";
names[0] = "name";
names[1] = "value";
fields[0] = standardField->timeStamp();
fields[1] = fieldCreate->createStructureArray(structure);
fields[0] = fieldCreate->createScalar(pvString);
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);
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(top);
PVRecordPtr pvRecord = PVRecord::create(recordName,pvStructure);
@@ -64,10 +105,10 @@ static void createStructureArrayRecord(
static void createRecords(
PVDatabasePtr const &master,
ScalarType scalarType,
String const &recordNamePrefix,
String const &properties)
string const &recordNamePrefix,
string const &properties)
{
String recordName = recordNamePrefix;
string recordName = recordNamePrefix;
PVStructurePtr pvStructure = standardPVField->scalar(scalarType,properties);
PVRecordPtr pvRecord = PVRecord::create(recordName,pvStructure);
bool result = master->addRecord(pvRecord);
@@ -82,13 +123,13 @@ void ExampleDatabase::create()
{
PVDatabasePtr master = PVDatabase::getMaster();
PVRecordPtr pvRecord;
String recordName;
string recordName;
bool result(false);
recordName = "traceRecordPGRPC";
pvRecord = TraceRecord::create(recordName);
result = master->addRecord(pvRecord);
if(!result) cout<< "record " << recordName << " not added" << endl;
String properties;
string properties;
properties = "alarm,timeStamp";
createRecords(master,pvBoolean,"exampleBoolean",properties);
createRecords(master,pvByte,"exampleByte",properties);
@@ -97,21 +138,31 @@ void ExampleDatabase::create()
createRecords(master,pvLong,"exampleLong",properties);
createRecords(master,pvFloat,"exampleFloat",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);
createStructureArrayRecord(master,pvDouble,"exampleStructureArray");
createStructureArrayRecord(master,"exampleStructureArray");
createRegularUnionArrayRecord(master,"exampleRegularUnionArray");
createVariantUnionArrayRecord(master,"exampleVariantUnionArray");
recordName = "examplePowerSupply";
PVStructurePtr pvStructure = createPowerSupply();
PowerSupplyPtr psr =
PowerSupply::create(recordName,pvStructure);
if(psr.get()==NULL) {
cout << "PowerSupply::create failed" << endl;
return;
PowerSupplyPtr psr = PowerSupply::create(recordName,pvStructure);
if(!psr) {
cout << "PowerSupply::create failed" << endl;
} else {
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";
pvRecord = RecordListRecord::create(recordName);
result = master->addRecord(pvRecord);
if(!result) cout<< "record " << recordName << " not added" << endl;
if(!pvRecord) {
cout << "RecordListRecord::create failed" << endl;
} else {
result = master->addRecord(pvRecord);
if(!result) cout<< "record " << recordName << " not added" << endl;
}
}

View File

@@ -16,15 +16,15 @@
# undef epicsExportSharedSymbols
#endif
#include <shareLib.h>
#include <pv/pvDatabase.h>
#ifdef exampledatabaseEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef exampledatabaseEpicsExportSharedSymbols
# include <shareLib.h>
#endif
#include <shareLib.h>
namespace epics { namespace pvDatabase {
class epicsShareClass ExampleDatabase{

View File

@@ -0,0 +1,2 @@
registrar("exampleDatabaseRegister")
registrar("exampleMonitorPluginRegister")

View File

@@ -22,7 +22,8 @@
#include <pv/channelProviderLocal.h>
#include <pv/serverContext.h>
#include <exampleDatabase.h>
#include <pv/exampleDatabase.h>
#include <pv/exampleMonitorPlugin.h>
using namespace std;
using std::tr1::static_pointer_cast;
@@ -36,13 +37,12 @@ int main(int argc,char *argv[])
PVDatabasePtr master = PVDatabase::getMaster();
ChannelProviderLocalPtr channelProvider = getChannelProviderLocal();
ExampleDatabase::create();
ExampleMonitorPlugin::create();
ServerContext::shared_pointer ctx =
startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true);
cout << "exampleDatabase\n";
PVStringArrayPtr pvNames = master->getRecordNames();
String buffer;
pvNames->toString(&buffer);
cout << "recordNames" << endl << buffer << endl;
cout << "recordNames" << endl << *pvNames << endl;
string str;
while(true) {
cout << "Type exit to stop: \n";
@@ -55,4 +55,3 @@ int main(int argc,char *argv[])
channelProvider->destroy();
return 0;
}

View File

@@ -32,8 +32,7 @@
#include <pv/pvDatabase.h>
#include <epicsExport.h>
#include <exampleDatabase.h>
#include <pv/exampleDatabase.h>
using namespace epics::pvData;
using namespace epics::pvAccess;

View File

@@ -1 +0,0 @@
registrar("exampleDatabaseRegister")

View 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);
}
}
}}

View 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 */

View 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);
}

View File

@@ -1,8 +1,6 @@
# Makefile at top of application tree
#Makefile at top of application tree
TOP = .
include $(TOP)/configure/CONFIG
DIRS += configure
DIRS += src
@@ -12,7 +10,6 @@ DIRS += ioc
ioc_DEPEND_DIRS = src
DIRS += iocBoot
iocBoot_DEPEND_DIRS = src
include $(TOP)/configure/RULES_TOP

View File

@@ -14,11 +14,26 @@
# Set CHECK_RELEASE to NO to disable checking completely.
# Set CHECK_RELEASE to WARN to perform consistency checking but
# continue building anyway if conflicts are found.
CHECK_RELEASE = WARN
#CHECK_RELEASE = YES
# Set this when you only want to compile this application
# for a subset of the cross-compiled target architectures
# that Base is built for.
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040
# To install files into a location other than $(TOP) define
# INSTALL_LOCATION here.
#INSTALL_LOCATION=</path/name/to/install/top>
-include $(TOP)/../configure/CONFIG_SITE.local
# 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)/../configure/CONFIG_SITE.local

View File

@@ -16,9 +16,8 @@
# EPICS V4 Developers: Do not edit the locations in this file!
#
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
# PVASRV = /path/to/epics/pvaSrvCPP
# Create a file RELEASE.local pointing to your places
# for the dependencies, e.g.
# PVACCESS = /path/to/epics/pvAccessCPP
# PVDATA = /path/to/epics/pvDataCPP
# PVCOMMON = /path/to/epics/pvCommonCPP
@@ -28,14 +27,14 @@
# use the following definitions:
PVDATABASE = $(TOP)/..
-include $(TOP)/../configure/RELEASE.local
-include $(TOP)/../../RELEASE.local
-include $(TOP)/../configure/RELEASE.local
# If you copied this example from pvDatabaseCPP to be built as a
# standalone TOP, adjust and use the following definitions:
# standalone TOP, define
# PVDATABASE = /path/to/epics/pvDatabaseCPP
# in the appropriate RELEASE[.local],
# and use the following definitions instead:
#PVDATABASE = /path/to/epics/pvDatabaseCPP
#-include $(TOP)/configure/RELEASE.local
#-include $(TOP)/../RELEASE.local
#-include $(TOP)/configure/RELEASE.local

View File

@@ -3,22 +3,27 @@ TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
#==================================================
# Build an IOC support library
#
#=============================
# build an ioc application
DBD += exampleLink.dbd
exampleLink_DBD += base.dbd
exampleLink_DBD += PVAServerRegister.dbd
exampleLink_DBD += PVAClientRegister.dbd
exampleLink_DBD += registerChannelProviderLocal.dbd
exampleLink_DBD += exampleLinkRegister.dbd
PROD_IOC += exampleLink
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
exampleLink_SRCS += exampleLink_registerRecordDeviceDriver.cpp
exampleLink_SRCS_DEFAULT += exampleLinkMain.cpp
exampleLink_SRCS_vxWorks += -nil-
# The following adds support from base/src/vxWorks
exampleLink_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
@@ -27,6 +32,7 @@ exampleLink_LIBS += pvDatabase
exampleLink_LIBS += pvaSrv
exampleLink_LIBS += pvAccess
exampleLink_LIBS += pvData
exampleLink_LIBS += Com
exampleLink_LIBS += $(EPICS_BASE_IOC_LIBS)
#===========================

View File

@@ -0,0 +1,5 @@
include "base.dbd"
include "PVAServerRegister.dbd"
include "PVAClientRegister.dbd"
include "registerChannelProviderLocal.dbd"
registrar("exampleLinkRegister")

View File

@@ -13,4 +13,4 @@ cd ${TOP}/iocBoot/${IOC}
iocInit()
startPVAClient
startPVAServer
exampleLinkCreateRecord exampleLinkRemote pvAccess doubleArray
exampleLinkCreateRecord exampleLink pvAccess doubleArray

View File

@@ -3,8 +3,13 @@ TOP=..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
DBD += exampleLinkRegister.dbd
#==================================================
# Build an IOC support library
#
DBD += exampleLink.dbd
INC += exampleLink.h

View File

@@ -12,22 +12,23 @@
#include <pv/standardPVField.h>
#include <pv/convert.h>
#define epicsExportSharedSymbols
#include <exampleLink.h>
#define epicsExportSharedSymbols
#include <pv/exampleLink.h>
namespace epics { namespace pvDatabase {
using namespace epics::pvData;
using namespace epics::pvAccess;
using std::tr1::static_pointer_cast;
using std::tr1::dynamic_pointer_cast;
using std::cout;
using std::endl;
using std::string;
namespace epics { namespace pvDatabase {
ExampleLinkPtr ExampleLink::create(
String const & recordName,
String const & providerName,
String const & channelName)
string const & recordName,
string const & providerName,
string const & channelName)
{
PVStructurePtr pvStructure = getStandardPVField()->scalarArray(
pvDouble,"alarm.timeStamp");
@@ -39,9 +40,9 @@ ExampleLinkPtr ExampleLink::create(
}
ExampleLink::ExampleLink(
String const & recordName,
String providerName,
String channelName,
string const & recordName,
string providerName,
string channelName,
PVStructurePtr const & pvStructure)
: PVRecord(recordName,pvStructure),
providerName(providerName),
@@ -64,13 +65,12 @@ bool ExampleLink::init()
pvAlarm.attach(pvStructure->getSubField("alarm"));
pvValue = static_pointer_cast<PVDoubleArray>(
pvStructure->getScalarArrayField("value",pvDouble));
if(pvValue==NULL) {
if(!pvValue) {
return false;
}
ChannelAccess::shared_pointer channelAccess = getChannelAccess();
ChannelProvider::shared_pointer provider =
channelAccess->getProvider(providerName);
if(provider==NULL) {
getChannelProviderRegistry()->getProvider(providerName);
if(!provider) {
cout << getRecordName() << " provider "
<< providerName << " does not exist" << endl;
return false;
@@ -97,7 +97,7 @@ bool ExampleLink::init()
}
getPVValue = static_pointer_cast<PVDoubleArray>(
getPVStructure->getScalarArrayField("value",pvDouble));
if(getPVValue==NULL) {
if(!getPVValue) {
cout << getRecordName() << " get value not PVDoubleArray" << endl;
return false;
}
@@ -107,7 +107,7 @@ bool ExampleLink::init()
void ExampleLink::process()
{
status = Status::Ok;
channelGet->get(false);
channelGet->get();
event.wait();
timeStamp.getCurrent();
pvTimeStamp.set(timeStamp);
@@ -145,20 +145,24 @@ void ExampleLink::channelStateChange(
void ExampleLink::channelGetConnect(
const Status& status,
ChannelGet::shared_pointer const & channelGet,
PVStructure::shared_pointer const & pvStructure,
BitSet::shared_pointer const & bitSet)
StructureConstPtr const & structure)
{
this->status = status;
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;
event.signal();
}
void ExampleLink::getDone(const Status& status)
{
this->status = status;
event.signal();
}
}}

View File

@@ -8,15 +8,14 @@
* @author mrk
* @date 2013.08.02
*/
#ifndef EXAMPLELINK_H
#define EXAMPLELINK_H
#ifndef EXAMPLEPVADOUBLEARRAYGET_H
#define EXAMPLEPVADOUBLEARRAYGET_H
#ifdef epicsExportSharedSymbols
# define examplelinkEpicsExportSharedSymbols
# define exampleLinkEpicsExportSharedSymbols
# undef epicsExportSharedSymbols
#endif
//#include <shareLib.h>
#include <pv/timeStamp.h>
#include <pv/pvTimeStamp.h>
#include <pv/alarm.h>
@@ -26,13 +25,12 @@
#include <pv/pvAccess.h>
#include <pv/serverContext.h>
#ifdef examplelinkEpicsExportSharedSymbols
#ifdef exampleLinkEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef examplelinkEpicsExportSharedSymbols
# include <shareLib.h>
# undef exampleLinkEpicsExportSharedSymbols
#endif
#include <shareLib.h>
namespace epics { namespace pvDatabase {
@@ -48,9 +46,9 @@ class epicsShareClass ExampleLink :
public:
POINTER_DEFINITIONS(ExampleLink);
static ExampleLinkPtr create(
epics::pvData::String const & recordName,
epics::pvData::String const & providerName,
epics::pvData::String const & channelName
std::string const & recordName,
std::string const & providerName,
std::string const & channelName
);
virtual ~ExampleLink() {}
virtual void destroy();
@@ -65,23 +63,26 @@ public:
virtual void channelGetConnect(
const epics::pvData::Status& status,
epics::pvAccess::ChannelGet::shared_pointer const & channelGet,
epics::pvData::PVStructure::shared_pointer const & pvStructure,
epics::pvData::BitSet::shared_pointer const & bitSet);
virtual void getDone(const epics::pvData::Status& status);
virtual epics::pvData::String getRequesterName() {return channelName;}
epics::pvData::StructureConstPtr const & structure);
virtual void getDone(
const epics::pvData::Status& status,
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(
epics::pvData::String const & message,
std::string const & message,
epics::pvData::MessageType messageType)
{
std::cout << "Why is ExampleLink::message called\n";
}
private:
ExampleLink(epics::pvData::String const & recordName,
epics::pvData::String providerName,
epics::pvData::String channelName,
ExampleLink(std::string const & recordName,
std::string providerName,
std::string channelName,
epics::pvData::PVStructurePtr const & pvStructure);
epics::pvData::String providerName;
epics::pvData::String channelName;
std::string providerName;
std::string channelName;
epics::pvData::ConvertPtr convert;
epics::pvData::PVDoubleArrayPtr pvValue;
epics::pvData::PVTimeStamp pvTimeStamp;
@@ -99,4 +100,4 @@ private:
}}
#endif /* EXAMPLELINK_H */
#endif /* EXAMPLEPVADOUBLEARRAYGET_H */

View File

@@ -0,0 +1 @@
registrar("exampleLinkRegister")

View File

@@ -35,14 +35,14 @@
#include <pv/pvDatabase.h>
#include <epicsExport.h>
#include <exampleLink.h>
#include <pv/exampleLink.h>
using namespace epics::pvData;
using namespace epics::pvAccess;
using namespace epics::pvDatabase;
using std::cout;
using std::endl;
using std::string;
static StandardPVFieldPtr standardPVField = getStandardPVField();
@@ -59,7 +59,7 @@ static void exampleLinkCallFunc(const iocshArgBuf *args)
PVDatabasePtr master = PVDatabase::getMaster();
PVRecordPtr pvRecord;
bool result(false);
String recordName;
string recordName;
PVStructurePtr pvStructure = standardPVField->scalarArray(
pvDouble,"alarm,timeStamp");
pvRecord = PVRecord::create("doubleArray",pvStructure);
@@ -70,8 +70,8 @@ static void exampleLinkCallFunc(const iocshArgBuf *args)
char *providerName = args[1].sval;
char *channelName = args[2].sval;
ExampleLinkPtr record = ExampleLink::create(recordName,providerName,channelName);
if(record!=NULL)
result = master->addRecord(record);
if(record)
result = master->addRecord(record);
if(!result) cout << "recordname" << " not added" << endl;
}

View File

@@ -14,11 +14,26 @@
# Set CHECK_RELEASE to NO to disable checking completely.
# Set CHECK_RELEASE to WARN to perform consistency checking but
# continue building anyway if conflicts are found.
CHECK_RELEASE = WARN
#CHECK_RELEASE = YES
# Set this when you only want to compile this application
# for a subset of the cross-compiled target architectures
# that Base is built for.
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040
# To install files into a location other than $(TOP) define
# INSTALL_LOCATION here.
#INSTALL_LOCATION=</path/name/to/install/top>
-include $(TOP)/../configure/CONFIG_SITE.local
# 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)/../configure/CONFIG_SITE.local

View File

@@ -16,9 +16,8 @@
# EPICS V4 Developers: Do not edit the locations in this file!
#
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
# PVASRV = /path/to/epics/pvaSrvCPP
# Create a file RELEASE.local pointing to your places
# for the dependencies, e.g.
# PVACCESS = /path/to/epics/pvAccessCPP
# PVDATA = /path/to/epics/pvDataCPP
# PVCOMMON = /path/to/epics/pvCommonCPP
@@ -27,17 +26,17 @@
# If this example is built in a directory under pvDatabaseCPP,
# use the following definitions:
PVDATABASETEST = $(TOP)/../testTop
PVDATABASE = $(TOP)/..
-include $(TOP)/../configure/RELEASE.local
PVDATABASETEST = $(TOP)/../test
-include $(TOP)/../../RELEASE.local
-include $(TOP)/../configure/RELEASE.local
# If you copied this example from pvDatabaseCPP to be built as a
# standalone TOP, adjust and use the following definitions:
#PVDATABASETEST = /path/to/epics/pvDatabaseCPP/testTop
#PVDATABASE = /path/to/epics/pvDatabaseCPP
# standalone TOP, define
# PVDATABASE = /path/to/epics/pvDatabaseCPP
# PVDATABASETEST = /path/to/epics/pvDatabaseCPP/test
# in the appropriate RELEASE[.local],
# and use the following definitions instead:
#-include $(TOP)/../RELEASE.local
#-include $(TOP)/configure/RELEASE.local

View File

@@ -3,22 +3,26 @@ TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
#==================================================
# Build an IOC support library
#
DBD += powerSupply.dbd
powerSupply_DBD += base.dbd
powerSupply_DBD += PVAServerRegister.dbd
powerSupply_DBD += registerChannelProviderLocal.dbd
powerSupply_DBD += dbPv.dbd
powerSupply_DBD += powerSupplyRegister.dbd
#=============================
# build an ioc application
PROD_IOC += powerSupply
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
powerSupply_SRCS += powerSupply_registerRecordDeviceDriver.cpp
powerSupply_SRCS_DEFAULT += powerSupplyMain.cpp
powerSupply_SRCS_vxWorks += -nil-
# The following adds support from base/src/vxWorks
powerSupply_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary

View File

@@ -0,0 +1,5 @@
include "base.dbd"
include "PVAServerRegister.dbd"
include "registerChannelProviderLocal.dbd"
include "dbPv.dbd"
include "powerSupplyRegister.dbd"

View File

@@ -3,14 +3,21 @@ TOP=..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
#==================================================
# Build an IOC support library
#
PROD_HOST += powerSupplyMain
powerSupplyMain_SRCS += powerSupplyMain.cpp
powerSupplyMain_LIBS += powerSupply
powerSupplyMain_LIBS += pvDatabase
powerSupplyMain_LIBS += pvAccess
powerSupplyMain_LIBS += pvData
powerSupplyMain_LIBS += Com
powerSupplyMain_LIBS += powerSupply
#===========================

View File

@@ -20,12 +20,12 @@
#include <pv/standardField.h>
#include <pv/standardPVField.h>
#include <pv/recordList.h>
#include <pv/powerSupply.h>
#include <pv/traceRecord.h>
#include <pv/channelProviderLocal.h>
#include <pv/serverContext.h>
#include <powerSupply.h>
using namespace std;
using std::tr1::static_pointer_cast;
using namespace epics::pvData;
@@ -39,7 +39,7 @@ int main(int argc,char *argv[])
ChannelProviderLocalPtr channelProvider = getChannelProviderLocal();
PVRecordPtr pvRecord;
bool result(false);
String recordName;
string recordName;
recordName = "powerSupply";
PVStructurePtr pv = createPowerSupply();
pvRecord = PowerSupply::create(recordName,pv);
@@ -49,7 +49,10 @@ int main(int argc,char *argv[])
pvRecord = TraceRecord::create(recordName);
result = master->addRecord(pvRecord);
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 =
startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true);
cout << "powerSupply\n";

View File

@@ -1,8 +1,6 @@
# Makefile at top of application tree
#Makefile at top of application tree
TOP = .
include $(TOP)/configure/CONFIG
DIRS += configure
DIRS += src
@@ -12,7 +10,6 @@ DIRS += ioc
ioc_DEPEND_DIRS = src
DIRS += iocBoot
iocBoot_DEPEND_DIRS = src
include $(TOP)/configure/RULES_TOP

View File

@@ -14,11 +14,26 @@
# Set CHECK_RELEASE to NO to disable checking completely.
# Set CHECK_RELEASE to WARN to perform consistency checking but
# continue building anyway if conflicts are found.
CHECK_RELEASE = WARN
#CHECK_RELEASE = YES
# Set this when you only want to compile this application
# for a subset of the cross-compiled target architectures
# that Base is built for.
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040
# To install files into a location other than $(TOP) define
# INSTALL_LOCATION here.
#INSTALL_LOCATION=</path/name/to/install/top>
-include $(TOP)/../configure/CONFIG_SITE.local
# 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)/../configure/CONFIG_SITE.local

View File

@@ -16,9 +16,8 @@
# EPICS V4 Developers: Do not edit the locations in this file!
#
# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
# PVASRV = /path/to/epics/pvaSrvCPP
# Create a file RELEASE.local pointing to your places
# for the dependencies, e.g.
# PVACCESS = /path/to/epics/pvAccessCPP
# PVDATA = /path/to/epics/pvDataCPP
# PVCOMMON = /path/to/epics/pvCommonCPP
@@ -28,14 +27,14 @@
# use the following definitions:
PVDATABASE = $(TOP)/..
-include $(TOP)/../configure/RELEASE.local
-include $(TOP)/../../RELEASE.local
-include $(TOP)/../configure/RELEASE.local
# If you copied this example from pvDatabaseCPP to be built as a
# standalone TOP, adjust and use the following definitions:
# standalone TOP, define
# PVDATABASE = /path/to/epics/pvDatabaseCPP
# in the appropriate RELEASE[.local],
# and use the following definitions instead:
#PVDATABASE = /path/to/epics/pvDatabaseCPP
#-include $(TOP)/configure/RELEASE.local
#-include $(TOP)/../RELEASE.local
#-include $(TOP)/configure/RELEASE.local

View File

@@ -3,22 +3,26 @@ TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
#==================================================
# Build an IOC support library
#
DBD += exampleServer.dbd
exampleServer_DBD += base.dbd
exampleServer_DBD += PVAServerRegister.dbd
exampleServer_DBD += registerChannelProviderLocal.dbd
exampleServer_DBD += dbPv.dbd
exampleServer_DBD += exampleServerRegister.dbd
#=============================
# build an ioc application
PROD_IOC += exampleServer
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
exampleServer_SRCS += exampleServer_registerRecordDeviceDriver.cpp
exampleServer_SRCS_DEFAULT += exampleServerMain.cpp
exampleServer_SRCS_vxWorks += -nil-
# The following adds support from base/src/vxWorks
exampleServer_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary

View File

@@ -0,0 +1,6 @@
include "base.dbd"
include "PVAClientRegister.dbd"
include "PVAServerRegister.dbd"
include "registerChannelProviderLocal.dbd"
include "dbPv.dbd"
include "exampleServer.dbd"

View File

@@ -3,8 +3,14 @@ TOP=..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
DBD += exampleServerRegister.dbd
#==================================================
# Build an IOC support library
#
DBD += exampleServer.dbd
INC += exampleServer.h
@@ -14,6 +20,7 @@ exampleServer_SRCS += exampleServerRegister.cpp
exampleServer_LIBS += pvDatabase
exampleServer_LIBS += pvAccess
exampleServer_LIBS += pvData
exampleServer_LIBS += Com
exampleServer_LIBS += $(EPICS_BASE_IOC_LIBS)
PROD_HOST += exampleServerMain

View File

@@ -9,34 +9,36 @@
* @date 2013.04.02
*/
#include <pv/standardPVField.h>
#include <pv/standardField.h>
#define epicsExportSharedSymbols
#include <pv/exampleServer.h>
#include <exampleServer.h>
namespace epics { namespace exampleServer {
using namespace epics::pvData;
using namespace epics::pvDatabase;
using std::tr1::static_pointer_cast;
using std::string;
namespace epics { namespace exampleServer {
ExampleServerPtr ExampleServer::create(
String const & recordName)
string const & recordName)
{
StandardPVFieldPtr standardPVField = getStandardPVField();
StandardFieldPtr standardField = getStandardField();
FieldCreatePtr fieldCreate = getFieldCreate();
PVDataCreatePtr pvDataCreate = getPVDataCreate();
PVStructurePtr pvArgument = standardPVField->scalar(pvString,"");
PVStructurePtr pvResult = standardPVField->scalar(pvString,"timeStamp");
StringArray names;
names.reserve(2);
PVFieldPtrArray fields;
fields.reserve(2);
names.push_back("argument");
fields.push_back(pvArgument);
names.push_back("result");
fields.push_back(pvResult);
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(names,fields);
StructureConstPtr topStructure = fieldCreate->createFieldBuilder()->
addNestedStructure("argument")->
add("value",pvString)->
endNested()->
addNestedStructure("result") ->
add("value",pvString) ->
add("timeStamp",standardField->timeStamp()) ->
endNested()->
createStructure();
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(topStructure);
ExampleServerPtr pvRecord(
new ExampleServer(recordName,pvStructure));
if(!pvRecord->init()) pvRecord.reset();
@@ -44,7 +46,7 @@ ExampleServerPtr ExampleServer::create(
}
ExampleServer::ExampleServer(
String const & recordName,
string const & recordName,
PVStructurePtr const & pvStructure)
: PVRecord(recordName,pvStructure)
{
@@ -74,7 +76,7 @@ bool ExampleServer::init()
void ExampleServer::process()
{
pvResultValue->put(String("Hello ") + pvArgumentValue->get());
pvResultValue->put(string("Hello ") + pvArgumentValue->get());
timeStamp.getCurrent();
pvTimeStamp.set(timeStamp);
}

View File

@@ -8,15 +8,14 @@
* @author mrk
* @date 2013.04.02
*/
#ifndef EXAMPLESERVER_H
#define EXAMPLESERVER_H
#ifndef EXAMPLECOUNTER_H
#define EXAMPLECOUNTER_H
#ifdef epicsExportSharedSymbols
# define exampleServerEpicsExportSharedSymbols
# undef epicsExportSharedSymbols
#endif
#include <shareLib.h>
#include <pv/pvDatabase.h>
#include <pv/timeStamp.h>
#include <pv/pvTimeStamp.h>
@@ -24,9 +23,10 @@
#ifdef exampleServerEpicsExportSharedSymbols
# define epicsExportSharedSymbols
# undef exampleServerEpicsExportSharedSymbols
# include <shareLib.h>
#endif
#include <shareLib.h>
namespace epics { namespace exampleServer {
@@ -40,13 +40,13 @@ class epicsShareClass ExampleServer :
public:
POINTER_DEFINITIONS(ExampleServer);
static ExampleServerPtr create(
epics::pvData::String const & recordName);
std::string const & recordName);
virtual ~ExampleServer();
virtual void destroy();
virtual bool init();
virtual void process();
private:
ExampleServer(epics::pvData::String const & recordName,
ExampleServer(std::string const & recordName,
epics::pvData::PVStructurePtr const & pvStructure);
epics::pvData::PVStringPtr pvArgumentValue;
@@ -58,4 +58,4 @@ private:
}}
#endif /* EXAMPLESERVER_H */
#endif /* EXAMPLECOUNTER_H */

View File

@@ -0,0 +1 @@
registrar("exampleServerRegister")

View File

@@ -20,12 +20,12 @@
#include <pv/standardField.h>
#include <pv/standardPVField.h>
#include <pv/exampleServer.h>
#include <pv/traceRecord.h>
#include <pv/recordList.h>
#include <pv/channelProviderLocal.h>
#include <pv/serverContext.h>
#include <exampleServer.h>
using namespace std;
using std::tr1::static_pointer_cast;
using namespace epics::pvData;
@@ -39,19 +39,24 @@ int main(int argc,char *argv[])
ChannelProviderLocalPtr channelProvider = getChannelProviderLocal();
PVRecordPtr pvRecord;
bool result(false);
String recordName;
string recordName;
recordName = "exampleServer";
pvRecord = ExampleServer::create(recordName);
result = master->addRecord(pvRecord);
cout << "result of addRecord " << recordName << " " << result << endl;
if(!result) cout<< "record " << recordName << " not added" << endl;
recordName = "traceRecordPGRPC";
pvRecord = TraceRecord::create(recordName);
result = master->addRecord(pvRecord);
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 =
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;
while(true) {
cout << "Type exit to stop: \n";

View File

@@ -31,10 +31,10 @@
#include <pv/pvData.h>
#include <pv/pvAccess.h>
#include <pv/pvDatabase.h>
#include <pv/recordList.h>
#include <epicsExport.h>
#include <exampleServer.h>
#include <pv/exampleServer.h>
using namespace epics::pvData;
using namespace epics::pvAccess;
@@ -51,10 +51,19 @@ static const iocshFuncDef exampleServerFuncDef = {
"exampleServerCreateRecord", 1, testArgs};
static void exampleServerCallFunc(const iocshArgBuf *args)
{
PVDatabasePtr master = PVDatabase::getMaster();
char *recordName = args[0].sval;
ExampleServerPtr record = ExampleServer::create(recordName);
bool result = PVDatabase::getMaster()->addRecord(record);
bool result = master->addRecord(record);
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)

Some files were not shown because too many files have changed in this diff Show More