本文整理汇总了C++中TaskPoint类的典型用法代码示例。如果您正苦于以下问题:C++ TaskPoint类的具体用法?C++ TaskPoint怎么用?C++ TaskPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TaskPoint类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: gs
GlideResult
TaskSolution::glide_solution_planned(const TaskPoint& taskpoint,
const AIRCRAFT_STATE &ac,
const GlidePolar &polar,
const fixed minH)
{
GlideState gs(taskpoint.get_vector_planned(),
max(minH,taskpoint.get_elevation()),
ac.NavAltitude, ac.wind);
return MacCready::solve(polar, gs);
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:11,代码来源:TaskSolution.cpp
示例2: gs
GlideResult
TaskSolution::GlideSolutionTravelled(const TaskPoint &taskpoint,
const AircraftState &ac,
const GlideSettings &settings,
const GlidePolar &polar,
const fixed min_h)
{
GlideState gs(taskpoint.GetVectorTravelled(),
max(min_h,taskpoint.GetElevation()),
ac.altitude, ac.wind);
return MacCready::Solve(settings, polar, gs);
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:12,代码来源:TaskSolution.cpp
示例3: Visit
virtual void Visit(const TaskPoint& tp) override {
switch (tp.GetType()) {
case TaskPointType::UNORDERED:
printf("# got a tp\n");
break;
case TaskPointType::FINISH:
printf("# got an ftp\n");
ozv.Visit(((const FinishPoint &)tp).GetObservationZone());
break;
case TaskPointType::START:
printf("# got an stp\n");
ozv.Visit(((const StartPoint &)tp).GetObservationZone());
break;
case TaskPointType::AAT:
printf("# got an aat\n");
ozv.Visit(((const AATPoint &)tp).GetObservationZone());
break;
case TaskPointType::AST:
printf("# got an ast\n");
ozv.Visit(((const ASTPoint &)tp).GetObservationZone());
break;
}
}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:27,代码来源:harness_task.cpp
示例4: switch
bool
TaskAdvance::IsStateReady(const TaskPoint &tp,
const AircraftState &state,
const bool x_enter,
const bool x_exit) const
{
switch (tp.GetType()) {
case TaskPointType::UNORDERED:
gcc_unreachable();
case TaskPointType::START:
return x_exit;
case TaskPointType::AAT: {
const AATPoint &ap = (const AATPoint &)tp;
return IsAATStateReady(ap.HasEntered(), ap.IsCloseToTarget(state));
}
case TaskPointType::AST: {
const ASTPoint &ip = (const ASTPoint &)tp;
return ip.GetScoreExit()
? x_exit
: ip.HasEntered();
}
case TaskPointType::FINISH:
return false;
}
gcc_unreachable();
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:31,代码来源:TaskAdvance.cpp
示例5: switch
void
TaskPointConstVisitor::Visit(const TaskPoint &tp)
{
switch (tp.GetType()) {
case TaskPoint::ROUTE:
assert(1); // not supported yet
break;
case TaskPoint::UNORDERED:
Visit((const UnorderedTaskPoint &)tp);
break;
case TaskPoint::START:
Visit((const StartPoint &)tp);
break;
case TaskPoint::AST:
Visit((const ASTPoint &)tp);
break;
case TaskPoint::AAT:
Visit((const AATPoint &)tp);
break;
case TaskPoint::FINISH:
Visit((const FinishPoint &)tp);
break;
}
}
开发者ID:damianob,项目名称:xcsoar,代码行数:30,代码来源:TaskPointVisitor.cpp
示例6:
void
RenderTaskPoint::DrawBearing(const TaskPoint &tp)
{
if (!draw_bearing || !PointCurrent())
return;
canvas.Select(task_look.bearing_pen);
map_canvas.offset_line(location, tp.GetLocationRemaining());
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:9,代码来源:RenderTaskPoint.cpp
示例7:
void
TaskPointRenderer::DrawBearing(const TaskPoint &tp)
{
if (!location_available || !draw_bearing || !PointCurrent())
return;
canvas.Select(task_look.bearing_pen);
map_canvas.DrawLineWithOffset(location, tp.GetLocationRemaining());
}
开发者ID:damianob,项目名称:xcsoar,代码行数:9,代码来源:TaskPointRenderer.cpp
示例8: draw_target
void
draw_target(const TaskPoint &tp)
{
if (!do_draw_target(tp))
return;
RasterPoint sc;
if (m_proj.GeoToScreenIfVisible(tp.get_location_remaining(), sc))
Graphics::hBmpTarget.draw(canvas, sc.x, sc.y);
}
开发者ID:galippi,项目名称:xcsoar,代码行数:10,代码来源:MapWindowTask.cpp
示例9: assert
GlideResult
TaskMacCreadyTravelled::SolvePoint(const TaskPoint &tp,
const AircraftState &aircraft,
fixed minH) const
{
assert(tp.GetType() != TaskPointType::UNORDERED);
const OrderedTaskPoint &otp = (const OrderedTaskPoint &)tp;
return TaskSolution::GlideSolutionTravelled(otp, aircraft,
settings, glide_polar, minH);
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:11,代码来源:TaskMacCreadyTravelled.cpp
示例10: GetSafetyHeight
static fixed
GetSafetyHeight(const TaskPoint &tp)
{
switch (tp.GetType()) {
case TaskPointType::FINISH:
return task_behaviour.safety_height_arrival;
default:
return task_behaviour.route_planner.safety_height_terrain;
}
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:11,代码来源:TestOrderedTask.cpp
示例11: PointCurrent
bool
TaskPointRenderer::IsTargetVisible(const TaskPoint &tp) const
{
if (!tp.HasTarget() || target_visibility == NONE)
return false;
if (target_visibility == ALL)
return true;
return PointCurrent();
}
开发者ID:damianob,项目名称:xcsoar,代码行数:11,代码来源:TaskPointRenderer.cpp
示例12: IsStateReady
bool
SmartTaskAdvance::CheckReadyToAdvance(const TaskPoint &tp,
const AircraftState &aircraft,
const bool x_enter, const bool x_exit)
{
const bool state_ready = IsStateReady(tp, aircraft, x_enter, x_exit);
if (armed)
request_armed = false;
switch (tp.GetType()) {
case TaskPointType::UNORDERED:
gcc_unreachable();
case TaskPointType::START: {
const StartPoint &sp = (const StartPoint &)tp;
if (sp.DoesRequireArm()) {
if (armed) {
state = TaskAdvance::START_ARMED;
} else {
state = TaskAdvance::START_DISARMED;
if (sp.IsInSector(aircraft))
request_armed = true;
}
return armed && state_ready;
} else {
state = TaskAdvance::AUTO;
return state_ready;
}
}
case TaskPointType::AAT:
if (armed) {
state = TaskAdvance::TURN_ARMED;
} else {
state = TaskAdvance::TURN_DISARMED;
if (state_ready)
request_armed = true;
}
return armed && state_ready;
case TaskPointType::AST: {
state = TaskAdvance::AUTO;
return state_ready;
}
case TaskPointType::FINISH:
return false;
}
gcc_unreachable();
}
开发者ID:MindMil,项目名称:XCSoar,代码行数:52,代码来源:SmartTaskAdvance.cpp
示例13: Visit
void Visit(const TaskPoint &tp) override {
switch (tp.GetType()) {
case TaskPointType::UNORDERED:
AddWaypoint(((const UnorderedTaskPoint &)tp).GetWaypointPtr(), true);
break;
case TaskPointType::START:
case TaskPointType::AST:
case TaskPointType::AAT:
case TaskPointType::FINISH:
AddWaypoint(((const OrderedTaskPoint &)tp).GetWaypointPtr(), true);
break;
}
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:14,代码来源:WaypointRenderer.cpp
示例14: Solve
GlideResult
TaskMacCreadyRemaining::SolvePoint(const TaskPoint &tp,
const AircraftState &aircraft,
fixed minH) const
{
GlideState gs = GlideState::Remaining(tp, aircraft, minH);
if (!include_travel_to_start && active_index == 0 &&
tp.GetType() == TaskPointType::START &&
!((const OrderedTaskPoint &)tp).HasEntered())
/* ignore the travel to the start point */
gs.vector.distance = fixed(0);
return MacCready::Solve(settings, glide_polar, gs);
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:15,代码来源:TaskMacCreadyRemaining.cpp
示例15: switch
bool
TaskAdvanceLegacy::mode_ready(const TaskPoint &tp) const
{
switch (mode) {
case ADVANCE_MANUAL:
return false;
case ADVANCE_AUTO:
return true;
case ADVANCE_ARM:
return m_armed;
case ADVANCE_ARMSTART:
return m_armed || tp.GetType() != TaskPoint::START;
};
return false;
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:15,代码来源:TaskAdvanceLegacy.cpp
示例16: switch
void
TaskPointRenderer::Draw(const TaskPoint &tp, Layer layer)
{
const OrderedTaskPoint &otp = (const OrderedTaskPoint &)tp;
const AATPoint &atp = (const AATPoint &)tp;
switch (tp.GetType()) {
case TaskPoint::UNORDERED:
if (layer == LAYER_LEG && location_available)
DrawTaskLine(location, tp.GetLocationRemaining());
if (layer == LAYER_SYMBOLS)
DrawBearing(tp);
index++;
break;
case TaskPoint::START:
index = 0;
DrawOrdered(otp, layer);
if (layer == LAYER_SYMBOLS) {
DrawBearing(tp);
DrawTarget(tp);
}
break;
case TaskPoint::AST:
index++;
DrawOrdered(otp, layer);
if (layer == LAYER_SYMBOLS) {
DrawBearing(tp);
DrawTarget(tp);
}
break;
case TaskPoint::AAT:
index++;
DrawOrdered(otp, layer);
if (layer == LAYER_SYMBOLS) {
DrawIsoline(atp);
DrawBearing(tp);
DrawTarget(tp);
}
break;
case TaskPoint::FINISH:
index++;
DrawOrdered(otp, layer);
if (layer == LAYER_SYMBOLS) {
DrawBearing(tp);
DrawTarget(tp);
}
break;
case TaskPoint::ROUTE:
/* unreachable */
assert(false);
break;
}
}
开发者ID:damianob,项目名称:xcsoar,代码行数:65,代码来源:TaskPointRenderer.cpp
示例17: f
bool TaskFileManagerOld::saveTaskList( QList<FlightTask*>& flightTaskList,
QString fileName )
{
QString fn;
if( fileName.isEmpty() )
{
// Use task default file name
fn = m_taskFileName;
}
QFile f( fn );
if ( ! f.open( QIODevice::WriteOnly ) )
{
qWarning() << __PRETTY_FUNCTION__ << "Could not write to task-file:" << fn;
return false;
}
QTextStream stream( &f );
// writing file-header
QDateTime dt = QDateTime::currentDateTime();
QString dtStr = dt.toString("yyyy-MM-dd hh:mm:ss");
stream << "# Cumulus-Task-File V4.0, created at "
<< dtStr << " by Cumulus "
<< QCoreApplication::applicationVersion() << endl << endl;
for ( int i=0; i < flightTaskList.count(); i++ )
{
FlightTask *task = flightTaskList.at(i);
QList<TaskPoint *> tpList = task->getTpList();
stream << "TS," << task->getTaskName() << "," << tpList.count() << endl;
for ( int j=0; j < tpList.count(); j++ )
{
// saving each task point ...
TaskPoint* tp = tpList.at(j);
stream << "TW,"
<< tp->getWGSPosition().x() << ","
<< tp->getWGSPosition().y() << ","
<< tp->getElevation() << ","
<< tp->getWPName() << ","
<< tp->getName() << ","
<< tp->getTypeID() << ","
<< tp->getActiveTaskPointFigureScheme() << ","
<< tp->getTaskLineLength().getMeters() << ","
<< tp->getTaskCircleRadius().getMeters() << ","
<< tp->getTaskSectorInnerRadius().getMeters() << ","
<< tp->getTaskSectorOuterRadius().getMeters() << ","
<< tp->getTaskSectorAngle() << ","
<< tp->getAutoZoom() << ","
<< tp->getUserEditFlag()
<< endl;
}
stream << "TE" << endl;
}
f.close();
qDebug() << "TFM:" << flightTaskList.size()
<< "task objects saved to file"
<< fn;
return true;
}
开发者ID:kflog-project,项目名称:Cumulus,代码行数:69,代码来源:taskfilemanager.cpp
示例18: formatDate
//.........这里部分代码省略.........
#ifdef MAEMO4
os = "Maemo 4";
#elif MAEMO5
os = "Maemo 5";
#elif ANDROID
os = "Android";
#else
os = "Linux";
#endif
QString hwv;
#ifndef ANDROID
hwv = HwInfo::instance()->getTypeString();
#else
QHash<QString, QString> hwh = jniGetBuildData();
hwv = hwh.value("MANUFACTURER", "Unknown") + ", " +
hwh.value("HARDWARE", "Unknown") + ", " +
hwh.value("MODEL", "Unknown");
#endif
_stream << "HFGTYGLIDERTYPE: " << gliderType << "\r\n";
_stream << "HFGIDGLIDERID: " << gliderRegistration << "\r\n";
_stream << "HFDTM100GPSDATUM: WSG-1984\r\n";
_stream << "HFRFWFIRMWAREVERION: " << QCoreApplication::applicationVersion() << "\r\n";
_stream << "HFRHWHARDWAREVERSION: " << hwv << "\r\n" ;
_stream << "HFFTYFRTYPE: Cumulus: " << QCoreApplication::applicationVersion()
<< ", Qt: " << qVersion()
<< ", OS: " << os
<< "\r\n";
_stream << "HFGPS: Unknown\r\n";
_stream << "HFPRSPRESSALTSENSOR: Unknown\r\n";
_stream << "HSCIDCOMPETITIONID: " << gliderCallSign << "\r\n";
// GSP info lines committed for now
_stream << "I023638FXA3940SIU\r\n"; // Fix accuracy and sat count as add ons
// Write J Record definitions, if extended logging is activated by the user.
if( conf->getKRecordInterval() > 0 )
{
// Set extended logging flag used for writing of K record.
_kRecordLogging = true;
_stream << "J050810HDT1116TAS1719WDI2022WSP2329VAT" << "\r\n";
}
else
{
_kRecordLogging = false;
}
// Task support: C-Records
extern MapContents* _globalMapContents;
FlightTask* task = _globalMapContents->getCurrentTask();
if ( ! task )
{
return; // no task active
}
QList<TaskPoint *> tpList = task->getTpList();
if ( tpList.count() < 2 )
{
return; // too less task points
}
QString taskDate = formatDate( task->getDeclarationDateTime().date() );
QString taskTime = formatTime( task->getDeclarationDateTime().time() );
QString fnr; fnr = fnr.sprintf( "%04d", flightNumber );
QString tpnr; tpnr = tpnr.sprintf( "%02d ", tpList.count() - 4 );
QString taskId = task->getTaskTypeString();
// date, time UTC is expected at first and second position
_stream << "C"
<< taskDate
<< taskTime
<< QDate::currentDate().toString("ddMMyy")
<< fnr
<< tpnr
<< task->getTaskDistanceString() << " "
<< taskId
<< "\r\n";
// Takeoff point as dummy entry
_stream << "C0000000N00000000E\r\n";
for( int i=0; i < tpList.count(); i++ )
{
TaskPoint *tp = tpList.at(i);
_stream << "C"
<< formatPosition( tp->getWGSPosition() )
<< tp->getWPName() << "\r\n";
}
// Landing point as dummy entry
_stream << "C0000000N00000000E\r\n";
}
开发者ID:Exadios,项目名称:Cumulus,代码行数:101,代码来源:igclogger.cpp
示例19: while
bool TaskFileManagerOld::loadTaskListNew( QList<FlightTask*>& flightTaskList,
QString fileName )
{
while( ! flightTaskList.isEmpty() )
{
// Clears the list as first.
delete flightTaskList.takeFirst();
}
QString fn;
if( fileName.isEmpty() )
{
// Use task default file name
fn = m_taskFileName;
}
QFile f( fn );
if ( ! f.open( QIODevice::ReadOnly ) )
{
qWarning() << __FUNCTION__ << "Could not open task-file:" << fn;
return false;
}
QTextStream stream( &f );
bool isTask = false;
QString taskName;
QStringList tmpList;
QList<TaskPoint *> *tpList = 0;
while ( !stream.atEnd() )
{
QString line = stream.readLine().trimmed();
if ( line.isEmpty() || line.mid( 0, 1 ) == "#" )
{
// Ignore empty and comment lines
continue;
}
if ( line.mid( 0, 2 ) == "TS" )
{
// new task ...
isTask = true;
if ( tpList != 0 )
{
// remove all elements from previous incomplete steps
qDeleteAll(*tpList);
tpList->clear();
}
else
{
tpList = new QList<TaskPoint *>;
}
tmpList = line.split( ",", QString::KeepEmptyParts );
if( tmpList.size() < 2 ) continue;
taskName = tmpList.at(1);
}
else
{
if ( line.mid( 0, 2 ) == "TW" && isTask )
{
// new task point
TaskPoint* tp = new TaskPoint;
tpList->append( tp );
tmpList = line.split( ",", QString::KeepEmptyParts );
if( tmpList.size() < 14 ) continue;
WGSPoint wgsp( tmpList.at( 1 ).toInt(), tmpList.at( 2 ) .toInt() );
int i = 3;
tp->setWGSPosition( wgsp );
tp->setPosition( _globalMapMatrix->wgsToMap( wgsp ) );
tp->setElevation( tmpList.at( i++ ).toInt() );
tp->setWPName( tmpList.at( i++ ) );
tp->setName( tmpList.at( i++ ) );
tp->setTypeID( (BaseMapElement::objectType) tmpList.at( i++ ).toShort() ) ;
tp->setActiveTaskPointFigureScheme( static_cast<enum GeneralConfig::ActiveTaskFigureScheme> (tmpList.at( i++ ).toInt()) );
tp->setTaskLineLength( tmpList.at( i++ ).toDouble() );
tp->setTaskCircleRadius( tmpList.at( i++ ).toDouble() );
tp->setTaskSectorInnerRadius( tmpList.at( i++ ).toDouble() );
tp->setTaskSectorOuterRadius( tmpList.at( i++ ).toDouble() );
tp->setTaskSectorAngle( tmpList.at( i++ ).toInt() );
tp->setAutoZoom( tmpList.at( i++ ).toInt() > 0 ? true : false );
tp->setUserEditFlag( tmpList.at( i++ ).toInt() > 0 ? true : false );
// Check active task figure schema
switch( tp->getActiveTaskPointFigureScheme() )
{
//.........这里部分代码省略.........
开发者ID:kflog-project,项目名称:Cumulus,代码行数:101,代码来源:taskfilemanager.cpp
注:本文中的TaskPoint类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论