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


C++ OperationEnvironment::SetText方法代码示例

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


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

示例1: assert

bool
DeviceDescriptor::DownloadFlight(const RecordedFlightInfo &flight,
                                 Path path,
                                 OperationEnvironment &env)
{
  assert(borrowed);
  assert(port != nullptr);
  assert(driver != nullptr);
  assert(device != nullptr);

  if (port == nullptr || driver == nullptr || device == nullptr)
    return false;

  StaticString<60> text;


  if (driver->HasPassThrough() && (second_device != nullptr)) {
    text.Format(_T("%s: %s."), _("Downloading flight log"),
                second_driver->display_name);
    env.SetText(text);

    device->EnablePassThrough(env);
    return second_device->DownloadFlight(flight, path, env);
  } else {
    text.Format(_T("%s: %s."), _("Downloading flight log"),
                driver->display_name);
    env.SetText(text);

    return device->DownloadFlight(flight, path, env);
  }
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:31,代码来源:Descriptor.cpp

示例2: flarm

bool
DeviceDescriptor::Declare(const struct Declaration &declaration,
                          const Waypoint *home,
                          OperationEnvironment &env)
{
  if (port == NULL)
    return false;

  SetBusy(true);

  StaticString<60> text;
  text.Format(_T("%s: %s."), _("Sending declaration"), driver->display_name);
  env.SetText(text);

  port->StopRxThread();

  bool result = device != NULL && device->Declare(declaration, home, env);

  if (device_blackboard->IsFLARM(index) && !IsDriver(_T("FLARM"))) {
    text.Format(_T("%s: FLARM."), _("Sending declaration"));
    env.SetText(text);
    FlarmDevice flarm(*port);
    result = flarm.Declare(declaration, home, env) || result;
  }

  port->StartRxThread();

  SetBusy(false);
  return result;
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:30,代码来源:Descriptor.cpp

示例3:

void
CAI302WaypointUploader::Run(OperationEnvironment &env)
{
  Waypoints waypoints;

  env.SetText(_("Loading Waypoints..."));
  if (!reader.Parse(waypoints, env)) {
    env.SetErrorMessage(_("Failed to load file."));
    return;
  }

  if (waypoints.size() > 9999) {
    env.SetErrorMessage(_("Too many waypoints."));
    return;
  }

  env.SetText(_("Uploading Waypoints"));
  env.SetProgressRange(waypoints.size() + 1);
  env.SetProgressPosition(0);

  if (!device.ClearPoints(env)) {
    if (!env.IsCancelled())
      env.SetErrorMessage(_("Failed to erase waypoints."));
    return;
  }

  if (!device.EnableBulkMode(env)) {
    if (!env.IsCancelled())
      env.SetErrorMessage(_("Failed to switch baud rate."));
    return;
  }

  unsigned id = 1;
  for (auto i = waypoints.begin(), end = waypoints.end();
       i != end; ++i, ++id) {
    if (env.IsCancelled())
      break;

    env.SetProgressPosition(id);

    if (!device.WriteNavpoint(id, *i, env)) {
      if (!env.IsCancelled())
        env.SetErrorMessage(_("Failed to write waypoint."));
      break;
    }
  }

  device.DisableBulkMode(env);
}
开发者ID:aharrison24,项目名称:XCSoar,代码行数:49,代码来源:WaypointUploader.cpp

示例4: LogStartUp

bool
WaypointGlue::LoadWaypoints(Waypoints &way_points,
                            const RasterTerrain *terrain,
                            OperationEnvironment &operation)
{
  LogStartUp(_T("ReadWaypoints"));
  operation.SetText(_("Loading Waypoints..."));

  bool found = false;

  // Delete old waypoints
  way_points.Clear();

  // ### FIRST FILE ###
  found |= LoadWaypointFile(1, way_points, terrain, operation);

  // ### SECOND FILE ###
  found |= LoadWaypointFile(2, way_points, terrain, operation);

  // ### WATCHED WAYPOINT/THIRD FILE ###
  found |= LoadWaypointFile(3, way_points, terrain, operation);

  // ### MAP/FOURTH FILE ###

  // If no waypoint file found yet
  if (!found)
    found = LoadMapFileWaypoints(0, szProfileMapFile, way_points, terrain,
                                 operation);

  // Optimise the waypoint list after attaching new waypoints
  way_points.Optimise();

  // Return whether waypoints have been loaded into the waypoint list
  return found;
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:35,代码来源:WaypointGlue.cpp

示例5: LogFormat

bool
WaypointGlue::LoadWaypoints(Waypoints &way_points,
                            const RasterTerrain *terrain,
                            OperationEnvironment &operation)
{
  LogFormat("ReadWaypoints");
  operation.SetText(_("Loading Waypoints..."));

  bool found = false;

  // Delete old waypoints
  way_points.Clear();

  TCHAR path[MAX_PATH];

  LoadWaypointFile(way_points, LocalPath(path, _T("user.cup")),
                   WaypointFileType::SEEYOU,
                   WaypointOrigin::USER, terrain, operation);

  // ### FIRST FILE ###
  if (Profile::GetPath(ProfileKeys::WaypointFile, path))
    found |= LoadWaypointFile(way_points, path, WaypointOrigin::PRIMARY,
                              terrain, operation);

  // ### SECOND FILE ###
  if (Profile::GetPath(ProfileKeys::AdditionalWaypointFile, path))
    found |= LoadWaypointFile(way_points, path, WaypointOrigin::ADDITIONAL,
                              terrain, operation);

  // ### WATCHED WAYPOINT/THIRD FILE ###
  if (Profile::GetPath(ProfileKeys::WatchedWaypointFile, path))
    found |= LoadWaypointFile(way_points, path, WaypointOrigin::WATCHED,
                              terrain, operation);

  // ### MAP/FOURTH FILE ###

  // If no waypoint file found yet
  if (!found) {
    auto dir = OpenMapFile();
    if (dir != nullptr) {
      found |= LoadWaypointFile(way_points, dir, "waypoints.xcw",
                                WaypointFileType::WINPILOT,
                                WaypointOrigin::MAP,
                                terrain, operation);

      found |= LoadWaypointFile(way_points, dir, "waypoints.cup",
                                WaypointFileType::SEEYOU,
                                WaypointOrigin::MAP,
                                terrain, operation);

      zzip_dir_close(dir);
    }
  }

  // Optimise the waypoint list after attaching new waypoints
  way_points.Optimise();

  // Return whether waypoints have been loaded into the waypoint list
  return found;
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:60,代码来源:WaypointGlue.cpp

示例6: ParseAirfieldDetails

/**
 * Opens the airfield details file and parses it
 */
void
WaypointDetails::ReadFile(TLineReader &reader, Waypoints &way_points,
                          OperationEnvironment &operation)
{
  operation.SetText(_("Loading Airfield Details File..."));
  ParseAirfieldDetails(way_points, reader, operation);
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:10,代码来源:WaypointDetailsReader.cpp

示例7: vl

bool
VolksloggerDevice::Declare(const Declaration &declaration,
                           const Waypoint *home,
                           OperationEnvironment &env)
{
  if (declaration.Size() < 2)
    return false;

  env.SetText(_T("Comms with Volkslogger"));

  port.SetRxTimeout(500);

  // change to IO mode baud rate
  unsigned lLastBaudrate = port.SetBaudrate(9600L);

  VLAPI vl(port, env);

  bool success = DeclareInner(vl, declaration, home);

  vl.close(1);

  port.SetBaudrate(lLastBaudrate); // restore baudrate

  return success;
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:25,代码来源:Declare.cpp

示例8: Run

 virtual void Run(OperationEnvironment &env) {
   env.SetText(_T("Working..."));
   env.SetProgressRange(30);
   for (unsigned i = 0; i < 30 && !env.IsCancelled(); ++i) {
     env.SetProgressPosition(i);
     env.Sleep(500);
   }
 }
开发者ID:davidswelt,项目名称:XCSoar,代码行数:8,代码来源:RunJobDialog.cpp

示例9: LoadConfiguredTopographyZip

bool
LoadConfiguredTopography(TopographyStore &store,
                         OperationEnvironment &operation)
{
  LogFormat("Loading Topography File...");
  operation.SetText(_("Loading Topography File..."));

  return LoadConfiguredTopographyZip(store, operation);
}
开发者ID:MaxPower-No1,项目名称:XCSoar,代码行数:9,代码来源:TopographyGlue.cpp

示例10: DeclareToFLARM

static bool
DoDeclare(const struct Declaration &declaration,
          Port &port, const DeviceRegister &driver, Device *device,
          bool flarm, const Waypoint *home,
          OperationEnvironment &env)
{
  StaticString<60> text;
  text.Format(_T("%s: %s."), _("Sending declaration"), driver.display_name);
  env.SetText(text);

  bool result = device != nullptr && device->Declare(declaration, home, env);

  if (flarm) {
    text.Format(_T("%s: FLARM."), _("Sending declaration"));
    env.SetText(text);

    result |= DeclareToFLARM(declaration, port, driver, device, home, env);
  }

  return result;
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:21,代码来源:Descriptor.cpp

示例11: assert

bool
DeviceDescriptor::ReadFlightList(RecordedFlightList &flight_list,
                                 OperationEnvironment &env)
{
  assert(borrowed);
  assert(port != nullptr);
  assert(driver != nullptr);
  assert(device != nullptr);

  StaticString<60> text;
  text.Format(_T("%s: %s."), _("Reading flight list"), driver->display_name);
  env.SetText(text);

  return device->ReadFlightList(flight_list, env);
}
开发者ID:M-Scholli,项目名称:XCSoar,代码行数:15,代码来源:Descriptor.cpp

示例12:

bool
DeviceDescriptor::ReadFlightList(RecordedFlightList &flight_list,
                                 OperationEnvironment &env)
{
  if (port == NULL || driver == NULL || device == NULL)
    return false;

  StaticString<60> text;
  text.Format(_T("%s: %s."), _("Reading flight list"), driver->display_name);
  env.SetText(text);

  port->StopRxThread();
  bool result = device->ReadFlightList(flight_list, env);
  port->StartRxThread();
  return result;
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:16,代码来源:Descriptor.cpp

示例13: LogFormat

bool
WaypointGlue::LoadWaypoints(Waypoints &way_points,
                            const RasterTerrain *terrain,
                            OperationEnvironment &operation)
{
  LogFormat("ReadWaypoints");
  operation.SetText(_("Loading Waypoints..."));

  bool found = false;

  // Delete old waypoints
  way_points.Clear();

  TCHAR path[MAX_PATH];

  // ### FIRST FILE ###
  if (Profile::GetPath(ProfileKeys::WaypointFile, path))
    found |= LoadWaypointFile(way_points, path, 1, terrain, operation);

  // ### SECOND FILE ###
  if (Profile::GetPath(ProfileKeys::AdditionalWaypointFile, path))
    found |= LoadWaypointFile(way_points, path, 2, terrain, operation);

  // ### WATCHED WAYPOINT/THIRD FILE ###
  if (Profile::GetPath(ProfileKeys::WatchedWaypointFile, path))
    found |= LoadWaypointFile(way_points, path, 3, terrain, operation);

  // ### MAP/FOURTH FILE ###

  // If no waypoint file found yet
  if (!found && Profile::GetPath(ProfileKeys::MapFile, path)) {
    TCHAR *tail = path + _tcslen(path);

    _tcscpy(tail, _T("/waypoints.xcw"));
    found |= LoadWaypointFile(way_points, path, 0, terrain, operation);

    _tcscpy(tail, _T("/waypoints.cup"));
    found |= LoadWaypointFile(way_points, path, 0, terrain, operation);
  }

  // Optimise the waypoint list after attaching new waypoints
  way_points.Optimise();

  // Return whether waypoints have been loaded into the waypoint list
  return found;
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:46,代码来源:WaypointGlue.cpp

示例14: LogStartUp

void
ReadAirspace(Airspaces &airspaces,
             RasterTerrain *terrain,
             const AtmosphericPressure &press,
             OperationEnvironment &operation)
{
  LogStartUp(_T("ReadAirspace"));
  operation.SetText(_("Loading Airspace File..."));

  bool airspace_ok = false;

  // Read the airspace filenames from the registry
  TLineReader *reader =
    OpenConfiguredTextFile(szProfileAirspaceFile, _T("airspace.txt"));
  if (reader != NULL) {
    if (!ReadAirspace(airspaces, *reader, operation))
      LogStartUp(_T("No airspace file 1"));
    else
      airspace_ok =  true;

    delete reader;
  }

  reader = OpenConfiguredTextFile(szProfileAdditionalAirspaceFile);
  if (reader != NULL) {
    if (!ReadAirspace(airspaces, *reader, operation))
      LogStartUp(_T("No airspace file 2"));
    else
      airspace_ok = true;

    delete reader;
  }

  if (airspace_ok) {
    airspaces.optimise();
    airspaces.set_flight_levels(press);

    if (terrain != NULL)
      airspaces.set_ground_levels(*terrain);
  } else
    // there was a problem
    airspaces.clear();
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:43,代码来源:AirspaceGlue.cpp

示例15: parser

void
ReadAirspace(Airspaces &airspaces,
             RasterTerrain *terrain,
             const AtmosphericPressure &press,
             OperationEnvironment &operation)
{
    LogFormat("ReadAirspace");
    operation.SetText(_("Loading Airspace File..."));

    bool airspace_ok = false;

    AirspaceParser parser(airspaces);

    // Read the airspace filenames from the registry
    auto path = Profile::GetPath(ProfileKeys::AirspaceFile);
    if (!path.IsNull())
        airspace_ok |= ParseAirspaceFile(parser, path, operation);

    path = Profile::GetPath(ProfileKeys::AdditionalAirspaceFile);
    if (!path.IsNull())
        airspace_ok |= ParseAirspaceFile(parser, path, operation);

    auto archive = OpenMapFile();
    if (archive)
        airspace_ok |= ParseAirspaceFile(parser, archive->get(), "airspace.txt",
                                         operation);

    if (airspace_ok) {
        airspaces.Optimise();
        airspaces.SetFlightLevels(press);

        if (terrain != NULL)
            airspaces.SetGroundLevels(*terrain);
    } else
        // there was a problem
        airspaces.Clear();
}
开发者ID:staylo,项目名称:XCSoar,代码行数:37,代码来源:AirspaceGlue.cpp


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