Beispiel #1
0
void
ProcessTimer()
{
  CommonProcessTimer();

  if (!is_simulator()) {
    // now check GPS status
    if (devices != nullptr)
      devices->Tick();

    // also service replay logger
    if (replay && replay->IsActive()) {
      if (CommonInterface::MovementDetected())
        replay->Stop();
    }

    ConnectionProcessTimer();
  } else {
    static PeriodClock m_clock;

    if (replay && replay->IsActive()) {
      m_clock.Update();
    } else if (m_clock.Elapsed() >= 1000) {
      m_clock.Update();
      device_blackboard->ProcessSimulation();
    } else if (!m_clock.IsDefined())
      m_clock.Update();
  }

#ifdef HAVE_TRACKING
  if (tracking != nullptr) {
    tracking->SetSettings(CommonInterface::GetComputerSettings().tracking);
    tracking->OnTimer(CommonInterface::Basic(), CommonInterface::Calculated());
  }
#endif
}
Beispiel #2
0
 /**
  * Call this in the "mouse up" handler.  It will take care for
  * resetting this object when the mouse/finger has moved too much.
  */
 void Moved(RasterPoint _location) {
   if (clock.IsDefined() &&
       manhattan_distance(location, _location) > MAX_DISTANCE_PX)
     Reset();
 }