more work in examples; documentation is now up to date

This commit is contained in:
Marty Kraimer
2014-02-07 13:57:32 -05:00
parent 9a798bc05a
commit 61d884334a
72 changed files with 2404 additions and 685 deletions

View File

@@ -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)
#===========================

View File

@@ -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();

View File

@@ -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);

View File

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

View File

@@ -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);

View File

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