Skip to content

Commit

Permalink
Refs #5410. Add check to see if period data.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Whitley committed May 24, 2012
1 parent 6a612b5 commit c69d052
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2438,6 +2438,18 @@ void MuonAnalysis::changeCurrentRun(std::string & workspaceGroupName)
{
Workspace_sptr workspace_ptr = AnalysisDataService::Instance().retrieve(m_workspace_name);
MatrixWorkspace_sptr matrix_workspace = boost::dynamic_pointer_cast<MatrixWorkspace>(workspace_ptr);
if(!matrix_workspace) // Data collected in periods.
{
// Get run number from first period data.
workspace_ptr = AnalysisDataService::Instance().retrieve(m_workspace_name + "_1");
matrix_workspace = boost::dynamic_pointer_cast<MatrixWorkspace>(workspace_ptr);
if(!matrix_workspace)
{
QMessageBox::information(this, "Mantid - Muon Analysis", "Mantid expected period data but no periods were found.\n"
"Default plot name will be used insead of run number.");
return;
}
}
const Run& runDetails = matrix_workspace->run();

std::string runNumber = runDetails.getProperty("run_number")->value();
Expand Down

0 comments on commit c69d052

Please sign in to comment.