mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 10:03:58 +02:00
Add test for adding waypoints
This commit is contained in:
parent
e1bca0b7d9
commit
737c9a49c7
3 changed files with 65 additions and 7 deletions
|
@ -63,16 +63,19 @@ LeoWaypointInputFileStreamContainer::GetNextSample (Waypoint &sample)
|
|||
NS_ABORT_MSG ("Input stream is bad");
|
||||
}
|
||||
|
||||
Time newLast = m_lastTime;
|
||||
while (m_input && sample.time < m_lastTime)
|
||||
sample.time = Time (0);
|
||||
sample.position = Vector (0.0, 0.0, 0.0);
|
||||
bool updated = false;
|
||||
while (sample.time < m_lastTime && (m_input >> sample))
|
||||
{
|
||||
m_input >> sample;
|
||||
newLast = sample.time;
|
||||
updated = true;
|
||||
}
|
||||
if (updated)
|
||||
{
|
||||
m_lastTime = sample.time;
|
||||
}
|
||||
bool res = (newLast != m_lastTime) && m_input;
|
||||
m_lastTime = newLast;
|
||||
|
||||
return res;
|
||||
return updated;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue