View | Details | Raw Unified | Return to bug 1216
Collapse All | Expand All

(-)a/src/energy/model/rv-battery-model.cc (-9 / +11 lines)
 Lines 278-283    Link Here 
278
RvBatteryModel::DoStart (void)
278
RvBatteryModel::DoStart (void)
279
{
279
{
280
  NS_LOG_DEBUG ("RvBatteryModel:Starting battery level update!");
280
  NS_LOG_DEBUG ("RvBatteryModel:Starting battery level update!");
281
  
282
  m_timeStamps.clear();
283
  m_load.clear();
284
  
285
  m_timeStamps.push_back(Simulator::Now());
286
  
281
  UpdateEnergySource ();  // start periodic sampling of load (total current)
287
  UpdateEnergySource ();  // start periodic sampling of load (total current)
282
}
288
}
283
289
 Lines 305-323    Link Here 
305
    {
311
    {
306
      m_load.push_back (load);
312
      m_load.push_back (load);
307
      m_previousLoad = load;
313
      m_previousLoad = load;
308
      if (t != Seconds (0.0))
314
      m_timeStamps[m_timeStamps.size () - 1] = m_lastSampleTime;
309
        {
310
          m_timeStamps[m_timeStamps.size () - 1] = m_lastSampleTime;
311
        }
312
      else
313
        {
314
          m_timeStamps.push_back (Seconds (0.0));
315
        }
316
      m_timeStamps.push_back (t);
315
      m_timeStamps.push_back (t);
317
    }
316
    }
318
  else
317
  else
319
    {
318
    {
320
      m_timeStamps[m_timeStamps.size () - 1] = t;
319
      if (!m_timeStamps.empty())
320
        {
321
          m_timeStamps[m_timeStamps.size () - 1] = t;
322
        }
321
    }
323
    }
322
324
323
  m_lastSampleTime = t;
325
  m_lastSampleTime = t;

Return to bug 1216