当前位置: 首页>>代码示例>>C++>>正文


C++ Analysis::options方法代码示例

本文整理汇总了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();
}
开发者ID:MaxG87,项目名称:jasp-desktop,代码行数:27,代码来源:mainwindow.cpp

示例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);
		}
	}
}
开发者ID:AlexanderLyNL,项目名称:jasp-desktop,代码行数:59,代码来源:engine.cpp

示例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;
}
开发者ID:AlexanderLyNL,项目名称:jasp-desktop,代码行数:22,代码来源:analyses.cpp


注:本文中的Analysis::options方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。