Commit b44d4e66 authored by Carla Guillen Carias's avatar Carla Guillen Carias
Browse files

only comments

parent 5d195b3b
......@@ -88,7 +88,7 @@ protected:
std::string _name;
std::string _mqtt;
std::unique_ptr<reading_t[]> _cache;
std::unique_ptr<reading_t[]> _cache; //ToDo why not vector<reading_t> ?
reading_t _latestValue;
std::unique_ptr<boost::lockfree::spsc_queue<reading_t>> _readingQueue;
};
......
......@@ -199,9 +199,11 @@ void PerfSensorGroup::read() {
if(!_sensors[j]->isLastValid()) {
validMeasurement = false;
}
reading_t lV = _sensors[j]->getLatestValue(); //has no correction (might overflow on no corrected value)
//calculate interval and then apply correction
//has no correction (might only overflow on uncorrected value)
reading_t lV = _sensors[j]->getLatestValue();
//first calculate interval and then apply correction to interval
reading.value = static_cast<uint64_t>(calculateIntervalValue(lV.value, val, PerfSensorBase::MAXCOUNTERVALUE)*correction);
#ifdef DEBUG
LOG(debug) << _groupName << "::" << _sensors[j]->getName() << ": \"" << reading.value << "\"";
......
Supports Markdown
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