Commit 7e66cbc6 authored by Dennis Mikkelson's avatar Dennis Mikkelson
Browse files

RE 6805 Refactor SelectionNotificationService class

Added bool parameter to message, to indicate whether the
Q-vector is in lab or sample coordinates.

refs #6805
parent 18889adb
......@@ -14,8 +14,6 @@
#include "MantidQtAPI/UserSubWindow.h"
#include "MantidQtAPI/SelectionNotificationService.h"
//#include "MantidAPI/SelectionNotificationService.h"
namespace MantidQt
{
namespace CustomInterfaces
......@@ -307,15 +305,8 @@ private slots:
/// Slot to enable/disable the ellipse size options controls
void setEnabledEllipseSizeOptions_slot();
/*
/// Methods to handle pointed at message from any source
void handleQpointNotification(const Poco::AutoPtr<Mantid::API::SelectionNotificationServiceImpl::AddNotification> & message );
void handleQpointNotification1(const Poco::AutoPtr<Mantid::API::SelectionNotificationServiceImpl::AfterReplaceNotification> & message );
*/
/// Method to get and display info about the specified Q-vector
void showInfo( Mantid::Kernel::V3D q_point );
void showInfo( bool lab_coords, Mantid::Kernel::V3D q_point );
private:
/// super class pure virtual method we MUST implement
......@@ -382,11 +373,6 @@ private:
/// allow running precisely one operation
/// at a time in a separate thread.
/*
Poco::NObserver<MantidEV, Mantid::API::SelectionNotificationServiceImpl::AddNotification> observer;
Poco::NObserver<MantidEV, Mantid::API::SelectionNotificationServiceImpl::AfterReplaceNotification> observer1;
*/
};
} // namespace CustomInterfaces
......
......@@ -164,7 +164,8 @@ public:
/// Get Info about a Q-Vector from a PeaksWorkspace
std::vector< std::pair< std::string, std::string > >
PointInfo( const std::string & peaks_ws_name,
Mantid::Kernel::V3D Q);
bool lab_coords,
Mantid::Kernel::V3D Q);
private:
......
......@@ -1061,7 +1061,7 @@ void MantidEV::showInfo_slot()
getDouble( m_uiForm.Qz_ledt, qz );
/// loop back test of SelectionNotificationService
MantidQt::API::SelectionNotificationService::Instance().sendQPointSelection( false, qx, qy, qz );
MantidQt::API::SelectionNotificationService::Instance().sendQPointSelection( true, qx, qy, qz );
}
......@@ -1078,7 +1078,7 @@ void MantidEV::showInfo_slot()
void MantidEV::QPointSelection_slot( bool lab_coords, double qx, double qy, double qz )
{
Mantid::Kernel::V3D q_point( qx, qy, qz );
showInfo( q_point );
showInfo( lab_coords, q_point );
}
......@@ -1086,9 +1086,11 @@ void MantidEV::QPointSelection_slot( bool lab_coords, double qx, double qy, doub
* Use the peaks workspace to get information about the specified
* Q-vector.
*
* @param lab_coords Will be true if the Q-components are in lab coordinates
* and false if they are in sample coordinates.
* @param q_point Vector containing the Q-coordinates.
*/
void MantidEV::showInfo( Mantid::Kernel::V3D q_point )
void MantidEV::showInfo( bool lab_coords, Mantid::Kernel::V3D q_point )
{
std::string peaks_ws_name = m_uiForm.PeaksWorkspace_ledt->text().toStdString();
if ( peaks_ws_name.length() == 0 )
......@@ -1102,7 +1104,7 @@ void MantidEV::showInfo( Mantid::Kernel::V3D q_point )
errorMessage("Requested Peaks Workspace Doesn't Exist");
}
std::vector< std::pair< std::string, std::string > > info = worker->PointInfo( peaks_ws_name, q_point );
std::vector< std::pair< std::string, std::string > > info = worker->PointInfo( peaks_ws_name, lab_coords, q_point );
m_uiForm.SelectedPoint_tbl->setRowCount((int)info.size());
m_uiForm.SelectedPoint_tbl->setColumnCount(2);
......
......@@ -858,7 +858,18 @@ bool MantidEVWorker::showUB( const std::string & peaks_ws_name )
}
/**
* Get information about a specified Q-position from the specified peaks
* workspace.
*
* @param peaks_ws_name The name of the peaks workspace
* @param lab_coords This will be true if the Q-vector is
* in lab coordinates and will be false if
* it is in sample coordinates.
* @param Q The Q-vector.
*/
std::vector< std::pair<std::string,std::string> >MantidEVWorker::PointInfo( const std::string & peaks_ws_name,
bool lab_coords,
Mantid::Kernel::V3D Q)
{
const auto& ADS = AnalysisDataService::Instance();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment