本文整理汇总了C++中Task::addSubTask方法的典型用法代码示例。如果您正苦于以下问题:C++ Task::addSubTask方法的具体用法?C++ Task::addSubTask怎么用?C++ Task::addSubTask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::addSubTask方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sl_loadSequenceButton
void DotPlotDialog::sl_loadSequenceButton(){
QString filter = DialogUtils::prepareDocumentsFileFilterByObjType(GObjectTypes::SEQUENCE, true);
LastUsedDirHelper lod("DotPlot file");
lod.url = U2FileDialog::getOpenFileName(this, tr("Open file"), lod.dir, filter);
if(!lod.url.isEmpty()){
Task *tasks = new Task("Adding document to the project", TaskFlag_NoRun);
if (!AppContext::getProject()) {
tasks->addSubTask( AppContext::getProjectLoader()->createNewProjectTask() );
}
//DotPlotLoadDocumentsTask *t = new DotPlotLoadDocumentsTask(lod.url, -1, NULL, -1, false);
//tasks->addSubTask(t);
QVariantMap hints;
hints[ProjectLoaderHint_LoadWithoutView] = false;
hints[ProjectLoaderHint_LoadUnloadedDocument] = true;
openSequenceTask = AppContext::getProjectLoader()->openWithProjectTask(lod.url, hints);
if(openSequenceTask == NULL){
return;
}
curURL = lod.url;
tasks->addSubTask(openSequenceTask);
connect( AppContext::getTaskScheduler(), SIGNAL( si_stateChanged(Task*) ), SLOT( sl_loadTaskStateChanged(Task*) ) );
AppContext::getTaskScheduler()->registerTopLevelTask(tasks);
}
}
示例2: getAlgorithmTask
Task* QDORFActor::getAlgorithmTask(const QVector<U2Region>& searchLocation) {
Task* t = NULL;
const DNASequence& dnaSeq = scheme->getSequence();
QMap<QString, Attribute*> params = cfg->getParameters();
switch (getStrandToRun()) {
case QDStrand_Both:
settings.strand = ORFAlgorithmStrand_Both;
break;
case QDStrand_DirectOnly:
settings.strand = ORFAlgorithmStrand_Direct;
break;
case QDStrand_ComplementOnly:
settings.strand = ORFAlgorithmStrand_Complement;
break;
}
settings.minLen = params.value(LEN_ATTR)->getAttributePureValue().toInt();
settings.mustFit = params.value(FIT_ATTR)->getAttributePureValue().toBool();
settings.mustInit = params.value(INIT_ATTR)->getAttributePureValue().toBool();
settings.allowAltStart = params.value(ALT_ATTR)->getAttributePureValue().toBool();
settings.maxResult2Search = params.value(RES_ATTR)->getAttributePureValue().toInt();
settings.searchRegion = U2Region(0, dnaSeq.length());
if (settings.strand != ORFAlgorithmStrand_Direct) {
DNATranslation* compTT = NULL;
if (dnaSeq.alphabet->isNucleic()) {
compTT = AppContext::getDNATranslationRegistry()->
lookupComplementTranslation(dnaSeq.alphabet);
}
if (compTT != NULL) {
settings.complementTT = compTT;
} else {
settings.strand = ORFAlgorithmStrand_Direct;
}
}
const QString& transId = params.value(ID_ATTR)->getAttributeValueWithoutScript<QString>();
settings.proteinTT = AppContext::getDNATranslationRegistry()->
lookupTranslation(dnaSeq.alphabet, DNATranslationType_NUCL_2_AMINO, transId);
if (!settings.proteinTT) {
return new FailTask(tr("Bad sequence"));
}
t = new Task(tr("ORF find"), TaskFlag_NoRun);
assert(orfTasks.isEmpty());
foreach(const U2Region& r, searchLocation) {
ORFAlgorithmSettings stngs(settings);
stngs.searchRegion = r;
ORFFindTask* sub = new ORFFindTask(stngs, scheme->getEntityRef());
orfTasks.append(sub);
t->addSubTask(sub);
}
示例3: getAlgorithmTask
Task* QDFindActor::getAlgorithmTask(const QVector<U2Region>& location) {
Task* t = new Task(tr("Find"), TaskFlag_NoRun);
settings.sequence = scheme->getSequence().seq;
settings.pattern = cfg->getParameter(PATTERN_ATTR)->getAttributeValueWithoutScript<QString>().toLatin1().toUpper();
settings.maxResult2Find = FindAlgorithmSettings::MAX_RESULT_TO_FIND_UNLIMITED;
switch(getStrandToRun()) {
case QDStrand_Both:
settings.strand = FindAlgorithmStrand_Both;
break;
case QDStrand_DirectOnly:
settings.strand = FindAlgorithmStrand_Direct;
break;
case QDStrand_ComplementOnly:
settings.strand = FindAlgorithmStrand_Complement;
break;
}
if (settings.strand != FindAlgorithmStrand_Direct) {
DNATranslation* compTT = NULL;
if (scheme->getSequence().alphabet->isNucleic()) {
compTT = AppContext::getDNATranslationRegistry()->
lookupComplementTranslation(scheme->getSequence().alphabet);
}
if (compTT != NULL) {
settings.complementTT = compTT ;
} else {
QString err = tr("%1: can not find complement translation.").arg(getParameters()->getLabel());
return new FailTask(err);
}
}
if (settings.pattern.isEmpty()) {
QString err = tr("%1: pattern is empty.").arg(getParameters()->getLabel());
return new FailTask(err);
}
const DNAAlphabet* ptrnAl = U2AlphabetUtils::findBestAlphabet(settings.pattern);
if (ptrnAl->getType()!=DNAAlphabet_NUCL) {
QString err = tr("%1: pattern has to be nucleic").arg(getParameters()->getLabel());
return new FailTask(err);
}
foreach(const U2Region& r, location) {
FindAlgorithmTaskSettings s(settings);
s.searchRegion = r;
FindAlgorithmTask* findTask = new FindAlgorithmTask(s);
connect(new TaskSignalMapper(findTask), SIGNAL(si_taskFinished(Task*)), SLOT(sl_onFindTaskFinished(Task*)));
t->addSubTask(findTask);
}
示例4: localSettings
Task *QDTandemActor::getAlgorithmTask(const QVector<U2Region> &location) {
settings.minPeriod = cfg->getParameter(MIN_PERIOD_ATTRIBUTE)->getAttributeValueWithoutScript<int>();
settings.maxPeriod = cfg->getParameter(MAX_PERIOD_ATTRIBUTE)->getAttributeValueWithoutScript<int>();
settings.algo = (TSConstants::TSAlgo)cfg->getParameter(ALGORITHM_ATTRIBUTE)->getAttributeValueWithoutScript<int>();
settings.minTandemSize = cfg->getParameter(MIN_TANDEM_SIZE_ATTRIBUTE)->getAttributeValueWithoutScript<int>();
settings.minRepeatCount = cfg->getParameter(MIN_REPEAT_COUNT_ATTRIBUTE)->getAttributeValueWithoutScript<int>();
settings.showOverlappedTandems = cfg->getParameter(SHOW_OVERLAPPED_TANDEMS_ATTRIBUTE)->getAttributeValueWithoutScript<bool>();
settings.nThreads = cfg->getParameter(N_THREADS_ATTRIBUTE)->getAttributeValueWithoutScript<int>();
const DNASequence& dnaSeq = scheme->getSequence();
Task *task = new Task(tr("TandemQDTask"), TaskFlag_NoRun);
foreach(const U2Region &r, location) {
FindTandemsTaskSettings localSettings(settings);
localSettings.seqRegion = r;
TandemFinder *subTask = new TandemFinder(localSettings, dnaSeq);
task->addSubTask(subTask);
subTasks.append(subTask);
}