clang compilation fixes
This commit is contained in:
@ -60,7 +60,7 @@ bool ArrayPerformance::init()
|
|||||||
|
|
||||||
initPVRecord();
|
initPVRecord();
|
||||||
PVScalarArrayPtr pvScalarArray = getPVStructure()->getScalarArrayField("value",pvLong);
|
PVScalarArrayPtr pvScalarArray = getPVStructure()->getScalarArrayField("value",pvLong);
|
||||||
if(pvScalarArray==NULL) return false;
|
if(!pvScalarArray) return false;
|
||||||
pvValue = static_pointer_cast<PVLongArray>(pvScalarArray);
|
pvValue = static_pointer_cast<PVLongArray>(pvScalarArray);
|
||||||
ArrayPerformancePtr xxx = dynamic_pointer_cast<ArrayPerformance>(getPtrSelf());
|
ArrayPerformancePtr xxx = dynamic_pointer_cast<ArrayPerformance>(getPtrSelf());
|
||||||
arrayPerformanceThread = ArrayPerformanceThreadPtr(new ArrayPerformanceThread(xxx));
|
arrayPerformanceThread = ArrayPerformanceThreadPtr(new ArrayPerformanceThread(xxx));
|
||||||
|
@ -266,9 +266,9 @@ void LongArrayChannelGet::channelGetConnect(
|
|||||||
bool structureOK(true);
|
bool structureOK(true);
|
||||||
PVStructurePtr pvStructure = getPVDataCreate()->createPVStructure(structure);
|
PVStructurePtr pvStructure = getPVDataCreate()->createPVStructure(structure);
|
||||||
PVFieldPtr pvField = pvStructure->getSubField("timeStamp");
|
PVFieldPtr pvField = pvStructure->getSubField("timeStamp");
|
||||||
if(pvField==NULL) structureOK = false;
|
if(!pvField) structureOK = false;
|
||||||
pvField = pvStructure->getSubField("value");
|
pvField = pvStructure->getSubField("value");
|
||||||
if(pvField==NULL) {
|
if(!pvField) {
|
||||||
structureOK = false;
|
structureOK = false;
|
||||||
} else {
|
} else {
|
||||||
FieldConstPtr field = pvField->getField();
|
FieldConstPtr field = pvField->getField();
|
||||||
@ -292,7 +292,7 @@ bool LongArrayChannelGet::init()
|
|||||||
{
|
{
|
||||||
ChannelProvider::shared_pointer channelProvider =
|
ChannelProvider::shared_pointer channelProvider =
|
||||||
getChannelProviderRegistry()->getProvider(providerName);
|
getChannelProviderRegistry()->getProvider(providerName);
|
||||||
if(channelProvider==NULL) {
|
if(!channelProvider) {
|
||||||
cout << "provider " << providerName << " not found" << endl;
|
cout << "provider " << providerName << " not found" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -305,7 +305,7 @@ bool LongArrayChannelGet::init()
|
|||||||
if(!status.isOK()) return false;
|
if(!status.isOK()) return false;
|
||||||
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
||||||
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
||||||
if(pvRequest==NULL) {
|
if(!pvRequest) {
|
||||||
cout << "request logic error " << createRequest->getMessage() << endl;
|
cout << "request logic error " << createRequest->getMessage() << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -334,10 +334,10 @@ void LongArrayChannelGet::destroy()
|
|||||||
if(runReturned) break;
|
if(runReturned) break;
|
||||||
epicsThreadSleep(.01);
|
epicsThreadSleep(.01);
|
||||||
}
|
}
|
||||||
if(longArrayChannelRequester!=NULL) {
|
if(longArrayChannelRequester) {
|
||||||
longArrayChannelRequester->destroy();
|
longArrayChannelRequester->destroy();
|
||||||
}
|
}
|
||||||
if(longArrayChannelGetRequester!=NULL) {
|
if(longArrayChannelGetRequester) {
|
||||||
longArrayChannelGetRequester->destroy();
|
longArrayChannelGetRequester->destroy();
|
||||||
}
|
}
|
||||||
thread->exitWait();
|
thread->exitWait();
|
||||||
@ -433,7 +433,7 @@ void LongArrayChannelGet::run()
|
|||||||
CreateRequest::create();
|
CreateRequest::create();
|
||||||
PVStructurePtr pvRequest =
|
PVStructurePtr pvRequest =
|
||||||
createRequest->createRequest(request);
|
createRequest->createRequest(request);
|
||||||
if(pvRequest==NULL) {
|
if(!pvRequest) {
|
||||||
cout << "request logic error " << createRequest->getMessage() << endl;
|
cout << "request logic error " << createRequest->getMessage() << endl;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
@ -138,9 +138,9 @@ void LAMMonitorRequester::monitorConnect(Status const & status,
|
|||||||
}
|
}
|
||||||
bool structureOK(true);
|
bool structureOK(true);
|
||||||
FieldConstPtr field = structure->getField("timeStamp");
|
FieldConstPtr field = structure->getField("timeStamp");
|
||||||
if(field==NULL) structureOK = false;
|
if(!field) structureOK = false;
|
||||||
field = structure->getField("value");
|
field = structure->getField("value");
|
||||||
if(field==NULL) {
|
if(!field) {
|
||||||
structureOK = false;
|
structureOK = false;
|
||||||
} else {
|
} else {
|
||||||
if(field->getType()!=scalarArray) {
|
if(field->getType()!=scalarArray) {
|
||||||
@ -179,9 +179,9 @@ void LAMMonitorRequester::run()
|
|||||||
{
|
{
|
||||||
Lock xx(mutex);
|
Lock xx(mutex);
|
||||||
monitorElement = longArrayMonitor->monitor->poll();
|
monitorElement = longArrayMonitor->monitor->poll();
|
||||||
if(monitorElement!=NULL) pvStructure = monitorElement->pvStructurePtr;
|
if(monitorElement) pvStructure = monitorElement->pvStructurePtr;
|
||||||
}
|
}
|
||||||
if(monitorElement==NULL) break;
|
if(!monitorElement) break;
|
||||||
if(waitTime>0.0) epicsThreadSleep(waitTime);
|
if(waitTime>0.0) epicsThreadSleep(waitTime);
|
||||||
pvTimeStamp.attach(pvStructure->getSubField("timeStamp"));
|
pvTimeStamp.attach(pvStructure->getSubField("timeStamp"));
|
||||||
pvTimeStamp.get(timeStamp);
|
pvTimeStamp.get(timeStamp);
|
||||||
@ -268,7 +268,7 @@ bool LongArrayMonitor::init(
|
|||||||
monitorRequester->init();
|
monitorRequester->init();
|
||||||
ChannelProvider::shared_pointer channelProvider =
|
ChannelProvider::shared_pointer channelProvider =
|
||||||
getChannelProviderRegistry()->getProvider(providerName);
|
getChannelProviderRegistry()->getProvider(providerName);
|
||||||
if(channelProvider==NULL) {
|
if(!channelProvider) {
|
||||||
cout << "provider " << providerName << " not found" << endl;
|
cout << "provider " << providerName << " not found" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -282,7 +282,7 @@ bool LongArrayMonitor::init(
|
|||||||
request += "]field(value,timeStamp,alarm)";
|
request += "]field(value,timeStamp,alarm)";
|
||||||
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
||||||
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
||||||
if(pvRequest==NULL) {
|
if(!pvRequest) {
|
||||||
cout << "request logic error " << createRequest->getMessage() << endl;
|
cout << "request logic error " << createRequest->getMessage() << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ private:
|
|||||||
bool LongArrayChannelPut::init()
|
bool LongArrayChannelPut::init()
|
||||||
{
|
{
|
||||||
ChannelProvider::shared_pointer channelProvider = getChannelProviderRegistry()->getProvider(providerName);
|
ChannelProvider::shared_pointer channelProvider = getChannelProviderRegistry()->getProvider(providerName);
|
||||||
if(channelProvider==NULL) {
|
if(!channelProvider) {
|
||||||
cout << "provider " << providerName << " not found" << endl;
|
cout << "provider " << providerName << " not found" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ bool LongArrayChannelPut::init()
|
|||||||
if(!status.isOK()) return false;
|
if(!status.isOK()) return false;
|
||||||
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
||||||
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
||||||
if(pvRequest==NULL) {
|
if(!pvRequest) {
|
||||||
cout << "request logic error " << createRequest->getMessage() << endl;
|
cout << "request logic error " << createRequest->getMessage() << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -187,7 +187,7 @@ void LongArrayChannelPut::channelPutConnect(
|
|||||||
bitSet = BitSetPtr(new BitSet(pvStructure->getNumberFields()));
|
bitSet = BitSetPtr(new BitSet(pvStructure->getNumberFields()));
|
||||||
bool structureOK(true);
|
bool structureOK(true);
|
||||||
PVFieldPtr pvField = pvStructure->getSubField("value");
|
PVFieldPtr pvField = pvStructure->getSubField("value");
|
||||||
if(pvField==NULL) {
|
if(!pvField) {
|
||||||
structureOK = false;
|
structureOK = false;
|
||||||
} else {
|
} else {
|
||||||
FieldConstPtr field = pvField->getField();
|
FieldConstPtr field = pvField->getField();
|
||||||
@ -294,7 +294,7 @@ void LongArrayChannelPut::run()
|
|||||||
channelPut->destroy();
|
channelPut->destroy();
|
||||||
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
CreateRequest::shared_pointer createRequest = CreateRequest::create();
|
||||||
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
PVStructurePtr pvRequest = createRequest->createRequest(request);
|
||||||
if(pvRequest==NULL) {
|
if(!pvRequest) {
|
||||||
cout << "request logic error " << createRequest->getMessage() << endl;
|
cout << "request logic error " << createRequest->getMessage() << endl;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ void ExampleDatabase::create()
|
|||||||
recordName = "examplePowerSupply";
|
recordName = "examplePowerSupply";
|
||||||
PVStructurePtr pvStructure = createPowerSupply();
|
PVStructurePtr pvStructure = createPowerSupply();
|
||||||
PowerSupplyPtr psr = PowerSupply::create(recordName,pvStructure);
|
PowerSupplyPtr psr = PowerSupply::create(recordName,pvStructure);
|
||||||
if(psr==NULL) {
|
if(!psr) {
|
||||||
cout << "PowerSupply::create failed" << endl;
|
cout << "PowerSupply::create failed" << endl;
|
||||||
} else {
|
} else {
|
||||||
result = master->addRecord(psr);
|
result = master->addRecord(psr);
|
||||||
@ -158,7 +158,7 @@ void ExampleDatabase::create()
|
|||||||
}
|
}
|
||||||
recordName = "laptoprecordListPGRPC";
|
recordName = "laptoprecordListPGRPC";
|
||||||
pvRecord = RecordListRecord::create(recordName);
|
pvRecord = RecordListRecord::create(recordName);
|
||||||
if(pvRecord==NULL) {
|
if(!pvRecord) {
|
||||||
cout << "RecordListRecord::create failed" << endl;
|
cout << "RecordListRecord::create failed" << endl;
|
||||||
} else {
|
} else {
|
||||||
result = master->addRecord(pvRecord);
|
result = master->addRecord(pvRecord);
|
||||||
|
@ -42,10 +42,10 @@ public:
|
|||||||
{
|
{
|
||||||
pvField = getPVDataCreate()->createPVField(field);
|
pvField = getPVDataCreate()->createPVField(field);
|
||||||
raiseMonitor = true;
|
raiseMonitor = true;
|
||||||
if(pvFieldOptions!=NULL) {
|
if(pvFieldOptions) {
|
||||||
PVStringPtr pvString =
|
PVStringPtr pvString =
|
||||||
pvFieldOptions->getSubField<PVString>("raiseMonitor");
|
pvFieldOptions->getSubField<PVString>("raiseMonitor");
|
||||||
if(pvString!=NULL) {
|
if(pvString) {
|
||||||
string value = pvString->get();
|
string value = pvString->get();
|
||||||
if(value.compare("false")==0) raiseMonitor = false;
|
if(value.compare("false")==0) raiseMonitor = false;
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ void ExampleMonitorPlugin::create()
|
|||||||
static OnChangePluginCreatorPtr plugin;
|
static OnChangePluginCreatorPtr plugin;
|
||||||
static Mutex mutex;
|
static Mutex mutex;
|
||||||
Lock xx(mutex);
|
Lock xx(mutex);
|
||||||
if(plugin==NULL) {
|
if(!plugin) {
|
||||||
plugin = OnChangePluginCreatorPtr(new OnChangePluginCreator());
|
plugin = OnChangePluginCreatorPtr(new OnChangePluginCreator());
|
||||||
MonitorPluginManager::get()->addPlugin(pluginName,plugin);
|
MonitorPluginManager::get()->addPlugin(pluginName,plugin);
|
||||||
}
|
}
|
||||||
|
@ -65,12 +65,12 @@ bool ExampleLink::init()
|
|||||||
pvAlarm.attach(pvStructure->getSubField("alarm"));
|
pvAlarm.attach(pvStructure->getSubField("alarm"));
|
||||||
pvValue = static_pointer_cast<PVDoubleArray>(
|
pvValue = static_pointer_cast<PVDoubleArray>(
|
||||||
pvStructure->getScalarArrayField("value",pvDouble));
|
pvStructure->getScalarArrayField("value",pvDouble));
|
||||||
if(pvValue==NULL) {
|
if(!pvValue) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ChannelProvider::shared_pointer provider =
|
ChannelProvider::shared_pointer provider =
|
||||||
getChannelProviderRegistry()->getProvider(providerName);
|
getChannelProviderRegistry()->getProvider(providerName);
|
||||||
if(provider==NULL) {
|
if(!provider) {
|
||||||
cout << getRecordName() << " provider "
|
cout << getRecordName() << " provider "
|
||||||
<< providerName << " does not exist" << endl;
|
<< providerName << " does not exist" << endl;
|
||||||
return false;
|
return false;
|
||||||
@ -97,7 +97,7 @@ bool ExampleLink::init()
|
|||||||
}
|
}
|
||||||
getPVValue = static_pointer_cast<PVDoubleArray>(
|
getPVValue = static_pointer_cast<PVDoubleArray>(
|
||||||
getPVStructure->getScalarArrayField("value",pvDouble));
|
getPVStructure->getScalarArrayField("value",pvDouble));
|
||||||
if(getPVValue==NULL) {
|
if(!getPVValue) {
|
||||||
cout << getRecordName() << " get value not PVDoubleArray" << endl;
|
cout << getRecordName() << " get value not PVDoubleArray" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -70,8 +70,8 @@ static void exampleLinkCallFunc(const iocshArgBuf *args)
|
|||||||
char *providerName = args[1].sval;
|
char *providerName = args[1].sval;
|
||||||
char *channelName = args[2].sval;
|
char *channelName = args[2].sval;
|
||||||
ExampleLinkPtr record = ExampleLink::create(recordName,providerName,channelName);
|
ExampleLinkPtr record = ExampleLink::create(recordName,providerName,channelName);
|
||||||
if(record!=NULL)
|
if(record)
|
||||||
result = master->addRecord(record);
|
result = master->addRecord(record);
|
||||||
if(!result) cout << "recordname" << " not added" << endl;
|
if(!result) cout << "recordname" << " not added" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ static void exampleServerCallFunc(const iocshArgBuf *args)
|
|||||||
if(!result) cout << "recordname" << " not added" << endl;
|
if(!result) cout << "recordname" << " not added" << endl;
|
||||||
PVRecordPtr pvRecord = RecordListRecord::create(
|
PVRecordPtr pvRecord = RecordListRecord::create(
|
||||||
"laptoprecordListPGRPC");
|
"laptoprecordListPGRPC");
|
||||||
if(pvRecord==NULL) {
|
if(!pvRecord) {
|
||||||
cout << "RecordListRecord::create failed" << endl;
|
cout << "RecordListRecord::create failed" << endl;
|
||||||
} else {
|
} else {
|
||||||
result = master->addRecord(pvRecord);
|
result = master->addRecord(pvRecord);
|
||||||
|
@ -371,7 +371,7 @@ void PVRecordField::init()
|
|||||||
{
|
{
|
||||||
fullFieldName = pvField->getFieldName();
|
fullFieldName = pvField->getFieldName();
|
||||||
PVRecordStructurePtr pvParent = parent;
|
PVRecordStructurePtr pvParent = parent;
|
||||||
while(pvParent.get()!= NULL) {
|
while(pvParent) {
|
||||||
string parentName = pvParent->getPVField()->getFieldName();
|
string parentName = pvParent->getPVField()->getFieldName();
|
||||||
if(parentName.size()>0) {
|
if(parentName.size()>0) {
|
||||||
fullFieldName = pvParent->getPVField()->getFieldName()
|
fullFieldName = pvParent->getPVField()->getFieldName()
|
||||||
@ -434,7 +434,7 @@ void PVRecordField::removeListener(PVListenerPtr const & pvListener)
|
|||||||
|
|
||||||
void PVRecordField::postPut()
|
void PVRecordField::postPut()
|
||||||
{
|
{
|
||||||
if(parent!=NULL) {
|
if(parent) {
|
||||||
parent->postParent(getPtrSelf());
|
parent->postParent(getPtrSelf());
|
||||||
}
|
}
|
||||||
postSubField();
|
postSubField();
|
||||||
@ -448,7 +448,7 @@ void PVRecordField::postParent(PVRecordFieldPtr const & subField)
|
|||||||
{
|
{
|
||||||
(*iter)->dataPut(pvrs,subField);
|
(*iter)->dataPut(pvrs,subField);
|
||||||
}
|
}
|
||||||
if(parent!=NULL) parent->postParent(subField);
|
if(parent) parent->postParent(subField);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PVRecordField::postSubField()
|
void PVRecordField::postSubField()
|
||||||
|
@ -70,7 +70,7 @@ typedef std::tr1::shared_ptr<ChannelArrayLocal> ChannelArrayLocalPtr;
|
|||||||
static bool getProcess(PVStructurePtr pvRequest,bool processDefault)
|
static bool getProcess(PVStructurePtr pvRequest,bool processDefault)
|
||||||
{
|
{
|
||||||
PVFieldPtr pvField = pvRequest->getSubField("record._options.process");
|
PVFieldPtr pvField = pvRequest->getSubField("record._options.process");
|
||||||
if(pvField==NULL || pvField->getField()->getType()!=scalar) {
|
if(!pvField || pvField->getField()->getType()!=scalar) {
|
||||||
return processDefault;
|
return processDefault;
|
||||||
}
|
}
|
||||||
ScalarConstPtr scalar = static_pointer_cast<const Scalar>(
|
ScalarConstPtr scalar = static_pointer_cast<const Scalar>(
|
||||||
@ -146,13 +146,13 @@ ChannelProcessLocalPtr ChannelProcessLocal::create(
|
|||||||
PVFieldPtr pvField;
|
PVFieldPtr pvField;
|
||||||
PVStructurePtr pvOptions;
|
PVStructurePtr pvOptions;
|
||||||
int nProcess = 1;
|
int nProcess = 1;
|
||||||
if(pvRequest!=NULL) pvField = pvRequest->getSubField("record._options");
|
if(pvRequest) pvField = pvRequest->getSubField("record._options");
|
||||||
if(pvField.get()!=NULL) {
|
if(pvField) {
|
||||||
pvOptions = static_pointer_cast<PVStructure>(pvField);
|
pvOptions = static_pointer_cast<PVStructure>(pvField);
|
||||||
pvField = pvOptions->getSubField("nProcess");
|
pvField = pvOptions->getSubField("nProcess");
|
||||||
if(pvField.get()!=NULL) {
|
if(pvField) {
|
||||||
PVStringPtr pvString = pvOptions->getStringField("nProcess");
|
PVStringPtr pvString = pvOptions->getStringField("nProcess");
|
||||||
if(pvString.get()!=NULL) {
|
if(pvString) {
|
||||||
int size;
|
int size;
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << pvString->get();
|
ss << pvString->get();
|
||||||
@ -291,7 +291,7 @@ ChannelGetLocalPtr ChannelGetLocal::create(
|
|||||||
pvRecord->getPVRecordStructure()->getPVStructure(),
|
pvRecord->getPVRecordStructure()->getPVStructure(),
|
||||||
pvRequest,
|
pvRequest,
|
||||||
"");
|
"");
|
||||||
if(pvCopy==NULL) {
|
if(!pvCopy) {
|
||||||
Status status(
|
Status status(
|
||||||
Status::STATUSTYPE_ERROR,
|
Status::STATUSTYPE_ERROR,
|
||||||
"invalid pvRequest");
|
"invalid pvRequest");
|
||||||
@ -442,7 +442,7 @@ ChannelPutLocalPtr ChannelPutLocal::create(
|
|||||||
pvRecord->getPVRecordStructure()->getPVStructure(),
|
pvRecord->getPVRecordStructure()->getPVStructure(),
|
||||||
pvRequest,
|
pvRequest,
|
||||||
"");
|
"");
|
||||||
if(pvCopy==NULL) {
|
if(!pvCopy) {
|
||||||
Status status(
|
Status status(
|
||||||
Status::STATUSTYPE_ERROR,
|
Status::STATUSTYPE_ERROR,
|
||||||
"invalid pvRequest");
|
"invalid pvRequest");
|
||||||
@ -624,7 +624,7 @@ ChannelPutGetLocalPtr ChannelPutGetLocal::create(
|
|||||||
pvRecord->getPVRecordStructure()->getPVStructure(),
|
pvRecord->getPVRecordStructure()->getPVStructure(),
|
||||||
pvRequest,
|
pvRequest,
|
||||||
"getField");
|
"getField");
|
||||||
if(pvPutCopy==NULL || pvGetCopy==NULL) {
|
if(!pvPutCopy || !pvGetCopy) {
|
||||||
Status status(
|
Status status(
|
||||||
Status::STATUSTYPE_ERROR,
|
Status::STATUSTYPE_ERROR,
|
||||||
"invalid pvRequest");
|
"invalid pvRequest");
|
||||||
@ -846,7 +846,7 @@ ChannelArrayLocalPtr ChannelArrayLocal::create(
|
|||||||
fieldName = fieldName.substr(6);
|
fieldName = fieldName.substr(6);
|
||||||
}
|
}
|
||||||
pvField = pvRecord->getPVRecordStructure()->getPVStructure()->getSubField(fieldName);
|
pvField = pvRecord->getPVRecordStructure()->getPVStructure()->getSubField(fieldName);
|
||||||
if(pvField==NULL) {
|
if(!pvField) {
|
||||||
Status status(
|
Status status(
|
||||||
Status::STATUSTYPE_ERROR,fieldName +" not found");
|
Status::STATUSTYPE_ERROR,fieldName +" not found");
|
||||||
ChannelArrayLocalPtr channelArray;
|
ChannelArrayLocalPtr channelArray;
|
||||||
@ -1190,7 +1190,7 @@ void ChannelLocal::getField(GetFieldRequester::shared_pointer const &requester,
|
|||||||
}
|
}
|
||||||
PVFieldPtr pvField =
|
PVFieldPtr pvField =
|
||||||
pvRecord->getPVRecordStructure()->getPVStructure()->getSubField(subField);
|
pvRecord->getPVRecordStructure()->getPVStructure()->getSubField(subField);
|
||||||
if(pvField.get()!=NULL) {
|
if(pvField) {
|
||||||
requester->getDone(Status::Ok,pvField->getField());
|
requester->getDone(Status::Ok,pvField->getField());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ MonitorElementPtr MonitorLocal::releaseActiveElement()
|
|||||||
{
|
{
|
||||||
Lock xx(mutex);
|
Lock xx(mutex);
|
||||||
MonitorElementPtr newActive = queue->getFree();
|
MonitorElementPtr newActive = queue->getFree();
|
||||||
if(newActive==NULL) return activeElement;
|
if(!newActive) return activeElement;
|
||||||
pvCopy->updateCopyFromBitSet(activeElement->pvStructurePtr,activeElement->changedBitSet);
|
pvCopy->updateCopyFromBitSet(activeElement->pvStructurePtr,activeElement->changedBitSet);
|
||||||
BitSetUtil::compress(activeElement->changedBitSet,activeElement->pvStructurePtr);
|
BitSetUtil::compress(activeElement->changedBitSet,activeElement->pvStructurePtr);
|
||||||
BitSetUtil::compress(activeElement->overrunBitSet,activeElement->pvStructurePtr);
|
BitSetUtil::compress(activeElement->overrunBitSet,activeElement->pvStructurePtr);
|
||||||
|
@ -77,17 +77,17 @@ void PVCopyMonitor::init(PVFieldPtr const &pvField)
|
|||||||
size_t offset = pvCopy->getCopyOffset(pvField);
|
size_t offset = pvCopy->getCopyOffset(pvField);
|
||||||
if(offset==string::npos) return;
|
if(offset==string::npos) return;
|
||||||
PVStructurePtr pvOptions = pvCopy->getOptions(offset);
|
PVStructurePtr pvOptions = pvCopy->getOptions(offset);
|
||||||
if(pvOptions!=NULL) {
|
if(pvOptions) {
|
||||||
PVStringPtr pvName = pvOptions->getSubField<PVString>("plugin");
|
PVStringPtr pvName = pvOptions->getSubField<PVString>("plugin");
|
||||||
if(pvName!=NULL) {
|
if(pvName) {
|
||||||
string pluginName = pvName->get();
|
string pluginName = pvName->get();
|
||||||
MonitorPluginManagerPtr manager = MonitorPluginManager::get();
|
MonitorPluginManagerPtr manager = MonitorPluginManager::get();
|
||||||
MonitorPluginCreatorPtr pluginCreator = manager->findPlugin(pluginName);
|
MonitorPluginCreatorPtr pluginCreator = manager->findPlugin(pluginName);
|
||||||
if(pluginCreator!=NULL) {
|
if(pluginCreator) {
|
||||||
StructureConstPtr top = pvCopy->getStructure();
|
StructureConstPtr top = pvCopy->getStructure();
|
||||||
FieldConstPtr field = pvField->getField();
|
FieldConstPtr field = pvField->getField();
|
||||||
MonitorPluginPtr monitorPlugin = pluginCreator->create(field,top,pvOptions);
|
MonitorPluginPtr monitorPlugin = pluginCreator->create(field,top,pvOptions);
|
||||||
if(monitorPlugin!=NULL) {
|
if(monitorPlugin) {
|
||||||
PVCopyMonitorFieldNodePtr fieldNode(new PVCopyMonitorFieldNode());
|
PVCopyMonitorFieldNodePtr fieldNode(new PVCopyMonitorFieldNode());
|
||||||
fieldNode->monitorPlugin = monitorPlugin;
|
fieldNode->monitorPlugin = monitorPlugin;
|
||||||
fieldNode->offset = offset;
|
fieldNode->offset = offset;
|
||||||
@ -207,7 +207,7 @@ void PVCopyMonitor::dataPut(PVRecordFieldPtr const & pvRecordField)
|
|||||||
changedBitSet->set(offset);
|
changedBitSet->set(offset);
|
||||||
if(isSet) overrunBitSet->set(offset);
|
if(isSet) overrunBitSet->set(offset);
|
||||||
MonitorPluginPtr monitorPlugin = getMonitorPlugin(offset);
|
MonitorPluginPtr monitorPlugin = getMonitorPlugin(offset);
|
||||||
if(monitorPlugin!=NULL) {
|
if(monitorPlugin) {
|
||||||
causeMonitor = monitorPlugin->causeMonitor(
|
causeMonitor = monitorPlugin->causeMonitor(
|
||||||
pvRecordField->getPVField(),
|
pvRecordField->getPVField(),
|
||||||
pvRecord->getPVRecordStructure()->getPVStructure(),
|
pvRecord->getPVRecordStructure()->getPVStructure(),
|
||||||
@ -246,7 +246,7 @@ void PVCopyMonitor::dataPut(
|
|||||||
changedBitSet->set(offset);
|
changedBitSet->set(offset);
|
||||||
if(isSet) overrunBitSet->set(offset);
|
if(isSet) overrunBitSet->set(offset);
|
||||||
MonitorPluginPtr monitorPlugin = getMonitorPlugin(offsetCopyRequested);
|
MonitorPluginPtr monitorPlugin = getMonitorPlugin(offsetCopyRequested);
|
||||||
if(monitorPlugin!=NULL) {
|
if(monitorPlugin) {
|
||||||
causeMonitor = monitorPlugin->causeMonitor(
|
causeMonitor = monitorPlugin->causeMonitor(
|
||||||
requested->getPVField(),
|
requested->getPVField(),
|
||||||
pvRecord->getPVRecordStructure()->getPVStructure(),
|
pvRecord->getPVRecordStructure()->getPVStructure(),
|
||||||
|
@ -63,11 +63,11 @@ bool TraceRecord::init()
|
|||||||
initPVRecord();
|
initPVRecord();
|
||||||
PVStructurePtr pvStructure = getPVStructure();
|
PVStructurePtr pvStructure = getPVStructure();
|
||||||
pvRecordName = pvStructure->getStringField("argument.recordName");
|
pvRecordName = pvStructure->getStringField("argument.recordName");
|
||||||
if(pvRecordName==NULL) return false;
|
if(!pvRecordName) return false;
|
||||||
pvLevel = pvStructure->getIntField("argument.level");
|
pvLevel = pvStructure->getIntField("argument.level");
|
||||||
if(pvLevel==NULL) return false;
|
if(!pvLevel) return false;
|
||||||
pvResult = pvStructure->getStringField("result.status");
|
pvResult = pvStructure->getStringField("result.status");
|
||||||
if(pvResult==NULL) return false;
|
if(!pvResult) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ void TraceRecord::process()
|
|||||||
{
|
{
|
||||||
string name = pvRecordName->get();
|
string name = pvRecordName->get();
|
||||||
PVRecordPtr pvRecord = pvDatabase->findRecord(name);
|
PVRecordPtr pvRecord = pvDatabase->findRecord(name);
|
||||||
if(pvRecord==NULL) {
|
if(!pvRecord) {
|
||||||
pvResult->put(name + " not found");
|
pvResult->put(name + " not found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ bool PowerSupply::init()
|
|||||||
PVFieldPtr pvField;
|
PVFieldPtr pvField;
|
||||||
bool result;
|
bool result;
|
||||||
pvField = pvStructure->getSubField("timeStamp");
|
pvField = pvStructure->getSubField("timeStamp");
|
||||||
if(pvField==NULL) {
|
if(!pvField) {
|
||||||
cerr << "no timeStamp" << endl;
|
cerr << "no timeStamp" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -91,7 +91,7 @@ bool PowerSupply::init()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
pvField = pvStructure->getSubField("alarm");
|
pvField = pvStructure->getSubField("alarm");
|
||||||
if(pvField==NULL) {
|
if(!pvField) {
|
||||||
cerr << "no alarm" << endl;
|
cerr << "no alarm" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -101,17 +101,17 @@ bool PowerSupply::init()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
pvCurrent = pvStructure->getSubField<PVDouble>("current.value");
|
pvCurrent = pvStructure->getSubField<PVDouble>("current.value");
|
||||||
if(pvCurrent==NULL) {
|
if(!pvCurrent) {
|
||||||
cerr << "no current\n";
|
cerr << "no current\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
pvVoltage = pvStructure->getSubField<PVDouble>("voltage.value");
|
pvVoltage = pvStructure->getSubField<PVDouble>("voltage.value");
|
||||||
if(pvVoltage==NULL) {
|
if(!pvVoltage) {
|
||||||
cerr << "no current\n";
|
cerr << "no current\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
pvPower = pvStructure->getSubField<PVDouble>("power.value");
|
pvPower = pvStructure->getSubField<PVDouble>("power.value");
|
||||||
if(pvPower==NULL) {
|
if(!pvPower) {
|
||||||
cerr << "no powert\n";
|
cerr << "no powert\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user