Skip to content

Commit

Permalink
Refs #11330 Fixes for improvement of peak table
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonPiccardoSelg committed Apr 8, 2015
1 parent 3bd1dfa commit f3167c9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
Expand Up @@ -96,7 +96,7 @@ class ConcretePeaksPresenterVsiTest : public CxxTest::TestSuite {
ConcretePeaksPresenterVsi presenter(pw_ptr, frustum, frame);
double radius = 0;
Mantid::Kernel::V3D coord(0,0,0);
presenter.getPeaksInfo(pw_ptr,0,coord, radius);
presenter.getPeaksInfo(pw_ptr,0,coord, radius, coordinateSystem);

//Assert
TSM_ASSERT_EQUALS("Should have a radius of 10", radius, peakRadius);
Expand Down
4 changes: 3 additions & 1 deletion Code/Mantid/Vates/VatesAPI/test/NullPeaksPresenterVsiTest.h
Expand Up @@ -4,6 +4,7 @@
#include <cxxtest/TestSuite.h>
#include "MantidVatesAPI/NullPeaksPresenterVsi.h"
#include "MantidKernel/V3D.h"
#include "MantidKernel/SpecialCoordinateSystem.h"
#include "MantidAPI/IPeaksWorkspace.h"
#include <stdexcept>

Expand Down Expand Up @@ -32,8 +33,9 @@ class NullPeaksPresenterVsiTest : public CxxTest::TestSuite
int row = 0;
double radius;
Mantid::Kernel::V3D position;
Mantid::Kernel::SpecialCoordinateSystem coord;
Mantid::API::IPeaksWorkspace_sptr peaksWorkspace;
TSM_ASSERT_THROWS("Should not implement this method", presenter.getPeaksInfo(peaksWorkspace,row,position,radius), std::runtime_error);
TSM_ASSERT_THROWS("Should not implement this method", presenter.getPeaksInfo(peaksWorkspace,row,position,radius, coord), std::runtime_error);
}
};
#endif
33 changes: 19 additions & 14 deletions Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp
Expand Up @@ -866,26 +866,31 @@ QString MdViewerWidget::getViewForInstrument(const std::string& instrumentName)
// 2. Neutron Diffraction --> SPLATTERPLOT
// 3. *Spectroscopy* --> MULTISLICE
// 4. Other --> STANDARD
const std::set<std::string> techniques = Mantid::Kernel::ConfigService::Instance().getInstrument(instrumentName).techniques();

QString associatedView;

if (techniques.count("Single Crystal Diffraction") > 0 )
{
associatedView = mdConstants.getSplatterPlotView();
}
else if (techniques.count("Neutron Diffraction") > 0 )
{
associatedView = mdConstants.getSplatterPlotView();
} else if (checkIfTechniqueContainsKeyword(techniques, "Spectroscopy"))
try
{
associatedView = mdConstants.getMultiSliceView();
const std::set<std::string> techniques = Mantid::Kernel::ConfigService::Instance().getInstrument(instrumentName).techniques();

if (techniques.count("Single Crystal Diffraction") > 0 )
{
associatedView = mdConstants.getSplatterPlotView();
}
else if (techniques.count("Neutron Diffraction") > 0 )
{
associatedView = mdConstants.getSplatterPlotView();
} else if (checkIfTechniqueContainsKeyword(techniques, "Spectroscopy"))
{
associatedView = mdConstants.getMultiSliceView();
}
else
{
associatedView = mdConstants.getStandardView();
}
}
else
catch (...)
{
associatedView = mdConstants.getStandardView();
}

return associatedView;
}

Expand Down

0 comments on commit f3167c9

Please sign in to comment.