本文整理汇总了C++中OrderedTask::get_factory方法的典型用法代码示例。如果您正苦于以下问题:C++ OrderedTask::get_factory方法的具体用法?C++ OrderedTask::get_factory怎么用?C++ OrderedTask::get_factory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderedTask
的用法示例。
在下文中一共展示了OrderedTask::get_factory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wser
void
Serialiser::deserialise_point(OrderedTask& data)
{
tstring type;
if (!m_node.get_attribute(_T("type"),type)) {
assert(1);
return;
}
DataNode* wp_node = m_node.get_child_by_name(_T("Waypoint"));
if (wp_node==NULL)
return;
Serialiser wser(*wp_node);
Waypoint *wp = wser.deserialise_waypoint();
if (wp==NULL) {
delete wp_node;
return;
}
DataNode* oz_node = m_node.get_child_by_name(_T("ObservationZone"));
if (oz_node==NULL) {
delete wp_node;
delete wp;
return;
}
Serialiser oser(*oz_node);
AbstractTaskFactory& fact = data.get_factory();
ObservationZonePoint* oz = NULL;
OrderedTaskPoint *pt = NULL;
if (_tcscmp(type.c_str(), _T("Start")) == 0) {
if ((oz = oser.deserialise_oz(*wp, false)) != NULL) {
pt = fact.createStart(oz, *wp);
}
} else if (_tcscmp(type.c_str(), _T("Turn")) == 0) {
if ((oz = oser.deserialise_oz(*wp, true)) != NULL) {
pt = fact.createAST(oz, *wp);
}
} else if (_tcscmp(type.c_str(), _T("Area")) == 0) {
if ((oz = oser.deserialise_oz(*wp, true)) != NULL) {
pt = fact.createAAT(oz, *wp);
}
} else if (_tcscmp(type.c_str(), _T("Finish")) == 0) {
if ((oz = oser.deserialise_oz(*wp, false)) != NULL) {
pt = fact.createFinish(oz, *wp);
}
}
if (pt != NULL) {
fact.append(pt,false);
}
delete wp;
delete wp_node;
delete oz_node;
}
示例2: assert
void
TaskDefaultsConfigPanel::Init(WndForm *_wf)
{
assert(_wf != NULL);
wf = _wf;
WndProperty *wp;
const SETTINGS_COMPUTER &settings_computer = XCSoarInterface::SettingsComputer();
OrderedTask* temptask = protected_task_manager->task_blank();
temptask->set_factory(TaskBehaviour::FACTORY_RT);
wp = (WndProperty*)wf->FindByName(_T("prpStartType"));
if (wp) {
const AbstractTaskFactory::LegalPointVector point_types =
temptask->get_factory().getValidStartTypes();
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
dfe->EnableItemHelp(true);
for (unsigned i = 0; i < point_types.size(); i++) {
dfe->addEnumText(OrderedTaskPointName(point_types[i]), (unsigned)point_types[i],
OrderedTaskPointDescription(point_types[i]));
if (point_types[i] == settings_computer.sector_defaults.start_type)
dfe->Set((unsigned)point_types[i]);
}
wp->RefreshDisplay();
}
LoadFormProperty(*wf, _T("prpStartRadius"), ugDistance,
settings_computer.sector_defaults.start_radius);
wp = (WndProperty*)wf->FindByName(_T("prpFinishType"));
if (wp) {
const AbstractTaskFactory::LegalPointVector point_types =
temptask->get_factory().getValidFinishTypes();
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
dfe->EnableItemHelp(true);
for (unsigned i = 0; i < point_types.size(); i++) {
dfe->addEnumText(OrderedTaskPointName(point_types[i]), (unsigned)point_types[i],
OrderedTaskPointDescription(point_types[i]));
if (point_types[i] == settings_computer.sector_defaults.finish_type)
dfe->Set((unsigned)point_types[i]);
}
wp->RefreshDisplay();
}
LoadFormProperty(*wf, _T("prpFinishRadius"), ugDistance,
settings_computer.sector_defaults.finish_radius);
wp = (WndProperty*)wf->FindByName(_T("prpTurnpointType"));
if (wp) {
const AbstractTaskFactory::LegalPointVector point_types =
temptask->get_factory().getValidIntermediateTypes();
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
dfe->EnableItemHelp(true);
for (unsigned i = 0; i < point_types.size(); i++) {
dfe->addEnumText(OrderedTaskPointName(point_types[i]),
(unsigned)point_types[i],
OrderedTaskPointDescription(point_types[i]));
if (point_types[i] == settings_computer.sector_defaults.turnpoint_type) {
dfe->Set((unsigned)point_types[i]);
}
}
wp->RefreshDisplay();
}
LoadFormProperty(*wf, _T("prpTurnpointRadius"), ugDistance,
settings_computer.sector_defaults.turnpoint_radius);
wp = (WndProperty*)wf->FindByName(_T("prpTaskType"));
if (wp) {
const std::vector<TaskBehaviour::Factory_t> factory_types =
temptask->get_factory_types();
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
dfe->EnableItemHelp(true);
for (unsigned i = 0; i < factory_types.size(); i++) {
dfe->addEnumText(OrderedTaskFactoryName(factory_types[i]),
(unsigned)factory_types[i], OrderedTaskFactoryDescription(
factory_types[i]));
if (factory_types[i] == settings_computer.task_type_default)
dfe->Set((unsigned)factory_types[i]);
}
wp->RefreshDisplay();
}
LoadFormProperty(*wf, _T("prpAATMinTime"),
(unsigned)(settings_computer.ordered_defaults.aat_min_time / 60));
LoadFormProperty(*wf, _T("prpAATTimeMargin"),
(unsigned)(settings_computer.optimise_targets_margin / 60));
delete temptask;
}