예제 #1
0
파일: vector.cpp 프로젝트: Exadios/Cumulus
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;
}
예제 #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;
}
예제 #3
0
파일: vector.cpp 프로젝트: Exadios/Cumulus
/** Sets the Y (latitudinal) speed in meters per second. */
void Vector::setY(Speed y){
    if (dirtyXY) recalcXY();
    _y=y.getMps();
    dirtyDR=true;
}
예제 #4
0
파일: vector.cpp 프로젝트: Exadios/Cumulus
/** Sets the X (longitudinal) speed in meters per second. */
void Vector::setX(Speed x){
    if (dirtyXY) recalcXY();
    _x=x.getMps();
    dirtyDR=true;
}
예제 #5
0
파일: Speed.cpp 프로젝트: Exadios/KFLog
/** * operator for speed. */
Speed
operator *(double left, const Speed& right)
{
  return Speed(left * right.getMps());
}