本文整理汇总了C++中OrderedTask::set_factory方法的典型用法代码示例。如果您正苦于以下问题:C++ OrderedTask::set_factory方法的具体用法?C++ OrderedTask::set_factory怎么用?C++ OrderedTask::set_factory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderedTask
的用法示例。
在下文中一共展示了OrderedTask::set_factory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pser
void
Serialiser::deserialise(OrderedTask& data)
{
data.clear();
data.set_factory(task_factory_type());
data.reset();
OrderedTaskBehaviour beh = data.get_ordered_task_behaviour();
deserialise(beh);
data.set_ordered_task_behaviour(beh);
DataNode* point_node;
unsigned i=0;
while ((point_node = m_node.get_child_by_name(_T("Point"),i)) != NULL) {
Serialiser pser(*point_node);
pser.deserialise_point(data);
delete point_node;
i++;
}
}
示例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;
}