Source code for polo.windows.time_res_dialog

from PyQt5 import QtCore, QtGui, QtWidgets, uic
from PyQt5.QtCore import QPoint, Qt
from PyQt5.QtGui import QBrush, QColor, QIcon, QPixmap
from PyQt5.QtWidgets import QAction, QGridLayout

from polo.crystallography.run import HWIRun
from polo.designer.UI_time_resolved_dialog import Ui_Dialog

# TODO: Downloading function and reflect files in the actual FTP server
# Probably want to look into threads for downloading so not being done on
# the GUI thread

[docs]class TimeResDialog(QtWidgets.QDialog): def __init__(self, available_runs): QtWidgets.QDialog.__init__(self) self.ui = Ui_Dialog() self.ui.setupUi(self) self.setAttribute(QtCore.Qt.WA_DeleteOnClose) self.available_runs = available_runs self.ui.listWidget.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection) self.ui.pushButton.clicked.connect(self.auto_detect_time_links) self.ui.pushButton_2.clicked.connect(self.close) self.display_runs() self.exec_()
[docs] def get_HWI_runs(self): return [run for run in self.available_runs if type(self.available_runs[run]) == HWIRun]
[docs] def display_runs(self): # filter by HWI type runs as of now if self.available_runs: self.ui.listWidget.addItems(self.get_HWI_runs())
[docs] def validate_user_selection(self): pass
# when user attempts to link images sets manually # give warning if links do not cofirm to what would # have been generated from auto setting
[docs] def sort_available_runs_by_date(self): pass