当前位置: 首页>>代码示例>>C++>>正文


C++ FlarmId类代码示例

本文整理汇总了C++中FlarmId的典型用法代码示例。如果您正苦于以下问题:C++ FlarmId类的具体用法?C++ FlarmId怎么用?C++ FlarmId使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FlarmId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnFlarmLockClicked

static void
OnFlarmLockClicked(gcc_unused WndButton &button)
{
  TCHAR newTeamFlarmCNTarget[4];
  _tcsncpy(newTeamFlarmCNTarget,
           XCSoarInterface::SetSettingsComputer().TeamFlarmCNTarget, 4);

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

  _tcsncpy(XCSoarInterface::SetSettingsComputer().TeamFlarmCNTarget,
           newTeamFlarmCNTarget, 4);
  XCSoarInterface::SetSettingsComputer().TeammateCodeValid = false;

  if (string_is_empty(XCSoarInterface::SettingsComputer().TeamFlarmCNTarget)) {
    XCSoarInterface::SetSettingsComputer().TeamFlarmTracking = false;
    XCSoarInterface::SetSettingsComputer().TeamFlarmIdTarget.clear();
    return;
  }

  FlarmId flarmId = FlarmDetails::LookupId(
      XCSoarInterface::SettingsComputer().TeamFlarmCNTarget);

  if (!flarmId.defined()) {
    MessageBoxX(_("Unknown Competition Number"),
                _("Not Found"), MB_OK | MB_ICONINFORMATION);

    XCSoarInterface::SetSettingsComputer().TeamFlarmTracking = false;
    XCSoarInterface::SetSettingsComputer().TeamFlarmIdTarget.clear();
    XCSoarInterface::SetSettingsComputer().TeamFlarmCNTarget[0] = 0;
  } else {
    XCSoarInterface::SetSettingsComputer().TeamFlarmIdTarget = flarmId;
    XCSoarInterface::SetSettingsComputer().TeamFlarmTracking = true;
  }
}
开发者ID:hnpilot,项目名称:XCSoar,代码行数:35,代码来源:dlgTeamCode.cpp

示例2:

FlarmId
FLARMNetRecord::GetId() const
{
  FlarmId id;
  id.parse(this->id, NULL);
  return id;
};
开发者ID:galippi,项目名称:xcsoar,代码行数:7,代码来源:FLARMNet.cpp

示例3: OnFlarmLockClicked

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);
}
开发者ID:Tjeerdm,项目名称:XCSoarDktjm,代码行数:35,代码来源:TeamCodeDialog.cpp

示例4: LoadFlarmDatabases

void
InputEvents::eventFlarmDetails(gcc_unused const TCHAR *misc)
{
  LoadFlarmDatabases();

  StaticString<4> callsign;
  callsign.clear();
  if (!TextEntryDialog(CommonInterface::main_window, callsign,
                       _("Competition ID")) ||
      callsign.empty())
    return;

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

  if (count > 0) {
    FlarmId id = dlgFlarmDetailsListShowModal(
        XCSoarInterface::main_window, _("Show details:"), ids, count);

    if (id.IsDefined())
      dlgFlarmTrafficDetailsShowModal(id);
  } else {
    ShowMessageBox(_("Unknown competition number"),
                _("Not found"), MB_OK | MB_ICONINFORMATION);
  }
}
开发者ID:damianob,项目名称:xcsoar,代码行数:26,代码来源:InputEventsActions.cpp

示例5:

void
FlarmDatabase::Insert(const FlarmRecord &record)
{
  FlarmId id = record.GetId();
  if (!id.IsDefined())
    /* ignore malformed records */
    return;

  map.insert(std::make_pair(id, record));
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例6: LoadSecondaryFile

static void
LoadSecondaryFile(TLineReader &reader)
{
  TCHAR *line;
  while ((line = reader.read()) != NULL) {
    TCHAR *endptr;
    FlarmId id;
    id.parse(line, &endptr);
    if (endptr > line && endptr[0] == _T('=') && endptr[1] != _T('\0')) {
      TCHAR *Name = endptr + 1;
      TrimRight(Name);
      if (!FlarmDetails::AddSecondaryItem(id, Name))
        break; // cant add anymore items !
    }
  }
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:16,代码来源:FlarmDetails.cpp

示例7: FindItem

  /**
   * Find an existing item by its FLARM id.  This is a simple linear
   * search that doesn't scale well with a large list.
   */
  gcc_pure
  ItemList::iterator FindItem(FlarmId id) {
    assert(id.IsDefined());

    return std::find_if(items.begin(), items.end(),
                        [id](const Item &item) { return item.id == id; });
  }
开发者ID:henrik1g,项目名称:XCSoar,代码行数:11,代码来源:TrafficList.cpp

示例8: LookupFLARMDetails

// Used by TeamCode, to select a CN and get back the Id
int LookupFLARMDetails(TCHAR *cn) 
{
  // try to find flarm from userFile
  int index = LookupSecondaryFLARMId(cn);
  if (index != -1)
    {
      return FLARM_Names[index].ID;
    }
  
  // try to find flarm from FLARMNet.org File
  FlarmId* flarmId = file.GetFlarmIdItem(cn);
  if (flarmId != NULL)
    {
      return flarmId->GetId();
    }
  return 0;
}
开发者ID:Mazuk,项目名称:LK8000,代码行数:18,代码来源:FlarmTools.cpp

示例9: assert

bool
FlarmDetails::AddSecondaryItem(FlarmId id, const TCHAR *name)
{
  assert(id.IsDefined());
  assert(traffic_databases != nullptr);

  return traffic_databases->flarm_names.Set(id, name);
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:8,代码来源:FlarmDetails.cpp

示例10: LookupSecondaryIndex

FlarmId
FlarmDetails::LookupId(const TCHAR *cn)
{
  // try to find flarm from userFile
  int index = LookupSecondaryIndex(cn);
  if (index != -1)
    return FLARM_Names[index].ID;

  // try to find flarm from FlarmNet.org File
  const FlarmNet::Record *record = FlarmNet::FindFirstRecordByCallSign(cn);
  if (record != NULL)
    return record->GetId();

  FlarmId id;
  id.clear();
  return id;
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:17,代码来源:FlarmDetails.cpp

示例11: assert

FlarmId
TrafficDatabases::FindIdByName(const TCHAR *name) const
{
  assert(name != nullptr);
  assert(!StringIsEmpty(name));

  // try to find flarm from userFile
  const FlarmId id = flarm_names.Get(name);
  if (id.IsDefined())
    return id;

  // try to find flarm from FlarmNet.org File
  const FlarmNetRecord *record = flarm_net.FindFirstRecordByCallSign(name);
  if (record != NULL)
    return record->GetId();

  return FlarmId::Undefined();
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:18,代码来源:TrafficDatabases.cpp

示例12: LKSound

FlarmIdFile::FlarmIdFile(void)
{
  TCHAR path[MAX_PATH];

  LKSound(_T("LK_CONNECT.WAV"));

  TCHAR flarmIdFileName[MAX_PATH] = TEXT("\0");
#if NOSIM
  if (SIMMODE) return;
#else
#ifdef _SIM_
	return;
#endif
#endif

  LocalPath(path);

  wsprintf(flarmIdFileName, TEXT("%s\\%s\\%s"), path, TEXT(LKD_CONF), TEXT(LKF_FLARMNET));

  FILE*	hFile = _wfopen(flarmIdFileName, TEXT("rt"));
  if (hFile == NULL) {
	wsprintf(flarmIdFileName, TEXT("%s\\%s\\data.fln"), path, TEXT(LKD_CONF));
	hFile = _wfopen(flarmIdFileName, TEXT("rt"));
	if (hFile == NULL) return;
  }

  DWORD fileLength;
	
  fseek (hFile , 0 , SEEK_END);
  fileLength = ftell (hFile);
  fseek (hFile , 7 , SEEK_SET);

  int itemCount = 0;

  while( ( (signed)fileLength - ftell(hFile)) > 87) {
	FlarmId *flarmId = new FlarmId;
	GetItem(hFile, flarmId);
	flarmIds[flarmId->GetId()] = flarmId;
	itemCount++;
  }
  FlarmNetCount=itemCount;
  fclose(hFile);
}
开发者ID:,项目名称:,代码行数:43,代码来源:

示例13: LoadFlarmNameFile

void
LoadFlarmNameFile(TLineReader &reader, FlarmNameDatabase &db)
{
  TCHAR *line;
  while ((line = reader.ReadLine()) != NULL) {
    TCHAR *endptr;
    FlarmId id = FlarmId::Parse(line, &endptr);
    if (!id.IsDefined())
      /* ignore malformed records */
      continue;

    if (endptr > line && endptr[0] == _T('=') && endptr[1] != _T('\0')) {
      TCHAR *Name = endptr + 1;
      TrimRight(Name);
      if (!db.Set(id, Name))
        break; // cant add anymore items !
    }
  }
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:19,代码来源:NameFile.cpp

示例14: TEXT

FlarmIdFile::FlarmIdFile(void)
{
  TCHAR path[MAX_PATH];

  TCHAR flarmIdFileName[MAX_PATH] = TEXT("\0");

  LocalPath(path);

  _stprintf(flarmIdFileName, TEXT("%s%s%s%s%s"), path, _T(DIRSEP), TEXT(LKD_CONF), _T(DIRSEP), TEXT(LKF_FLARMNET));

  FILE*	hFile = _tfopen(flarmIdFileName, TEXT("rt"));
  if (hFile == NULL) {
	_stprintf(flarmIdFileName, TEXT("%s%s%s%sdata.fln"), path, _T(DIRSEP), TEXT(LKD_CONF), _T(DIRSEP));
	hFile = _tfopen(flarmIdFileName, TEXT("rt"));
	if (hFile == NULL) return;
  }

  fseek (hFile , 0 , SEEK_END);
  long int fileLength = ftell (hFile);
  fseek (hFile , 7 , SEEK_SET);

  int itemCount = 0;

  while( ( fileLength - ftell(hFile)) > 87) {
	FlarmId *flarmId = new FlarmId;

	_tcscpy(flarmId->id,_T(""));
	_tcscpy(flarmId->name,_T(""));
	_tcscpy(flarmId->airfield,_T(""));
	_tcscpy(flarmId->type,_T(""));
	_tcscpy(flarmId->reg,_T(""));
	_tcscpy(flarmId->cn,_T(""));
	_tcscpy(flarmId->freq,_T(""));

	GetItem(hFile, flarmId);
	flarmIds[flarmId->GetId()] = flarmId;
	itemCount++;
  }
  FlarmNetCount=itemCount;
  fclose(hFile);
}
开发者ID:PhilColbert,项目名称:LK8000,代码行数:41,代码来源:FlarmIdFile.cpp

示例15: LoadColor

static void
LoadColor(FlarmColorDatabase &db, const char *key, FlarmColor color)
{
  const char *ids = Profile::Get(key);
  if (ids == nullptr)
    return;

  const char *p = ids;
  while (true) {
    char *endptr;
    FlarmId id = FlarmId::Parse(p, &endptr);
    if (id.IsDefined())
      db.Set(id, color);

    p = strchr(endptr, ',');
    if (p == nullptr)
      break;

    ++p;
  }
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:21,代码来源:FlarmProfile.cpp


注:本文中的FlarmId类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。