WIP
This commit is contained in:
58
src/ecmcDAQDataChannel.cpp
Normal file
58
src/ecmcDAQDataChannel.cpp
Normal 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() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user