Commit 1d39890a authored by Alessio Netti's avatar Alessio Netti

Analytics: minor changes to Cooling Control plugin

parent 242b102e
......@@ -83,14 +83,21 @@ bool CoolingControlOperator::execOnStart() {
void CoolingControlOperator::compute(U_Ptr unit) {
// Querying input data
std::vector<std::vector<reading_t>> buffer;
uint64_t rCtr = 0;
for(const auto& in : unit->getInputs()) {
std::vector<reading_t> bufferInt;
if (!_queryEngine.querySensor(in->getName(), _window, 0, bufferInt, true) || bufferInt.empty()) {
LOG(debug) << "Operator " + _name + ": cannot read from sensor " + in->getName() + "!";
}
rCtr += bufferInt.size();
buffer.push_back(bufferInt);
}
// No sensor data available - we just return
if( rCtr == 0 ) {
return;
}
// Establishing the new setting - needs to be a 32-bit signed integer
int newSetting=-1;
if( _strategy == "continuous" ) {
......
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