WIP
This commit is contained in:
63
src/ecmcDAQDataArray.cpp
Normal file
63
src/ecmcDAQDataArray.cpp
Normal file
@@ -0,0 +1,63 @@
|
||||
7/*************************************************************************\
|
||||
* Copyright (c) 2024 PSI
|
||||
* ecmc is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
*
|
||||
* ecmcDAQDataArray.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 "ecmcDAQDataArray.h"
|
||||
#include "ecmcPluginClient.h"
|
||||
|
||||
ecmcDAQDataArray::ecmcDAQDataArray(size_t nelm){
|
||||
buffer_ = new double [nelm];
|
||||
nelm_ = nelm;
|
||||
channelCounter_ = 0;
|
||||
}
|
||||
|
||||
ecmcDAQDataArray::~ecmcDAQDataArray() {
|
||||
|
||||
}
|
||||
|
||||
void ecmcDAQDataArray::addDataItem(char* name, int timeFormat) {
|
||||
dataChannels_.push_back(new ecmcDataChannel(name, timeFormat);
|
||||
channelCounter_++;
|
||||
}
|
||||
|
||||
void ecmcDAQDataArray::connectToDataSources() {
|
||||
if( dataSourceLinked_ ) {
|
||||
return;
|
||||
}
|
||||
|
||||
for(std::vector<ecmcDataChannel*>::iterator pDataCh = dataChannels_.begin(); pDataCh != dataChannels_.end(); ++pDataCh) {
|
||||
if(!(*pDataCh)) {
|
||||
throw std::runtime_error( "Channel empty..");
|
||||
}
|
||||
(*pDataCh)->connectToSource();
|
||||
}
|
||||
|
||||
// Register asyn parameters
|
||||
initAsyn();
|
||||
|
||||
dataSourceLinked_ = 1;
|
||||
}
|
||||
|
||||
void ecmcDAQDataArray::buildHeader(){
|
||||
// Each Data channel takes 4 doubles
|
||||
}
|
||||
|
||||
void ecmcDAQDataArray::execute() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user