Exemplo n.º 1
0
void SchemeDisplayWizard::accepted() {
    qDebug() << "void SchemeDisplayWizard::accepted()";
    qDebug() << "indicator" << field("indicator");
    qDebug() << "category" << field("category");
    QVector<QString> curves;
    auto schemes = getSchemes(scheme::fromString(field("category").toString()), mParasManager->getAbstractSchemeList(), curves);
    if(schemes.empty()) {
        QMessageBox::warning(
            this,
            tr("方案指标演示"),
            tr("没有可以演示的数据,放弃演示"),
            QMessageBox::Ok);
        return;
    }

    QWidget* widget = nullptr;
    int startYear = Config::config.Int("START_YEAR");
    int endYear = Config::config.Int("END_YEAR");
    if(field("category").toString().contains(tr("分龄"))) {
        widget = PyramidController::createPyramidController(curves, schemes, startYear, endYear);
    } else {
        auto indicators = getIndicators(schemes, field("indicator").toString());
        if(field("dispMode") == IndicatorSel::MAP_DISP_MODE) {
            widget = MapType1::makeMapType1(curves, indicators, startYear, endYear);
        } else {
            widget = SequenceController::createSequenceController(curves, indicators, startYear, endYear);
        }
    }
    widget->show();
}
Exemplo n.º 2
0
void SBWorkspace::queueSchemes(const StringSet& schemeNames, const StringSet& configNames) {
    BuildSettings bs(NULL);
    bool isInteractive = bs.getValue("VSIMPORTER_INTERACTIVE") == "YES";

    // Get the specified schemes
    SchemeVec schemePtrs;
    if (schemeNames.empty()) {
        // Queue up all schemes
        schemePtrs.insert(schemePtrs.end(), m_schemes.begin(), m_schemes.end());
    } else {
        getSchemes(schemeNames, schemePtrs);
    }

    // Process all schemes
    for (auto scheme : schemePtrs) {
        // Process all build references in the scheme
        for (auto buildRef : scheme->getTargets()) {
            // Construct a path to the project specified by the BuildRef
            String projectPath = joinPaths(scheme->getContainerParentDir(), buildRef.container);

            // Find or create the project
            SBProject* targetProj = openProject(projectPath);

            // Create the target
            SBTarget* target = NULL;
            if (targetProj) {
                target = targetProj->queueTargetWithId(buildRef.id, &configNames);
            } else {
                SBLog::warning() << "Failed to open \"" << buildRef.container << "\" project referenced by \"" << scheme->getName()
                                 << "\" scheme. "
                                 << "Ignoring \"" << buildRef.targetName << "\" target." << std::endl;
            }

            // Mark target as having been explicitly queued up
            if (target) {
                target->markExplicit();
            }
        }
    }
}