Beispiel #1
0
void
PlaneGlue::Synchronize(const Plane &plane, ComputerSettings &settings,
                       GlidePolar &gp)
{
  settings.contest.handicap = plane.handicap;

  PolarCoefficients pc = plane.polar_shape.CalculateCoefficients();
  if (!pc.IsValid())
    return;

  gp.SetCoefficients(pc, false);

  // Glider empty weight
  gp.SetReferenceMass(plane.reference_mass, false);
  gp.SetDryMass(plane.dry_mass, false);

  // Ballast weight
  gp.SetBallastRatio(plane.max_ballast / plane.reference_mass);

  gp.SetWingArea(plane.wing_area);

  gp.Update();
  settings.plane.competition_id = plane.competition_id;
  settings.plane.registration = plane.registration;
  settings.plane.type = plane.type;
}
Beispiel #2
0
void
GlidePolarTest::Init()
{
  // Polar 1 from PolarStore (206 Hornet)
  polar.SetCoefficients(PolarCoefficients(fixed(0.0022032), fixed(-0.08784),
                                          fixed(1.47)), false);

  polar.SetReferenceMass(fixed(318), false);
  polar.SetDryMass(fixed(318), false);
  polar.SetBallastRatio(fixed(100) / polar.reference_mass);

  polar.SetWingArea(fixed(9.8));

  // No ballast and no bugs on the wings
  polar.ballast = fixed(0);
  polar.bugs = fixed(1);

  // MC zero
  polar.mc = fixed(0);

  polar.SetVMax(Units::ToSysUnit(fixed(200), Unit::KILOMETER_PER_HOUR), false);
}