本文整理汇总了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);
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}
示例9: LoadConfiguredTopographyZip
bool
LoadConfiguredTopography(TopographyStore &store,
OperationEnvironment &operation)
{
LogFormat("Loading Topography File...");
operation.SetText(_("Loading Topography File..."));
return LoadConfiguredTopographyZip(store, operation);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}