Example #1
0
void
TaskPropertiesPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  AddTime(_("AAT min. time"), _("Minimum AAT task time in minutes."),
          0, 36000, 60, 180);

  AddFloat(_("Start max. speed"),
           _("Maximum speed allowed in start observation zone.  Set to 0 for no limit."),
           _T("%.0f %s"), _T("%.0f"),
           fixed_zero, fixed(300), fixed(5), false, fixed_zero);

  AddFloat(_("Start max. height"),
           _("Maximum height based on start height reference (AGL or MSL) while starting the task.  Set to 0 for no limit."),
           _T("%.0f %s"), _T("%.0f"),
           fixed_zero, fixed(10000), fixed(25), false, fixed_zero);

  static gcc_constexpr_data StaticEnumChoice start_max_height_ref_list[] = {
    { (unsigned)HeightReferenceType::AGL, N_("AGL"), N_("Reference AGL for start maximum height rule (above start point).") },
    { (unsigned)HeightReferenceType::MSL, N_("MSL"), N_("Reference MSL for start maximum height rule (above sea level).") },
    { 0 }
  };

  AddEnum(_("Start height ref."),
          _("Reference used for start max height rule\n"
            "[MSL] Reference is altitude above mean sea level\n"
            "[AGL] Reference is the height above the start point"),
          start_max_height_ref_list);

  AddFloat(_("Finish min. height"),
           _("Minimum height based on finish height reference (AGL or MSL) while finishing the task.  Set to 0 for no limit."),
           _T("%.0f %s"), _T("%.0f"),
           fixed_zero, fixed(10000), fixed(25), false, fixed_zero);

  static gcc_constexpr_data StaticEnumChoice finish_min_height_ref_list[] = {
    { (unsigned)HeightReferenceType::AGL, N_("AGL"), N_("Reference AGL for finish minimum height rule (above finish point).") },
    { (unsigned)HeightReferenceType::MSL, N_("MSL"), N_("Reference MSL for finish minimum height rule (above sea level).") },
    { 0 }
  };
  AddEnum(_("Finish height ref."),
          _("Reference used for finish min height rule\n"
            "[MSL] Reference is altitude above mean sea level\n"
            "[AGL] Reference is the height above the finish point"),
          finish_min_height_ref_list);

  AddBoolean(_("FAI start / finish rules"),
             _("If enabled, has no max start height or max start speed and requires the minimum height above ground for finish to be greater than 1000m below the start height."),
             false, this);

  DataFieldEnum *dfe = new DataFieldEnum(NULL);
  dfe->SetListener(this);
  dfe->EnableItemHelp(true);
  const std::vector<TaskFactoryType> factory_types =
    ordered_task->GetFactoryTypes();
  for (unsigned i = 0; i < factory_types.size(); i++) {
    dfe->addEnumText(OrderedTaskFactoryName(factory_types[i]),
                     (unsigned)factory_types[i],
                     OrderedTaskFactoryDescription(factory_types[i]));
    if (factory_types[i] == ordered_task->GetFactoryType())
      dfe->Set((unsigned)factory_types[i]);
  }
  Add(_("Task type"), _("Sets the behaviour for the current task."), dfe);
}