示例#1
0
void
UIActions::ShowTrafficRadar()
{
  LoadFlarmDatabases();

  dlgFlarmTrafficShowModal();
}
示例#2
0
static void
OnFlarmLockClicked()
{
  TeamCodeSettings &settings =
    CommonInterface::SetComputerSettings().team_code;
  TCHAR newTeamFlarmCNTarget[settings.team_flarm_callsign.MAX_SIZE];
  _tcscpy(newTeamFlarmCNTarget, settings.team_flarm_callsign.c_str());

  if (!dlgTextEntryShowModal(newTeamFlarmCNTarget, 4))
    return;

  if (StringIsEmpty(newTeamFlarmCNTarget)) {
    settings.team_flarm_id.Clear();
    settings.team_flarm_callsign.clear();
    return;
  }

  LoadFlarmDatabases();

  FlarmId ids[30];
  unsigned count =
    FlarmDetails::FindIdsByCallSign(newTeamFlarmCNTarget, ids, 30);

  if (count == 0) {
    ShowMessageBox(_("Unknown Competition Number"),
                   _("Not Found"), MB_OK | MB_ICONINFORMATION);
    return;
  }

  const FlarmId id = PickFlarmTraffic(_("Set new teammate"), ids, count);
  if (!id.IsDefined())
    return;

  TeamActions::TrackFlarm(id, newTeamFlarmCNTarget);
}
示例#3
0
void
InputEvents::eventTraffic(const TCHAR *misc)
{
  LoadFlarmDatabases();

  if (StringIsEqual(misc, _T("show"))) {
    PageActions::ShowTrafficRadar();
    return;
  }

  TrafficWidget *traffic_widget = (TrafficWidget *)
    CommonInterface::main_window->GetFlavourWidget(_T("Traffic"));
  if (traffic_widget == nullptr)
    return;

  if (StringIsEqual(misc, _T("zoom auto toggle"))) {
    traffic_widget->ToggleAutoZoom();
  } else if (StringIsEqual(misc, _T("zoom in"))) {
    traffic_widget->ZoomIn();
  } else if (StringIsEqual(misc, _T("zoom out"))) {
    traffic_widget->ZoomOut();
  } else if (StringIsEqual(misc, _T("northup toggle"))) {
    traffic_widget->ToggleNorthUp();
  } else if (StringIsEqual(misc, _T("details"))) {
    traffic_widget->OpenDetails();
  } else if (StringIsEqual(misc, _T("label toggle"))) {
    traffic_widget->SwitchData();
  }
}
示例#4
0
void
InputEvents::eventTraffic(const TCHAR *misc)
{
  LoadFlarmDatabases();

  if (StringIsEqual(misc, _T("show"))) {
    if (CommonInterface::Basic().flarm.traffic.IsEmpty() ||
        IsFlavour(_T("Traffic")))
      return;

    traffic_widget = new TrafficWidget();
    CommonInterface::main_window.SetWidget(traffic_widget);
    SetFlavour(_T("Traffic"));
    return;
  }

  if (!IsFlavour(_T("Traffic")))
    return;

  assert(traffic_widget != NULL);

  if (StringIsEqual(misc, _T("zoom auto toggle"))) {
    traffic_widget->ToggleAutoZoom();
  } else if (StringIsEqual(misc, _T("zoom in"))) {
    traffic_widget->ZoomIn();
  } else if (StringIsEqual(misc, _T("zoom out"))) {
    traffic_widget->ZoomOut();
  } else if (StringIsEqual(misc, _T("northup toggle"))) {
    traffic_widget->ToggleNorthUp();
  }
}
示例#5
0
void
UIActions::ShowTrafficRadar()
{
    if (InputEvents::IsFlavour(_T("Traffic")))
        return;

    LoadFlarmDatabases();

    CommonInterface::main_window->SetWidget(new TrafficWidget());
    InputEvents::SetFlavour(_T("Traffic"));
}
示例#6
0
void
InputEvents::eventFlarmDetails(gcc_unused const TCHAR *misc)
{
  LoadFlarmDatabases();
  TrafficListDialog();
}