Skip to content

Commit

Permalink
update presenter for last view updates, re #12610
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeMPouzols committed Aug 4, 2015
1 parent a97f9ab commit 915d5dc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ set ( INC_FILES
inc/MantidQtCustomInterfaces/DllConfig.h
inc/MantidQtCustomInterfaces/EnggDiffraction/IEnggDiffractionPresenter.h
inc/MantidQtCustomInterfaces/EnggDiffraction/IEnggDiffractionView.h
inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffCalibSettings.h
inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionPresenter.h
inc/MantidQtCustomInterfaces/EnggDiffraction/EnggDiffractionViewQtGUI.h
inc/MantidQtCustomInterfaces/Homer.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTIDQT_CUSTOMINTERFACES_DLL EnggDiffractionPresenter
class EnggDiffractionPresenter
: public IEnggDiffractionPresenter {

public:
Expand All @@ -58,6 +58,7 @@ class MANTIDQT_CUSTOMINTERFACES_DLL EnggDiffractionPresenter
void processLoadExistingCalib();
void processCalcCalib();
void processLogMsg();
void processInstChange();
void processShutDown();

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class IEnggDiffractionPresenter {
LoadExistingCalib, ///< Load a calibration already availble on disk
CalcCalib, ///< Calculate a (new) calibration
LogMsg, ///< need to send a message to the Mantid log system
InstrumentChange, ///< Instrument selection updated
ShutDown ///< closing the interface
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ using namespace MantidQt::CustomInterfaces;
namespace MantidQt {
namespace CustomInterfaces {

namespace {
Mantid::Kernel::Logger g_log("EngineeringDiffractionGUI");
}

EnggDiffractionPresenter::EnggDiffractionPresenter(IEnggDiffractionView *view)
: m_view(view) /*, m_model(new EnggDiffractionModel()), */ {
if (!m_view) {
Expand Down Expand Up @@ -52,6 +56,9 @@ void EnggDiffractionPresenter::notify(
processLogMsg();
break;

case IEnggDiffractionPresenter::InstrumentChange:
processInstChange();

case IEnggDiffractionPresenter::ShutDown:
processShutDown();
break;
Expand All @@ -61,7 +68,7 @@ void EnggDiffractionPresenter::notify(
void EnggDiffractionPresenter::processStart() {
std::vector<std::string> msgs = m_view->logMsgs();
for (size_t i = 0; i < msgs.size(); i++) {
//m_model->logMsg(msgs[i]);
g_log.information() << msgs[i] << std::endl;
}
}

Expand All @@ -71,6 +78,10 @@ void EnggDiffractionPresenter::processCalcCalib() {}

void EnggDiffractionPresenter::processLogMsg() {}

void EnggDiffractionPresenter::processInstChange() {
g_log.error() << "Changing instrument is not supported!" << std::endl;
}

void EnggDiffractionPresenter::processShutDown() {
m_view->saveSettings();
cleanup();
Expand Down

0 comments on commit 915d5dc

Please sign in to comment.