Skip to content
Snippets Groups Projects
Commit d5bc7e50 authored by Conor Finn's avatar Conor Finn
Browse files

#26846 Created Skeleton Calibration Model and Presenter

Non functional right now...
parent 90459435
No related branches found
No related tags found
No related merge requests found
# 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
# SPDX - License - Identifier: GPL - 3.0 +
# pylint: disable=invalid-name
from __future__ import (absolute_import, division, print_function)
from qtpy import QtCore, QtWidgets
from Engineering.gui.engineering_diffraction.tabs.calibration.presenter import CalibrationPresenter, CalibrationView, \
CalibrationModel
from mantidqt.utils.qt import load_ui
Ui_main_window, _ = load_ui(__file__, "main_window.ui")
class EngineeringDiffractionGui(QtWidgets.QMainWindow, Ui_main_window):
"""
The engineering diffraction interface v2.0
"""
def __init__(self, parent=None):
super(EngineeringDiffractionGui, self).__init__(parent)
# Main Window
self.setupUi(self)
self.tabs = self.tab_main
self.setFocusPolicy(QtCore.Qt.StrongFocus)
# Calibration Tab
cal_model = CalibrationModel()
cal_view = CalibrationView(parent=self.tabs)
self.calibration_presenter = CalibrationPresenter(cal_model, cal_view)
self.tabs.addTab(cal_view, "Calibration")
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EngDIffMainGUI</class>
<widget class="QMainWindow" name="EngDIffMainGUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>197</height>
</rect>
</property>
<property name="windowTitle">
<string>Engineering Diffraction Analysis</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0" colspan="2">
<widget class="QTabWidget" name="tab_main">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="topBar">
<item>
<widget class="QLabel" name="label_RBNumber">
<property name="text">
<string>RB Number:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_RBNumber"/>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>138</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Instrument:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_instrument">
<item>
<property name="text">
<string>ENGINX</string>
</property>
</item>
<item>
<property name="text">
<string>IMAT</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" colspan="2">
<layout class="QHBoxLayout" name="bottomBar">
<item>
<widget class="QPushButton" name="pushButton_help">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>25</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>?</string>
</property>
</widget>
</item>
<item>
<widget class="QStatusBar" name="statusbar">
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_close">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CalibTab</class>
<widget class="QWidget" name="CalibTab">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>619</width>
<height>165</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">QGroupBox {
border: 1px solid grey;border-radius: 10px;margin-top: 1ex; margin-right: 0ex
}
QGroupBox:title {
subcontrol-origin: margin;
padding: 0 3px;
subcontrol-position: top center;
padding-top: 0px;
padding-bottom: 0px;
padding-right: 10px;
color: rgb(56, 56, 56)
}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout" stretch="1">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QGroupBox" name="loadingGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="title">
<string>Load Calibration</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignHCenter</set>
</property>
<property name="flat">
<bool>false</bool>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,0" columnstretch="0,0,0">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="check_plotCalibWsp">
<property name="text">
<string>Plot Calibrated Workspace</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QRadioButton" name="radio_newCalib">
<property name="text">
<string>Create New Calibration</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0" colspan="3">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="2">
<widget class="QPushButton" name="button_calibrate">
<property name="text">
<string>Calibrate</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="FileFinder" name="finder_calib" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="FileFinder" name="finder_vanadium" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>FileFinder</class>
<extends>QWidget</extends>
<header>mantidqt.widgets.filefinder</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>radio_newCalib</tabstop>
<tabstop>check_plotCalibWsp</tabstop>
<tabstop>button_calibrate</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
# pylint: disable=invalid-name
from __future__ import (absolute_import, division, print_function)
from Engineering.gui.engineering_diffraction.tabs.calibration.model import CalibrationModel
from Engineering.gui.engineering_diffraction.tabs.calibration.view import CalibrationView
class CalibrationPresenter(object):
def __init__(self, model, view):
self.model = model
self.view = view
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
# pylint: disable=invalid-name
from __future__ import (absolute_import, division, print_function)
from qtpy import QtWidgets
from mantidqt.widgets.filefinder import FileFinder
from mantidqt.utils.qt import load_ui
Ui_calib, _ = load_ui(__file__, "calibration_tab.ui")
class CalibrationView(QtWidgets.QWidget, Ui_calib):
def __init__(self, parent=None):
super(CalibrationView, self).__init__(parent)
self.setupUi(self)
def on_browse_vanadium_clicked(self, slot):
self.button_browseVanadium.clicked.connect(slot)
def on_browse_calibration_clicked(self, slot):
self.button_browseCalib.clicked.connect(slot)
def on_calibrate_clicked(self, slot):
self.button_calibrate.clicked.connect(slot)
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
# pylint: disable=invalid-name
from __future__ import (absolute_import, division, print_function)
from Engineering.gui.engineering_diffraction.engineering_diffraction import EngineeringDiffractionGui
from qtpy import QtCore
Name = "Engineering_Diffraction"
if 'engineering_diffraction' in globals():
eng_diff = globals()['engineering_diffraction']
else:
eng_diff = EngineeringDiffractionGui()
eng_diff.show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment