Skip to content

Commit

Permalink
Use OpenModelica rtclock.h for timers
Browse files Browse the repository at this point in the history
Older RHEL do not have OSG, Qt 4.6 (4.8 is needed for the Qt timers).
  • Loading branch information
sjoelund authored and adeas31 committed Nov 16, 2018
1 parent 0e17c70 commit 1496912
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions OMEdit/OMEditGUI/Animation/TimeManager.cpp
Expand Up @@ -44,17 +44,16 @@ TimeManager::TimeManager(const double simTime, const double realTime, const doub
_startTime(startTime),
_endTime(endTime),
_pause(true),
mSpeedUp(1.0),
_visualTimer()
mSpeedUp(1.0)
{
mpUpdateSceneTimer = new QTimer;
mpUpdateSceneTimer->setInterval(100);
rt_ext_tp_tick_realtime(&_visualTimer);
}

void TimeManager::updateTick()
{
_visualTimer.tick();
_realTime = _visualTimer.time_m() / 1000.0;
_realTime = rt_ext_tp_tock(&_visualTimer)*1e9;
}

int TimeManager::getTimeFraction()
Expand Down
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/Animation/TimeManager.h
Expand Up @@ -37,7 +37,7 @@

#include <cmath>

#include <osg/Timer>
#include <util/rtclock.h>

#include <QTimer>

Expand Down Expand Up @@ -109,7 +109,7 @@ class TimeManager
//! This variable indicates if the simulation/visualization currently pauses.
bool _pause;
double mSpeedUp;
osg::Timer _visualTimer;
rtclock_t _visualTimer;
QTimer *mpUpdateSceneTimer;
};

Expand Down

0 comments on commit 1496912

Please sign in to comment.