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

(-)a/src/visualizer/model/pyviz.cc (-3 / +9 lines)
 Lines 310-329   PyViz::SimulatorRunUntil (Time time) Link Here 
310
310
311
  if (Simulator::Now () >= time)
311
  if (Simulator::Now () >= time)
312
    {
312
    {
313
      return;
313
      return;
314
    }
314
    }
315
  // Schedule a dummy callback function for the target time, to make
315
  // Schedule a dummy callback function for the target time, to make
316
  // sure we stop at the right time.  Otherwise, simulations with few
316
  // sure we stop at the right time.  Otherwise, simulations with few
317
  // events just appear to "jump" big chunks of time.
317
  // events just appear to "jump" big chunks of time.
318
  NS_LOG_LOGIC ("Schedule dummy callback to be called in " << (time - Simulator::Now ()));
318
  NS_LOG_LOGIC ("Schedule dummy callback to be called in "
319
                << (time - Simulator::Now ()));
319
  m_stop = false;
320
  m_stop = false;
320
  Simulator::Cancel (m_stopCallbackEvent);
321
  if (m_stopEvent)
321
  m_stopCallbackEvent = Simulator::Schedule (time - Simulator::Now (), &PyViz::CallbackStopSimulation, this);
322
    {
323
      m_stopEvent->Cancel ();
324
    }
325
  m_stopEvent = MakeEvent (&PyViz::CallbackStopSimulation, this);
326
  Simulator::ScheduleWithContext (0, time - Simulator::Now (),
327
                                  PeekPointer (m_stopEvent));
322
328
323
  Ptr<SimulatorImpl> impl = Simulator::GetImplementation ();
329
  Ptr<SimulatorImpl> impl = Simulator::GetImplementation ();
324
  Ptr<VisualSimulatorImpl> visualImpl = DynamicCast<VisualSimulatorImpl> (impl);
330
  Ptr<VisualSimulatorImpl> visualImpl = DynamicCast<VisualSimulatorImpl> (impl);
325
  if (visualImpl)
331
  if (visualImpl)
326
    {
332
    {
327
      visualImpl->RunRealSimulator ();
333
      visualImpl->RunRealSimulator ();
328
    }
334
    }
329
  else
335
  else
(-)a/src/visualizer/model/pyviz.h (-2 / +2 lines)
 Lines 19-35    Link Here 
19
 * Python is too slow at).
19
 * Python is too slow at).
20
 *
20
 *
21
 * Author: Gustavo Carneiro  <gjc@inescporto.pt>
21
 * Author: Gustavo Carneiro  <gjc@inescporto.pt>
22
 */
22
 */
23
#ifndef NS3_PYVIZ_H
23
#ifndef NS3_PYVIZ_H
24
#define NS3_PYVIZ_H
24
#define NS3_PYVIZ_H
25
25
26
#include "ns3/nstime.h"
26
#include "ns3/nstime.h"
27
#include "ns3/event-id.h"
27
#include "ns3/event-impl.h"
28
#include "ns3/node.h"
28
#include "ns3/node.h"
29
#include "ns3/channel.h"
29
#include "ns3/channel.h"
30
#include "ns3/packet.h"
30
#include "ns3/packet.h"
31
#include "ns3/mac48-address.h"
31
#include "ns3/mac48-address.h"
32
#include "ns3/ipv4-header.h"
32
#include "ns3/ipv4-header.h"
33
#include "ns3/ipv4-l3-protocol.h"
33
#include "ns3/ipv4-l3-protocol.h"
34
34
35
#include <map>
35
#include <map>
 Lines 215-230   private: Link Here 
215
  void TraceNetDevTxLte (std::string context, Ptr<const Packet> packet, Mac48Address const &destination);
215
  void TraceNetDevTxLte (std::string context, Ptr<const Packet> packet, Mac48Address const &destination);
216
  void TraceNetDevRxLte (std::string context, Ptr<const Packet> packet, Mac48Address const &source);
216
  void TraceNetDevRxLte (std::string context, Ptr<const Packet> packet, Mac48Address const &source);
217
217
218
  inline NetDeviceStatistics & FindNetDeviceStatistics (int node, int interface);
218
  inline NetDeviceStatistics & FindNetDeviceStatistics (int node, int interface);
219
219
220
  void DoPause (std::string const &message);
220
  void DoPause (std::string const &message);
221
221
222
  bool m_stop;
222
  bool m_stop;
223
  EventId m_stopCallbackEvent;
223
  Ptr<EventImpl> m_stopEvent;
224
  void CallbackStopSimulation ();
224
  void CallbackStopSimulation ();
225
};
225
};
226
226
227
227
228
}
228
}
229
229
230
#endif /* NS3_PYVIZ_H */
230
#endif /* NS3_PYVIZ_H */

Return to bug 1410