more work in examples; documentation is now up to date
This commit is contained in:
@@ -6,8 +6,8 @@ DIRS += configure
|
||||
DIRS += src
|
||||
src_DEPEND_DIRS = configure
|
||||
|
||||
DIRS += example
|
||||
test_DEPEND_DIRS = src
|
||||
DIRS += ioc
|
||||
ioc_DEPEND_DIRS = src
|
||||
|
||||
DIRS += iocBoot
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
TOP=../..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
#----------------------------------------
|
||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||
#=============================
|
||||
|
||||
#==================================================
|
||||
# Build an IOC support library
|
||||
#
|
||||
|
||||
#=============================
|
||||
# build an ioc application
|
||||
|
||||
|
||||
DBD += examplePVADoubleArrayGet.dbd
|
||||
|
||||
PROD_IOC += examplePVADoubleArrayGet
|
||||
|
||||
|
||||
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
|
||||
examplePVADoubleArrayGet_SRCS += examplePVADoubleArrayGet_registerRecordDeviceDriver.cpp
|
||||
examplePVADoubleArrayGet_SRCS_DEFAULT += examplePVADoubleArrayGetMain.cpp
|
||||
examplePVADoubleArrayGet_SRCS_vxWorks += -nil-
|
||||
|
||||
|
||||
# The following adds support from base/src/vxWorks
|
||||
examplePVADoubleArrayGet_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
|
||||
|
||||
examplePVADoubleArrayGet_LIBS += pvData pvAccess
|
||||
examplePVADoubleArrayGet_LIBS += pvDatabase
|
||||
examplePVADoubleArrayGet_LIBS += examplePVADoubleArrayGetSupport
|
||||
examplePVADoubleArrayGet_LIBS += $(EPICS_BASE_IOC_LIBS)
|
||||
|
||||
#===========================
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
#----------------------------------------
|
||||
# ADD RULES AFTER THIS LINE
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
include "base.dbd"
|
||||
include "PVAServerRegister.dbd"
|
||||
include "PVAClientRegister.dbd"
|
||||
include "registerChannelProviderLocal.dbd"
|
||||
registrar("examplePVADoubleArrayGetRegister")
|
||||
@@ -0,0 +1,40 @@
|
||||
TOP=../..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
#----------------------------------------
|
||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||
#=============================
|
||||
|
||||
#==================================================
|
||||
# Build an IOC support library
|
||||
#
|
||||
|
||||
#=============================
|
||||
# build an ioc application
|
||||
|
||||
|
||||
DBD += exampleLink.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
|
||||
|
||||
exampleLink_LIBS += pvData pvAccess
|
||||
exampleLink_LIBS += pvDatabase
|
||||
exampleLink_LIBS += exampleLinkSupport
|
||||
exampleLink_LIBS += $(EPICS_BASE_IOC_LIBS)
|
||||
|
||||
#===========================
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
#----------------------------------------
|
||||
# ADD RULES AFTER THIS LINE
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ include "base.dbd"
|
||||
include "PVAServerRegister.dbd"
|
||||
include "PVAClientRegister.dbd"
|
||||
include "registerChannelProviderLocal.dbd"
|
||||
registrar("examplePVADoubleArrayGetRegister")
|
||||
registrar("exampleLinkRegister")
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/* examplePVADoubleArrayGetMain.cpp */
|
||||
/* exampleLinkMain.cpp */
|
||||
/**
|
||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
||||
+3
-3
@@ -3,8 +3,8 @@
|
||||
cd ${TOP}
|
||||
|
||||
## Register all support components
|
||||
dbLoadDatabase("dbd/examplePVADoubleArrayGet.dbd")
|
||||
examplePVADoubleArrayGet_registerRecordDeviceDriver(pdbbase)
|
||||
dbLoadDatabase("dbd/exampleLink.dbd")
|
||||
exampleLink_registerRecordDeviceDriver(pdbbase)
|
||||
|
||||
## Load record instances
|
||||
dbLoadRecords("db/dbArray.db","name=double01,type=DOUBLE")
|
||||
@@ -13,4 +13,4 @@ cd ${TOP}/iocBoot/${IOC}
|
||||
iocInit()
|
||||
startPVAClient
|
||||
startPVAServer
|
||||
examplePVADoubleArrayGetCreateRecord examplePVADoubleArrayGet local doubleArray
|
||||
exampleLinkCreateRecord exampleLink local doubleArray
|
||||
+3
-3
@@ -3,8 +3,8 @@
|
||||
cd ${TOP}
|
||||
|
||||
## Register all support components
|
||||
dbLoadDatabase("dbd/examplePVADoubleArrayGet.dbd")
|
||||
examplePVADoubleArrayGet_registerRecordDeviceDriver(pdbbase)
|
||||
dbLoadDatabase("dbd/exampleLink.dbd")
|
||||
exampleLink_registerRecordDeviceDriver(pdbbase)
|
||||
|
||||
## Load record instances
|
||||
dbLoadRecords("db/dbArray.db","name=double01,type=DOUBLE")
|
||||
@@ -13,4 +13,4 @@ cd ${TOP}/iocBoot/${IOC}
|
||||
iocInit()
|
||||
startPVAClient
|
||||
startPVAServer
|
||||
examplePVADoubleArrayGetCreateRecord examplePVADoubleArrayGet pvAccess arrayDouble
|
||||
exampleLinkCreateRecord exampleLinkRemote pvAccess doubleArray
|
||||
@@ -9,17 +9,17 @@ include $(TOP)/configure/CONFIG
|
||||
# Build an IOC support library
|
||||
#
|
||||
|
||||
DBD += examplePVADoubleArrayGet.dbd
|
||||
DBD += exampleLink.dbd
|
||||
|
||||
INC += examplePVADoubleArrayGet.h
|
||||
INC += exampleLink.h
|
||||
|
||||
LIBRARY_IOC += examplePVADoubleArrayGetSupport
|
||||
examplePVADoubleArrayGetSupport_SRCS += examplePVADoubleArrayGet.cpp
|
||||
examplePVADoubleArrayGetSupport_SRCS += examplePVADoubleArrayGetRegister.cpp
|
||||
examplePVADoubleArrayGetSupport_LIBS += pvData
|
||||
examplePVADoubleArrayGetSupport_LIBS += pvAccess
|
||||
examplePVADoubleArrayGetSupport_LIBS += pvDatabase
|
||||
examplePVADoubleArrayGetSupport_LIBS += $(EPICS_BASE_IOC_LIBS)
|
||||
LIBRARY_IOC += exampleLinkSupport
|
||||
exampleLinkSupport_SRCS += exampleLink.cpp
|
||||
exampleLinkSupport_SRCS += exampleLinkRegister.cpp
|
||||
exampleLinkSupport_LIBS += pvData
|
||||
exampleLinkSupport_LIBS += pvAccess
|
||||
exampleLinkSupport_LIBS += pvDatabase
|
||||
exampleLinkSupport_LIBS += $(EPICS_BASE_IOC_LIBS)
|
||||
|
||||
#===========================
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* examplePVADoubleArrayGet.cpp */
|
||||
/* exampleLink.cpp */
|
||||
/**
|
||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
||||
@@ -9,7 +9,7 @@
|
||||
* @date 2013.08.02
|
||||
*/
|
||||
|
||||
#include <pv/examplePVADoubleArrayGet.h>
|
||||
#include <pv/exampleLink.h>
|
||||
#include <pv/standardPVField.h>
|
||||
#include <pv/convert.h>
|
||||
|
||||
@@ -21,21 +21,21 @@ using std::tr1::dynamic_pointer_cast;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
ExamplePVADoubleArrayGetPtr ExamplePVADoubleArrayGet::create(
|
||||
ExampleLinkPtr ExampleLink::create(
|
||||
String const & recordName,
|
||||
String const & providerName,
|
||||
String const & channelName)
|
||||
{
|
||||
PVStructurePtr pvStructure = getStandardPVField()->scalarArray(
|
||||
pvDouble,"alarm.timeStamp");
|
||||
ExamplePVADoubleArrayGetPtr pvRecord(
|
||||
new ExamplePVADoubleArrayGet(
|
||||
ExampleLinkPtr pvRecord(
|
||||
new ExampleLink(
|
||||
recordName,providerName,channelName,pvStructure));
|
||||
if(!pvRecord->init()) pvRecord.reset();
|
||||
return pvRecord;
|
||||
}
|
||||
|
||||
ExamplePVADoubleArrayGet::ExamplePVADoubleArrayGet(
|
||||
ExampleLink::ExampleLink(
|
||||
String const & recordName,
|
||||
String providerName,
|
||||
String channelName,
|
||||
@@ -47,12 +47,12 @@ ExamplePVADoubleArrayGet::ExamplePVADoubleArrayGet(
|
||||
{
|
||||
}
|
||||
|
||||
void ExamplePVADoubleArrayGet::destroy()
|
||||
void ExampleLink::destroy()
|
||||
{
|
||||
PVRecord::destroy();
|
||||
}
|
||||
|
||||
bool ExamplePVADoubleArrayGet::init()
|
||||
bool ExampleLink::init()
|
||||
{
|
||||
initPVRecord();
|
||||
|
||||
@@ -101,7 +101,7 @@ bool ExamplePVADoubleArrayGet::init()
|
||||
return true;
|
||||
}
|
||||
|
||||
void ExamplePVADoubleArrayGet::process()
|
||||
void ExampleLink::process()
|
||||
{
|
||||
status = Status::Ok;
|
||||
channelGet->get(false);
|
||||
@@ -124,7 +124,7 @@ void ExamplePVADoubleArrayGet::process()
|
||||
pvAlarm.set(alarm);
|
||||
}
|
||||
|
||||
void ExamplePVADoubleArrayGet::channelCreated(
|
||||
void ExampleLink::channelCreated(
|
||||
const Status& status,
|
||||
Channel::shared_pointer const & channel)
|
||||
{
|
||||
@@ -133,13 +133,13 @@ void ExamplePVADoubleArrayGet::channelCreated(
|
||||
event.signal();
|
||||
}
|
||||
|
||||
void ExamplePVADoubleArrayGet::channelStateChange(
|
||||
void ExampleLink::channelStateChange(
|
||||
Channel::shared_pointer const & channel,
|
||||
Channel::ConnectionState connectionState)
|
||||
{
|
||||
}
|
||||
|
||||
void ExamplePVADoubleArrayGet::channelGetConnect(
|
||||
void ExampleLink::channelGetConnect(
|
||||
const Status& status,
|
||||
ChannelGet::shared_pointer const & channelGet,
|
||||
PVStructure::shared_pointer const & pvStructure,
|
||||
@@ -152,7 +152,7 @@ void ExamplePVADoubleArrayGet::channelGetConnect(
|
||||
event.signal();
|
||||
}
|
||||
|
||||
void ExamplePVADoubleArrayGet::getDone(const Status& status)
|
||||
void ExampleLink::getDone(const Status& status)
|
||||
{
|
||||
this->status = status;
|
||||
event.signal();
|
||||
@@ -1,4 +1,4 @@
|
||||
/* examplePVADoubleArrayGet.h */
|
||||
/* exampleLink.h */
|
||||
/**
|
||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
||||
@@ -24,22 +24,22 @@
|
||||
namespace epics { namespace pvDatabase {
|
||||
|
||||
|
||||
class ExamplePVADoubleArrayGet;
|
||||
typedef std::tr1::shared_ptr<ExamplePVADoubleArrayGet> ExamplePVADoubleArrayGetPtr;
|
||||
class ExampleLink;
|
||||
typedef std::tr1::shared_ptr<ExampleLink> ExampleLinkPtr;
|
||||
|
||||
class ExamplePVADoubleArrayGet :
|
||||
class ExampleLink :
|
||||
public PVRecord,
|
||||
public epics::pvAccess::ChannelRequester,
|
||||
public epics::pvAccess::ChannelGetRequester
|
||||
{
|
||||
public:
|
||||
POINTER_DEFINITIONS(ExamplePVADoubleArrayGet);
|
||||
static ExamplePVADoubleArrayGetPtr create(
|
||||
POINTER_DEFINITIONS(ExampleLink);
|
||||
static ExampleLinkPtr create(
|
||||
epics::pvData::String const & recordName,
|
||||
epics::pvData::String const & providerName,
|
||||
epics::pvData::String const & channelName
|
||||
);
|
||||
virtual ~ExamplePVADoubleArrayGet() {}
|
||||
virtual ~ExampleLink() {}
|
||||
virtual void destroy();
|
||||
virtual bool init();
|
||||
virtual void process();
|
||||
@@ -60,10 +60,10 @@ public:
|
||||
epics::pvData::String const & message,
|
||||
epics::pvData::MessageType messageType)
|
||||
{
|
||||
std::cout << "Why is ExamplePVADoubleArrayGet::message called\n";
|
||||
std::cout << "Why is ExampleLink::message called\n";
|
||||
}
|
||||
private:
|
||||
ExamplePVADoubleArrayGet(epics::pvData::String const & recordName,
|
||||
ExampleLink(epics::pvData::String const & recordName,
|
||||
epics::pvData::String providerName,
|
||||
epics::pvData::String channelName,
|
||||
epics::pvData::PVStructurePtr const & pvStructure);
|
||||
@@ -0,0 +1 @@
|
||||
registrar("exampleLinkRegister")
|
||||
+9
-9
@@ -1,4 +1,4 @@
|
||||
/*examplePVADoubleArrayGet.cpp */
|
||||
/*exampleLink.cpp */
|
||||
/**
|
||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <pv/standardPVField.h>
|
||||
#include <pv/pvAccess.h>
|
||||
#include <pv/pvDatabase.h>
|
||||
#include <pv/examplePVADoubleArrayGet.h>
|
||||
#include <pv/exampleLink.h>
|
||||
|
||||
using namespace epics::pvData;
|
||||
using namespace epics::pvAccess;
|
||||
@@ -51,9 +51,9 @@ static const iocshArg testArg2 = { "channelName", iocshArgString };
|
||||
static const iocshArg *testArgs[] = {
|
||||
&testArg0,&testArg1,&testArg2};
|
||||
|
||||
static const iocshFuncDef examplePVADoubleArrayGetFuncDef = {
|
||||
"examplePVADoubleArrayGetCreateRecord", 3, testArgs};
|
||||
static void examplePVADoubleArrayGetCallFunc(const iocshArgBuf *args)
|
||||
static const iocshFuncDef exampleLinkFuncDef = {
|
||||
"exampleLinkCreateRecord", 3, testArgs};
|
||||
static void exampleLinkCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
PVDatabasePtr master = PVDatabase::getMaster();
|
||||
PVRecordPtr pvRecord;
|
||||
@@ -68,18 +68,18 @@ static void examplePVADoubleArrayGetCallFunc(const iocshArgBuf *args)
|
||||
recordName = args[0].sval;
|
||||
char *providerName = args[1].sval;
|
||||
char *channelName = args[2].sval;
|
||||
ExamplePVADoubleArrayGetPtr record = ExamplePVADoubleArrayGet::create(recordName,providerName,channelName);
|
||||
ExampleLinkPtr record = ExampleLink::create(recordName,providerName,channelName);
|
||||
if(record!=NULL)
|
||||
result = master->addRecord(record);
|
||||
if(!result) cout << "recordname" << " not added" << endl;
|
||||
}
|
||||
|
||||
static void examplePVADoubleArrayGetRegister(void)
|
||||
static void exampleLinkRegister(void)
|
||||
{
|
||||
static int firstTime = 1;
|
||||
if (firstTime) {
|
||||
firstTime = 0;
|
||||
iocshRegister(&examplePVADoubleArrayGetFuncDef, examplePVADoubleArrayGetCallFunc);
|
||||
iocshRegister(&exampleLinkFuncDef, exampleLinkCallFunc);
|
||||
}
|
||||
}
|
||||
epicsExportRegistrar(examplePVADoubleArrayGetRegister);
|
||||
epicsExportRegistrar(exampleLinkRegister);
|
||||
Reference in New Issue
Block a user