Ejemplo n.º 1
0
Vector::Vector(double angle, Speed R){
  setAngleRad((float)angle);
  // qDebug("angle:  %f", angle*180/PI);
  _speed=R.getMps();
  // qDebug("_speed:  %f", _speed);
  dirtyDR=false;
  dirtyXY=true;
}
Ejemplo n.º 2
0
/**
 * This function formats the variometer speed value in meters with sign +/-,
 * 3 numbers with 3 decimal numbers.
 */
QString IgcLogger::formatVario(const Speed vSpeed)
{
  QString result;

  double mps = vSpeed.getMps();

  if( mps == 0.0 )
    {
      result += " ";
    }
  else if( mps > 0.0 )
    {
      result += "+";
    }

  // We need a number with 6 digits and without a decimal point. Therefore
  // the value meter per second is multiplied with 1000.
  result += QString("%1").arg( (int) rint(mps*1000.0), 6, 10, QChar('0') );

  return result;
}
Ejemplo n.º 3
0
/** Sets the Y (latitudinal) speed in meters per second. */
void Vector::setY(Speed y){
    if (dirtyXY) recalcXY();
    _y=y.getMps();
    dirtyDR=true;
}
Ejemplo n.º 4
0
/** Sets the X (longitudinal) speed in meters per second. */
void Vector::setX(Speed x){
    if (dirtyXY) recalcXY();
    _x=x.getMps();
    dirtyDR=true;
}
Ejemplo n.º 5
0
/** * operator for speed. */
Speed
operator *(double left, const Speed& right)
{
  return Speed(left * right.getMps());
}