energy: (fixes #658) EnergySource correct current update

Fixes the update time of EnergySource when SetCurrentA is used.
This commit is contained in:
Alberto Gallegos Ramonet
2022-05-18 11:11:46 +09:00
committed by Tom Henderson
parent afe54bad8d
commit 4e3d9485c4

View File

@@ -110,10 +110,10 @@ SimpleDeviceEnergyModel::SetCurrentA (double current)
m_totalEnergyConsumption += energyToDecrease; m_totalEnergyConsumption += energyToDecrease;
// update last update time stamp // update last update time stamp
m_lastUpdateTime = Simulator::Now (); m_lastUpdateTime = Simulator::Now ();
// notify energy source
m_source->UpdateEnergySource ();
// update the current drain // update the current drain
m_actualCurrentA = current; m_actualCurrentA = current;
// notify energy source
m_source->UpdateEnergySource ();
} }
void void