本文整理汇总了C++中WorkspaceGroup_sptr::removeAll方法的典型用法代码示例。如果您正苦于以下问题:C++ WorkspaceGroup_sptr::removeAll方法的具体用法?C++ WorkspaceGroup_sptr::removeAll怎么用?C++ WorkspaceGroup_sptr::removeAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorkspaceGroup_sptr
的用法示例。
在下文中一共展示了WorkspaceGroup_sptr::removeAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: algorithmComplete
/**
* Handles completion of the algorithm.
*
* Sets result workspace for Python export and ungroups result WorkspaceGroup.
*
* @param error True if the algorithm was stopped due to error, false otherwise
*/
void ISISEnergyTransfer::algorithmComplete(bool error) {
disconnect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this,
SLOT(algorithmComplete(bool)));
if (error)
return;
WorkspaceGroup_sptr energyTransferOutputGroup =
AnalysisDataService::Instance().retrieveWS<WorkspaceGroup>(
"IndirectEnergyTransfer_Workspaces");
if (energyTransferOutputGroup->size() == 0)
return;
// Set workspace for Python export as the first result workspace
m_pythonExportWsName = energyTransferOutputGroup->getNames()[0];
m_outputWorkspaces = energyTransferOutputGroup->getNames();
// Ungroup the output workspace
energyTransferOutputGroup->removeAll();
AnalysisDataService::Instance().remove("IndirectEnergyTransfer_Workspaces");
// Enable plotting and saving
m_uiForm.pbPlot->setEnabled(true);
m_uiForm.cbPlotType->setEnabled(true);
m_uiForm.pbSave->setEnabled(true);
m_uiForm.ckSaveAclimax->setEnabled(true);
m_uiForm.ckSaveASCII->setEnabled(true);
m_uiForm.ckSaveDaveGrp->setEnabled(true);
m_uiForm.ckSaveNexus->setEnabled(true);
m_uiForm.ckSaveNXSPE->setEnabled(true);
m_uiForm.ckSaveSPE->setEnabled(true);
}
示例2: algorithmComplete
/**
* Handles completion of algorithm
*
* @param error True if the chain was stopped due to error
*/
void IndirectDiffractionReduction::algorithmComplete(bool error) {
// Handles completion of the diffraction algorithm chain
disconnect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this,
SLOT(algorithmComplete(bool)));
if (error) {
showInformationBox(
"Error running diffraction reduction.\nSee Results Log for details.");
return;
}
// Ungroup the output workspace if generic reducer was used
if (AnalysisDataService::Instance().doesExist(
"IndirectDiffraction_Workspaces")) {
WorkspaceGroup_sptr diffResultsGroup =
AnalysisDataService::Instance().retrieveWS<WorkspaceGroup>(
"IndirectDiffraction_Workspaces");
m_plotWorkspaces.clear();
m_plotWorkspaces = diffResultsGroup->getNames();
diffResultsGroup->removeAll();
AnalysisDataService::Instance().remove("IndirectDiffraction_Workspaces");
}
// Enable plotting
m_uiForm.pbPlot->setEnabled(true);
m_uiForm.cbPlotType->setEnabled(true);
// Enable saving
m_uiForm.ckAscii->setEnabled(true);
m_uiForm.ckGSS->setEnabled(true);
m_uiForm.ckNexus->setEnabled(true);
m_uiForm.pbSave->setEnabled(true);
}
示例3: plotResults
/**
* Handles plotting result spectra from algorithm chains.
*
* @param error True if the chain was stopped due to error
*/
void IndirectDiffractionReduction::plotResults(bool error) {
// Handles completion of the diffraction algorithm chain
disconnect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this,
SLOT(plotResults(bool)));
// Nothing can be plotted
if (error) {
showInformationBox(
"Error running diffraction reduction.\nSee Results Log for details.");
return;
}
// Ungroup the output workspace if generic reducer was used
if (AnalysisDataService::Instance().doesExist(
"IndirectDiffraction_Workspaces")) {
WorkspaceGroup_sptr diffResultsGroup =
AnalysisDataService::Instance().retrieveWS<WorkspaceGroup>(
"IndirectDiffraction_Workspaces");
m_plotWorkspaces.clear();
m_plotWorkspaces = diffResultsGroup->getNames();
diffResultsGroup->removeAll();
AnalysisDataService::Instance().remove("IndirectDiffraction_Workspaces");
saveGenericReductions();
}
QString instName = m_uiForm.iicInstrumentConfiguration->getInstrumentName();
QString mode = m_uiForm.iicInstrumentConfiguration->getReflectionName();
QString plotType = m_uiForm.cbPlotType->currentText();
QString pyInput = "from mantidplot import plotSpectrum, plot2D\n";
if (plotType == "Spectra" || plotType == "Both") {
for (auto it = m_plotWorkspaces.begin(); it != m_plotWorkspaces.end(); ++it)
pyInput += "plotSpectrum('" + QString::fromStdString(*it) + "', 0)\n";
}
if (plotType == "Contour" || plotType == "Both") {
for (auto it = m_plotWorkspaces.begin(); it != m_plotWorkspaces.end(); ++it)
pyInput += "plot2D('" + QString::fromStdString(*it) + "')\n";
}
runPythonCode(pyInput);
}
示例4: algorithmComplete
/**
* Handles completion of the algorithm.
*
* Sets result workspace for Python export and ungroups result WorkspaceGroup.
*
* @param error True if the algorithm was stopped due to error, false otherwise
*/
void IndirectConvertToEnergy::algorithmComplete(bool error)
{
disconnect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this, SLOT(algorithmComplete(bool)));
if(error)
return;
WorkspaceGroup_sptr energyTransferOutputGroup = AnalysisDataService::Instance().retrieveWS<WorkspaceGroup>("IndirectEnergyTransfer_Workspaces");
if(energyTransferOutputGroup->size() == 0)
return;
// Set workspace for Python export as the first result workspace
m_pythonExportWsName = energyTransferOutputGroup->getNames()[0];
// Ungroup the output workspace
energyTransferOutputGroup->removeAll();
AnalysisDataService::Instance().remove("IndirectEnergyTransfer_Workspaces");
}
示例5: sliceAlgDone
/**
* Updates the preview plot when the algorithm is complete.
*
* @param error True if the algorithm was stopped due to error, false otherwise
*/
void ISISDiagnostics::sliceAlgDone(bool error) {
disconnect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this,
SLOT(sliceAlgDone(bool)));
if (error)
return;
QStringList filenames = m_uiForm.dsInputFiles->getFilenames();
if (filenames.size() < 1)
return;
WorkspaceGroup_sptr sliceOutputGroup =
AnalysisDataService::Instance().retrieveWS<WorkspaceGroup>(
"IndirectDiagnostics_Workspaces");
if (sliceOutputGroup->size() == 0) {
g_log.warning("No result workspaces, cannot plot preview.");
return;
}
MatrixWorkspace_sptr sliceWs = boost::dynamic_pointer_cast<MatrixWorkspace>(
sliceOutputGroup->getItem(0));
if (!sliceWs) {
g_log.warning("No result workspaces, cannot plot preview.");
return;
}
// Set workspace for Python export as the first result workspace
m_pythonExportWsName = sliceWs->getName();
// Plot result spectrum
m_uiForm.ppSlicePreview->clear();
m_uiForm.ppSlicePreview->addSpectrum("Slice", sliceWs, 0);
m_uiForm.ppSlicePreview->resizeX();
// Ungroup the output workspace
sliceOutputGroup->removeAll();
AnalysisDataService::Instance().remove("IndirectDiagnostics_Workspaces");
}
示例6: sliceAlgDone
/**
* Updates the preview plot when the algorithm is complete.
*
* @param error True if the algorithm was stopped due to error, false otherwise
*/
void IndirectDiagnostics::sliceAlgDone(bool error)
{
if(error)
return;
QStringList filenames = m_uiForm.dsInputFiles->getFilenames();
if(filenames.size() < 1)
return;
WorkspaceGroup_sptr sliceOutputGroup = AnalysisDataService::Instance().retrieveWS<WorkspaceGroup>("IndirectDiagnostics_Workspaces");
if(sliceOutputGroup->size() == 0)
{
g_log.warning("No result workspaces, cannot plot preview.");
return;
}
MatrixWorkspace_sptr sliceWs = boost::dynamic_pointer_cast<MatrixWorkspace>(sliceOutputGroup->getItem(0));
if(!sliceWs)
{
g_log.warning("No result workspaces, cannot plot preview.");
return;
}
// Set workspace for Python export as the first result workspace
m_pythonExportWsName = sliceWs->getName();
// Plot result spectrum
plotMiniPlot(sliceWs, 0, "SlicePreviewPlot", "SlicePreviewCurve");
// Set X range to data range
setXAxisToCurve("SlicePreviewPlot", "SlicePreviewCurve");
m_plots["SlicePreviewPlot"]->replot();
// Ungroup the output workspace
sliceOutputGroup->removeAll();
AnalysisDataService::Instance().remove("IndirectDiagnostics_Workspaces");
}