Add time in first element

This commit is contained in:
2024-03-05 09:58:56 +01:00
parent b069f36c69
commit cfe8be8196
5 changed files with 10 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ USR_CXXFLAGS += -std=c++17
OPT_CXXFLAGS_YES = -O3
# dependencies
#ECmasterECMC_VERSION = v1.1.0
ECmasterECMC_VERSION = v1.1.0
ecmc_VERSION = 9.1.0
BASE_DIR = .

View File

@@ -200,7 +200,7 @@ class ecmcDAQChannelItem {
default:
data = 0;
return ERROR_MEM_INVALID_DATA_TYPE;
return ERROR_DAQ_MEM_INVALID_DATA_TYPE;
break;
}

View File

@@ -23,7 +23,6 @@
#include "ecmcPluginClient.h"
ecmcDAQDataArray::ecmcDAQDataArray(const char* name, const char* portName)
: asynPortDriver(portName,
1, /* maxAddr */
@@ -49,6 +48,7 @@ ecmcDAQDataArray::ecmcDAQDataArray(const char* name, const char* portName)
enablePlugin_ = -1;
dataSourcesLinked_ = 0;
name_ = name;
master_ = (ecmcEc*)getEcMaster();
printf("Created an array with name = %s, asynPortName = %s\n",name, portName);
}
@@ -156,6 +156,10 @@ void ecmcDAQDataArray::execute() {
if(!enablePlugin_) {
return;
}
//convert to micro secs 32bit and double
buffer_[0] =(double)((master_->getTimeNs()/1000)& 0xFFFFFFFF);
int first = 1;
size_t index = firstDataElementIndex_ ;
for(std::vector<ecmcDAQDataChannel*>::iterator pDataCh = dataChannels_.begin(); pDataCh != dataChannels_.end(); ++pDataCh) {

View File

@@ -17,6 +17,7 @@
#include <string>
#include "ecmcDAQDataChannel.h"
#include "ecmcAsynPortDriver.h"
#include "ecmcEc.h"
/* Class to format an array of ecmcDAQDataChannels with headers and push over asyn to epics */
class ecmcDAQDataArray : public asynPortDriver {
@@ -50,7 +51,7 @@ private:
int asynEnableId_; // Enable/disable
int asynRawDataId_; // Raw data buffer
int enablePlugin_; // Enable
ecmcEc *master_;
};
#endif /* ECMC_DAQ_DATA_ARRAY_H_ */

View File

@@ -19,6 +19,6 @@
#define ECMC_PLUGIN_ENABLE_OPTION_CMD "ENABLE="
#define ERROR_MEM_INVALID_DATA_TYPE 1000;
#define ERROR_DAQ_MEM_INVALID_DATA_TYPE 1000;
#endif /* ECMC_SCOPE_DEFS_H_ */