From af1cde94b2e91be5a0fcc92c6c0f80c86d351d35 Mon Sep 17 00:00:00 2001 From: Conor Finn <conor.finn@stfc.ac.uk> Date: Mon, 9 Dec 2019 17:50:55 +0000 Subject: [PATCH] RE #27189 Fix broken functionality from rebase --- .../gui/engineering_diffraction/tabs/calibration/view.py | 4 ++-- .../gui/engineering_diffraction/tabs/focus/presenter.py | 3 ++- .../tabs/focus/test/test_focus_model.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/Engineering/gui/engineering_diffraction/tabs/calibration/view.py b/scripts/Engineering/gui/engineering_diffraction/tabs/calibration/view.py index edb620a3ff5..25a9ece34c6 100644 --- a/scripts/Engineering/gui/engineering_diffraction/tabs/calibration/view.py +++ b/scripts/Engineering/gui/engineering_diffraction/tabs/calibration/view.py @@ -72,8 +72,8 @@ class CalibrationView(QtWidgets.QWidget, Ui_calib): self.finder_vanadium.setInstrumentOverride(instrument) self.finder_sample.setInstrumentOverride(instrument) - def set_vanadium_read_only(self, set_to): - self.finder_vanadium.setReadOnly(set_to) + def set_vanadium_enabled(self, set_to): + self.finder_vanadium.setEnabled(set_to) def set_sample_enabled(self, set_to): self.finder_sample.setEnabled(set_to) diff --git a/scripts/Engineering/gui/engineering_diffraction/tabs/focus/presenter.py b/scripts/Engineering/gui/engineering_diffraction/tabs/focus/presenter.py index 536446233cd..0424365c9f6 100644 --- a/scripts/Engineering/gui/engineering_diffraction/tabs/focus/presenter.py +++ b/scripts/Engineering/gui/engineering_diffraction/tabs/focus/presenter.py @@ -9,6 +9,7 @@ from __future__ import (absolute_import, division, print_function) from Engineering.gui.engineering_diffraction.tabs.common import INSTRUMENT_DICT, create_error_message from Engineering.gui.engineering_diffraction.tabs.common.calibration_info import CalibrationInfo +from Engineering.gui.engineering_diffraction.tabs.common.vanadium_corrections import check_workspaces_exist from mantidqt.utils.asynchronous import AsyncTask from mantidqt.utils.observer_pattern import Observer from mantid.simpleapi import logger @@ -72,7 +73,7 @@ class FocusPresenter(object): else: create_error_message(self.view, "Check run numbers/path is valid.") return False - if not self.current_calibration.is_valid(): + if not check_workspaces_exist() or not self.current_calibration.is_valid(): create_error_message( self.view, "Create or Load a calibration via the Calibration tab before focusing.") return False diff --git a/scripts/Engineering/gui/engineering_diffraction/tabs/focus/test/test_focus_model.py b/scripts/Engineering/gui/engineering_diffraction/tabs/focus/test/test_focus_model.py index 6dcb06a9948..58ed7d4d229 100644 --- a/scripts/Engineering/gui/engineering_diffraction/tabs/focus/test/test_focus_model.py +++ b/scripts/Engineering/gui/engineering_diffraction/tabs/focus/test/test_focus_model.py @@ -59,7 +59,7 @@ class FocusModelTest(unittest.TestCase): banks = ["1", "2"] load_focus.return_value = "mocked_sample" - self.model.focus_run("305761", banks, True, "ENGINX", "0", self.current_calibration) + self.model.focus_run("305761", banks, True, "ENGINX", "0") self.assertEqual(1, plot_focus.call_count) @patch(file_path + ".Ads") -- GitLab