examples/sensors/panorama/timedcontroller.cpp
changeset 0 876b1a06bc25
equal deleted inserted replaced
-1:000000000000 0:876b1a06bc25
       
     1 
       
     2 
       
     3 #include "inputcontroller.h"
       
     4 #include "timedcontroller.h"
       
     5 #include <QTime>
       
     6 #include <QDebug>
       
     7 
       
     8 TimedController::TimedController(): m_delay(10), m_interval(0){
       
     9     m_exTime = QTime::currentTime();
       
    10     m_exTimestamp =QTime::currentTime();
       
    11     m_timer.setSingleShot(false);
       
    12     m_timer.start(m_delay);
       
    13     connect(&m_timer, SIGNAL(timeout()), this, SLOT(handleTimedUpdate()));
       
    14 
       
    15 }
       
    16 
       
    17 TimedController::~TimedController(){
       
    18     m_timer.stop();
       
    19     disconnect(&m_timer);
       
    20 }
       
    21 
       
    22 
       
    23 void TimedController::handleTimedUpdate()
       
    24 {
       
    25     int timeDiff = m_exTime.msecsTo(QTime::currentTime());
       
    26     if (timeDiff<  m_delay) return;
       
    27     updateCoordinates();
       
    28     m_exTime = QTime::currentTime();
       
    29 }
       
    30 
       
    31