void
 Visit(LineSectorZone& oz)
 {
   fixed line_length =
     Units::ToSysDistance(GetFormValueFixed(*wf, _T("prpOZLineLength")));
   if (fabs(line_length - oz.getLength()) > fixed(49)) {
     oz.setLength(line_length);
     task_modified = true;
   }
 }
Esempio n. 2
0
ObservationZonePoint*
Serialiser::deserialise_oz(const Waypoint& wp, const bool is_turnpoint)
{

  tstring type;
  if (!m_node.get_attribute(_T("type"),type)) {
    assert(1);
    return NULL;
  }
  if (_tcscmp(type.c_str(), _T("Line")) == 0) {
    LineSectorZone *ls = new LineSectorZone(wp.Location);

    fixed length;
    if (m_node.get_attribute(_T("length"), length)) {
      ls->setLength(length);
    }
    return ls;
  } else if (_tcscmp(type.c_str(), _T("Cylinder")) == 0) {
    CylinderZone *ls = new CylinderZone(wp.Location);

    fixed radius;
    if (m_node.get_attribute(_T("radius"), radius)) {
      ls->setRadius(radius);
    }
    return ls;
  } else if (_tcscmp(type.c_str(), _T("Sector")) == 0) {
    SectorZone *ls = new SectorZone(wp.Location);

    fixed radius;
    Angle start, end;
    if (m_node.get_attribute(_T("radius"), radius)) {
      ls->setRadius(radius);
    }
    if (m_node.get_attribute(_T("start_radial"), start)) {
      ls->setStartRadial(start);
    }
    if (m_node.get_attribute(_T("end_radial"), end)) {
      ls->setEndRadial(end);
    }
    return ls;
  } else if (_tcscmp(type.c_str(), _T("FAISector")) == 0) {
    return new FAISectorZone(wp.Location, is_turnpoint);
  } else if (_tcscmp(type.c_str(), _T("Keyhole")) == 0) {
    return new KeyholeZone(wp.Location);
  } else if (_tcscmp(type.c_str(), _T("BGAFixedCourse")) == 0) {
    return new BGAFixedCourseZone(wp.Location);
  } else if (_tcscmp(type.c_str(), _T("BGAEnhancedOption")) == 0) {
    return new BGAEnhancedOptionZone(wp.Location);
  }
  assert(1);
  return NULL;
}
Esempio n. 3
0
void 
RenderObservationZone::Visit(const LineSectorZone& oz) 
{
  parms_sector(oz);
  if (draw_style(false)) {
    draw_segment(oz.getStartRadial(), oz.getEndRadial());
  }
  if (draw_style(!m_past)) {
    draw_two_lines();
  }

  m_buffer.mix_copy();
}
  void
  Visit(const LineSectorZone& oz)
  {
    hide_all();
    WndFrame* wp = ((WndFrame *)wf->FindByName(_T("frmOZLine")));
    if (wp)
      wp->show();

    LoadFormProperty(*wf, _T("prpOZLineLength"),
                     ugDistance, oz.getLength());
  }
Esempio n. 5
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;
}
Esempio n. 6
0
static void
Visit(WritableDataNode &node, const LineSectorZone &data)
{
  node.SetAttribute(_T("type"), _T("Line"));
  node.SetAttribute(_T("length"), data.GetLength());
}
Esempio n. 7
0
 void
 Visit(const LineSectorZone& oz)
 {
   ozUserSize = oz.getLength();
 }
Esempio n. 8
0
void 
Serialiser::Visit(const LineSectorZone& data)
{
  m_node.set_attribute(_T("type"), _T("Line"));
  m_node.set_attribute(_T("length"), data.getLength());
}
Esempio n. 9
0
void 
Serialiser::Visit(const LineSectorZone &data)
{
  node.SetAttribute(_T("type"), _T("Line"));
  node.SetAttribute(_T("length"), data.GetLength());
}
Esempio n. 10
0
 virtual void Visit(LineSectorZone& tp) {
   // length
   tp.setLength(fixed(1000));
 }