Fix energy logs sometimes resetting to 0 on reboots
parent
a30fffd294
commit
1387353074
|
|
@ -323,7 +323,7 @@ void EnergyLogger::sample()
|
|||
medianAcquisition /= sampleStart.msecsTo(sampleEnd);
|
||||
medianStorage /= sampleStart.msecsTo(sampleEnd);
|
||||
|
||||
PowerBalanceLogEntry newest = m_balanceLiveLog.count() > 0 ? m_balanceLiveLog.at(0) : PowerBalanceLogEntry();
|
||||
PowerBalanceLogEntry newest = latestLogEntry(SampleRateAny);
|
||||
double totalConsumption = newest.totalConsumption();
|
||||
double totalProduction = newest.totalProduction();
|
||||
double totalAcquisition = newest.totalAcquisition();
|
||||
|
|
@ -349,7 +349,7 @@ void EnergyLogger::sample()
|
|||
}
|
||||
medianPower /= sampleStart.msecsTo(sampleEnd);
|
||||
|
||||
ThingPowerLogEntry newest = entries.count() > 0 ? entries.first() : ThingPowerLogEntry();
|
||||
ThingPowerLogEntry newest = latestLogEntry(SampleRateAny, thingId);
|
||||
double totalConsumption = newest.totalConsumption();
|
||||
double totalProduction = newest.totalProduction();
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ EnergyManager::EnergyError EnergyManagerImpl::setRootMeter(const ThingId &rootMe
|
|||
m_rootMeter = rootMeter;
|
||||
|
||||
QSettings settings(NymeaSettings::settingsPath() + "/energy.conf", QSettings::IniFormat);
|
||||
settings.setValue("rootMeterThingId", rootMeter->id());
|
||||
settings.setValue("rootMeterThingId", rootMeter->id().toString());
|
||||
|
||||
emit rootMeterChanged();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue