This commit is contained in:
2024-03-04 21:30:23 +01:00
parent e7d90c550a
commit 16f1795e32
9 changed files with 160 additions and 47 deletions

View File

@@ -43,7 +43,7 @@ void ecmcDAQDataChannel::connectToDataSources() {
for(std::vector<ecmcDAQChannelItem*>::iterator pDataItem = dataItems_.begin(); pDataItem != dataItems_.end(); ++pDataItem) {
if(!(*pDataItem)) {
throw std::runtime_error( "Channel empty..");
throw std::runtime_error( "Data item empty..");
}
(*pDataItem)->connectToSource();
dataElementCount_ = dataElementCount_ + (*pDataItem)->getDataElementCount();
@@ -93,3 +93,20 @@ double ecmcDAQDataChannel::getData(int first){
bool ecmcDAQDataChannel::empty(){
return returnedDataCounter_>=dataElementCount_;
}
int ecmcDAQDataChannel::validate() {
if(dataElementCount_==0) {
throw std::runtime_error("Error: DAQ-Channel element count 0");
}
if(itemCounter_==0) {
throw std::runtime_error("Error: DAQ-Channel data item count 0");
}
for(std::vector<ecmcDAQChannelItem*>::iterator pDataItem = dataItems_.begin(); pDataItem != dataItems_.end(); ++pDataItem) {
if(!(*pDataItem)) {
throw std::runtime_error( "Data item empty..");
}
(*pDataItem)->validate();
}
return 0;
}