Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/bugfix/8860_muon_same_inst_diff_…
Browse files Browse the repository at this point in the history
…no_spectra'
  • Loading branch information
KarlPalmen committed Feb 28, 2014
2 parents 11a7fdb + 6542373 commit c6ff3b3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,20 @@ boost::shared_ptr<GroupResult> MuonAnalysis::group(boost::shared_ptr<LoadResult>
int instrIndex = m_uiForm.instrSelector->findText( QString::fromStdString(instr->getName()) );
bool instrChanged = m_uiForm.instrSelector->currentIndex() != instrIndex;

if ( !instrChanged && isGroupingSet() )
// Check whether the number of spectra was changed
bool noSpectraChanged(true);

if ( AnalysisDataService::Instance().doesExist(m_workspace_name) )
{
auto currentWs = AnalysisDataService::Instance().retrieveWS<Workspace>(m_workspace_name);
size_t currentNoSpectra = firstPeriod(currentWs)->getNumberHistograms();

size_t loadedNoSpectra = firstPeriod(loadResult->loadedWorkspace)->getNumberHistograms();

noSpectraChanged = (currentNoSpectra != loadedNoSpectra);
}

if ( !noSpectraChanged && !instrChanged && isGroupingSet() )
{
// Use grouping currently set
result->usedExistGrouping = true;
Expand Down Expand Up @@ -1550,7 +1563,10 @@ void MuonAnalysis::inputFileChanged(const QStringList& files)
// XXX: this should be done after the instrument was changed, because changing the instrument will
// clear the grouping
if ( ! groupResult->usedExistGrouping )
{
runClearGroupingButton();
fillGroupingTable(*(groupResult->groupingUsed), m_uiForm);
}

// Populate instrument fields
std::stringstream str;
Expand Down

0 comments on commit c6ff3b3

Please sign in to comment.