void
  Visit(AnnularSectorZone& oz)
  {
    Visit((SectorZone&)oz);

    fixed radius =
      Units::ToSysDistance(GetFormValueFixed(*wf, _T("prpOZSectorInnerRadius")));
    if (fabs(radius - oz.getInnerRadius()) > fixed(49)) {
      oz.setInnerRadius(radius);
      task_modified = true;
    }
  }
  void
  Visit(const AnnularSectorZone& oz)
  {
    Visit((const SectorZone&)oz);
    LoadFormProperty(*wf, _T("prpOZSectorInnerRadius"),
                     ugDistance, oz.getInnerRadius());

    WndProperty* wap = (WndProperty*)wf->FindByName(_T("prpOZSectorInnerRadius"));
    if (wap) {
      wap->show();
    }
  }
예제 #3
0
ObservationZonePoint*
Deserialiser::DeserialiseOZ(const Waypoint &wp, bool is_turnpoint)
{
  const TCHAR *type = node.GetAttribute(_T("type"));
  if (type == nullptr)
    return nullptr;

  if (StringIsEqual(type, _T("Line"))) {
    LineSectorZone *ls = new LineSectorZone(wp.location);

    fixed length;
    if (node.GetAttribute(_T("length"), length) && positive(length))
      ls->SetLength(length);

    return ls;
  } else if (StringIsEqual(type, _T("Cylinder"))) {
    CylinderZone *ls = new CylinderZone(wp.location);

    fixed radius;
    if (node.GetAttribute(_T("radius"), radius) && positive(radius))
      ls->SetRadius(radius);

    return ls;
  } else if (StringIsEqual(type, _T("MatCylinder"))) {
    return CylinderZone::CreateMatCylinderZone(wp.location);
  } else if (StringIsEqual(type, _T("Sector"))) {

    fixed radius, inner_radius;
    Angle start, end;
    SectorZone *ls;

    if (node.GetAttribute(_T("inner_radius"), inner_radius)) {
      AnnularSectorZone *als = new AnnularSectorZone(wp.location);
      als->SetInnerRadius(inner_radius);
      ls = als;
    } else
      ls = new SectorZone(wp.location);

    if (node.GetAttribute(_T("radius"), radius) && positive(radius))
      ls->SetRadius(radius);
    if (node.GetAttribute(_T("start_radial"), start))
      ls->SetStartRadial(start);
    if (node.GetAttribute(_T("end_radial"), end))
      ls->SetEndRadial(end);

    return ls;
  } else if (StringIsEqual(type, _T("FAISector")))
    return SymmetricSectorZone::CreateFAISectorZone(wp.location, is_turnpoint);
  else if (StringIsEqual(type, _T("SymmetricQuadrant"))) {
    fixed radius = fixed(10000);
    node.GetAttribute(_T("radius"), radius);

    return new SymmetricSectorZone(wp.location, radius);
  } else if (StringIsEqual(type, _T("Keyhole")))
    return KeyholeZone::CreateDAeCKeyholeZone(wp.location);
  else if (StringIsEqual(type, _T("CustomKeyhole"))) {
    fixed radius = fixed(10000), inner_radius = fixed(500);
    Angle angle = Angle::QuarterCircle();

    node.GetAttribute(_T("radius"), radius);
    node.GetAttribute(_T("inner_radius"), inner_radius);
    node.GetAttribute(_T("angle"), angle);

    KeyholeZone *keyhole =
      KeyholeZone::CreateCustomKeyholeZone(wp.location, radius, angle);
    keyhole->SetInnerRadius(inner_radius);
    return keyhole;
  } else if (StringIsEqual(type, _T("BGAStartSector")))
    return KeyholeZone::CreateBGAStartSectorZone(wp.location);
  else if (StringIsEqual(type, _T("BGAFixedCourse")))
    return KeyholeZone::CreateBGAFixedCourseZone(wp.location);
  else if (StringIsEqual(type, _T("BGAEnhancedOption")))
    return KeyholeZone::CreateBGAEnhancedOptionZone(wp.location);

  assert(1);
  return nullptr;
}
예제 #4
0
static void
Visit(WritableDataNode &node, const AnnularSectorZone &data)
{
  Visit(node, (const SectorZone &)data);
  node.SetAttribute(_T("inner_radius"), data.GetInnerRadius());
}
예제 #5
0
 void
 Visit(const AnnularSectorZone& oz)
 {
   ozUserSize = oz.getRadius();
 }
예제 #6
0
void
Serialiser::Visit(const AnnularSectorZone &data)
{
  Visit((const SectorZone&)data);
  node.SetAttribute(_T("inner_radius"), data.GetInnerRadius());
}