1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

refactoring to comply with code style

This commit is contained in:
Manuel Pitz 2021-02-11 14:31:19 +01:00
parent 670b008ca7
commit edea8e1729
3 changed files with 4 additions and 12 deletions

View file

@ -93,7 +93,6 @@ protected:
int* signal_index;//a list of signal_index to do dft on
uint signalCnt;//number of signal_index given by config file
public:
DftHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) :
Hook(p, n, fl, prio, en),
@ -124,7 +123,6 @@ public:
phasorPhase = new Dumper("/tmp/plot/phasorPhase");
phasorAmpitude = new Dumper("/tmp/plot/phasorAmpitude");
phasorFreq = new Dumper("/tmp/plot/phasorFreq");
}
virtual ~DftHook()
@ -136,7 +134,6 @@ public:
delete phasorPhase;
delete phasorAmpitude;
delete phasorFreq;
}
virtual void prepare()
@ -174,7 +171,7 @@ public:
smp_memory[i][j] = 0;
}
window_multiplier = ceil(((double)sample_rate / window_size) / frequency_resolution);//calculate how much zero padding ist needed for a needed resolution
window_multiplier = ceil(((double)sample_rate / window_size) / frequency_resolution); //calculate how much zero padding ist needed for a needed resolution
freq_count = ceil((end_freqency - start_freqency) / frequency_resolution) + 1;
@ -206,7 +203,6 @@ public:
calcWindow(window_type);
state = State::PREPARED;
}
virtual void start()

View file

@ -101,7 +101,7 @@ public:
period = 1.0 / fSmps;
info("parsed config thresh=%f signal_index=%d nominal_period=%f", thresh, idx, period);
debug(LOG_HOOK | 5, "parsed config thresh=%f signal_index=%d nominal_period=%f", thresh, idx, period);
state = State::PARSED;
@ -121,7 +121,6 @@ public:
if (isEdge) {
if (isSynced) {
//timeErr += 1.0 - (cntSmps * period);
if(tsVirt.tv_nsec > 0.5e9)
timeErr += 1.0 - (tsVirt.tv_nsec / 1.0e9);
else
@ -133,7 +132,6 @@ public:
unsigned int tmp = cntEdges < filtLen ? cntEdges : horizonEst;
double cntSmpsAvg = (cntSmpsTotal - filtWin[(cntEdges - tmp) % filtLen]) / tmp;
periodEst = 1.0 / cntSmpsAvg;
//info("cntSmpsAvg %f", cntSmpsAvg);
periodErrComp = timeErr / (cntSmpsAvg * horizonComp);
period = periodEst + periodErrComp;
}
@ -147,7 +145,7 @@ public:
cntSmps = 0;
cntEdges++;
info("Time Error is: %f periodEst %f periodErrComp %f", timeErr, periodEst, periodErrComp);
debug(LOG_HOOK | 5, "Time Error is: %f periodEst %f periodErrComp %f", timeErr, periodEst, periodErrComp);
}
cntSmps++;

View file

@ -671,7 +671,7 @@ int uldaq_start(struct vnode *n)
/* Start the acquisition */
err = ulAInScan(u->device_handle, 0, 0, (AiInputMode) 0, (Range) 0, u->in.buffer_len / u->in.channel_count, &u->in.sample_rate, u->in.scan_options, u->in.flags, u->in.buffer);
if (err != ERR_NO_ERROR) {
ul_decode_error(err);
warning("Failed to start acquisition on DAQ device for node '%s'", node_name(n));
@ -768,8 +768,6 @@ int uldaq_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *r
return cnt;
}
static struct plugin p;
__attribute__((constructor(110)))