more work on special; all pvdbcr* redone
This commit is contained in:
@ -20,8 +20,8 @@ INC += pv/pvSupport.h
|
||||
INC += pv/controlSupport.h
|
||||
INC += pv/scalarAlarmSupport.h
|
||||
|
||||
INC += pv/pvdbcrScalar.h
|
||||
INC += pv/pvdbcrScalarArray.h
|
||||
INC += pv/pvdbcrScalarRecord.h
|
||||
INC += pv/pvdbcrScalarArrayRecord.h
|
||||
INC += pv/pvdbcrAddRecord.h
|
||||
INC += pv/pvdbcrRemoveRecord.h
|
||||
INC += pv/pvdbcrProcessRecord.h
|
||||
|
@ -7,8 +7,8 @@
|
||||
* @author mrk
|
||||
* @date 2021.04.11
|
||||
*/
|
||||
#ifndef PVDBCRSCALARARRAY_H
|
||||
#define PVDBCRSCALARARRAY_H
|
||||
#ifndef PVDBCRSCALARARRAYRECORD_H
|
||||
#define PVDBCRSCALARARRAYRECORD_H
|
||||
|
||||
#include <pv/pvDatabase.h>
|
||||
#include <pv/pvSupport.h>
|
||||
@ -18,26 +18,26 @@
|
||||
|
||||
namespace epics { namespace pvDatabase {
|
||||
|
||||
class PvdbcrScalarArray;
|
||||
typedef std::tr1::shared_ptr<PvdbcrScalarArray> PvdbcrScalarArrayPtr;
|
||||
class PvdbcrScalarArrayRecord;
|
||||
typedef std::tr1::shared_ptr<PvdbcrScalarArrayRecord> PvdbcrScalarArrayRecordPtr;
|
||||
|
||||
/**
|
||||
* @brief PvdbcrScalarArray creates a record with a scalar array value, alarm, and timeStamp.
|
||||
* @brief PvdbcrScalarArrayRecord creates a record with a scalar array value, alarm, and timeStamp.
|
||||
*
|
||||
*/
|
||||
class epicsShareClass PvdbcrScalarArray :
|
||||
class epicsShareClass PvdbcrScalarArrayRecord :
|
||||
public PVRecord
|
||||
{
|
||||
private:
|
||||
PvdbcrScalarArray(
|
||||
PvdbcrScalarArrayRecord(
|
||||
std::string const & recordName,epics::pvData::PVStructurePtr const & pvStructure,
|
||||
int asLevel,std::string const & asGroup);
|
||||
public:
|
||||
POINTER_DEFINITIONS(PvdbcrScalarArray);
|
||||
POINTER_DEFINITIONS(PvdbcrScalarArrayRecord);
|
||||
/**
|
||||
* The Destructor.
|
||||
*/
|
||||
virtual ~PvdbcrScalarArray() {}
|
||||
virtual ~PvdbcrScalarArrayRecord() {}
|
||||
/**
|
||||
* @brief Create a record.
|
||||
*
|
||||
@ -47,11 +47,11 @@ public:
|
||||
* @param asGroup The access security group.
|
||||
* @return The PVRecord
|
||||
*/
|
||||
static PvdbcrScalarArrayPtr create(
|
||||
static PvdbcrScalarArrayRecordPtr create(
|
||||
std::string const & recordName,std::string const & scalarType,
|
||||
int asLevel=0,std::string const & asGroup = std::string("DEFAULT"));
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif /* PVDBCRSCALARARRAY_H */
|
||||
#endif /* PVDBCRSCALARARRAYRECORD_H */
|
@ -7,8 +7,8 @@
|
||||
* @author mrk
|
||||
* @date 2021.04.11
|
||||
*/
|
||||
#ifndef PVDBCRSCALAR_H
|
||||
#define PVDBCRSCALAR_H
|
||||
#ifndef PVDBCRSCALARRECORD_H
|
||||
#define PVDBCRSCALARRECORD_H
|
||||
|
||||
#include <pv/pvDatabase.h>
|
||||
#include <pv/pvSupport.h>
|
||||
@ -18,26 +18,26 @@
|
||||
|
||||
namespace epics { namespace pvDatabase {
|
||||
|
||||
class PvdbcrScalar;
|
||||
typedef std::tr1::shared_ptr<PvdbcrScalar> PvdbcrScalarPtr;
|
||||
class PvdbcrScalarRecord;
|
||||
typedef std::tr1::shared_ptr<PvdbcrScalarRecord> PvdbcrScalarRecordPtr;
|
||||
|
||||
/**
|
||||
* @brief PvdbcrScalar creates a record with a scalar value, alarm, and timeStamp.
|
||||
* @brief PvdbcrScalarRecord creates a record with a scalar value, alarm, and timeStamp.
|
||||
*
|
||||
*/
|
||||
class epicsShareClass PvdbcrScalar :
|
||||
class epicsShareClass PvdbcrScalarRecord :
|
||||
public PVRecord
|
||||
{
|
||||
private:
|
||||
PvdbcrScalar(
|
||||
PvdbcrScalarRecord(
|
||||
std::string const & recordName,epics::pvData::PVStructurePtr const & pvStructure,
|
||||
int asLevel,std::string const & asGroup);
|
||||
public:
|
||||
POINTER_DEFINITIONS(PvdbcrScalar);
|
||||
POINTER_DEFINITIONS(PvdbcrScalarRecord);
|
||||
/**
|
||||
* The Destructor.
|
||||
*/
|
||||
virtual ~PvdbcrScalar() {}
|
||||
virtual ~PvdbcrScalarRecord() {}
|
||||
/**
|
||||
* @brief Create a record.
|
||||
*
|
||||
@ -47,11 +47,11 @@ public:
|
||||
* @param asGroup The access security group.
|
||||
* @return The PVRecord
|
||||
*/
|
||||
static PvdbcrScalarPtr create(
|
||||
static PvdbcrScalarRecordPtr create(
|
||||
std::string const & recordName,std::string const & scalarType,
|
||||
int asLevel=0,std::string const & asGroup = std::string("DEFAULT"));
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif /* PVDBCRSCALAR_H */
|
||||
#endif /* PVDBCRSCALARRECORD_H */
|
@ -2,18 +2,17 @@
|
||||
|
||||
SRC_DIRS += $(PVDATABASE_SRC)/special
|
||||
|
||||
DBD += pvdbcrTraceRecordRegister.dbd
|
||||
DBD += pvdbcrRemoveRecordRegister.dbd
|
||||
DBD += pvdbcrAddRecordRegister.dbd
|
||||
DBD += pvdbcrProcessRecordRegister.dbd
|
||||
DBD += pvdbcrScalarRegister.dbd
|
||||
DBD += pvdbcrScalarArrayRegister.dbd
|
||||
DBD += pvdbSpecialRegister.dbd
|
||||
|
||||
LIBSRCS += pvdbcrScalarRegister.cpp
|
||||
LIBSRCS += pvdbcrScalarArrayRegister.cpp
|
||||
LIBSRCS += pvdbcrTraceRecordRegister.cpp
|
||||
LIBSRCS += pvdbcrRemoveRecordRegister.cpp
|
||||
LIBSRCS += pvdbcrAddRecordRegister.cpp
|
||||
LIBSRCS += pvdbcrProcessRecordRegister.cpp
|
||||
DBD += pvdbcrScalarRecord.dbd
|
||||
DBD += pvdbcrScalarArrayRecord.dbd
|
||||
DBD += pvdbcrAddRecord.dbd
|
||||
DBD += pvdbcrRemoveRecord.dbd
|
||||
DBD += pvdbcrProcessRecord.dbd
|
||||
DBD += pvdbcrTraceRecord.dbd
|
||||
DBD += pvdbcrAllRecords.dbd
|
||||
|
||||
LIBSRCS += pvdbcrScalarRecord.cpp
|
||||
LIBSRCS += pvdbcrScalarArrayRecord.cpp
|
||||
LIBSRCS += pvdbcrAddRecord.cpp
|
||||
LIBSRCS += pvdbcrRemoveRecord.cpp
|
||||
LIBSRCS += pvdbcrProcessRecord.cpp
|
||||
LIBSRCS += pvdbcrTraceRecord.cpp
|
||||
|
@ -1,6 +0,0 @@
|
||||
include "pvdbcrAddRecordRegister.dbd"
|
||||
include "pvdbcrRemoveRecordRegister.dbd"
|
||||
include "pvdbcrProcessRecordRegister.dbd"
|
||||
include "pvdbcrTraceRecordRegister.dbd"
|
||||
include "pvdbcrScalarRegister.dbd"
|
||||
include "pvdbcrScalarArrayRegister.dbd"
|
@ -133,7 +133,7 @@ static void pvdbcrAddRecordCallFunc(const iocshArgBuf *args)
|
||||
if(!result) cout << "recordname " << recordName << " not added" << endl;
|
||||
}
|
||||
|
||||
static void pvdbcrAddRecordRegister(void)
|
||||
static void pvdbcrAddRecord(void)
|
||||
{
|
||||
static int firstTime = 1;
|
||||
if (firstTime) {
|
||||
@ -143,5 +143,5 @@ static void pvdbcrAddRecordRegister(void)
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
epicsExportRegistrar(pvdbcrAddRecordRegister);
|
||||
epicsExportRegistrar(pvdbcrAddRecord);
|
||||
}
|
1
src/special/pvdbcrAddRecord.dbd
Normal file
1
src/special/pvdbcrAddRecord.dbd
Normal file
@ -0,0 +1 @@
|
||||
registrar("pvdbcrAddRecord")
|
@ -1 +0,0 @@
|
||||
registrar("pvdbcrAddRecordRegister")
|
6
src/special/pvdbcrAllRecords.dbd
Normal file
6
src/special/pvdbcrAllRecords.dbd
Normal file
@ -0,0 +1,6 @@
|
||||
include "pvdbcrAddRecord.dbd"
|
||||
include "pvdbcrRemoveRecord.dbd"
|
||||
include "pvdbcrProcessRecord.dbd"
|
||||
include "pvdbcrTraceRecord.dbd"
|
||||
include "pvdbcrScalarRecord.dbd"
|
||||
include "pvdbcrScalarArrayRecord.dbd"
|
@ -192,7 +192,7 @@ static void pvdbcrProcessRecordCallFunc(const iocshArgBuf *args)
|
||||
if(!result) cout << "recordname " << recordName << " not added" << endl;
|
||||
}
|
||||
|
||||
static void pvdbcrProcessRecordRegister(void)
|
||||
static void pvdbcrProcessRecord(void)
|
||||
{
|
||||
static int firstTime = 1;
|
||||
if (firstTime) {
|
||||
@ -202,5 +202,5 @@ static void pvdbcrProcessRecordRegister(void)
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
epicsExportRegistrar(pvdbcrProcessRecordRegister);
|
||||
epicsExportRegistrar(pvdbcrProcessRecord);
|
||||
}
|
1
src/special/pvdbcrProcessRecord.dbd
Normal file
1
src/special/pvdbcrProcessRecord.dbd
Normal file
@ -0,0 +1 @@
|
||||
registrar("pvdbcrProcessRecord")
|
@ -1 +0,0 @@
|
||||
registrar("pvdbcrProcessRecordRegister")
|
@ -109,7 +109,7 @@ static void pvdbcrRemoveRecordCallFunc(const iocshArgBuf *args)
|
||||
if(!result) cout << "recordname " << recordName << " not added" << endl;
|
||||
}
|
||||
|
||||
static void pvdbcrRemoveRecordRegister(void)
|
||||
static void pvdbcrRemoveRecord(void)
|
||||
{
|
||||
static int firstTime = 1;
|
||||
if (firstTime) {
|
||||
@ -119,5 +119,5 @@ static void pvdbcrRemoveRecordRegister(void)
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
epicsExportRegistrar(pvdbcrRemoveRecordRegister);
|
||||
epicsExportRegistrar(pvdbcrRemoveRecord);
|
||||
}
|
1
src/special/pvdbcrRemoveRecord.dbd
Normal file
1
src/special/pvdbcrRemoveRecord.dbd
Normal file
@ -0,0 +1 @@
|
||||
registrar("pvdbcrRemoveRecord")
|
@ -1 +0,0 @@
|
||||
registrar("pvdbcrRemoveRecordRegister")
|
@ -21,20 +21,20 @@
|
||||
// The following must be the last include for code pvDatabase implements
|
||||
#include <epicsExport.h>
|
||||
#define epicsExportSharedSymbols
|
||||
#include "pv/pvdbcrScalarArray.h"
|
||||
#include "pv/pvDatabase.h"
|
||||
#include "pv/pvdbcrScalarArrayRecord.h"
|
||||
using namespace epics::pvData;
|
||||
using namespace std;
|
||||
|
||||
namespace epics { namespace pvDatabase {
|
||||
|
||||
PvdbcrScalarArray::PvdbcrScalarArray(
|
||||
PvdbcrScalarArrayRecord::PvdbcrScalarArrayRecord(
|
||||
std::string const & recordName,epics::pvData::PVStructurePtr const & pvStructure,
|
||||
int asLevel,std::string const & asGroup)
|
||||
: PVRecord(recordName,pvStructure,asLevel,asGroup)
|
||||
{}
|
||||
|
||||
PvdbcrScalarArrayPtr PvdbcrScalarArray::create(
|
||||
PvdbcrScalarArrayRecordPtr PvdbcrScalarArrayRecord::create(
|
||||
std::string const & recordName,std::string const & scalarType,
|
||||
int asLevel,std::string const & asGroup)
|
||||
{
|
||||
@ -46,9 +46,9 @@ PvdbcrScalarArrayPtr PvdbcrScalarArray::create(
|
||||
addArray("value",st) ->
|
||||
add("timeStamp",standardField->timeStamp()) ->
|
||||
add("alarm",standardField->alarm()) ->
|
||||
createStructure();
|
||||
createStructure();
|
||||
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(top);
|
||||
PvdbcrScalarArrayPtr pvRecord(new PvdbcrScalarArray(recordName,pvStructure,asLevel,asGroup));
|
||||
PvdbcrScalarArrayRecordPtr pvRecord(new PvdbcrScalarArrayRecord(recordName,pvStructure,asLevel,asGroup));
|
||||
pvRecord->initPVRecord();
|
||||
return pvRecord;
|
||||
};
|
||||
@ -60,18 +60,18 @@ static const iocshArg arg2 = { "asLevel", iocshArgInt };
|
||||
static const iocshArg arg3 = { "asGroup", iocshArgString };
|
||||
static const iocshArg *args[] = {&arg0,&arg1,&arg2,&arg3};
|
||||
|
||||
static const iocshFuncDef pvdbcrScalarArrayFuncDef = {"pvdbcrScalarArray", 4,args};
|
||||
static const iocshFuncDef pvdbcrScalarArrayFuncDef = {"pvdbcrScalarArrayRecord", 4,args};
|
||||
|
||||
static void pvdbcrScalarArrayCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
char *sval = args[0].sval;
|
||||
if(!sval) {
|
||||
throw std::runtime_error("pvdbcrScalarArray recordName not specified");
|
||||
throw std::runtime_error("pvdbcrScalarArrayRecord recordName not specified");
|
||||
}
|
||||
string recordName = string(sval);
|
||||
sval = args[1].sval;
|
||||
if(!sval) {
|
||||
throw std::runtime_error("pvdbcrScalarArray scalarType not specified");
|
||||
throw std::runtime_error("pvdbcrScalarArrayRecord scalarType not specified");
|
||||
}
|
||||
string scalarType = string(sval);
|
||||
int asLevel = args[2].ival;
|
||||
@ -80,8 +80,8 @@ static void pvdbcrScalarArrayCallFunc(const iocshArgBuf *args)
|
||||
if(sval) {
|
||||
asGroup = string(sval);
|
||||
}
|
||||
epics::pvDatabase::PvdbcrScalarArrayPtr record
|
||||
= epics::pvDatabase::PvdbcrScalarArray::create(recordName,scalarType);
|
||||
epics::pvDatabase::PvdbcrScalarArrayRecordPtr record
|
||||
= epics::pvDatabase::PvdbcrScalarArrayRecord::create(recordName,scalarType);
|
||||
epics::pvDatabase::PVDatabasePtr master = epics::pvDatabase::PVDatabase::getMaster();
|
||||
record->setAsLevel(asLevel);
|
||||
record->setAsGroup(asGroup);
|
||||
@ -89,7 +89,7 @@ static void pvdbcrScalarArrayCallFunc(const iocshArgBuf *args)
|
||||
if(!result) cout << "recordname " << recordName << " not added" << endl;
|
||||
}
|
||||
|
||||
static void pvdbcrScalarArrayRegister(void)
|
||||
static void pvdbcrScalarArrayRecord(void)
|
||||
{
|
||||
static int firstTime = 1;
|
||||
if (firstTime) {
|
||||
@ -99,5 +99,5 @@ static void pvdbcrScalarArrayRegister(void)
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
epicsExportRegistrar(pvdbcrScalarArrayRegister);
|
||||
epicsExportRegistrar(pvdbcrScalarArrayRecord);
|
||||
}
|
1
src/special/pvdbcrScalarArrayRecord.dbd
Normal file
1
src/special/pvdbcrScalarArrayRecord.dbd
Normal file
@ -0,0 +1 @@
|
||||
registrar("pvdbcrScalarArrayRecord")
|
@ -1 +0,0 @@
|
||||
registrar("pvdbcrScalarArrayRegister")
|
@ -21,20 +21,20 @@
|
||||
// The following must be the last include for code pvDatabase implements
|
||||
#include <epicsExport.h>
|
||||
#define epicsExportSharedSymbols
|
||||
#include "pv/pvdbcrScalar.h"
|
||||
#include "pv/pvDatabase.h"
|
||||
#include "pv/pvdbcrScalarRecord.h"
|
||||
using namespace epics::pvData;
|
||||
using namespace std;
|
||||
|
||||
namespace epics { namespace pvDatabase {
|
||||
|
||||
PvdbcrScalar::PvdbcrScalar(
|
||||
PvdbcrScalarRecord::PvdbcrScalarRecord(
|
||||
std::string const & recordName,epics::pvData::PVStructurePtr const & pvStructure,
|
||||
int asLevel,std::string const & asGroup)
|
||||
: PVRecord(recordName,pvStructure,asLevel,asGroup)
|
||||
{}
|
||||
|
||||
PvdbcrScalarPtr PvdbcrScalar::create(
|
||||
PvdbcrScalarRecordPtr PvdbcrScalarRecord::create(
|
||||
std::string const & recordName,std::string const & scalarType,
|
||||
int asLevel,std::string const & asGroup)
|
||||
{
|
||||
@ -46,9 +46,9 @@ PvdbcrScalarPtr PvdbcrScalar::create(
|
||||
add("value",st) ->
|
||||
add("timeStamp",standardField->timeStamp()) ->
|
||||
add("alarm",standardField->alarm()) ->
|
||||
createStructure();
|
||||
createStructure();
|
||||
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(top);
|
||||
PvdbcrScalarPtr pvRecord(new PvdbcrScalar(recordName,pvStructure,asLevel,asGroup));
|
||||
PvdbcrScalarRecordPtr pvRecord(new PvdbcrScalarRecord(recordName,pvStructure,asLevel,asGroup));
|
||||
pvRecord->initPVRecord();
|
||||
return pvRecord;
|
||||
};
|
||||
@ -60,18 +60,18 @@ static const iocshArg arg2 = { "asLevel", iocshArgInt };
|
||||
static const iocshArg arg3 = { "asGroup", iocshArgString };
|
||||
static const iocshArg *args[] = {&arg0,&arg1,&arg2,&arg3};
|
||||
|
||||
static const iocshFuncDef pvdbcrScalarFuncDef = {"pvdbcrScalar", 4,args};
|
||||
static const iocshFuncDef pvdbcrScalarFuncDef = {"pvdbcrScalarRecord", 4,args};
|
||||
|
||||
static void pvdbcrScalarCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
char *sval = args[0].sval;
|
||||
if(!sval) {
|
||||
throw std::runtime_error("pvdbcrScalar recordName not specified");
|
||||
throw std::runtime_error("pvdbcrScalarRecord recordName not specified");
|
||||
}
|
||||
string recordName = string(sval);
|
||||
sval = args[1].sval;
|
||||
if(!sval) {
|
||||
throw std::runtime_error("pvdbcrScalar scalarType not specified");
|
||||
throw std::runtime_error("pvdbcrScalarRecord scalarType not specified");
|
||||
}
|
||||
string scalarType = string(sval);
|
||||
int asLevel = args[2].ival;
|
||||
@ -80,8 +80,8 @@ static void pvdbcrScalarCallFunc(const iocshArgBuf *args)
|
||||
if(sval) {
|
||||
asGroup = string(sval);
|
||||
}
|
||||
epics::pvDatabase::PvdbcrScalarPtr record
|
||||
= epics::pvDatabase::PvdbcrScalar::create(recordName,scalarType);
|
||||
epics::pvDatabase::PvdbcrScalarRecordPtr record
|
||||
= epics::pvDatabase::PvdbcrScalarRecord::create(recordName,scalarType);
|
||||
epics::pvDatabase::PVDatabasePtr master = epics::pvDatabase::PVDatabase::getMaster();
|
||||
record->setAsLevel(asLevel);
|
||||
record->setAsGroup(asGroup);
|
||||
@ -89,7 +89,7 @@ static void pvdbcrScalarCallFunc(const iocshArgBuf *args)
|
||||
if(!result) cout << "recordname " << recordName << " not added" << endl;
|
||||
}
|
||||
|
||||
static void pvdbcrScalarRegister(void)
|
||||
static void pvdbcrScalarRecord(void)
|
||||
{
|
||||
static int firstTime = 1;
|
||||
if (firstTime) {
|
||||
@ -99,5 +99,5 @@ static void pvdbcrScalarRegister(void)
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
epicsExportRegistrar(pvdbcrScalarRegister);
|
||||
epicsExportRegistrar(pvdbcrScalarRecord);
|
||||
}
|
1
src/special/pvdbcrScalarRecord.dbd
Normal file
1
src/special/pvdbcrScalarRecord.dbd
Normal file
@ -0,0 +1 @@
|
||||
registrar("pvdbcrScalarRecord")
|
@ -1 +0,0 @@
|
||||
registrar("pvdbcrScalarRegister")
|
@ -114,7 +114,7 @@ static void pvdbcrTraceRecordCallFunc(const iocshArgBuf *args)
|
||||
if(!result) cout << "recordname " << recordName << " not added" << endl;
|
||||
}
|
||||
|
||||
static void pvdbcrTraceRecordRegister(void)
|
||||
static void pvdbcrTraceRecord(void)
|
||||
{
|
||||
static int firstTime = 1;
|
||||
if (firstTime) {
|
||||
@ -124,5 +124,5 @@ static void pvdbcrTraceRecordRegister(void)
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
epicsExportRegistrar(pvdbcrTraceRecordRegister);
|
||||
epicsExportRegistrar(pvdbcrTraceRecord);
|
||||
}
|
1
src/special/pvdbcrTraceRecord.dbd
Normal file
1
src/special/pvdbcrTraceRecord.dbd
Normal file
@ -0,0 +1 @@
|
||||
registrar("pvdbcrTraceRecord")
|
@ -1 +0,0 @@
|
||||
registrar("pvdbcrTraceRecordRegister")
|
Reference in New Issue
Block a user