diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h index e7ae3ae6b3c7514ad4f4b94446e4888f2a5c23d7..119a4b206db4cbd5f13e90c4cfb44a8f39d1b84e 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h @@ -68,6 +68,8 @@ namespace CustomInterfaces void displayError(const std::string &error); void setAvailableLogs(const std::vector<std::string> &logs); void setAvailablePeriods(const std::vector<std::string> &periods); + void setTimeLimits(double tMin, double tMax); + void setTimeRange (double tMin, double tMax); void setWaitingCursor(); void restoreCursor(); void help(); diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui index 41440428b1cbb8f4c0992fee55681f94a34a0848..ebd0214679a8790968ec3c8b6f175f30520d54a4 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui @@ -387,7 +387,17 @@ </widget> </item> <item> - <widget class="QDoubleSpinBox" name="minTime"/> + <widget class="QDoubleSpinBox" name="minTime"> + <property name="minimum"> + <double>-6</double> + </property> + <property name="maximum"> + <double>33</double> + </property> + <property name="decimals"> + <number>3</number> + </property> + </widget> </item> <item> <widget class="QLabel" name="label_5"> @@ -397,7 +407,17 @@ </widget> </item> <item> - <widget class="QDoubleSpinBox" name="maxTime"/> + <widget class="QDoubleSpinBox" name="maxTime"> + <property name="minimum"> + <double>-6</double> + </property> + <property name="maximum"> + <double>33</double> + </property> + <property name="decimals"> + <number>3</number> + </property> + </widget> </item> </layout> </widget> diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCDataLoadingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCDataLoadingView.h index 56a61e0bbc2377bfbee68ea22c9cdcbc37720127..54ec12db0a804fe6e9a5667054c5f37bdf52116f 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCDataLoadingView.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCDataLoadingView.h @@ -103,6 +103,16 @@ namespace CustomInterfaces /// @param periods :: New list of periods virtual void setAvailablePeriods(const std::vector<std::string>& periods) = 0; + /// Update the time limits + /// @param tMin :: Minimum X value available + /// @param tMax :: Maximum X value available + virtual void setTimeLimits(double tMin, double tMax) = 0; + + /// Update the time limits + /// @param tMin :: Minimum X value available + /// @param tMax :: Maximum X value available + virtual void setTimeRange(double tMin, double tMax) = 0; + /// Set waiting cursor for long operation virtual void setWaitingCursor() = 0; diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingPresenter.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingPresenter.cpp index c92356a85561c25da2d4c5ff05080aa93feb9499..1e42a20b0d5a59e29a08c47d4a832bb993333f5f 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingPresenter.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingPresenter.cpp @@ -137,6 +137,7 @@ namespace CustomInterfaces { m_view->setAvailableLogs(std::vector<std::string>()); // Empty logs list m_view->setAvailablePeriods(std::vector<std::string>()); // Empty period list + m_view->setTimeLimits(0,0); // "Empty" time limits return; } @@ -161,6 +162,11 @@ namespace CustomInterfaces periods.push_back(buffer.str()); } m_view->setAvailablePeriods(periods); + + // Set time limits + m_view->setTimeLimits(ws->readX(0).front(),ws->readX(0).back()); + // Set allowed time range + m_view->setTimeRange (ws->readX(0).front(),ws->readX(0).back()); } } // namespace CustomInterfaces diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp index 1c10a0abf0a1548174d232962fa3657ca1e17339..6cea3759e0f926c01a1289b7d673dd3100963327 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp @@ -163,6 +163,23 @@ namespace CustomInterfaces } } + void ALCDataLoadingView::setTimeLimits(double tMin, double tMax) + { + // Set initial values + m_ui.minTime->setValue(tMin); + m_ui.maxTime->setValue(tMax); + } + + void ALCDataLoadingView::setTimeRange(double tMin, double tMax) + { + // Set range for minTime + m_ui.minTime->setMinimum(tMin); + m_ui.minTime->setMaximum(tMax); + // Set range for maxTime + m_ui.maxTime->setMinimum(tMin); + m_ui.maxTime->setMaximum(tMax); + } + void ALCDataLoadingView::help() { MantidQt::API::HelpWindow::showCustomInterface(NULL, QString("Muon_ALC")); diff --git a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h index 850d5812542ee6b72f317f6c7674313399262a35..e61879312c74af0428c2825ca5acd6ba8308326c 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h @@ -48,6 +48,8 @@ public: MOCK_METHOD1(displayError, void(const std::string&)); MOCK_METHOD1(setAvailableLogs, void(const std::vector<std::string>&)); MOCK_METHOD1(setAvailablePeriods, void(const std::vector<std::string>&)); + MOCK_METHOD2(setTimeLimits, void(double,double)); + MOCK_METHOD2(setTimeRange, void(double,double)); MOCK_METHOD0(setWaitingCursor, void()); MOCK_METHOD0(restoreCursor, void()); MOCK_METHOD0(help, void());