Commit 0f4e5f60 authored by Stephen Smith's avatar Stephen Smith Committed by Smith
Browse files

Move Diff, Drill and ISIS_sans launch scripts

parent cc740ff7
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
import sys
from qtpy import PYQT5
from mantid.kernel import config, logger
if not PYQT5:
logger.error('Drill interface is supported only in workbench.')
else:
if config['default.facility'] != 'ILL':
logger.error('Drill is enabled only if the facility is set to ILL.')
else:
from mantidqt.gui_helper import get_qapplication
from Interface.ui.drill.view.DrillView import DrillView
app, within_mantid = get_qapplication()
if 'drillInterface' not in globals():
drillInterface = DrillView()
drillInterface.show()
if not within_mantid:
sys.exit(app.exec_())
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# pylint: disable=invalid-name
from Engineering.gui.engineering_diffraction.engineering_diffraction import EngineeringDiffractionGui
from qtpy import QtCore
import sys
# Single instance. If minimized the menu should show it and not create a new one
ENGG_UI_INSTANCE = None
def _on_delete():
global ENGG_UI_INSTANCE
ENGG_UI_INSTANCE = None
if ENGG_UI_INSTANCE is not None and ENGG_UI_INSTANCE.isHidden():
ENGG_UI_INSTANCE.setWindowState(ENGG_UI_INSTANCE.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive)
ENGG_UI_INSTANCE.activateWindow()
else:
if 'workbench' in sys.modules:
from workbench.config import get_window_config
parent, flags = get_window_config()
else:
parent, flags = None, None
ENGG_UI_INSTANCE = EngineeringDiffractionGui(parent=parent, window_flags=flags)
ENGG_UI_INSTANCE.destroyed.connect(_on_delete)
ENGG_UI_INSTANCE.show()
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
#pylint: disable=invalid-name
"""
Script used to start the Test Interface from MantidPlot
"""
import sys
from sans.common.enums import SANSFacility
from sans.gui_logic.models.run_tab_model import RunTabModel
from sans.gui_logic.presenter.run_tab_presenter import RunTabPresenter
from ui.sans_isis import sans_data_processor_gui
if 'workbench' in sys.modules:
from workbench.config import get_window_config
parent, flags = get_window_config()
else:
parent, flags = None, None
main_window_view = sans_data_processor_gui.SANSDataProcessorGui(parent, flags)
run_tab_presenter = RunTabPresenter(SANSFacility.ISIS, run_tab_model=RunTabModel(), view=main_window_view)
# Show
main_window_view.show()
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