1) PVRecord now has two new methods: setAsLevel and setAsGroup.
2) The following special records are DEPRECATED: addRecord,processRecord,removeRecord, and traceRecord.
They are replaced by pvdbcrAddRecord,pvdbcrProcessRecord,pvdbcrRemoveRecord, and pvdbcrTraceRecord.
3) A new convention is that all special records start with pvdbcr, which means pvDatabase Create Record.
4) pvdbcrAddRecord,pvdbcrProcessRecord,pvdbcrRemoveRecord, and pvdbcrTraceRecord are like what they replace.
But they also allow the asLevel to be set when they are created.
5) pvdbcrScalar and pvdbcrScalarArray are new special records.
They created records that have fields value, alarm, and timeStamp.
value can have any of the allowed scalar types, i.e. boolean,byte,...,string.
64 lines
1.6 KiB
C++
64 lines
1.6 KiB
C++
/*
|
|
* Copyright information and license terms for this software can be
|
|
* found in the file LICENSE that is included with the distribution
|
|
*/
|
|
|
|
/**
|
|
* @author mrk
|
|
* @date 2013.07.24
|
|
*/
|
|
|
|
|
|
/* Author: Marty Kraimer */
|
|
#include <epicsThread.h>
|
|
#include <iocsh.h>
|
|
#include <pv/event.h>
|
|
#include <pv/pvAccess.h>
|
|
#include <pv/serverContext.h>
|
|
#include <pv/pvData.h>
|
|
#include <pv/pvTimeStamp.h>
|
|
#include <pv/rpcService.h>
|
|
|
|
// The following must be the last include for code pvDatabase uses
|
|
#include <epicsExport.h>
|
|
#define epicsExportSharedSymbols
|
|
#include "pv/pvStructureCopy.h"
|
|
#include "pv/pvDatabase.h"
|
|
#include "pv/removeRecord.h"
|
|
|
|
using namespace epics::pvData;
|
|
using namespace epics::pvAccess;
|
|
using namespace epics::pvDatabase;
|
|
using namespace std;
|
|
|
|
static const iocshArg testArg0 = { "recordName", iocshArgString };
|
|
static const iocshArg *testArgs[] = {
|
|
&testArg0};
|
|
|
|
static const iocshFuncDef removeRecordFuncDef = {"removeRecordCreate", 1,testArgs};
|
|
|
|
static void removeRecordCallFunc(const iocshArgBuf *args)
|
|
{
|
|
cerr << "DEPRECATED use pvdbcrRemoveRecord instead\n";
|
|
char *recordName = args[0].sval;
|
|
if(!recordName) {
|
|
throw std::runtime_error("removeRecordCreate invalid number of arguments");
|
|
}
|
|
RemoveRecordPtr record = RemoveRecord::create(recordName);
|
|
bool result = PVDatabase::getMaster()->addRecord(record);
|
|
if(!result) cout << "recordname" << " not added" << endl;
|
|
}
|
|
|
|
static void removeRecordRegister(void)
|
|
{
|
|
static int firstTime = 1;
|
|
if (firstTime) {
|
|
firstTime = 0;
|
|
iocshRegister(&removeRecordFuncDef, removeRecordCallFunc);
|
|
}
|
|
}
|
|
|
|
extern "C" {
|
|
epicsExportRegistrar(removeRecordRegister);
|
|
}
|