more work in examples; documentation is now up to date
This commit is contained in:
@@ -2,6 +2,19 @@ TOP=..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
DBD += powerSupplyRegister.dbd
|
||||
|
||||
INC += powerSupply.h
|
||||
|
||||
LIBRARY_IOC += powerSupply
|
||||
powerSupply_SRCS += powerSupply.cpp
|
||||
powerSupply_SRCS += powerSupplyRegister.cpp
|
||||
powerSupply_LIBS += pvData
|
||||
powerSupply_LIBS += pvAccess
|
||||
powerSupply_LIBS += pvDatabase
|
||||
powerSupply_LIBS += $(EPICS_BASE_IOC_LIBS)
|
||||
|
||||
|
||||
PROD_HOST += testPVCopy
|
||||
testPVCopy_SRCS += powerSupply.cpp
|
||||
testPVCopy_SRCS += testPVCopy.cpp
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/*powerSupplyRegister.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 <iostream>
|
||||
|
||||
#include <cantProceed.h>
|
||||
#include <epicsStdio.h>
|
||||
#include <epicsMutex.h>
|
||||
#include <epicsEvent.h>
|
||||
#include <epicsThread.h>
|
||||
#include <iocsh.h>
|
||||
|
||||
#include <epicsExport.h>
|
||||
|
||||
#include <pv/pvIntrospect.h>
|
||||
#include <pv/pvData.h>
|
||||
#include <pv/pvAccess.h>
|
||||
#include <pv/pvDatabase.h>
|
||||
#include <pv/powerSupply.h>
|
||||
|
||||
using namespace epics::pvData;
|
||||
using namespace epics::pvAccess;
|
||||
using namespace epics::pvDatabase;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
|
||||
static const iocshArg testArg0 = { "recordName", iocshArgString };
|
||||
static const iocshArg *testArgs[] = {
|
||||
&testArg0};
|
||||
|
||||
static const iocshFuncDef powerSupplyFuncDef = {
|
||||
"powerSupplyCreateRecord", 1, testArgs};
|
||||
static void powerSupplyCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
char *recordName = args[0].sval;
|
||||
PVStructurePtr pv = createPowerSupply();
|
||||
|
||||
PowerSupplyPtr record = PowerSupply::create(recordName,pv);
|
||||
bool result = PVDatabase::getMaster()->addRecord(record);
|
||||
if(!result) cout << "recordname" << " not added" << endl;
|
||||
}
|
||||
|
||||
static void powerSupplyRegister(void)
|
||||
{
|
||||
static int firstTime = 1;
|
||||
if (firstTime) {
|
||||
firstTime = 0;
|
||||
iocshRegister(&powerSupplyFuncDef, powerSupplyCallFunc);
|
||||
}
|
||||
}
|
||||
epicsExportRegistrar(powerSupplyRegister);
|
||||
@@ -0,0 +1 @@
|
||||
registrar("powerSupplyRegister")
|
||||
Reference in New Issue
Block a user