This commit is contained in:
2024-03-01 21:06:50 +01:00
parent c1b7742561
commit 02012d9841
4 changed files with 164 additions and 11 deletions

View File

@@ -0,0 +1,58 @@
7/*************************************************************************\
* Copyright (c) 2024 PSI
* ecmc is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*
* ecmcDAQDataChannel.cpp
*
* Created on: March 1, 2024
* Author: anders sandstrom
* Credits to https://github.com/sgreg/dynamic-loading
*
\*************************************************************************/
// Needed to get headers in ecmc right...
#define ECMC_IS_PLUGIN
#include <sstream>
#include "ecmcDAQDataChannel.h"
#include "ecmcPluginClient.h"
ecmcDAQDataChannel::ecmcDAQDataChannel(int type){
itemCounter_ = 0;
type_ = (double) type;
}
ecmcDAQDataChannel::~ecmcDAQDataChannel() {
}
void ecmcDAQDataChannel::addDataItem(char* name, int timeFormat) {
dataItems_.push_back(new ecmcDAQChannelItem(name, timeFormat);
itemCounter_++;
}
void ecmcDAQDataChannel::connectToDataSources() {
if( dataSourceLinked_ ) {
return;
}
for(std::vector<ecmcDAQChannelItem*>::iterator pDataItem = dataItems_.begin(); pDataItem != dataItems_.end(); ++pDataItem) {
if(!(*pDataItem)) {
throw std::runtime_error( "Channel empty..");
}
(*pDataItem)->connectToSource();
}
// Register asyn parameters
initAsyn();
dataSourceLinked_ = 1;
}
void ecmcDAQDataChannel::execute() {
}