Commit 39479779 authored by Alessio Netti's avatar Alessio Netti

Analytics: fixing sensor cache initialization

parent 75563503
......@@ -225,7 +225,7 @@ protected:
// The job unit is generated as a hierarchical unit
jobUnit = unitGen.generateFromTemplate(uTemplate, jobTopic, jobData.nodes, this->_mqttPart, this->_enforceTopics, this->_relaxed);
// Initializing sensors if necessary
jobUnit->init(this->_cacheSize);
jobUnit->init(this->_interval);
this->addToUnitCache(jobUnit);
}
return jobUnit;
......
......@@ -231,7 +231,7 @@ public:
OperatorInterface::init(io);
for(const auto u : _units)
u->init(_cacheSize);
u->init(_interval);
this->execOnInit();
}
......@@ -350,7 +350,7 @@ public:
addToUnitCache(tempUnit);
}
// Initializing sensors if necessary
tempUnit->init(_cacheSize);
tempUnit->init(_interval);
compute(tempUnit);
retrieveAndFlush(outMap, tempUnit);
} catch(const exception& e) {
......
......@@ -59,9 +59,9 @@ public:
/**
* @brief Initializes the sensors in the unit
*
* @param cacheSize size of the sensor cache
* @param interval Sampling interval in milliseconds
*/
virtual void init(unsigned int cacheSize) = 0;
virtual void init(unsigned int interval) = 0;
/**
* @brief Sets the name of this unit
......
......@@ -177,16 +177,16 @@ public:
/**
* @brief Initializes the sensors in the unit
*
* @param cacheSize size of the sensor cache
* @param interval Sampling interval in milliseconds
*/
void init(unsigned int cacheSize) override {
void init(unsigned int interval) override {
for(const auto s : _outputs)
if (!s->isInit())
s->initSensor(cacheSize);
s->initSensor(interval);
for (const auto &su : _subUnits)
for (const auto s : su->getOutputs())
if (!s->isInit())
s->initSensor(cacheSize);
s->initSensor(interval);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment