Esempio n. 1
0
    def __init__(self, loadfile=None):
        """ Create the Manager Window.
        """
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_config_window.ui')
        self.log = logging.getLogger(__name__)

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)

        self.modules = dict()
        self.globalsection = OrderedDict()
        self.currentFile = ''

        # palette
        self.colors = {
            'hardware': palette.c2,
            'logic': palette.c1,
            'gui': palette.c4,
            '': palette.c3
        }

        # init
        self.setupUi()
        self.show()

        if loadfile is not None:
            self.loadConfigFile(loadfile)
Esempio n. 2
0
    def __init__(self, *args, **kwargs):
        super(AboutDialog, self).__init__()

        self.ui_file = kwargs.get('ui_file')

        if self.ui_file:
            uic.loadUi(self.ui_file, self)
        else:

            self.setFixedSize(600, 200)

            self.setWindowTitle("About QtPyVCP")

            self.layout = QVBoxLayout()
            self.setLayout(self.layout)

            self.button_box = QDialogButtonBox(QDialogButtonBox.Ok)
            self.button_box.accepted.connect(self.close)

            self.about_text = QLabel()
            self.about_text.setOpenExternalLinks(True)
            self.about_text.setText("""
                <center>
                QtPyVCP is a Qt and Python based framework for LinuxCNC.<br />
                Copyright (c) 2018 - 2020 Kurt Jacobson<br />
                <a href="https://www.qtpyvcp.com">https://www.qtpyvcp.com</a>
                </center>
                """)

            self.layout.addWidget(self.about_text)
            self.layout.addWidget(self.button_box)
Esempio n. 3
0
    def __init__(self, *args):
        super().__init__(*args)
        uic.loadUi(UI_FILE, self)

        self._viewer = None

        # button's icon
        self.rec_Button.setIcon(QIcon(str(ICONS / "play-button_1.svg")))
        self.rec_Button.setIconSize(QtCore.QSie(20, 20))

        # connect buttons
        self.detect_board_Button.clicked.connect(self.is_loaded)
        self.rec_Button.clicked.connect(self.start_recordings)
        self.browse_rec_save_Button.clicked.connect(self.save_recordongs)

        # connect spinBox
        self.delay_spinBox.valueChanged.connect(self.frame_values_changed)
        self.interval_spinBox.valueChanged.connect(self.frame_values_changed)
        self.Pulses_spinBox.valueChanged.connect(self.frame_values_changed)
        self.exp_spinBox_1.valueChanged.connect(self.frame_values_changed)

        self.led_start_pwr_spinBox.valueChanged.connect(self.led_values_changed)
        self.led_pwr_inc_spinBox.valueChanged.connect(self.led_values_changed)
        self.Pulses_spinBox.valueChanged.connect(self.led_values_changed)

        # connect toggle group box
        self.save_groupBox_rec.toggled.connect(self.toggle_rec_button)
        self.dir_rec_lineEdit.textChanged.connect(self.toggle_rec_button)
        self.fname_rec_lineEdit.textChanged.connect(self.toggle_rec_button)
Esempio n. 4
0
    def initUI(self):
        """
        Set up user interface by loading the .ui file
        and configuring items in the GUI.
        """
        plugin_path = os.path.dirname(os.path.abspath(__file__))
        ui_dir = os.path.join(plugin_path, "ui")
        ui_path = os.path.join(ui_dir, 'table_generator.ui')
        loadUi(ui_path, self)

        self.setWindowTitle(self.title)
        self.statusBar().showMessage("Waiting for user input")

        #Set up no cutout option
        self.no_cutout_radio.setChecked(True)
        self._no_cutout_radio_toggled()

        #Set up radio buttons
        self.no_cutout_radio.toggled.connect(self._no_cutout_radio_toggled)
        self.add_cutout_radio.toggled.connect(self._add_cutout_radio_toggled)

        #Set up click buttons
        self.spectra_browse_button.clicked.connect(self.get_spec_path)
        self.add_cutout_button.clicked.connect(self.get_cutout_path)
        self.make_cutouts_button.clicked.connect(self.call_cutout)
        self.default_filename_button.clicked.connect(self.default_filename)
        self.generate_table_button.clicked.connect(self.call_main)
        self.change_save_path_button.clicked.connect(self.change_save_path)

        #Set up defaults
        self.default_filename()
        self.default_save_dir()

        self.show()
Esempio n. 5
0
    def __init__(self, info, parent=None):
        super(ChanInfoDialog, self).__init__(parent)
        ui_file = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                               "channel_info_dialog.ui")
        uic.loadUi(ui_file, self)

        ch_obj, ch_exp, ch_val, ch_doc = info

        doc_lines = [l.strip() for l in ch_doc.strip().splitlines()]
        title = doc_lines[0]

        self.lbl_rtn_typ.setText(type(ch_obj.getValue()).__name__)

        for line in doc_lines:
            if line.startswith(':returns:'):
                self.lbl_chan_rtn.setText(
                    line.replace(':returns:', '').strip())
            elif line.startswith(':rtype:'):
                self.lbl_rtn_typ.setText(line.replace(':rtype:', '').strip())

        self.lbl_chan_name.setText(title)
        self.tb_chan_doc.setText(ch_doc)
        val = ch_obj.getValue()
        txt = ''
        if len(self.lbl_rtn_typ.text().split(',')) > 1:
            txt = ', ' + str(ch_val)
        self.lbl_can_val.setText(str(val) + txt)
Esempio n. 6
0
    def __init__(self, parent=None):

        QtWidgets.QMainWindow.__init__(self)
        uipath = os.path.join(os.path.dirname(__file__), 'GuiStim.ui')
        uic.loadUi(uipath, self)
        self.setWindowTitle('Stimulation PyFET')

        self.InitMenu()

        # Buttons
        self.ButInitChannels.clicked.connect(self.ButInitChannelsClick)
        self.ButUnselAll.clicked.connect(self.ButUnselAllClick)
        self.ButCont.clicked.connect(self.ButContClick)
        self.ButSaveCont.clicked.connect(self.SaveContData)

        # Slider
        self.SLTstart.valueChanged.connect(self.SLTStartChanged)
        self.SLTstop.valueChanged.connect(self.SLTStopChanged)

        # Spin Box
        self.SpnSVinTP.valueChanged.connect(self.VinTimePlotChanged)

        self.ContEnableObjects = [self.SpnTestFreqMin,
                                  self.SpnTestFreqMax,
                                  self.SpnTestNFreqs,
                                  self.SpnTestAmp,
                                  self.SpnRefresh,
                                  self.SpnFsTime]
Esempio n. 7
0
    def __init__(self, parent=None):
        super(DateDialog, self).__init__(parent=parent)
        ui = os.path.join(os.path.dirname(__file__), "../resources/ui/date.ui")
        loadUi(ui, self)

        self.setWindowTitle("TSAnalyzer - Date Tool")
        self.mjd = 51544.5
        self.julday = 2451545
        self.demical_year = 2000.0
        self.doy = "2000-001"
        self.date = datetime(2000, 1, 1, 12)
        self.dateEdit.setDateTime(QDateTime(2000, 1, 1, 12, 0))

        self.conversionButton.clicked.connect(self.conversionButtonClicked)
        self.ydEdit.setInputMask("9999-999")
        self.dyEdit.setInputMask("9999.9999")
        self.mjdEdit.setValue(51544.5)
        self.juldayEdit.setInputMask("9999999")
        self.gpsweekEdit.setInputMask("99999")

        self.radios = [
            self.dateRadio, self.mjdRadio, self.juldayRadio, self.dyRadio,
            self.ydRadio, self.gpsweekRadio
        ]
        self.edits = [
            self.dateEdit, self.mjdEdit, self.juldayEdit, self.dyEdit,
            self.ydEdit, self.gpsweekEdit
        ]
Esempio n. 8
0
    def __init__(
            self,
            *args,
            **kwargs
    ):
        """

        :param parent:
        """
        super(PDBFolderLoad, self).__init__(
            *args,
            **kwargs
        )
        uic.loadUi(
            os.path.join(
                os.path.dirname(os.path.abspath(__file__)),
                "proteinFolderLoad.ui"
            ),
            self
        )

        self.pushButton_12.clicked.connect(self.onLoadStructure)
        self.updatePBar(0)
        self.load_thread = LoadThread()
        self.load_thread.partDone.connect(self.updatePBar)
        self.load_thread.procDone.connect(self.fin)
        self.trajectory = TrajectoryFile()
Esempio n. 9
0
    def load_ui(self):
        """
        Setup the MOSView viewer interface.
        """
        self.central_widget = QWidget(self)

        path = os.path.abspath(
            os.path.join(os.path.dirname(__file__),
                         '..', 'widgets', 'ui', 'mos_widget.ui'))
        loadUi(path, self.central_widget)

        self.image_widget = DrawableImageWidget()
        self.spectrum2d_widget = ShareableAxesImageWidget()
        self.spectrum1d_widget = Line1DWidget()
        self.meta_form_layout = self.central_widget.meta_form_layout

        self.central_widget.left_vertical_splitter.insertWidget(0, self.image_widget)
        self.central_widget.right_vertical_splitter.addWidget(self.spectrum2d_widget)
        self.central_widget.right_vertical_splitter.addWidget(self.spectrum1d_widget)

        # Set the splitter stretch factors
        self.central_widget.left_vertical_splitter.setStretchFactor(0, 1)
        self.central_widget.left_vertical_splitter.setStretchFactor(1, 8)

        self.central_widget.right_vertical_splitter.setStretchFactor(0, 1)
        self.central_widget.right_vertical_splitter.setStretchFactor(1, 2)

        self.central_widget.horizontal_splitter.setStretchFactor(0, 1)
        self.central_widget.horizontal_splitter.setStretchFactor(1, 2)

        # Set the central widget
        self.setCentralWidget(self.central_widget)

        # Define the options widget
        self._options_widget = OptionsWidget()
Esempio n. 10
0
    def __init__(self):
        QtWidgets.QGroupBox.__init__(self)
        uic.loadUi(os.path.join(os.path.dirname(__file__), 'main.ui'), self)

        self.traceRectROI = RectSelector([0, 0], [10, 10])
        self.traceRectROI.setVisible(False)

        self.traceROICheck.toggled.connect(self.toggleVisible)
        self.measureButton.clicked.connect(measure.gui)
        self.tableWidget.setFormat("%.3f")
        self.tableWidget.setSortingEnabled(False)
        self.traceComboBox.mousePressEvent = self.comboBoxClicked
        self.logButton.clicked.connect(self.logData)

        self.nextButton.clicked.connect(self.nextROI)
        self.prevButton.clicked.connect(self.previousROI)
        self.nextPuffButton.clicked.connect(self.nextPuff)
        self.prevPuffButton.clicked.connect(self.previousPuff)

        def saveLogData():
            f = save_file_gui("Save Logged Ploynomial Fit Data",
                              filetypes="*.txt")
            if f:
                self.saveLoggedData(f)

        self.traceRectROI.sigRegionChanged.connect(self.fillDataTable)
        self.saveButton.clicked.connect(saveLogData)
        self.traceComboBox.updating = False
        self.all_rois = []
        self.traceComboBox.activated.connect(self.indexChanged)
        self.puffComboBox.activated.connect(self.puffSelected)
        self.traceComboBox.currentIndexChanged.connect(self.indexChanged)
        self.puffComboBox.currentIndexChanged.connect(self.puffSelected)

        g.m.dialogs.append(self)
Esempio n. 11
0
    def setup_ui(self):
        """Setup the PyQt UI for this dialog."""
        # Load the ui dialog
        loadUi(os.path.join(os.path.dirname(__file__), "apply_operation.ui"),
               self)

        if self._ui_settings is not None:
            self.setWindowTitle(self._ui_settings.get("title"))
            self.operation_group_box.setTitle(
                self._ui_settings.get("group_box_title"))
            self.description_label.setText(
                self._ui_settings.get("description"))

        component_ids = [str(i) for i in self._data.component_ids()]
        cur_ind = self._data.component_ids().index(self._component_id)

        self.operation_combo_box.addItem(self._operation_name)

        # Populate combo box
        self.data_component_combo_box.addItems(component_ids)
        self.data_component_combo_box.setCurrentIndex(cur_ind)

        # Disable the button box if there are no available operations
        if self._function is None:
            self.button_box.button(QDialogButtonBox.Ok).setEnabled(False)
Esempio n. 12
0
    def __init__(self, manager, basename, modulename):
        """ Create a module widget.

          @param str basename: module category
          @param str modulename: unique module name
        """
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_module_widget.ui')

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)

        self.manager = manager
        self.name = modulename
        self.base = basename

        self.is_remote = ('remote' in self.manager.tree['defined'][self.base][self.name])
        self.remote_module_loaded = False  # This flag is set to True once 'Connect to' button is clicked.
        #                               # Needed to disable "Connect to" button after clicking once

        if self.is_remote:
            # In the case of remote module
            self.loadButton.setText('Connect to {0}'.format(self.name))
        else:
            # In the case of local module
            self.loadButton.setText('Load {0}'.format(self.name))

        # connect buttons
        self.loadButton.clicked.connect(self.loadButtonClicked)
        self.reloadButton.clicked.connect(self.reloadButtonClicked)
        self.deactivateButton.clicked.connect(self.deactivateButtonClicked)
        self.cleanupButton.clicked.connect(self.cleanupButtonClicked)
Esempio n. 13
0
    def initUI(self):
        """
        Set up user interface by loading the .ui file
        and configuring items in the GUI.
        """
        plugin_path = os.path.dirname(os.path.abspath(__file__))
        ui_dir = os.path.join(plugin_path, "ui")
        ui_path = os.path.join(ui_dir, 'table_generator.ui')
        loadUi(ui_path, self)

        self.setWindowTitle(self.title)
        self.statusBar().showMessage("Waiting for user input")

        #Set up no cutout option
        self.no_cutout_radio.setChecked(True)
        self._no_cutout_radio_toggled()

        #Set up radio buttons
        self.no_cutout_radio.toggled.connect(self._no_cutout_radio_toggled)
        self.add_cutout_radio.toggled.connect(self._add_cutout_radio_toggled)

        #Set up click buttons
        self.spectra_browse_button.clicked.connect(self.get_spec_path)
        self.add_cutout_button.clicked.connect(self.get_cutout_path)
        self.make_cutouts_button.clicked.connect(self.call_cutout)
        self.default_filename_button.clicked.connect(self.default_filename)
        self.generate_table_button.clicked.connect(self.call_main)
        self.change_save_path_button.clicked.connect(self.change_save_path)

        #Set up defaults
        self.default_filename()
        self.default_save_dir()

        self.show()
Esempio n. 14
0
    def __init__(self, widget, parent=None):
        super(SettingSelector, self).__init__(parent)

        self.widget = widget
        self.app = QApplication.instance()

        uic.loadUi(UI_FILE, self)

        for setting in sorted(SETTINGS):
            print setting
            print SETTINGS[setting].__doc__
            self.settingsCombo.addItem(setting)

        current_setting = self.widget.settingName
        if current_setting:
            if current_setting in SETTINGS:
                self.settingsCombo.setCurrentText(self.widget.settingName)
            else:
                self.settingsCombo.insertItem(0, current_setting)
                self.settingsCombo.setCurrentIndex(0)

        bb = self.buttonBox
        bb.button(QDialogButtonBox.Apply).setDefault(True)
        bb.button(QDialogButtonBox.Cancel).setDefault(False)
        bb.button(QDialogButtonBox.Apply).clicked.connect(self.accept)
Esempio n. 15
0
    def __init__(self):
        super().__init__()
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_threadwidget.ui')

        # Load it
        uic.loadUi(ui_file, self)
Esempio n. 16
0
    def __init__(self, loadfile=None):
        """ Create the Manager Window.
        """
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_config_window.ui')
        self.log = logging.getLogger(__name__)

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)

        self.mods = dict()
        self.globalsection = OrderedDict()
        self.currentFile = ''

        # palette
        self.colors = {
            'hardware': palette.c2,
            'logic': palette.c1,
            'gui': palette.c4,
            '': palette.c3
        }

        # init
        self.setupUi()
        self.show()

        if loadfile is not None:
            self.loadConfigFile(loadfile)
Esempio n. 17
0
    def __init__(self, parent=None, *args, **kwargs):
        super().__init__(parent=parent, *args, **kwargs)

        self.model_items = None

        self._smoothing_thread = None  # Worker thread

        self.kernel = None  # One of the sub-dicts in KERNEL_REGISTRY
        self.function = None  # function from `~specutils.manipulation.smoothing`
        self.data = None  # Current `~specviz.core.items.DataItem`
        self.size = None  # Current kernel size
        self._already_loaded = False

        #
        # Do the first-time loading and initialization of the GUI
        #
        loadUi(os.path.abspath(
            os.path.join(os.path.dirname(__file__),
                         ".", "smoothing.ui")), self)

        self.smooth_button.clicked.connect(self.accept)
        self.cancel_button.clicked.connect(self.close)
        self.data_combo.currentIndexChanged.connect(self._on_data_change)

        for key in KERNEL_REGISTRY:
            kernel = KERNEL_REGISTRY[key]
            self.kernel_combo.addItem(kernel["name"], key)
        self.kernel_combo.currentIndexChanged.connect(self._on_kernel_change)

        # Add integer validator to size input field
        self.size_input.setValidator(QIntValidator())
Esempio n. 18
0
    def initUI(self):

        plugin_path = os.path.dirname(os.path.abspath(__file__))
        ui_dir = os.path.join(plugin_path, "ui")
        ui_path = os.path.join(ui_dir, 'cutout_tool.ui')
        loadUi(ui_path, self)
        self.statusBar().showMessage("Waiting for user input")

        self.progress_bar = self.progressBar
        self.status_bar = self.statusBar
        self.progressBar.reset()
        self.save_path_display.setDisabled(True)

        if self.tableGen:
            self.spectra_user_input.setText(self.spec_path)
            self.spectra_user_input.setDisabled(True)
            self.spectra_browse_button.setDisabled(True)
            self.update_save()
        else:
            self.spectra_user_input.setText(self.spec_path)
            self.spectra_user_input.textChanged.connect(self.update_save)
            self.spectra_browse_button.clicked.connect(self.get_spec_path)

        self.start_button.clicked.connect(self.call_main)
        self.change_save_button.clicked.connect(self.custom_path)
        self.image_browse_button.clicked.connect(self.get_img_path)
        self.preview_button.clicked.connect(self.call_peview)

        self.x_user_input.setText(self.cutout_x_size_default)
        self.y_user_input.setText(self.cutout_y_size_default)
        self.x_user_input.selectAll()
        self.y_user_input.selectAll()

        self.show()
Esempio n. 19
0
    def initUI(self):

        plugin_path = os.path.dirname(os.path.abspath(__file__))
        ui_dir = os.path.join(plugin_path, "ui")
        ui_path = os.path.join(ui_dir, 'general_cutout_tool.ui')
        loadUi(ui_path, self)
        self.statusBar().showMessage("Waiting for user input")

        self.progress_bar = self.progressBar
        self.status_bar = self.statusBar
        self.progressBar.reset()
        self.save_path_display.setDisabled(True)

        self.start_button.clicked.connect(self.call_main)
        self.target_browse_button.clicked.connect(self.get_target_path)
        self.change_save_button.clicked.connect(self.custom_path)
        self.image_browse_button.clicked.connect(self.get_img_path)
        self.target_user_input.textChanged.connect(self.update_save)
        self.preview_button.clicked.connect(self.call_peview)

        self.x_user_input.setText(self.cutout_x_size_default)
        self.y_user_input.setText(self.cutout_y_size_default)
        self.x_user_input.selectAll()
        self.y_user_input.selectAll()

        self.show()
Esempio n. 20
0
    def __init__(self, deviceitem):
        '''
        Parameters
        ----------
        motordevice :   Motor

        '''
        super(MotorControl, self).__init__()
        loadUi(os.path.join(os.path.dirname(__file__), 'motor.ui'), self)
        self.motordevice = deviceitem.device
        self.joylayout.addWidget(pg.JoystickButton())

        self.targetSpinBox = simplewidgets.placeHolderSpinBox(self.targetGo)

        self._updateRange()

        self._setTarget(self.motordevice.setpoint.value)

        self.targetHSlider.valueChanged.connect(self._setTarget)
        self.targetVSlider.valueChanged.connect(self._setTarget)
        self.targetDial.valueChanged.connect(self._setTarget)
        self.targetLineEditLayout.insertWidget(0, self.targetSpinBox)
        # self.targetSpinBox.returnPressed.connect(lambda: self._setTarget(self.targetSpinBox.text()))
        self.targetGo.clicked.connect(lambda: self._setTarget(self.targetSpinBox.text()))
        self.stopButton.clicked.connect(self.stop)

        self.motordevice.readback.subscribe(self._setCurrentValue)
        # motordevice.motor.add_callback('DMOV',partial(guiinvoker.invoke_in_main_thread,self._updateStatus))

        self.sigStatusChanged.connect(self._updateStatus)

        self._setCurrentValue(self.motordevice.readback.get())

        self.targetHSlider.update()
        self.targetVSlider.update()
Esempio n. 21
0
    def __init__(self, wizard_obj, output_dict, *args, **kwargs):
        """Constructor"""

        super().__init__(*args, **kwargs)
        ui_file = os.path.join(os.path.dirname(__file__), 'skip_page.ui')
        uic.loadUi(ui_file, self)

        w = wizard_obj
        if isinstance(w, ReportWizard):
            pass

        if False:  # only allows forward jumping
            cur_page_suffix = w.currentPage().objectName()[len('wizardPage_'):]
            self.avail_page_suffixes = w.page_name_list[
                w.page_name_list.index(cur_page_suffix) + 1:]
        else:  # allows both forward & backward jumping
            self.avail_page_suffixes = w.page_name_list[:]

        data = [
            w.page_links[suffix].title() for suffix in self.avail_page_suffixes
        ]

        model = SkipPageListModel(data, self.listView)
        self.listView.setModel(model)

        self.accepted.connect(self.process_selection)

        self.output_dict = output_dict
Esempio n. 22
0
    def __init__(self):
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_localflipmirror.ui')

        super().__init__()
        uic.loadUi(ui_file, self)
        self.show
Esempio n. 23
0
    def __init__(self):
        super().__init__()
        ui_file = os.path.join(os.path.dirname(__file__), 'cluster_status.ui')
        uic.loadUi(ui_file, self)

        self.partition_info = None

        q_output_format_delimiter = '#'  # Cannot use "|" here, as this will
        # conflict with piping in custom commands.
        self.q_output_format_delimiter = q_output_format_delimiter

        q_output_format_list = [
            '%A', '%i', '%P', '%j', '%u', '%t', '%M', '%L', '%D', '%C', '%R',
            '%S', '%V', '%Q'
        ]
        self.q_output_format = q_output_format_delimiter.join(
            q_output_format_list)

        self.model_q = TableModelQueue(q_output_format_list)

        self.proxy_model_q = QtCore.QSortFilterProxyModel()
        self.proxy_model_q.setSourceModel(self.model_q)
        self.proxy_model_q.setSortRole(Qt.UserRole)

        self.tableView_q.setModel(self.proxy_model_q)
        self.tableView_q.setSortingEnabled(True)
        self.tableView_q.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)

        self.tableWidget_load.verticalHeader().setVisible(False)
        self.tableWidget_load.resizeColumnsToContents()

        self.q_cmd_extra_args = {}
        for i in range(self.comboBox_q_cmd.count()):
            k = self.comboBox_q_cmd.itemText(i)
            self.q_cmd_extra_args[k] = ''

        x0, y0 = 100, 300
        width, height = 1200, 700
        ini_width_load_table = 500
        self.setGeometry(x0, y0, width, height)

        # Adjust initial splitter ratio
        self.splitter.setSizes(
            [ini_width_load_table, width - ini_width_load_table])

        # Change the initial selection for "scancel" type
        self.comboBox_scancel_type.setCurrentText('Only Selected')

        self.update_edit_q_cmd_suppl('All')

        self.pushButton_update_q.clicked.connect(self.update_q_table)
        self.pushButton_update_load.clicked.connect(self.update_load_table)
        self.pushButton_scancel.clicked.connect(self.scancel)

        self.lineEdit_q_cmd_suppl.textEdited.connect(
            self.update_q_cmd_extra_args)
        self.comboBox_q_cmd.currentTextChanged.connect(
            self.update_edit_q_cmd_suppl)
Esempio n. 24
0
    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'magnet_control.ui')

        # Load it
        super(MagnetControlSettingDialog, self).__init__()
        uic.loadUi(ui_file, self)
Esempio n. 25
0
    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_reorient_roi_dialog.ui')

        # Load it
        super(ReorientRoiDialog, self).__init__()
        uic.loadUi(ui_file, self)
Esempio n. 26
0
    def loadUi(self, ui_file):
        """Loads a window layout from a QtDesigner .ui file.

        Args:
            ui_file (str) : Path to a .ui file to load.
        """
        # TODO: Check for compiled *_ui.py files and load from that if exists
        uic.loadUi(ui_file, self)
Esempio n. 27
0
    def __init__(self):
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_alignment_tab.ui')

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)
        self.show()
Esempio n. 28
0
    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_console_settings.ui')

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)
Esempio n. 29
0
    def __init__(self, parent=None, *args, **kwargs):
        super(MainWindow, self).__init__(parent)

        dispatch.setup(self)

        loadUi(os.path.join(UI_PATH, "main_window.ui"), self)

        self.mdi_area.subWindowActivated.connect(self._set_activated_window)
Esempio n. 30
0
    def __init__(self, **kwargs):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'time_series_selector_dialog.ui')

        # Load it
        super().__init__(**kwargs)
        uic.loadUi(ui_file, self)
Esempio n. 31
0
    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_piezo_settings.ui')

        # Load it
        super(PiezoSettingDialog, self).__init__()
        uic.loadUi(ui_file, self)
Esempio n. 32
0
    def __init__(self):
         # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_console_settings.ui')

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)
Esempio n. 33
0
    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_odmr_settings.ui')

        # Load it
        super(ODMRSettingDialog, self).__init__()
        uic.loadUi(ui_file, self)
    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_reorient_roi_dialog.ui')

        # Load it
        super(ReorientRoiDialog, self).__init__()
        uic.loadUi(ui_file, self)
    def __init__(self, parent=None, ui_file=''):
        super(ConversationalBaseWidget, self).__init__(parent)
        uic.loadUi(os.path.join(os.path.dirname(__file__), ui_file), self)

        self._tool_is_valid = False
        self._tool_table = TOOL_TABLE.getToolTable()

        self._validators = [
            self._validate_z_heights, self._validate_spindle_rpm,
            self._validate_xy_feed_rate, self._validate_z_feed_rate,
            self._validate_tool_number, self._validate_retract_height
        ]

        self.wcs_input.addItem('G54')
        self.wcs_input.addItem('G55')
        self.wcs_input.addItem('G56')
        self.wcs_input.addItem('G57')
        self.wcs_input.addItem('G58')
        self.wcs_input.addItem('G59')
        self.wcs_input.addItem('G59.1')
        self.wcs_input.addItem('G59.2')
        self.wcs_input.addItem('G59.3')

        self.unit_input.addItem('IN')
        self.unit_input.addItem('MM')
        self.update_selected_unit()

        self.coolant_input.addItem('OFF')
        self.coolant_input.addItem('MIST')
        self.coolant_input.addItem('FLOOD')

        self.spindle_direction_input.addItem('CW')
        self.spindle_direction_input.addItem('CCW')

        self.xy_feed_rate_input.setText(
            '{0:.3f}'.format(DEFAULT_LINEAR_VELOCITY))
        self.spindle_rpm_input.setText('{0:.3f}'.format(DEFAULT_SPINDLE_SPEED))

        self.post_to_file.clicked.connect(self.on_post_to_file)

        self.tool_number_input.editingFinished.connect(
            self.set_tool_description_from_tool_num)
        self.tool_number_input.editingFinished.connect(
            self._validate_tool_number)
        self.z_start_input.editingFinished.connect(self._validate_z_heights)
        self.z_end_input.editingFinished.connect(self._validate_z_heights)
        self.spindle_rpm_input.editingFinished.connect(
            self._validate_spindle_rpm)
        self.xy_feed_rate_input.editingFinished.connect(
            self._validate_xy_feed_rate)
        self.z_feed_rate_input.editingFinished.connect(
            self._validate_z_feed_rate)
        self.retract_height_input.editingFinished.connect(
            self._validate_retract_height)

        STATUS.g5x_index.onValueChanged(self.update_wcs)
        STATUS.program_units.onValueChanged(self.update_selected_unit)
        STATUS.tool_in_spindle.onValueChanged(self.update_tool_number)
Esempio n. 36
0
    def load_ui(self):
        """
        Setup the MOSView viewer interface.
        """
        self.central_widget = QWidget(self)

        path = os.path.join(UI_DIR, 'mos_widget.ui')
        loadUi(path, self.central_widget)

        self.image_widget = DrawableImageWidget(
            slit_controller=self.slit_controller)
        self.spectrum2d_widget = Spectrum2DWidget()
        self.spectrum1d_widget = Line1DWidget()

        # Set up helper for sharing axes. SharedAxisHelper defaults to no sharing
        # and we control the sharing later by setting .sharex and .sharey on the
        # helper
        self.spectrum2d_spectrum1d_share = SharedAxisHelper(
            self.spectrum2d_widget._axes, self.spectrum1d_widget._axes)
        self.spectrum2d_image_share = SharedAxisHelper(
            self.spectrum2d_widget._axes, self.image_widget._axes)

        # We only need to set the image widget to keep the same aspect ratio
        # since the two other viewers don't require square pixels, so the axes
        # should not change shape.
        self.image_widget._axes.set_adjustable('datalim')

        self.meta_form_layout = self.central_widget.meta_form_layout
        self.meta_form_layout.setFieldGrowthPolicy(
            self.meta_form_layout.ExpandingFieldsGrow)
        self.central_widget.left_vertical_splitter.insertWidget(
            0, self.image_widget)
        self.central_widget.right_vertical_splitter.addWidget(
            self.spectrum2d_widget)
        self.central_widget.right_vertical_splitter.addWidget(
            self.spectrum1d_widget)

        # Set the splitter stretch factors
        self.central_widget.left_vertical_splitter.setStretchFactor(0, 1)
        self.central_widget.left_vertical_splitter.setStretchFactor(1, 8)

        self.central_widget.right_vertical_splitter.setStretchFactor(0, 1)
        self.central_widget.right_vertical_splitter.setStretchFactor(1, 2)

        self.central_widget.horizontal_splitter.setStretchFactor(0, 1)
        self.central_widget.horizontal_splitter.setStretchFactor(1, 2)

        # Keep the left and right splitters in sync otherwise the axes don't line up
        self.central_widget.left_vertical_splitter.splitterMoved.connect(
            self._left_splitter_moved)
        self.central_widget.right_vertical_splitter.splitterMoved.connect(
            self._right_splitter_moved)

        # Set the central widget
        self.setCentralWidget(self.central_widget)

        # Define the options widget
        self._options_widget = OptionsWidget()
Esempio n. 37
0
    def __init__(self, **kwargs):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_slow_counter.ui')

        # Load it
        super().__init__(**kwargs)
        uic.loadUi(ui_file, self)
        self.show()
Esempio n. 38
0
    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_gated_counter_gui.ui')

        # Load it
        super(GatedCounterMainWindow, self).__init__()
        uic.loadUi(ui_file, self)
        self.show()
Esempio n. 39
0
    def __init__(self):
        QtWidgets.QMainWindow.__init__(self)
        uipath = os.path.join(os.path.dirname(__file__),
                              'GuiRecordExplorer.ui')
        uic.loadUi(uipath, self)

        self.setWindowTitle('Record Explorer')

        self.ButColor.clicked.connect(self.ButColorClick)
Esempio n. 40
0
    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_odmrgui.ui')

        # Load it
        super(ODMRMainWindow, self).__init__()
        uic.loadUi(ui_file, self)
        self.show()
Esempio n. 41
0
    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_nuclear_operations_gui.ui')

        # Load it
        super(NuclearOperationsMainWindow, self).__init__()
        uic.loadUi(ui_file, self)
        self.show()
Esempio n. 42
0
    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_temperature_monitor.ui')

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)
        self.show()
Esempio n. 43
0
    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_laser.ui')

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)
        self.show()
Esempio n. 44
0
    def __init__(self):
        """ Create Qudi About Dialog.
        """
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_about.ui')

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)
Esempio n. 45
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        # Load the ui file and attach it to this instance
        loadUi(os.path.join(os.path.dirname(__file__),
                            "ui", "export_size.ui"), self)

        # Add some simple validators to the text boxes
        self.height_line_edit.setValidator(QIntValidator())
        self.width_line_edit.setValidator(QIntValidator())
    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_pulsed_extraction_external_gui.ui')

        # Load it
        super(PulsedExtractionExternalMainWindow, self).__init__()

        uic.loadUi(ui_file, self)
        self.show()
Esempio n. 47
0
    def __init__(self, manager=None, **kwargs):
        """Creates the log widget.

        @param object parent: Qt parent object for log widet

        """
        super().__init__(**kwargs)
        self._manager = manager
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_logwidget.ui')

        # Load it
        uic.loadUi(ui_file, self)

        self.logLength = 1000

        # Set up data model and visibility filter
        self.model = LogModel()
        self.filtermodel = LogFilter()
        self.filtermodel.setSourceModel(self.model)
        self.output.setModel(self.filtermodel)

        # set up able view properties
        # setResizeMode is deprecated in Qt5 (and therefore not available
        # in pyqt5
        if qtpy.PYQT4 or qtpy.PYSIDE:
            self.output.horizontalHeader().setResizeMode(
                0, QtWidgets.QHeaderView.Interactive)
            self.output.horizontalHeader().setResizeMode(
                1, QtWidgets.QHeaderView.ResizeToContents)
            self.output.horizontalHeader().setResizeMode(
                2, QtWidgets.QHeaderView.ResizeToContents)
            self.output.horizontalHeader().setResizeMode(
                3, QtWidgets.QHeaderView.ResizeToContents)
            self.output.verticalHeader().setResizeMode(
                QtWidgets.QHeaderView.ResizeToContents)
        else:
            self.output.horizontalHeader().setSectionResizeMode(
                0, QtWidgets.QHeaderView.Interactive)
            self.output.horizontalHeader().setSectionResizeMode(
                1, QtWidgets.QHeaderView.ResizeToContents)
            self.output.horizontalHeader().setSectionResizeMode(
                2, QtWidgets.QHeaderView.ResizeToContents)
            self.output.horizontalHeader().setSectionResizeMode(
                3, QtWidgets.QHeaderView.ResizeToContents)
            self.output.verticalHeader().setSectionResizeMode(
                QtWidgets.QHeaderView.ResizeToContents)
        self.output.setTextElideMode(QtCore.Qt.ElideRight)
        self.output.setItemDelegate(AutoToolTipDelegate(self.output))

        # connect signals
        self.sigDisplayEntry.connect(self.displayEntry,
                                     QtCore.Qt.QueuedConnection)
        self.sigAddEntry.connect(self.addEntry, QtCore.Qt.QueuedConnection)
        self.filterTree.itemChanged.connect(self.setCheckStates)
Esempio n. 48
0
    def __init__(self):
        """ Create the switch GUI window.
        """
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_autogui.ui')

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)
        self.show()
Esempio n. 49
0
    def load_ui(self):
        """
        Setup the MOSView viewer interface.
        """
        self.central_widget = QWidget(self)

        path = os.path.join(UI_DIR, 'mos_widget.ui')
        loadUi(path, self.central_widget)

        self.image_widget = DrawableImageWidget(slit_controller=self.slit_controller)
        self.spectrum2d_widget = Spectrum2DWidget()

        self._specviz_viewer = Workspace()
        self._specviz_viewer.add_plot_window()
        self.spectrum1d_widget = self._specviz_viewer.current_plot_window
        self.spectrum1d_widget.plot_widget.getPlotItem().layout.setContentsMargins(45, 0, 25, 0)

        # Set up helper for sharing axes. SharedAxisHelper defaults to no sharing
        # and we control the sharing later by setting .sharex and .sharey on the
        # helper
        self.spectrum2d_image_share = SharedAxisHelper(self.spectrum2d_widget._axes,
                                                       self.image_widget._axes)

        # We only need to set the image widget to keep the same aspect ratio
        # since the two other viewers don't require square pixels, so the axes
        # should not change shape.
        self.image_widget._axes.set_adjustable('datalim')

        self.meta_form_layout = self.central_widget.meta_form_layout
        self.meta_form_layout.setFieldGrowthPolicy(self.meta_form_layout.ExpandingFieldsGrow)
        self.central_widget.left_vertical_splitter.insertWidget(0, self.image_widget)
        self.central_widget.right_vertical_splitter.addWidget(self.spectrum2d_widget)
        self.central_widget.right_vertical_splitter.addWidget(self.spectrum1d_widget.widget())

        # Set the splitter stretch factors
        self.central_widget.left_vertical_splitter.setStretchFactor(0, 1)
        self.central_widget.left_vertical_splitter.setStretchFactor(1, 8)

        self.central_widget.right_vertical_splitter.setStretchFactor(0, 1)
        self.central_widget.right_vertical_splitter.setStretchFactor(1, 2)

        self.central_widget.horizontal_splitter.setStretchFactor(0, 1)
        self.central_widget.horizontal_splitter.setStretchFactor(1, 2)

        # Keep the left and right splitters in sync otherwise the axes don't line up
        self.central_widget.left_vertical_splitter.splitterMoved.connect(self._left_splitter_moved)
        self.central_widget.right_vertical_splitter.splitterMoved.connect(self._right_splitter_moved)

        # Set the central widget
        self.setCentralWidget(self.central_widget)

        self.central_widget.show()
        # Define the options widget
        self._options_widget = OptionsWidget()
Esempio n. 50
0
    def __init__(self):
        """ Create the laser scanner window.
        """
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_scanwindow.ui')

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)
        self.show()
Esempio n. 51
0
    def _init_ui(self):
        loadUi(os.path.abspath(
            os.path.join(os.path.dirname(__file__),
                         ".", "model_editor.ui")), self)

        # Populate the add mode button with a dropdown containing available
        # fittable model objects
        self.add_model_button.setPopupMode(QToolButton.InstantPopup)
        models_menu = QMenu(self.add_model_button)
        self.add_model_button.setMenu(models_menu)

        for k, v in MODELS.items():
            action = QAction(k, models_menu)
            action.triggered.connect(lambda x, m=v: self._add_fittable_model(m))
            models_menu.addAction(action)

        self.fit_model_thread = None

        # Initially hide the model editor tools until user has selected an
        # editable model spectrum object
        self.editor_holder_widget.setHidden(True)
        self.setup_holder_widget.setHidden(False)

        self.equation_edit_button.clicked.connect(
            self._on_equation_edit_button_clicked)
        self.new_model_button.clicked.connect(self._on_create_new_model)
        self.remove_model_button.clicked.connect(self._on_remove_model)

        self.advanced_settings_button.clicked.connect(
            lambda: ModelAdvancedSettingsDialog(self, self).exec())

        self.save_model_button.clicked.connect(self._on_save_model)
        self.load_model_button.clicked.connect(self._on_load_from_file)

        self._data_item_proxy_model = DataItemProxyModel()
        self._data_item_proxy_model.setSourceModel(self.hub.model)
        self.data_selection_combo.setModel(self._data_item_proxy_model)
        self.data_selection_combo.currentIndexChanged.connect(self._redraw_model)

        # When a plot data item is select, get its model editor model
        # representation
        self.hub.workspace.current_selected_changed.connect(
            self._on_plot_item_selected)

        # When the plot window changes, reset model editor
        self.hub.workspace.mdi_area.subWindowActivated.connect(self._on_new_plot_activated)

        # Listen for when data items are added to internal model
        self.hub.model.data_added.connect(self._on_data_item_added)

        # Connect the fit model button
        self.fit_button.clicked.connect(self._on_fit_clicked)
Esempio n. 52
0
    def __init__(self):
        """ Create the switch GUI window.
        """
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_switchgui.ui')

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)
        self.show()

        # Add layout that we want to fill
        self.layout = QtWidgets.QVBoxLayout(self.scrollArea)
Esempio n. 53
0
    def initUI(self):
        ui_file = frozen(osp.join('data', 'wndmain.ui'))
        uic.loadUi(ui_file, self)
        self.supported_files = self.tr("Supported files (*.pdf *.jpg *.jpeg"
                                       " *.bmp *.gif *.j2p *.jpx *.png *.tiff)"
                                       ";;PDF file (*.pdf)"
                                       ";;Image file (*.jpg *.jpeg *.bmp *.gif"
                                       " *.j2p *.jpx *.png *.tiff)"
                                       ";;All files (*.*)")
        validator = QtGui.QDoubleValidator()
        self.lineStampX.setValidator(validator)
        self.lineStampY.setValidator(validator)
        self.lineFileDPI.setValidator(validator)

        self.show()
