本文整理汇总了C++中Analysis::options方法的典型用法代码示例。如果您正苦于以下问题:C++ Analysis::options方法的具体用法?C++ Analysis::options怎么用?C++ Analysis::options使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analysis
的用法示例。
在下文中一共展示了Analysis::options方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveSelected
void MainWindow::saveSelected(const QString &filename)
{
if (_analyses->count() > 0)
{
QWebElement element = ui->webViewResults->page()->mainFrame()->documentElement();
QString qHTML = element.toOuterXml();
_package->analysesHTML = fq(qHTML);
Json::Value analysesData = Json::arrayValue;
for (Analyses::iterator itr = _analyses->begin(); itr != _analyses->end(); itr++)
{
Analysis *analysis = *itr;
if (analysis != NULL && analysis->visible())
{
Json::Value analysisData = analysis->asJSON();
analysisData["options"] = analysis->options()->asJSON();
analysesData.append(analysisData);
}
}
_package->analysesData = analysesData;
_package->hasAnalyses = true;
}
_loader.save(filename, _package);
_alert->show();
}
示例2: receiveMessages
void Engine::receiveMessages(int timeout)
{
string data;
if (_channel->receive(data, timeout))
{
Value jsonRequest;
Reader r;
r.parse(data, jsonRequest, false);
string analysisName = jsonRequest.get("name", nullValue).asString();
int id = jsonRequest.get("id", -1).asInt();
bool run = jsonRequest.get("perform", "run").asString() == "run";
Value jsonOptions = jsonRequest.get("options", nullValue);
if (_currentAnalysis != NULL && _currentAnalysis->id() == id)
{
_currentAnalysis->options()->set(jsonOptions);
if (run)
_currentAnalysis->setStatus(Analysis::Running);
else
_currentAnalysis->setStatus(Analysis::Empty);
}
else if (_nextAnalysis != NULL && _nextAnalysis->id() == id)
{
_nextAnalysis->options()->set(jsonOptions);
if (run)
_nextAnalysis->setStatus(Analysis::Running);
else
_nextAnalysis->setStatus(Analysis::Empty);
}
else
{
Analysis *analysis = AnalysisLoader::load(id, analysisName);
analysis->options()->set(jsonOptions);
if (run)
analysis->setStatus(Analysis::Running);
if (_dataSet == NULL)
{
managed_shared_memory *mem = SharedMemory::get();
_dataSet = mem->find<DataSet>(boost::interprocess::unique_instance).first;
_R.setDataSet(_dataSet);
}
analysis->setDataSet(_dataSet);
analysis->setRInterface(&_R);
analysis->resultsChanged.connect(boost::bind(&Engine::analysisResultsChanged, this, _1));
if (_nextAnalysis != NULL)
delete _nextAnalysis;
_nextAnalysis = analysis;
if (_currentAnalysis != NULL)
_currentAnalysis->setStatus(Analysis::Aborted);
}
}
}
示例3:
Analysis *Analyses::create(string name, int id)
{
Analysis *analysis = AnalysisLoader::load(id, name);
if (_defaults.find(name) != _defaults.end())
{
Json::Value opt = _defaults[name]->options()->asJSON();
analysis->options()->set(opt);
}
while (id >= _analyses.size())
_analyses.push_back(NULL);
_analyses[id] = analysis;
analysis->optionsChanged.connect(boost::bind(&Analyses::analysisOptionsChangedHandler, this, _1));
analysis->resultsChanged.connect(boost::bind(&Analyses::analysisResultsChangedHandler, this, _1));
analysisAdded(analysis);
return analysis;
}