Ejemplo n.º 1
0
void
MsgChannel::eventPingTimeout(void)
{
	auto diff(this->getDiffFromLastRead());
	PWLOGLIB("eventPingTimeout: diff:%jd this:%p type:%s", diff, this, typeid(*this).name());
	setExpired();
}
Ejemplo n.º 2
0
		GpsConnection::GpsConnection (QObject *parent)
			: QObject (parent)
			, isExpired_ (true)
			, gpsPort_ (AbstractGpsPort::createGpsPort (ComPortSettings::isMockPort ()
														? AbstractGpsPort::MOCK_GPS_PORT
														: AbstractGpsPort::REAL_GPS_PORT))
		{
			constexpr int currentCoordinatesExpireTime = 1500;
			coordinatesExpireTimer_.setInterval (currentCoordinatesExpireTime);

			connect (&coordinatesExpireTimer_, SIGNAL (timeout ()), SLOT (setExpired ()));

			connect (gpsPort_.get (), SIGNAL (ggaSentenceReceived (GgaSentence)),
					 SLOT (rememberCoordinates (GgaSentence)));

			connect (gpsPort_.get (), SIGNAL (sentenceReady (QString)), SLOT (showSentence (QString)));
		}
Ejemplo n.º 3
0
void Bullet::update(
    void
    )
{
    Rectf boundary;


    if(m_velocity.lengthSquared() > 0)
    {
        m_orientation = atan2f(m_velocity.y, m_velocity.x);
    }

    m_position += m_velocity;

    Grid::getInstance()->applyExplosiveForce(0.5f *m_velocity.length(), m_position, 80);

    // Check if the bullet is still in boundary.
    boundary = Rectf(0, 0, (float) constants::WINDOW_WIDTH, (float) constants::WINDOW_HEIGHT);
    if(!boundary.contains(Vector2f(m_position.x, m_position.y)))
    {
        setExpired();
    }
}
Ejemplo n.º 4
0
//----[  releaseScenery  ]-----------------------------------------------------
void SceneryBinding::releaseScenery() {
  scenery_ = NULL;
  setExpired();
}