INET Framework for OMNeT++/OMNEST
inet::visualizer::AnimationPosition Class Reference

#include <AnimationPosition.h>

Public Types

enum  TimeType { SIMULATION_TIME, ANIMATION_TIME, REAL_TIME }
 

Public Member Functions

 AnimationPosition ()
 
 AnimationPosition (simtime_t simulationTime, double animationTime, double realTime)
 
simtime_t getSimulationTime () const
 
double getAnimationTime () const
 
double getRealTime () const
 
double getTime (TimeType type) const
 
AnimationPositionoperator= (const AnimationPosition &other)
 

Protected Member Functions

double computeRealTime () const
 

Protected Attributes

simtime_t simulationTime
 
double animationTime
 
double realTime
 

Member Enumeration Documentation

Enumerator
SIMULATION_TIME 
ANIMATION_TIME 
REAL_TIME 
30  {
33  REAL_TIME
34  };
Definition: AnimationPosition.h:33
Definition: AnimationPosition.h:32

Constructor & Destructor Documentation

inet::visualizer::AnimationPosition::AnimationPosition ( )
24  :
25  simulationTime(getSimulation()->getSimTime()),
26  animationTime(getSimulation()->getEnvir()->getAnimationTime()),
28 {
29 }
double realTime
Definition: AnimationPosition.h:39
double getAnimationTime() const
Definition: AnimationPosition.h:49
simtime_t simulationTime
Definition: AnimationPosition.h:37
double animationTime
Definition: AnimationPosition.h:38
double computeRealTime() const
Definition: AnimationPosition.cc:52
inet::visualizer::AnimationPosition::AnimationPosition ( simtime_t  simulationTime,
double  animationTime,
double  realTime 
)
31  :
35 {
36 }
double realTime
Definition: AnimationPosition.h:39
simtime_t simulationTime
Definition: AnimationPosition.h:37
double animationTime
Definition: AnimationPosition.h:38

Member Function Documentation

double inet::visualizer::AnimationPosition::computeRealTime ( ) const
protected
53 {
54  struct timeval tv;
55  gettimeofday(&tv, NULL);
56  return tv.tv_sec + tv.tv_usec / 1.0E+6;
57 }
double inet::visualizer::AnimationPosition::getTime ( TimeType  type) const

Referenced by inet::visualizer::AnimationSpeedInterpolator::getCurrentAnimationSpeed().

39 {
40  switch (type) {
41  case SIMULATION_TIME:
42  return simulationTime.dbl();
43  case ANIMATION_TIME:
44  return animationTime;
45  case REAL_TIME:
46  return realTime;
47  default:
48  throw cRuntimeError("Unknown time type");
49  }
50 }
double realTime
Definition: AnimationPosition.h:39
simtime_t simulationTime
Definition: AnimationPosition.h:37
double animationTime
Definition: AnimationPosition.h:38
Definition: AnimationPosition.h:33
Definition: AnimationPosition.h:32
AnimationPosition & inet::visualizer::AnimationPosition::operator= ( const AnimationPosition other)
60 {
61  simulationTime = other.simulationTime;
62  animationTime = other.animationTime;
63  realTime = other.realTime;
64  return *this;
65 }
double realTime
Definition: AnimationPosition.h:39
simtime_t simulationTime
Definition: AnimationPosition.h:37
double animationTime
Definition: AnimationPosition.h:38

Member Data Documentation

double inet::visualizer::AnimationPosition::animationTime
protected

Referenced by getTime(), and operator=().

double inet::visualizer::AnimationPosition::realTime
protected

Referenced by getTime(), and operator=().

simtime_t inet::visualizer::AnimationPosition::simulationTime
protected

Referenced by getTime(), and operator=().


The documentation for this class was generated from the following files: