예제 #1
0
void DJGameUser::setSpeed( quint8 speed )
{
	if ( m_speed != speed ) {
		m_speed	= speed;
		emit speedChanged( this );
	}
}
예제 #2
0
void PositionSource::updatePosition()
{
    if ( m_marbleModel ) {
        bool const hasPosition = m_marbleModel->positionTracking()->status() == Marble::PositionProviderStatusAvailable;

        if ( hasPosition ) {
            Marble::GeoDataCoordinates position = m_marbleModel->positionTracking()->currentLocation();
            m_position.setLongitude( position.longitude( Marble::GeoDataCoordinates::Degree ) );
            m_position.setLatitude( position.latitude( Marble::GeoDataCoordinates::Degree ) );
            m_position.setAltitude( position.altitude() );
        }

        m_speed = m_marbleModel->positionTracking()->speed() * Marble::METER2KM / Marble::SEC2HOUR;
        emit speedChanged();

        if ( hasPosition != m_hasPosition ) {
            m_hasPosition = hasPosition;
            emit hasPositionChanged();
        }

        if ( hasPosition ) {
            emit positionChanged();
        }
    }
}
예제 #3
0
void Monster::setSpeed(int speed){
    if (m_speed == speed)
        return;

    m_speed = speed;
    emit speedChanged(speed);
}
예제 #4
0
void djvImagePlay2TestPlayback::setSpeed(const djvSpeed & speed)
{
    if (speed == _speed)
        return;

    _speed = speed;
    
    Q_EMIT speedChanged(_speed);
}
예제 #5
0
void QDeclarativePosition::setSpeed(double speed)
{
    if (speed == m_speed)
        return;
    m_speed = speed;
    if (!m_speedValid) {
        m_speedValid = true;
        emit speedValidChanged();
    }
    emit speedChanged();
}
예제 #6
0
void FileListModel::AddFile( FileStreamer const * fileStreamer )
{
    FileReceivedModel * newFile = new FileReceivedModel( fileStreamer );

    connect( newFile, SIGNAL( progressChanged() ),
             this, SLOT( fileChanged() ) );
    connect( newFile, SIGNAL( speedChanged() ),
             this, SLOT( fileChanged() ) );

    beginInsertRows( QModelIndex(), rowCount(), rowCount() );
    m_files << newFile;
    endInsertRows();
}
예제 #7
0
파일: AVPlayer.cpp 프로젝트: 383530895/QtAV
void AVPlayer::setSpeed(qreal speed)
{
    if (speed == mSpeed)
        return;
    mSpeed = speed;
    //TODO: check clock type?
    if (_audio && _audio->isAvailable()) {
        qDebug("set speed %.2f", mSpeed);
        _audio->setSpeed(mSpeed);
    } else {
        masterClock()->setSpeed(mSpeed);
    }
    emit speedChanged(mSpeed);
}
예제 #8
0
void SGMVATValveState::setSpeed(AMControl *newControl)
{
	if (speed_ != newControl) {

		if (speed_)
			removeChildControl(speed_);

		speed_ = newControl;

		if (speed_)
			addChildControl(speed_);

		emit speedChanged(speed_);
	}
}
예제 #9
0
/*
void adjustMotor(float lSpd, float rSpd)
{
  if (lCurrentSpd <=0 && lSpd >0) //left going backward and want forward
  { 
        analogWrite(ID_SPEED_L, 0);
        analogWrite(ID_SPEED_R, 0);
        delay(DELAY_STOP); //need to stop a bit
        digitalWrite(ID_DIRECTION_L, HIGH); 
  }
  
  if (lCurrentSpd >=0 && lSpd <0) //left going forward and want backward
  { 
        analogWrite(ID_SPEED_L, 0);
        analogWrite(ID_SPEED_R, 0);
        delay(DELAY_STOP); //need to stop a bit
        digitalWrite(ID_DIRECTION_L, LOW);
  }

  if (rCurrentSpd <=0 && rSpd >0) //right going backward and want forward
  { 
        analogWrite(ID_SPEED_L, 0);
        analogWrite(ID_SPEED_R, 0);
        delay(DELAY_STOP); //need to stop a bit
        digitalWrite(ID_DIRECTION_R, HIGH);
  }
  if (rCurrentSpd >=0 && rSpd <0) //right going forward and want backward
  { 
        analogWrite(ID_SPEED_L, 0);
        analogWrite(ID_SPEED_R, 0);
        delay(DELAY_STOP); //need to stop a bit
        digitalWrite(ID_DIRECTION_R, LOW);
  }

  lCurrentSpd = lSpd;
  rCurrentSpd = rSpd;

  lSpd = abs((int) (lSpd*(hasSerial ? 255 : 200))); //get correction
  rSpd = abs((int) (rSpd*(hasSerial ? 251 : 255))); //get correction

  int s1 = (int) lSpd;
  analogWrite(ID_SPEED_L,s1);

  int s2 = (int) rSpd;
  analogWrite(ID_SPEED_R,s2); 
}
*/
void adjustMotor(float motor_l, float motor_r){
  if (motor_l > 0){
    digitalWrite(ID_DIRECTION_L, HIGH);
    analogWrite(ID_SPEED_L, ((int)(MOTOR_CORRECTION_L*motor_l)));
  }else{
    digitalWrite(ID_DIRECTION_L, LOW);
    analogWrite(ID_SPEED_L, ((int)(MOTOR_CORRECTION_L*-motor_l)));
  }
  if (motor_r > 0){
    digitalWrite(ID_DIRECTION_R, HIGH);
    analogWrite(ID_SPEED_R, ((int)(MOTOR_CORRECTION_R*motor_r)));
  }else{
    digitalWrite(ID_DIRECTION_R, LOW);
    analogWrite(ID_SPEED_R, ((int)(MOTOR_CORRECTION_R*-motor_r)));
  }
  speedChanged(motor_l, motor_r);
}
예제 #10
0
void MasterThread::Decoding(QString comdata)
{
    QString header = comdata.left(6);
    if (header == "$GPGGA")
    {
        QStringList list = comdata.split(',');
        QString time = list.at(1);
        int time_hour = time.mid(0, 2).toInt();
        int time_minute = time.mid(2, 2).toInt();
        int time_second = time.mid(4, 2).toInt();
        int time_msec = time.right(3).toInt();
        QString latlon = list.at(2) + ',' +list.at(4).mid(1);
        qDebug()<<"latLon"<<latlon;
        QString timeStr = QString("%1:%2:%3:%4").arg(time_hour).arg(time_minute).arg(time_second).arg(time_msec);
        qDebug()<<"timeStr"<<timeStr;
        emit positionChanged(QVariant::fromValue(latlon));
        emit timeChanged(QVariant::fromValue(timeStr));
    }
    else if (header == "$GPRMC")
    {
        QStringList list = comdata.split(',');

        QString time = list.at(1);
        int time_hour = time.mid(0, 2).toInt();
        int time_minute = time.mid(2, 2).toInt();
        int time_second = time.mid(4, 2).toInt();
        int time_msec = time.right(3).toInt();
        QString timeStr = QString("%1:%2:%3:%4").arg(time_hour).arg(time_minute).arg(time_second).arg(time_msec);
        emit timeChanged(QVariant::fromValue(timeStr));
        QString state = list.at(2);
        QString lat = DMTODMS(list.at(3));
        QString lon = DMTODMS(list.at(5));
        QString latlon = lat + "," + lon;
        QString speed = QString::number(list.at(7).toDouble() * 1.852) + "km/h";
        QString heading = list.at(8);
//        emit stateChanged(QVariant::fromValue(state));
        emit positionChanged(QVariant::fromValue(latlon));
        emit speedChanged(QVariant::fromValue(speed));
        emit headingChanged(QVariant::fromValue(heading));

        double dLat = DMTodecimalDegrees(list.at(3));
        double dLon = DMTodecimalDegrees(list.at(5));
        emit avaliblePosition(dLat, dLon, heading.toDouble());

    }
}
예제 #11
0
//--------------------------------------------------------------
void ofApp::update() {

    //if the speed has changed we need to clear the lines.
    // we can't test for float equality or non-equality
    // (speed.getValue() != preSpeed)
    // so we look at the change and if the change is greater then a certain
    // amount we clear.

    if( fabs(speed.getValue() - preSpeed) > 0.00001f ) {
        speedChanged();
    }
    preSpeed = speed.getValue();

    t = ofGetElapsedTimef();
    if(trail[0].size()==0) {
        initTime = t;
    }
    t = t - initTime;

    x = int(t*speed.getValue())%(ofGetWidth()-rightMargin);
    y[1] = 60*3+ofNoise(t*freq.getValue())*yFactor.getValue();
    y[2] = 60*4+ofSignedNoise(t*freq.getValue())*yFactor.getValue();

    float test = 60*4+ofSignedNoise(t*freq.getValue())*yFactor.getValue();

    cout<< test << endl;

    y[3] = 60*5+ofRandom(-1,1)*yFactor.getValue(); // random can't be dependent on time or frequency
    y[4] = 60*6+sin(t*freq.getValue()*TWO_PI)*yFactor.getValue();
    y[5] = 60*7+(sin(t*freq.getValue()*TWO_PI)+1)*.5*yFactor.getValue();
    y[6] = 60*8+fmod(t*freq.getValue(),1)*yFactor.getValue();
    y[7] = 60*9+(fmod(t*freq.getValue(),1)*2-1)*yFactor.getValue();

    for(int i=0; i<(int)trail.size(); i++) {
        if(x<prevX) {
            trail[i].clear();
        } else {
            trail[i].addVertex(ofPoint(x,y[i]));
        }
    }

    prevX = x;

}
예제 #12
0
/**
 * @brief SubteStatus::updateSpeed: checkea que haya un cambio de velocidad, si hay,
 * actualiza el valor en el modelo y en caso de volver a velocidad 0 reactiva la
 * evaluacion del sistema de cierre de puertas.
 * @param value: nueva velocidad
 */
void SubteStatus::updateSpeed(double value){
    if(m_speed != value){
        m_speed = value;
        emit speedChanged(m_speed);
        if( m_speed <= 0 && m_cscp->getBypass()){
            m_cscp->setBypass(false);
            emit CSCPChanged(m_cscp->evalCircuit());
        }

        if( m_speed <= 0 && m_brake->getEmergencyBrake()){
            m_brake->setEmergencyBrake_atp(false);
        }

        if((m_speed>4) && (m_cscp->leftDoors() || m_cscp->rightDoors())){
            m_cscp->notifyActionLeftDoors(CSCP::CLOSE);
            m_cscp->notifyActionRightDoors(CSCP::CLOSE);
        }
    }
}
예제 #13
0
void QMLBridge::setActive(bool b)
{
    if(b)
    {
        connect(&emu_thread, SIGNAL(speedChanged(double)), this, SLOT(speedChanged(double)), Qt::QueuedConnection);
        connect(&emu_thread, SIGNAL(turboModeChanged(bool)), this, SIGNAL(turboModeChanged()), Qt::QueuedConnection);
        connect(&emu_thread, SIGNAL(stopped()), this, SIGNAL(isRunningChanged()), Qt::QueuedConnection);
        connect(&emu_thread, SIGNAL(started(bool)), this, SIGNAL(isRunningChanged()), Qt::QueuedConnection);
        connect(&emu_thread, SIGNAL(suspended(bool)), this, SIGNAL(isRunningChanged()), Qt::QueuedConnection);
        connect(&emu_thread, SIGNAL(resumed(bool)), this, SIGNAL(isRunningChanged()), Qt::QueuedConnection);
        connect(&emu_thread, SIGNAL(started(bool)), this, SLOT(started(bool)), Qt::QueuedConnection);
        connect(&emu_thread, SIGNAL(resumed(bool)), this, SLOT(resumed(bool)), Qt::QueuedConnection);
        connect(&emu_thread, SIGNAL(suspended(bool)), this, SLOT(suspended(bool)), Qt::QueuedConnection);

        // We might have missed some events.
        turboModeChanged();
        speedChanged();
        isRunningChanged();
    }
    else
    {
예제 #14
0
void GPSSpeedData::locationUpdated(const DeviceLocation &location) {
    if(location.m_positionLog.size() < 2)
        return;
    auto currentPos = location.m_positionLog.at(location.m_positionLog.length()-1);
    auto prevPos = location.m_positionLog.at(location.m_positionLog.length()-2);
    if(!currentPos.isValid() && !prevPos.isValid())
        return;

    qreal delta_s = currentPos.coordinate().distanceTo(prevPos.coordinate());
    qreal delta_t = (currentPos.timestamp().toMSecsSinceEpoch() - prevPos.timestamp().toMSecsSinceEpoch())/1000.0f;
    if(delta_t > 0) {
        m_speedData = delta_s/delta_t * 3600.0 / 1000.0;
        m_deltat = delta_t;
        m_deltas = delta_s;
    }
    m_smoothedSpeedData = MathUtils::exponentialFilter(m_speedData, m_prevSpeedData, m_alpha);
    m_prevSpeedData = m_smoothedSpeedData;
    m_avgSpeedData = m_avgSpeedData + (m_speedData - m_avgSpeedData) / ++m_pointsCount;

    emit speedChanged();
}
예제 #15
0
void LocationData::onPositionChanged(const QGeoPositionInfo& info)
{
    emit positionChanged(info);
    if (info.isValid())
    {
        const QGeoCoordinate& c = info.coordinate();
        if (c.isValid())
        {
            double lat = c.latitude();
            double lon = c.longitude();
            double alt = c.altitude();
            //qDebug() << "LocationData::onPositionChanged()" << lat << lon << alt;
            if ((latitude != lat) || (longitude != lon))
            {
                latitude  = lat;
                mask |= LATMASK;
                longitude = lon;
                mask |= LONMASK;
            }
            if (altitude != alt)
            {
                altitude = alt;
                mask |= ALTMASK;
            }
            emit positionChanged(lat,lon,alt);
        }
        if (info.hasAttribute(QGeoPositionInfo::GroundSpeed))
        {
            double s = info.attribute(QGeoPositionInfo::GroundSpeed);
            emit speedChanged(s);
        }
        if (info.hasAttribute(QGeoPositionInfo::Direction))
        {
            double c = info.attribute(QGeoPositionInfo::Direction);
            emit courseChanged(c);
        }
    }
}
예제 #16
0
void senseSoarMAV::receiveMessage(LinkInterface *link, mavlink_message_t message)
{
#ifdef MAVLINK_ENABLED_SENSESOAR
	if (message.sysid == uasId)  // make sure the message is for the right UAV
	{ 
		if (!link) return;
		switch (message.msgid)
		{
		case MAVLINK_MSG_ID_CMD_AIRSPEED_ACK: // TO DO: check for acknowledgement after sended commands
			{
				mavlink_cmd_airspeed_ack_t airSpeedMsg;
				mavlink_msg_cmd_airspeed_ack_decode(&message,&airSpeedMsg);
				break;
			}
		/*case MAVLINK_MSG_ID_CMD_AIRSPEED_CHNG: only sent to UAV
			{
				break;
			}*/
		case MAVLINK_MSG_ID_FILT_ROT_VEL: // rotational velocities
			{
				mavlink_filt_rot_vel_t rotVelMsg;
				mavlink_msg_filt_rot_vel_decode(&message,&rotVelMsg);
				quint64 time = getUnixTime();
				for(unsigned char i=0;i<3;i++)
				{
					this->m_rotVel[i]=rotVelMsg.rotVel[i];
				}
				emit valueChanged(uasId, "rollspeed", "rad/s", this->m_rotVel[0], time);
                emit valueChanged(uasId, "pitchspeed", "rad/s", this->m_rotVel[1], time);
                emit valueChanged(uasId, "yawspeed", "rad/s", this->m_rotVel[2], time);
                emit attitudeRotationRatesChanged(uasId, this->m_rotVel[0], this->m_rotVel[1], this->m_rotVel[2], time);
				break;
			}
		case MAVLINK_MSG_ID_LLC_OUT: // low level controller output
			{
				mavlink_llc_out_t llcMsg;
				mavlink_msg_llc_out_decode(&message,&llcMsg);
				quint64 time = getUnixTime();
				emit valueChanged(uasId, "Servo. 1", "rad", llcMsg.servoOut[0], time);
                emit valueChanged(uasId, "Servo. 2", "rad", llcMsg.servoOut[1], time);
				emit valueChanged(uasId, "Servo. 3", "rad", llcMsg.servoOut[2], time);
				emit valueChanged(uasId, "Servo. 4", "rad", llcMsg.servoOut[3], time);
				emit valueChanged(uasId, "Motor. 1", "raw", llcMsg.MotorOut[0]  , time);
				emit valueChanged(uasId, "Motor. 2", "raw", llcMsg.MotorOut[1], time);
				break;
			}
		case MAVLINK_MSG_ID_OBS_AIR_TEMP:
			{
				mavlink_obs_air_temp_t airTMsg;
				mavlink_msg_obs_air_temp_decode(&message,&airTMsg);
				quint64 time = getUnixTime();
				emit valueChanged(uasId, "Air Temp", "°", airTMsg.airT, time);
				break;
			}
		case MAVLINK_MSG_ID_OBS_AIR_VELOCITY:
			{
				mavlink_obs_air_velocity_t airVMsg;
				mavlink_msg_obs_air_velocity_decode(&message,&airVMsg);
				quint64 time = getUnixTime();
				emit valueChanged(uasId, "AirVel. mag", "m/s", airVMsg.magnitude, time);
				emit valueChanged(uasId, "AirVel. AoA", "rad", airVMsg.aoa, time);
				emit valueChanged(uasId, "AirVel. Slip", "rad", airVMsg.slip, time);
				break;
			}
		case MAVLINK_MSG_ID_OBS_ATTITUDE:
			{
				mavlink_obs_attitude_t quatMsg;
				mavlink_msg_obs_attitude_decode(&message,&quatMsg);
				quint64 time = getUnixTime();
				this->quat2euler(quatMsg.quat,this->roll,this->pitch,this->yaw);
				emit valueChanged(uasId, "roll", "rad", roll, time);
                emit valueChanged(uasId, "pitch", "rad", pitch, time);
                emit valueChanged(uasId, "yaw", "rad", yaw, time);
				emit valueChanged(uasId, "roll deg", "deg", (roll/M_PI)*180.0, time);
                emit valueChanged(uasId, "pitch deg", "deg", (pitch/M_PI)*180.0, time);
                emit valueChanged(uasId, "heading deg", "deg", (yaw/M_PI)*180.0, time);
				emit attitudeChanged(this, roll, pitch, yaw, time);
				break;
			}
		case MAVLINK_MSG_ID_OBS_BIAS:
			{
				mavlink_obs_bias_t biasMsg;
				mavlink_msg_obs_bias_decode(&message, &biasMsg);
				quint64 time = getUnixTime();
				emit valueChanged(uasId, "acc. biasX", "m/s^2", biasMsg.accBias[0], time);
				emit valueChanged(uasId, "acc. biasY", "m/s^2", biasMsg.accBias[1], time);
				emit valueChanged(uasId, "acc. biasZ", "m/s^2", biasMsg.accBias[2], time);
				emit valueChanged(uasId, "gyro. biasX", "rad/s", biasMsg.gyroBias[0], time);
				emit valueChanged(uasId, "gyro. biasY", "rad/s", biasMsg.gyroBias[1], time);
				emit valueChanged(uasId, "gyro. biasZ", "rad/s", biasMsg.gyroBias[2], time);
				break;
			}
		case MAVLINK_MSG_ID_OBS_POSITION:
			{
				mavlink_obs_position_t posMsg;
				mavlink_msg_obs_position_decode(&message, &posMsg);
				quint64 time = getUnixTime();
				this->longitude = posMsg.lon/(double)1E7;
				this->latitude = posMsg.lat/(double)1E7;
				this->altitude = posMsg.alt/1000.0;
				emit valueChanged(uasId, "latitude", "deg", this->latitude, time);
                emit valueChanged(uasId, "longitude", "deg", this->longitude, time);
                emit valueChanged(uasId, "altitude", "m", this->altitude, time);
				emit globalPositionChanged(this, this->latitude, this->longitude, this->altitude, time);
				break;
			}
		case MAVLINK_MSG_ID_OBS_QFF:
			{
				mavlink_obs_qff_t qffMsg;
				mavlink_msg_obs_qff_decode(&message,&qffMsg);
				quint64 time = getUnixTime();
				emit valueChanged(uasId, "QFF", "Pa", qffMsg.qff, time);
				break;
			}
		case MAVLINK_MSG_ID_OBS_VELOCITY:
			{
				mavlink_obs_velocity_t velMsg;
				mavlink_msg_obs_velocity_decode(&message, &velMsg);
				quint64 time = getUnixTime();
				emit valueChanged(uasId, "x speed", "m/s", velMsg.vel[0], time);
                emit valueChanged(uasId, "y speed", "m/s", velMsg.vel[1], time);
                emit valueChanged(uasId, "z speed", "m/s", velMsg.vel[2], time);
				emit speedChanged(this, velMsg.vel[0], velMsg.vel[1], velMsg.vel[2], time);
				break;
			}
		case MAVLINK_MSG_ID_OBS_WIND:
			{
				mavlink_obs_wind_t windMsg;
				mavlink_msg_obs_wind_decode(&message, &windMsg);
				quint64 time = getUnixTime();
				emit valueChanged(uasId, "Wind speed x", "m/s", windMsg.wind[0], time);
				emit valueChanged(uasId, "Wind speed y", "m/s", windMsg.wind[1], time);
				emit valueChanged(uasId, "Wind speed z", "m/s", windMsg.wind[2], time);
				break;
			}
		case MAVLINK_MSG_ID_PM_ELEC:
			{
				mavlink_pm_elec_t pmMsg;
				mavlink_msg_pm_elec_decode(&message, &pmMsg);
				quint64 time = getUnixTime();
				emit valueChanged(uasId, "Battery status", "%", pmMsg.BatStat, time);
				emit valueChanged(uasId, "Power consuming", "W", pmMsg.PwCons, time);
				emit valueChanged(uasId, "Power generating sys1", "W", pmMsg.PwGen[0], time);
				emit valueChanged(uasId, "Power generating sys2", "W", pmMsg.PwGen[1], time);
				emit valueChanged(uasId, "Power generating sys3", "W", pmMsg.PwGen[2], time);
				break;
			}
		case MAVLINK_MSG_ID_SYS_STAT:
			{
#define STATE_WAKING_UP            0x0  // TO DO: not important here, only for the visualisation needed
#define STATE_ON_GROUND            0x1
#define STATE_MANUAL_FLIGHT        0x2
#define STATE_AUTONOMOUS_FLIGHT    0x3
#define STATE_AUTONOMOUS_LAUNCH    0x4
				mavlink_sys_stat_t statMsg;
				mavlink_msg_sys_stat_decode(&message,&statMsg);
				quint64 time = getUnixTime();
				// check actuator states
				emit valueChanged(uasId, "Motor1 status", "on/off", (statMsg.act & 0x01), time);
				emit valueChanged(uasId, "Motor2 status", "on/off", (statMsg.act & 0x02)>>1, time);
				emit valueChanged(uasId, "Servo1 status", "on/off", (statMsg.act & 0x04)>>2, time);
				emit valueChanged(uasId, "Servo2 status", "on/off", (statMsg.act & 0x08)>>3, time);
				emit valueChanged(uasId, "Servo3 status", "on/off", (statMsg.act & 0x10)>>4, time);
				emit valueChanged(uasId, "Servo4 status", "on/off", (statMsg.act & 0x20)>>5, time);
				// check the current state of the sensesoar
				this->senseSoarState = statMsg.mod;
				emit valueChanged(uasId,"senseSoar status","-",this->senseSoarState,time);
				// check the gps fixes
				emit valueChanged(uasId,"Lat Long fix","true/false", (statMsg.gps & 0x01), time);
				emit valueChanged(uasId,"Altitude fix","true/false", (statMsg.gps & 0x02), time);
				emit valueChanged(uasId,"GPS horizontal accuracy","m",((statMsg.gps & 0x1C)>>2), time);
				emit valueChanged(uasId,"GPS vertiacl accuracy","m",((statMsg.gps & 0xE0)>>5),time);
				// Xbee RSSI
				emit valueChanged(uasId, "Xbee strength", "%", statMsg.commRssi, time);
				//emit valueChanged(uasId, "Xbee strength", "%", statMsg.gps, time);  // TO DO: define gps bits

				break;
			}
		default:
			{
				// Let UAS handle the default message set
				UAS::receiveMessage(link, message);
				break;
			}
		}
	}
#else
    // Let UAS handle the default message set
    UAS::receiveMessage(link, message);
    Q_UNUSED(link);
    Q_UNUSED(message);
#endif // MAVLINK_ENABLED_SENSESOAR
}
예제 #17
0
void QDeclarativePosition::setPosition(const QGeoPositionInfo &info)
{
    // timestamp
    const QDateTime pTimestamp = m_info.timestamp();
    const QDateTime timestamp = info.timestamp();
    bool emitTimestampChanged = pTimestamp != timestamp;

    // coordinate
    const QGeoCoordinate pCoordinate = m_info.coordinate();
    const QGeoCoordinate coordinate = info.coordinate();
    bool emitCoordinateChanged = pCoordinate != coordinate;
    bool emitLatitudeValidChanged = exclusiveNaN(pCoordinate.latitude(), coordinate.latitude());
    bool emitLongitudeValidChanged = exclusiveNaN(pCoordinate.longitude(), coordinate.longitude());
    bool emitAltitudeValidChanged = exclusiveNaN(pCoordinate.altitude(), coordinate.altitude());

    // direction
    const qreal pDirection = m_info.attribute(QGeoPositionInfo::Direction);
    const qreal direction = info.attribute(QGeoPositionInfo::Direction);
    bool emitDirectionChanged = !equalOrNaN(pDirection, direction);
    bool emitDirectionValidChanged = exclusiveNaN(pDirection, direction);

    // ground speed
    const qreal pSpeed = m_info.attribute(QGeoPositionInfo::GroundSpeed);
    const qreal speed = info.attribute(QGeoPositionInfo::GroundSpeed);
    bool emitSpeedChanged = !equalOrNaN(pSpeed, speed);
    bool emitSpeedValidChanged = exclusiveNaN(pSpeed, speed);

    // vertical speed
    const qreal pVerticalSpeed = m_info.attribute(QGeoPositionInfo::VerticalSpeed);
    const qreal verticalSpeed = info.attribute(QGeoPositionInfo::VerticalSpeed);
    bool emitVerticalSpeedChanged = !equalOrNaN(pVerticalSpeed, verticalSpeed);
    bool emitVerticalSpeedValidChanged = exclusiveNaN(pVerticalSpeed, verticalSpeed);

    // magnetic variation
    const qreal pMagneticVariation = m_info.attribute(QGeoPositionInfo::MagneticVariation);
    const qreal magneticVariation = info.attribute(QGeoPositionInfo::MagneticVariation);
    bool emitMagneticVariationChanged = !equalOrNaN(pMagneticVariation, magneticVariation);
    bool emitMagneticVariationValidChanged = exclusiveNaN(pMagneticVariation, magneticVariation);

    // horizontal accuracy
    const qreal pHorizontalAccuracy = m_info.attribute(QGeoPositionInfo::HorizontalAccuracy);
    const qreal horizontalAccuracy = info.attribute(QGeoPositionInfo::HorizontalAccuracy);
    bool emitHorizontalAccuracyChanged = !equalOrNaN(pHorizontalAccuracy, horizontalAccuracy);
    bool emitHorizontalAccuracyValidChanged = exclusiveNaN(pHorizontalAccuracy, horizontalAccuracy);

    // vertical accuracy
    const qreal pVerticalAccuracy = m_info.attribute(QGeoPositionInfo::VerticalAccuracy);
    const qreal verticalAccuracy = info.attribute(QGeoPositionInfo::VerticalAccuracy);
    bool emitVerticalAccuracyChanged = !equalOrNaN(pVerticalAccuracy, verticalAccuracy);
    bool emitVerticalAccuracyValidChanged = exclusiveNaN(pVerticalAccuracy, verticalAccuracy);

    m_info = info;

    if (emitTimestampChanged)
        emit timestampChanged();
    if (emitCoordinateChanged)
        emit coordinateChanged();
    if (emitLatitudeValidChanged)
        emit latitudeValidChanged();
    if (emitLongitudeValidChanged)
        emit longitudeValidChanged();
    if (emitAltitudeValidChanged)
        emit altitudeValidChanged();
    if (emitDirectionChanged)
        emit directionChanged();
    if (emitDirectionValidChanged)
        emit directionValidChanged();
    if (emitSpeedChanged)
        emit speedChanged();
    if (emitSpeedValidChanged)
        emit speedValidChanged();
    if (emitVerticalSpeedChanged)
        emit verticalSpeedChanged();
    if (emitVerticalSpeedValidChanged)
        emit verticalSpeedValidChanged();
    if (emitHorizontalAccuracyChanged)
        emit horizontalAccuracyChanged();
    if (emitHorizontalAccuracyValidChanged)
        emit horizontalAccuracyValidChanged();
    if (emitVerticalAccuracyChanged)
        emit verticalAccuracyChanged();
    if (emitVerticalAccuracyValidChanged)
        emit verticalAccuracyValidChanged();
    if (emitMagneticVariationChanged)
        emit magneticVariationChanged();
    if (emitMagneticVariationValidChanged)
        emit magneticVariationValidChanged();
}
예제 #18
0
void IniReader::setSpeed(const int &s){settings.insert("speed",s);emit speedChanged();}
예제 #19
0
void IniReader::finished()
{
    settings=watcher->result();
    emit readConfigChanged();
    emit writeConfigChanged();
    emit romPathChanged();
    emit hashPathChanged();
    emit samplePathChanged();
    emit artPathChanged();
    emit ctrlrPathChanged();
    emit iniPathChanged();
    emit fontPathChanged();
    emit cheatPathChanged();
    emit crosshairPathChanged();
    emit cfgDirChanged();
    emit nvramDirChanged();
    emit inputDirChanged();
    emit stateDirChanged();
    emit snapshotDirChanged();
    emit diffDirChanged();
    emit commentDirChanged();
    emit stateChanged();
    emit autoSaveChanged();
    emit playbackChanged();
    emit recordChanged();
    emit mngWriteChanged();
    emit aviWriteChanged();
    emit wavWriteChanged();
    emit snapNameChanged();
    emit snapSizeChanged();
    emit snapViewChanged();
    emit snapBilinearChanged();
    emit stateNameChanged();
    emit burninChanged();
    emit autoFrameSkipChanged();
    emit frameSkipChanged();
    emit secondsToRunChanged();
    emit throttleChanged();
    emit sleepChanged();
    emit speedChanged();
    emit refreshSpeedChanged();
    emit rotateChanged();
    emit rorChanged();
    emit rolChanged();
    emit autoRorChanged();
    emit autoRolChanged();
    emit flipXChanged();
    emit flipYChanged();
    emit artworkCropChanged();
    emit useBackdropsChanged();
    emit useOverlaysChanged();
    emit useBezelsChanged();
    emit useCPanelsChanged();
    emit useMarqueesChanged();
    emit brightnessChanged();
    emit contrastChanged();
    emit gammaChanged();
    emit effectChanged();
    emit beamChanged();
    emit flickerChanged();
    emit sampleRateChanged();
    emit samplesChanged();
    emit volumeChanged();
    emit coinLockoutChanged();
    emit ctrlrChanged();
    emit mouseChanged();
    emit joystickChanged();
    emit lightgunChanged();
    emit multiKeyboardChanged();
    emit multiMouseChanged();
    emit steadyKeyChanged();
    emit uiActiveChanged();
    emit offScreenReloadChanged();
    emit joystickMapChanged();
    emit joystickDeadzoneChanged();
    emit joystickSaturationChanged();
    emit naturalChanged();
    emit joystickContradictoryChanged();
    emit coinImpulseChanged();
    emit paddleDeviceChanged();
    emit adstickDeviceChanged();
    emit pedalDeviceChanged();
    emit dialDeviceChanged();
    emit trackballDeviceChanged();
    emit lightgunDeviceChanged();
    emit positionalDeviceChanged();
    emit mouseDeviceChanged();
    emit verboseChanged();
    emit logChanged();
    emit osLogChanged();
    emit debugChanged();
    emit updateInPauseChanged();
    emit debugScriptChanged();
    emit sdlVideoFPSChanged();
    emit commLocalHostChanged();
    emit commLocalPortChanged();
    emit commRemoteHostChanged();
    emit commRemotePortChanged();
    emit antiAliasChanged();
    emit drcChanged();
    emit drcUseCChanged();
    emit drcLogUMLChanged();
    emit drcLogNativeChanged();
    emit biosChanged();
    emit cheatChanged();
    emit skipGameInfoChanged();
    emit uiFontChanged();
    emit ramSizeChanged();
    emit confirmQuitChanged();
    emit uiMouseChanged();
    emit autoBootCommandChanged();
    emit autoBootDelayChanged();
    emit autoBootScriptChanged();
    emit httpChanged();
    emit httpPortChanged();
    emit httpPathChanged();
    emit consoleChanged();
    emit multiThreadingChanged();
    emit numProcessorsChanged();
    emit videoChanged();
    emit numScreensChanged();
    emit windowChanged();
    emit maximizeChanged();
    emit keepAspectChanged();
    emit unevenStretchChanged();
    emit waitVSyncChanged();
    emit syncRefreshChanged();
    emit screenChanged();
    emit aspectChanged();
    emit resolutionChanged();
    emit viewChanged();
    emit switchResChanged();
    emit filterChanged();
    emit prescaleChanged();
    emit glForcePow2TextureChanged();
    emit glNoTextureRectChanged();
    emit glVboChanged();
    emit glPboChanged();
    emit glGlslChanged();
    emit glGlslFilterChanged();
    emit soundChanged();
    emit audioLatencyChanged();
    emit centerHChanged();
    emit centerVChanged();
    emit scaleModeChanged();
    emit useAllHeadsChanged();
    emit keymapChanged();
    emit keymapFileChanged();
    emit sixAxisChanged();
    emit videoDriverChanged();
    emit renderDriverChanged();
    emit audioDriverChanged();
    emit glLibChanged();
}
예제 #20
0
void ChocoboEditor::SpeedChanged(int speed)
{
	choco_data.speed = speed;
	emit speedChanged(choco_data.speed);
}
void ConnectionParameters::speedValueChanged(int n)
{
    emit speedChanged(n);
}