def __init__(self): QMainWindow.__init__(self) # -- instance attributes -- self.setWindowTitle("Mantid Workbench") self.setObjectName("Mantid Workbench") # widgets self.messagedisplay = None self.ipythonconsole = None self.workspacewidget = None self.editor = None self.algorithm_selector = None self.plot_selector = None self.widgets = [] # Widget layout map: required for use in Qt.connection self._layout_widget_info = None # Menus self.file_menu = None self.file_menu_actions = None self.editor_menu = None self.view_menu = None self.view_menu_actions = None self.interfaces_menu = None # Allow splash screen text to be overridden in set_splash self.splash = SPLASH # Layout self.setDockOptions(self.DOCKOPTIONS) # Project self.project = None
def __init__(self, parent=None): QMainWindow.__init__(self,parent) self.ui = load_ui(__file__, 'converter.ui', baseinstance=self) self.ui.InputVal.setValidator(QDoubleValidator(self.ui.InputVal)) self.ui.totalFlightPathInput.setValidator(QDoubleValidator(self.ui.totalFlightPathInput)) self.ui.scatteringAngleInput.setValidator(QDoubleValidator(self.ui.scatteringAngleInput)) self.ui.convertButton.clicked.connect(self.convert) self.ui.helpButton.clicked.connect(self.helpClicked) self.ui.inputUnits.currentIndexChanged.connect(self.setInstrumentInputs) self.ui.outputUnits.currentIndexChanged.connect(self.setInstrumentInputs) self.setInstrumentInputs() ##defaults self.flightpath = -1.0 self.Theta = -1.0 self.output = 0.0 #help self.assistant_process = QtCore.QProcess(self) # pylint: disable=protected-access import mantid self.mantidplot_name='TOF Converter' self.collection_file = os.path.join(mantid._bindir, '../docs/qthelp/MantidProject.qhc') version = ".".join(mantid.__version__.split(".")[:2]) self.qt_url = 'qthelp://org.sphinx.mantidproject.' + version + '/doc/interfaces/TOF Converter.html' self.external_url = 'http://docs.mantidproject.org/nightly/interfaces/TOF Converter.html' try: import mantid #register startup mantid.UsageService.registerFeatureUsage("Interface","TofConverter",False) except ImportError: pass
def __init__(self, *args, **kwargs): ui_module = MyWidgetUI try: self.ui = ui_module.Ui_Form() #enable autocomplete except: pass QMainWindow.__init__(self, *args, **kwargs) self.widget = QtWidgetLoader(ui_module=ui_module, parent=self, action_receiver=self) self.widget.ui.lineEdit.setText("MyWidget") self.show()
def __init__(self, parent=None): self.parent = parent QMainWindow.__init__(self, parent=parent) self.ui = load_ui('jobStatus.ui', baseinstance=self) self.init_table() self.launch_table_update_thread()
def __init__(self, parent=None): self.parent = parent QMainWindow.__init__(self, parent=parent) self.ui = load_ui('advanced_window.ui', baseinstance=self) self.setWindowTitle("Advanced Window for Super User Only !") self.init_widgets()
def __init__(self, main_window=None, key=None): self.main_window = main_window self.key = key QMainWindow.__init__(self, parent=main_window) self.ui = load_ui('manual_key_value_input.ui', baseinstance=self) self.init_widgets()
def __init__(self): QMainWindow.__init__(self) self.mplwidget = MatplotlibWidget(self, title='Example', xlabel='Linear scale', ylabel='Log scale', hold=True, yscale='log') self.mplwidget.setFocus() self.setCentralWidget(self.mplwidget) self.plot(self.mplwidget.axes)
def __init__(self, parent=None, key=None, data_type='sample'): self.parent = parent self.key = key self.data_type = data_type QMainWindow.__init__(self, parent=parent) self.ui = load_ui('mass_density.ui', baseinstance=self) self.init_widgets() self.set_column_index()
def __init__(self, parent=None, button_name=''): QMainWindow.__init__(self, parent) self.parent = parent self.button_name = button_name self.ui = load_ui('helpGui.ui', baseinstance=self) self.init_global_gui() self.init_table()
def __init__(self, canvas, parent=None): QMainWindow.__init__(self, parent=parent) # attributes self._canvas = weakref.proxy(canvas) self.setAttribute(Qt.WA_DeleteOnClose, True) self.setWindowIcon(QIcon(':/images/MantidIcon.ico')) self.close_signal.connect(self._run_close) self.setAcceptDrops(True)
def __init__(self, parent=None, key=None, data_type='sample'): self.parent = parent self.data_type = data_type self.key = key QMainWindow.__init__(self, parent=parent) self.ui = load_ui('placzek.ui', baseinstance=self) self.init_widgets() self.set_column()
def __init__(self, parent=None, text=None, filename=None): self.parent = parent QMainWindow.__init__(self, parent=parent) self.ui = load_ui('preview_ascii.ui', baseinstance=self) _title = filename self.setWindowTitle(_title) self.ui.preview_ascii_text_edit.setText(text)
def __init__(self, parent=None, json_conflicts={}): self.parent = parent self.json_conflicts = json_conflicts QMainWindow.__init__(self, parent=parent) self.ui = load_ui('solve_import_conflicts.ui', baseinstance=self) #self.ui = UiMainWindow() #self.ui.setupUi(self) self.init_widgets()
def __init__(self, parent=None, next_ui='from_database_ui', next_function=None): QMainWindow.__init__(self, parent=parent) self.parent = parent self.next_ui = next_ui self.next_function = next_function self.ui = load_ui('oncat_authentication.ui', baseinstance=self) self.center() self.init_widgets() self.ui.password.setFocus()
def __init__(self, arr, mgr): QMainWindow.__init__(self) self.setWindowTitle('skimage') self.mgr = mgr self.main_widget = QWidget() self.layout = QGridLayout(self.main_widget) self.setCentralWidget(self.main_widget) self.label = ImageLabel(self, arr) self.layout.addWidget(self.label, 0, 0) self.layout.addLayout self.mgr.add_window(self) self.main_widget.show()
def __init__(self, arr, mgr): QMainWindow.__init__(self) self.arr = arr self.mgr = mgr self.main_widget = QWidget() self.layout = QGridLayout(self.main_widget) self.setCentralWidget(self.main_widget) self.label = ImageLabel(self, arr) self.label_container = QFrame() self.label_container.setFrameShape(QFrame.StyledPanel | QFrame.Sunken) self.label_container.setLineWidth(1) self.label_container.layout = QGridLayout(self.label_container) self.label_container.layout.setContentsMargins(0, 0, 0, 0) self.label_container.layout.addWidget(self.label, 0, 0) self.layout.addWidget(self.label_container, 0, 0) self.mgr.add_window(self) self.main_widget.show() self.setWindowTitle('Skivi - The skimage viewer.') self.mixer_panel = MixerPanel(self.arr) self.layout.addWidget(self.mixer_panel, 0, 2) self.mixer_panel.show() self.mixer_panel.set_callback(self.refresh_image) self.rgbv_hist = QuadHistogram(self.arr) self.layout.addWidget(self.rgbv_hist, 0, 1) self.rgbv_hist.show() self.rgb_hsv_disp = RGBHSVDisplay() self.layout.addWidget(self.rgb_hsv_disp, 1, 0) self.rgb_hsv_disp.show() self.layout.setColumnStretch(0, 1) self.layout.setRowStretch(0, 1) self.save_file = QtWidgets.QPushButton('Save to File') self.save_file.clicked.connect(self.save_to_file) self.save_stack = QtWidgets.QPushButton('Save to Stack') self.save_stack.clicked.connect(self.save_to_stack) self.save_file.show() self.save_stack.show() self.layout.addWidget(self.save_stack, 1, 1) self.layout.addWidget(self.save_file, 1, 2)
def __init__(self, parent=None, database_window=None, key=None, data_type='sample'): self.parent = parent self.database_window = database_window self.key = key self.data_type = data_type QMainWindow.__init__(self, parent=parent) self.ui = load_ui('periodic_table.ui', baseinstance=self) self.setWindowTitle("Define Chemical Formula") self.init_ui_color_dictionary() self.init_widgets() self.set_column_index()
def __init__(self, parent=None): """ Initialization :param parent: :return: """ # Init QMainWindow.__init__(self, parent) ui_path ="View3DWidget.ui" self.ui = load_ui(__file__, ui_path, baseinstance=self) self._promote_widgets() # Initialize widgets self.ui.lineEdit_baseColorRed.setText('0.5') self.ui.lineEdit_baseColorGreen.setText('0.5') self.ui.lineEdit_baseColorBlue.setText('0.5') self.ui.lineEdit_countsThresholdLower.setText('0') self.ui.comboBox_scans.addItem('unclassified') # Event handling self.ui.pushButton_plot3D.clicked.connect(self.do_plot_3d) self.ui.pushButton_checkCounts.clicked.connect(self.do_check_counts) self.ui.pushButton_clearPlots.clicked.connect(self.do_clear_plots) self.ui.pushButton_quit.clicked.connect(self.do_quit) self.ui.comboBox_scans.currentIndexChanged.connect(self.evt_change_scan) # Set up # list of data keys for management self._dataKeyList = list() # dictionary for 3D data self._mergedDataDict = dict() # dictionary for group control, key = str(scan), value = list of data keys self._groupDict = dict() self._currSessionName = 'unclassified' self._groupDict['unclassified'] = [] return
def __init__(self, *args, **kwargs): QMainWindow.__init__(self, *args, **kwargs) QtGuiApplication.__init__(self, self) QtUI.__init__(self, self) self.menubar = self.menuBar() self.fileMenu = self.menubar.addMenu('&File') openAction = QAction(QIcon('open.png'), '&Open...', self) openAction.setShortcut('Ctrl+O') openAction.setStatusTip('Open...') openAction.triggered.connect(self.actionOpen) exitAction = QAction("&Exit", self, shortcut='Ctrl+Q', statusTip='Exit', triggered=app.exit) self.fileMenu.addAction(openAction) self.fileMenu.addSeparator() sep = self.fileMenu.addSeparator() self.fileMenu.addAction(exitAction) self.recentInMenu = RecentInMenu(self, self.fileMenu, self.open, sep) self.show()
def __init__(self): QMainWindow.__init__(self) qapp = QApplication.instance() qapp.setAttribute(Qt.AA_UseHighDpiPixmaps) if hasattr(Qt, 'AA_EnableHighDpiScaling'): qapp.setAttribute(Qt.AA_EnableHighDpiScaling, True) self.setWindowTitle("Mantid Workbench") # -- instance attributes -- self.window_size = None self.window_position = None self.maximized_flag = None # widgets self.messagedisplay = None self.ipythonconsole = None self.workspacewidget = None self.editor = None self.algorithm_selector = None self.widgets = [] # Widget layout map: required for use in Qt.connection self._layout_widget_info = None # Menus self.file_menu = None self.file_menu_actions = None self.editor_menu = None self.view_menu = None self.view_menu_actions = None # Allow splash screen text to be overridden in set_splash self.splash = SPLASH # Layout self.setDockOptions(self.DOCKOPTIONS)
def __init__(self, parent=None): """ Initialization and set up """ # Base class QMainWindow.__init__(self, parent) # Mantid configuration config = ConfigService.Instance() self._instrument = config["default.instrument"] # Central widget self.centralwidget = QWidget(self) # UI Window (from Qt Designer) self.ui = load_ui(__file__, 'MainWindow.ui', baseinstance=self) mpl_layout = QVBoxLayout() self.ui.graphicsView.setLayout(mpl_layout) self.fig = Figure() self.canvas = FigureCanvas(self.fig) self.ui.mainplot = self.fig.add_subplot(111, projection='mantid') mpl_layout.addWidget(self.canvas) # Do initialize plotting vecx, vecy, xlim, ylim = self.computeMock() self.mainline = self.ui.mainplot.plot(vecx, vecy, 'r-') leftx = [xlim[0], xlim[0]] lefty = [ylim[0], ylim[1]] self.leftslideline = self.ui.mainplot.plot(leftx, lefty, 'b--') rightx = [xlim[1], xlim[1]] righty = [ylim[0], ylim[1]] self.rightslideline = self.ui.mainplot.plot(rightx, righty, 'g--') upperx = [xlim[0], xlim[1]] uppery = [ylim[1], ylim[1]] self.upperslideline = self.ui.mainplot.plot(upperx, uppery, 'b--') lowerx = [xlim[0], xlim[1]] lowery = [ylim[0], ylim[0]] self.lowerslideline = self.ui.mainplot.plot(lowerx, lowery, 'g--') self.canvas.mpl_connect('button_press_event', self.on_mouseDownEvent) # Set up horizontal slide (integer) and string value self._leftSlideValue = 0 self._rightSlideValue = 99 self.ui.horizontalSlider.setRange(0, 100) self.ui.horizontalSlider.setValue(self._leftSlideValue) self.ui.horizontalSlider.setTracking(True) self.ui.horizontalSlider.setTickPosition(QSlider.NoTicks) self.ui.horizontalSlider.valueChanged.connect(self.move_leftSlider) self.ui.horizontalSlider_2.setRange(0, 100) self.ui.horizontalSlider_2.setValue(self._rightSlideValue) self.ui.horizontalSlider_2.setTracking(True) self.ui.horizontalSlider_2.setTickPosition(QSlider.NoTicks) self.ui.horizontalSlider_2.valueChanged.connect(self.move_rightSlider) # self.connect(self.ui.lineEdit_3, QtCore.SIGNAL("textChanged(QString)"), # self.set_startTime) self.ui.lineEdit_3.setValidator(QDoubleValidator(self.ui.lineEdit_3)) self.ui.pushButton_setT0.clicked.connect(self.set_startTime) # self.connect(self.ui.lineEdit_4, QtCore.SIGNAL("textChanged(QString)"), # self.set_stopTime) self.ui.lineEdit_4.setValidator(QDoubleValidator(self.ui.lineEdit_4)) self.ui.pushButton_setTf.clicked.connect(self.set_stopTime) # File loader self.scanEventWorkspaces() self.ui.pushButton_refreshWS.clicked.connect(self.scanEventWorkspaces) self.ui.pushButton_browse.clicked.connect(self.browse_File) self.ui.pushButton_load.clicked.connect(self.load_File) self.ui.pushButton_3.clicked.connect(self.use_existWS) # Set up time self.ui.lineEdit_3.setValidator(QDoubleValidator(self.ui.lineEdit_3)) self.ui.lineEdit_4.setValidator(QDoubleValidator(self.ui.lineEdit_4)) # Filter by time self.ui.pushButton_filterTime.clicked.connect(self.filterByTime) # Filter by log value self.ui.lineEdit_5.setValidator(QDoubleValidator(self.ui.lineEdit_5)) self.ui.lineEdit_6.setValidator(QDoubleValidator(self.ui.lineEdit_6)) self.ui.lineEdit_7.setValidator(QDoubleValidator(self.ui.lineEdit_7)) self.ui.lineEdit_8.setValidator(QDoubleValidator(self.ui.lineEdit_8)) self.ui.lineEdit_9.setValidator(QDoubleValidator(self.ui.lineEdit_9)) self.ui.lineEdit_5.textChanged.connect(self.set_minLogValue) self.ui.lineEdit_6.textChanged.connect(self.set_maxLogValue) dirchangeops = ["Both", "Increase", "Decrease"] self.ui.comboBox_4.addItems(dirchangeops) logboundops = ["Centre", "Left"] self.ui.comboBox_5.addItems(logboundops) self.ui.pushButton_4.clicked.connect(self.plotLogValue) self.ui.pushButton_filterLog.clicked.connect(self.filterByLogValue) # Set up help button self.ui.helpBtn.clicked.connect(self.helpClicked) # Set up vertical slide self._upperSlideValue = 99 self._lowerSlideValue = 0 self.ui.verticalSlider.setRange(0, 100) self.ui.verticalSlider.setValue(self._upperSlideValue) self.ui.verticalSlider.setTracking(True) self.ui.verticalSlider.valueChanged.connect(self.move_upperSlider) self.ui.verticalSlider_2.setRange(0, 100) self.ui.verticalSlider_2.setValue(self._lowerSlideValue) self.ui.verticalSlider_2.setTracking(True) self.ui.verticalSlider_2.valueChanged.connect(self.move_lowerSlider) # Set up for filtering (advanced setup) self._tofcorrection = False self.ui.checkBox_fastLog.setChecked(False) self.ui.checkBox_filterByPulse.setChecked(False) self.ui.checkBox_from1.setChecked(False) self.ui.checkBox_groupWS.setChecked(True) self.ui.comboBox_tofCorr.currentIndexChanged.connect(self.showHideEi) self.ui.pushButton_refreshCorrWSList.clicked.connect(self._searchTableWorkspaces) self.ui.lineEdit_Ei.setValidator(QDoubleValidator(self.ui.lineEdit_Ei)) self.ui.label_Ei.hide() self.ui.lineEdit_Ei.hide() self.ui.label_Ei_2.hide() self.ui.comboBox_corrWS.hide() self.ui.pushButton_refreshCorrWSList.hide() # Set up for workspaces self._dataWS = None self._sampleLogNames = [] self._sampleLog = None # Side information self.ui.label_mean.hide() self.ui.label_meanvalue.hide() self.ui.label_avg.hide() self.ui.label_timeAvgValue.hide() self.ui.label_freq.hide() self.ui.label_freqValue.hide() self.ui.label_logname.hide() self.ui.label_lognamevalue.hide() self.ui.label_logsize.hide() self.ui.label_logsizevalue.hide() # Default self._defaultdir = os.getcwd() # register startup mantid.UsageService.registerFeatureUsage(mantid.kernel.FeatureType.Interface, "EventFilter", False)
def __init__(self, canvas, parent=None): QMainWindow.__init__(self, parent=parent) # attributes self._canvas = weakref.proxy(canvas) self.setAcceptDrops(True)
def __init__(self, parent=None): """ Initialization and set up """ # Base class QMainWindow.__init__(self, parent) # Mantid configuration config = ConfigService.Instance() self._instrument = config["default.instrument"] # Central widget self.centralwidget = QWidget(self) # UI Window (from Qt Designer) self.ui = load_ui(__file__, 'MainWindow.ui', baseinstance=self) mpl_layout = QVBoxLayout() self.ui.graphicsView.setLayout(mpl_layout) self.fig = Figure() self.canvas = FigureCanvas(self.fig) self.ui.mainplot = self.fig.add_subplot(111, projection='mantid') mpl_layout.addWidget(self.canvas) # Do initialize plotting vecx, vecy, xlim, ylim = self.computeMock() self.mainline = self.ui.mainplot.plot(vecx, vecy, 'r-') leftx = [xlim[0], xlim[0]] lefty = [ylim[0], ylim[1]] self.leftslideline = self.ui.mainplot.plot(leftx, lefty, 'b--') rightx = [xlim[1], xlim[1]] righty = [ylim[0], ylim[1]] self.rightslideline = self.ui.mainplot.plot(rightx, righty, 'g--') upperx = [xlim[0], xlim[1]] uppery = [ylim[1], ylim[1]] self.upperslideline = self.ui.mainplot.plot(upperx, uppery, 'b--') lowerx = [xlim[0], xlim[1]] lowery = [ylim[0], ylim[0]] self.lowerslideline = self.ui.mainplot.plot(lowerx, lowery, 'g--') self.canvas.mpl_connect('button_press_event', self.on_mouseDownEvent) # Set up horizontal slide (integer) and string value self._leftSlideValue = 0 self._rightSlideValue = 99 self.ui.horizontalSlider.setRange(0, 100) self.ui.horizontalSlider.setValue(self._leftSlideValue) self.ui.horizontalSlider.setTracking(True) self.ui.horizontalSlider.setTickPosition(QSlider.NoTicks) self.ui.horizontalSlider.valueChanged.connect(self.move_leftSlider) self.ui.horizontalSlider_2.setRange(0, 100) self.ui.horizontalSlider_2.setValue(self._rightSlideValue) self.ui.horizontalSlider_2.setTracking(True) self.ui.horizontalSlider_2.setTickPosition(QSlider.NoTicks) self.ui.horizontalSlider_2.valueChanged.connect(self.move_rightSlider) # self.connect(self.ui.lineEdit_3, QtCore.SIGNAL("textChanged(QString)"), # self.set_startTime) self.ui.lineEdit_3.setValidator(QDoubleValidator(self.ui.lineEdit_3)) self.ui.pushButton_setT0.clicked.connect(self.set_startTime) # self.connect(self.ui.lineEdit_4, QtCore.SIGNAL("textChanged(QString)"), # self.set_stopTime) self.ui.lineEdit_4.setValidator(QDoubleValidator(self.ui.lineEdit_4)) self.ui.pushButton_setTf.clicked.connect(self.set_stopTime) # File loader self.scanEventWorkspaces() self.ui.pushButton_refreshWS.clicked.connect(self.scanEventWorkspaces) self.ui.pushButton_browse.clicked.connect(self.browse_File) self.ui.pushButton_load.clicked.connect(self.load_File) self.ui.pushButton_3.clicked.connect(self.use_existWS) # Set up time self.ui.lineEdit_3.setValidator(QDoubleValidator(self.ui.lineEdit_3)) self.ui.lineEdit_4.setValidator(QDoubleValidator(self.ui.lineEdit_4)) # Filter by time self.ui.pushButton_filterTime.clicked.connect(self.filterByTime) # Filter by log value self.ui.lineEdit_5.setValidator(QDoubleValidator(self.ui.lineEdit_5)) self.ui.lineEdit_6.setValidator(QDoubleValidator(self.ui.lineEdit_6)) self.ui.lineEdit_7.setValidator(QDoubleValidator(self.ui.lineEdit_7)) self.ui.lineEdit_8.setValidator(QDoubleValidator(self.ui.lineEdit_8)) self.ui.lineEdit_9.setValidator(QDoubleValidator(self.ui.lineEdit_9)) self.ui.lineEdit_5.textChanged.connect(self.set_minLogValue) self.ui.lineEdit_6.textChanged.connect(self.set_maxLogValue) dirchangeops = ["Both", "Increase", "Decrease"] self.ui.comboBox_4.addItems(dirchangeops) logboundops = ["Centre", "Left"] self.ui.comboBox_5.addItems(logboundops) self.ui.pushButton_4.clicked.connect(self.plotLogValue) self.ui.pushButton_filterLog.clicked.connect(self.filterByLogValue) # Set up help button self.ui.helpBtn.clicked.connect(self.helpClicked) # Set up vertical slide self._upperSlideValue = 99 self._lowerSlideValue = 0 self.ui.verticalSlider.setRange(0, 100) self.ui.verticalSlider.setValue(self._upperSlideValue) self.ui.verticalSlider.setTracking(True) self.ui.verticalSlider.valueChanged.connect(self.move_upperSlider) self.ui.verticalSlider_2.setRange(0, 100) self.ui.verticalSlider_2.setValue(self._lowerSlideValue) self.ui.verticalSlider_2.setTracking(True) self.ui.verticalSlider_2.valueChanged.connect(self.move_lowerSlider) # Set up for filtering (advanced setup) self._tofcorrection = False self.ui.checkBox_fastLog.setChecked(False) self.ui.checkBox_filterByPulse.setChecked(False) self.ui.checkBox_from1.setChecked(False) self.ui.checkBox_groupWS.setChecked(True) self.ui.comboBox_tofCorr.currentIndexChanged.connect(self.showHideEi) self.ui.pushButton_refreshCorrWSList.clicked.connect(self._searchTableWorkspaces) self.ui.lineEdit_Ei.setValidator(QDoubleValidator(self.ui.lineEdit_Ei)) self.ui.label_Ei.hide() self.ui.lineEdit_Ei.hide() self.ui.label_Ei_2.hide() self.ui.comboBox_corrWS.hide() self.ui.pushButton_refreshCorrWSList.hide() # Set up for workspaces self._dataWS = None self._sampleLogNames = [] self._sampleLog = None # Side information self.ui.label_mean.hide() self.ui.label_meanvalue.hide() self.ui.label_avg.hide() self.ui.label_timeAvgValue.hide() self.ui.label_freq.hide() self.ui.label_freqValue.hide() self.ui.label_logname.hide() self.ui.label_lognamevalue.hide() self.ui.label_logsize.hide() self.ui.label_logsizevalue.hide() # Default self._defaultdir = os.getcwd() # register startup mantid.UsageService.registerFeatureUsage("Interface", "EventFilter", False)
def __init__(self): QMainWindow.__init__(self) QtProgressInformation.__init__(self, self)
def __init__(self, plugin): QMainWindow.__init__(self) self.plugin = plugin
def __init__(self, instrument=None, instrument_list=None): QMainWindow.__init__(self) self.ui = load_ui(__file__, 'ui/reduction_main.ui', baseinstance=self) if STARTUP_WARNING: message = "The reduction application has problems starting:\n\n" message += STARTUP_WARNING QMessageBox.warning(self, "WARNING", message) # Application settings settings = QSettings() # Name handle for the instrument if instrument is None: instrument = unicode(settings.value("instrument_name", '')) if instrument_list is not None and instrument not in instrument_list: instrument = None self._instrument = instrument self._facility = None # List of allowed instrument self._instrument_list = instrument_list # Reduction interface self._interface = None # Recent files self._recent_files = settings.value("recent_files", []) if self._recent_files is None: # An empty list saved to QSettings comes back as 'None' self._recent_files = [] # Folder to open files in self._last_directory = unicode(settings.value("last_directory", '.')) self._last_export_directory = unicode(settings.value("last_export_directory", '.')) # Current file name self._filename = None # Cluster credentials and options self._cluster_details_set = False self._number_of_nodes = 1 self._cores_per_node = 16 self._compute_resources = ['Fermi'] if CAN_REDUCE and hasattr(ConfigService.Instance().getFacility(), "computeResources"): self._compute_resources = ConfigService.Instance().getFacility().computeResources() # Internal flag for clearing all settings and restarting the application self._clear_and_restart = False # General settings shared by all widgets self.general_settings = GeneralSettings(settings) # Event connections if not CAN_REDUCE: self.reduce_button.hide() self.export_button.clicked.connect(self._export) self.reduce_button.clicked.connect(self.reduce_clicked) self.save_button.clicked.connect(self._save) self.interface_chk.clicked.connect(self._interface_choice) self.interface_chk.setChecked(self.general_settings.advanced) self.general_settings.progress.connect(self._progress_updated)
def __init__(self): QMainWindow.__init__(self) self.setupUi(self)
def __init__(self): QMainWindow.__init__(self) view = MapGraphicsView(tileSource=MapTileSourceHere()) self.setCentralWidget(view) view.scene().setCenter(10.065990, 44.861041) view.setOptimizationFlag(QGraphicsView.DontSavePainterState, True) view.setRenderHint(QPainter.Antialiasing, True) view.setRenderHint(QPainter.SmoothPixmapTransform, True) pointItem = view.scene().addCircle(10.068640, 44.860767, 3.0) pointItem.setBrush(Qt.black) pointItem.setToolTip('10.068640, 44.860767') pointItem.setFlag(QGraphicsItem.ItemIsSelectable, True) lats = list() lons = list() for p in POINTS: pointItem = view.scene().addCircle(p[1], p[0], 5.0) pointItem.setBrush(Qt.green) pointItem.setPen(QPen(Qt.NoPen)) pointItem.setToolTip('%f, %f' % (p[1], p[0])) pointItem.setFlag(QGraphicsItem.ItemIsSelectable, True) lons.append(p[1]) lats.append(p[0]) lineItem = view.scene().addLine(10.191037, 44.832810, 10.201736, 44.837632) lineItem.setPen(QPen(QBrush(Qt.blue), 3.0)) polylineItem = view.scene().addPolyline(lons, lats) polylineItem.setPen(QPen(QBrush(Qt.red), 3.0)) pix = QPixmap(24, 24) pix.fill(Qt.red) pixmapItem = view.scene().addPixmap(10.090598, 44.857893, pix) pixmapItem.setOffset(-12, -12) pointItemPixmapOrigin = view.scene().addCircle(10.090598, 44.857893, 3.0) pointItemPixmapOrigin.setBrush(Qt.black) pointItemWithChild = view.scene().addCircle(10.083103, 44.858014, 3.0) pointItemWithChild.setBrush(Qt.blue) pointItemWithChild.setPen(QPen(Qt.NoPen)) textItem = QGraphicsSimpleTextItem('Annotation\nfor blue point', parent=pointItemWithChild) textItem.setBrush(QBrush(QColor(Qt.blue))) textItem.setPos(-5, 3) lats_2 = list() lons_2 = list() for p in POINTS_2: lons_2.append(p[1]) lats_2.append(p[0]) linesGroupItem = view.scene().addLinesGroup(lons_2, lats_2) linesGroupItem.setLineStyle(POINTS_2_COLORS, width=POINTS_2_SIZES) legendItem = view.scene().addLegend() legendItem.addPoint('Point 1', '#FF0000', border=None) legendItem.addRect('Rect 2', '#00FF00', border=None) legendItem.addPoint('Circle 3', '#0000FF', border=None) legendItem.addRect('Sphere 4', '#00FFFF', border=None) legendItem.addPoint('Polygon 5', '#FF00FF', border=None) scaleItem = view.scene().addScale(anchor=Qt.BottomRightCorner)