14 #include "levelmeter.h"
15 #include "interface.h"
18 XLevelMeter::XLevelMeter(
const char *name,
bool runtime,
19 Transaction &tr_meas,
const shared_ptr<XMeasure> &meas) :
29 for(
unsigned int ch = 0; ch < tr[ *
this].m_levels.size(); ch++) {
30 tr[ *
this].m_levels[ch] = reader.pop<
double>();
31 m_entries[ch]->value(tr, tr[ *
this].m_levels[ch]);
40 const char **channel_names) {
41 shared_ptr<XScalarEntryList> entries(meas->scalarEntries());
43 for(
int i = 0; channel_names[i]; i++) {
44 shared_ptr<XScalarEntry> entry(create<XScalarEntry>(
45 channel_names[i],
false,
46 dynamic_pointer_cast<XDriver>(shared_from_this()),
"%.4g"));
47 m_entries.push_back(entry);
48 entries->insert(tr_meas, entry);
51 tr[ *
this].m_levels.resize(m_entries.size());
60 auto writer = std::make_shared<RawData>();
63 unsigned int num = m_entries.size();
64 for(
unsigned int ch = 0; ch < num; ch++)
65 writer->push((
double)getLevel(ch));