Esempio n. 54
0
def load_ui(path, parent=None, directory=None):
    """
    Load a .ui file

    Parameters
    ----------
    path : str
        Name of ui file to load

    parent : QObject
        Object to use as the parent of this widget

    Returns
    -------
    w : QtWidgets.QWidget
        The new widget
    """

    if directory is not None:
        full_path = os.path.join(directory, path)
    else:
        full_path = os.path.abspath(path)

    if not os.path.exists(full_path) and 'site-packages.zip' in full_path:
        # Workaround for Mac app
        full_path = os.path.join(full_path.replace('site-packages.zip', 'glue'))

    return loadUi(full_path, parent)
Esempio n. 55
0
 def open_template_file(self, variables=None):
     """
     Opens the widget specified in the templateFilename property.
     
     Parameters
     ----------
     variables : dict
         A dictionary of macro variables to apply when loading, in addition
         to all the macros specified on the template repeater widget.
     Returns
     -------
     display : QWidget
     """
     if not variables:
         variables = {}
     # Expand user (~ or ~user) and environment variables.
     fname = os.path.expanduser(os.path.expandvars(self.templateFilename))
     if is_pydm_app():
         if not self._cached_template:
             self._cached_template = self.app.open_template(fname)
         return self.app.widget_from_template(self._cached_template, variables)
     else:
         try:
             f = macro.substitute_in_file(fname, variables)
             return uic.loadUi(f)
         except Exception as e:
             logger.exception("Exception while opening template file.")
             return None
Esempio n. 56
0
    def _initUI(self):
        """
		Initializes the UI and sets button actions
		"""
        QtWidgets.QMainWindow.__init__(self)

        # Load resources
        ui_path = get_resource_loc("firstdraft.ui")

        # Load and setup UI
        ui = uic.loadUi(ui_path)
        ui.setWindowTitle("Open Eyes")
        ui.show()

        # Connect menu buttons to functions
        ui.actionImport.triggered.connect(self.importFiles)
        ui.actionOpen.triggered.connect(self.openFile)
        ui.toggleFilesWidget.toggled.connect(self.toggleDockWidget)
        ui.toggleOutputWidget.toggled.connect(self.toggleDockWidget)

        # Connect other events
        ui.filesWidget.visibilityChanged.connect(self.setDockWidgetVisibility)
        ui.outputWidget.visibilityChanged.connect(self.setDockWidgetVisibility)

        # Redirect console output to textbox in UI, printing stdout in black
        # and stderr in red
        sys.stdout = Output(ui.statusBox, sys.stdout, QtGui.QColor(0, 0, 0))
        if not hasattr(sys, "frozen"):
            sys.stderr = Output(ui.statusBox, sys.stderr, QtGui.QColor(255, 0, 0))
        else:
            sys.stderr = Output(ui.statusBox, None, QtGui.QColor(255, 0, 0))

        ui.statusBar().showMessage("Ready")
        return ui
Esempio n. 57
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        loadUi(os.path.abspath(
            os.path.join(os.path.dirname(__file__),
                         "ui", "spectrum_selection.ui")), self)

        self.setWindowTitle('Spectrum Selection')

        self._model = QStandardItemModel(self.spectrumList)
        self.spectrumList.setModel(self._model)
        self._selected = False

        self.buttonBox.accepted.connect(self._confirm_selection)

        self.selectAllButton.clicked.connect(self._select_all)
        self.deselectAllButton.clicked.connect(self._deselect_all)
Esempio n. 58
0
    def _build_GUI(self, linelist, table_view):
        panel_layout = QGridLayout()
        panel_layout.setSizeConstraint(QLayout.SetMaximumSize)
        self.setLayout(panel_layout)

        # GUI cannot be completely defined in a .ui file.
        # It has to be built on-the-fly here.
        self.button_pane = QWidget()
        loadUi(os.path.join(os.path.dirname(__file__), "ui", "linelists_panel_buttons.ui"), self.button_pane)

        # internal signals do not use Hub infrastructure.
        self.button_pane.create_set_button.clicked.connect(self._create_set)
        self.button_pane.deselect_button.clicked.connect(table_view.clearSelection)

        # header with line list metadata.
        info = QTextBrowser()
        info.setMaximumHeight(100)
        info.setAutoFillBackground(True)
        info.setStyleSheet("background-color: rgb(230,230,230);")
        for comment in linelist.meta['comments']:
            info.append(comment)

        # populate color picker
        model = self.button_pane.combo_box_color.model()
        for cname in ID_COLORS:
            item = QStandardItem(cname)
            item.setForeground(ID_COLORS[cname])
            item.setData(QColor(ID_COLORS[cname]), role=Qt.UserRole)
            model.appendRow(item)

        # set validators
        validator = QDoubleValidator()
        validator.setRange(0.05, 0.95, decimals=2)
        self.button_pane.height_textbox.setValidator(validator)
        validator = QDoubleValidator()
        validator.setRange(-1.e5, 1.e10, decimals=4)
        self.button_pane.redshift_textbox.setValidator(validator)

        model = self.button_pane.combo_box_z_units.model()
        for uname in ['z', 'km/s']:
            item = QStandardItem(uname)
            model.appendRow(item)

        # put it all together
        panel_layout.addWidget(info,0,0)
        panel_layout.addWidget(table_view,1,0)
        panel_layout.addWidget(self.button_pane,2,0)
Esempio n. 59
0
def test_load_ui():
    """
    Make sure that the patched loadUi function behaves as expected with a
    simple .ui file.
    """
    app = get_qapp()
    ui = loadUi(os.path.join(os.path.dirname(__file__), 'test.ui'))
    assert isinstance(ui.pushButton, QtWidgets.QPushButton)
    assert isinstance(ui.comboBox, QComboBox)
Esempio n. 60
0
def load_ui(ui_filename, baseinstance):
    ui_filename = os.path.split(ui_filename)[-1]
    ui_path = os.path.dirname(ui.__file__)

    # get the location of the ui directory
    # this function assumes that all ui files are there
    filename = os.path.join(ui_path, ui_filename)

    return loadUi(filename, baseinstance=baseinstance)