Ejemplo n.º 1
0
    def __init__(self, dialog_parent, dock_area):
        dockarea.Dock.__init__(self, "Datasets", size=(1500, 500))
        self.dialog_parent = dialog_parent
        self.dock_area = dock_area

        grid = LayoutWidget()
        self.addWidget(grid)

        self.search = QtGui.QLineEdit()
        self.search.setPlaceholderText("search...")
        self.search.editingFinished.connect(self._search_datasets)
        grid.addWidget(
            self.search,
            0,
        )

        self.table = QtGui.QTableView()
        self.table.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
        self.table.horizontalHeader().setResizeMode(
            QtGui.QHeaderView.ResizeToContents)
        grid.addWidget(self.table, 1, 0)

        add_display_box = QtGui.QGroupBox("Add display")
        grid.addWidget(add_display_box, 1, 1)
        display_grid = QtGui.QGridLayout()
        add_display_box.setLayout(display_grid)

        for n, name in enumerate(display_types.keys()):
            btn = QtGui.QPushButton(name)
            display_grid.addWidget(btn, n, 0)
            btn.clicked.connect(partial(self.create_dialog, name))

        self.displays = dict()
Ejemplo n.º 2
0
    def __init__(self, procdesc):
        LayoutWidget.__init__(self)

        self.stack = QtGui.QStackedWidget()
        self.addWidget(self.stack, 1, 0, colspan=4)

        self.scale = procdesc["scale"]

        gmin, gmax = procdesc["global_min"], procdesc["global_max"]
        gstep = procdesc["global_step"]
        unit = procdesc["unit"]
        ndecimals = procdesc["ndecimals"]

        self.v_noscan = QtGui.QDoubleSpinBox()
        self.v_noscan.setDecimals(ndecimals)
        if gmin is not None:
            self.v_noscan.setMinimum(gmin / self.scale)
        else:
            self.v_noscan.setMinimum(float("-inf"))
        if gmax is not None:
            self.v_noscan.setMaximum(gmax / self.scale)
        else:
            self.v_noscan.setMaximum(float("inf"))
        self.v_noscan.setSingleStep(gstep / self.scale)
        if unit:
            self.v_noscan.setSuffix(" " + unit)
        self.v_noscan_gr = LayoutWidget()
        self.v_noscan_gr.addWidget(QtGui.QLabel("Value:"), 0, 0)
        self.v_noscan_gr.addWidget(self.v_noscan, 0, 1)
        self.stack.addWidget(self.v_noscan_gr)

        self.v_linear = _Range(gmin, gmax, gstep, unit, self.scale, ndecimals)
        self.stack.addWidget(self.v_linear)

        self.v_random = _Range(gmin, gmax, gstep, unit, self.scale, ndecimals)
        self.stack.addWidget(self.v_random)

        self.v_explicit = QtGui.QLineEdit()
        self.v_explicit_gr = LayoutWidget()
        self.v_explicit_gr.addWidget(QtGui.QLabel("Sequence:"), 0, 0)
        self.v_explicit_gr.addWidget(self.v_explicit, 0, 1)
        self.stack.addWidget(self.v_explicit_gr)

        self.noscan = QtGui.QRadioButton("No scan")
        self.linear = QtGui.QRadioButton("Linear")
        self.random = QtGui.QRadioButton("Random")
        self.explicit = QtGui.QRadioButton("Explicit")
        radiobuttons = QtGui.QButtonGroup()
        for n, b in enumerate(
            [self.noscan, self.linear, self.random, self.explicit]):
            self.addWidget(b, 0, n)
            radiobuttons.addButton(b)
            b.toggled.connect(self.select_page)

        if "default" in procdesc:
            self.set_argument_value(procdesc["default"])
        else:
            self.noscan.setChecked(True)
Ejemplo n.º 3
0
    def __init__(self, dialog_parent, status_bar, schedule_ctl):
        dockarea.Dock.__init__(self, "Explorer", size=(1500, 500))

        self.dialog_parent = dialog_parent
        self.status_bar = status_bar
        self.schedule_ctl = schedule_ctl

        self.splitter = QtGui.QSplitter(QtCore.Qt.Horizontal)
        self.addWidget(self.splitter)

        grid = LayoutWidget()
        self.splitter.addWidget(grid)

        self.el = QtGui.QListView()
        self.el.selectionChanged = self._selection_changed
        self.selected_key = None
        grid.addWidget(self.el, 0, 0, colspan=4)

        self.datetime = QtGui.QDateTimeEdit()
        self.datetime.setDisplayFormat("MMM d yyyy hh:mm:ss")
        self.datetime.setDate(QtCore.QDate.currentDate())
        self.datetime.dateTimeChanged.connect(self.enable_duedate)
        self.datetime_en = QtGui.QCheckBox("Due date:")
        grid.addWidget(self.datetime_en, 1, 0, colspan=2)
        grid.addWidget(self.datetime, 1, 2, colspan=2)

        self.pipeline = QtGui.QLineEdit()
        self.pipeline.setText("main")
        grid.addWidget(QtGui.QLabel("Pipeline:"), 2, 0, colspan=2)
        grid.addWidget(self.pipeline, 2, 2, colspan=2)

        self.priority = QtGui.QSpinBox()
        self.priority.setRange(-99, 99)
        grid.addWidget(QtGui.QLabel("Priority:"), 3, 0)
        grid.addWidget(self.priority, 3, 1)

        self.flush = QtGui.QCheckBox("Flush")
        self.flush.setToolTip(
            "Flush the pipeline before starting the experiment")
        grid.addWidget(self.flush, 3, 2)

        self.log_level = QtGui.QComboBox()
        for item in "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL":
            self.log_level.addItem(item)
        self.log_level.setCurrentIndex(1)
        self.log_level.setToolTip("Minimum level for log entry production")
        grid.addWidget(self.log_level, 3, 3)

        submit = QtGui.QPushButton("Submit")
        submit.setShortcut("CTRL+RETURN")
        submit.setToolTip("Schedule the selected experiment (CTRL+ENTER)")
        grid.addWidget(submit, 4, 0, colspan=4)
        submit.clicked.connect(self.submit_clicked)

        self.argeditor = _ArgumentEditor(self.dialog_parent)
        self.splitter.addWidget(self.argeditor)
        self.splitter.setSizes([grid.minimumSizeHint().width(), 1000])
        self.state = dict()
Ejemplo n.º 4
0
    def __init__(self, parent, window_title, prev_name, create_cb):
        QtGui.QDialog.__init__(self, parent=parent)
        self.setWindowTitle(window_title)

        self.grid = QtGui.QGridLayout()
        self.setLayout(self.grid)

        self.grid.addWidget(QtGui.QLabel("Name:"), 0, 0)
        self.name = QtGui.QLineEdit()
        self.grid.addWidget(self.name, 0, 1)
        if prev_name is not None:
            self.name.setText(prev_name)

        def on_accept():
            create_cb(self.name.text(), self.get_input())
        self.accepted.connect(on_accept)
Ejemplo n.º 5
0
    def __init__(self):
        dockarea.Dock.__init__(self, "Parameters", size=(400, 300))

        grid = LayoutWidget()
        self.addWidget(grid)

        self.search = QtGui.QLineEdit()
        self.search.setPlaceholderText("search...")
        self.search.editingFinished.connect(self._search_parameters)
        grid.addWidget(self.search, 0, 0)

        self.table = QtGui.QTableView()
        self.table.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
        self.table.horizontalHeader().setResizeMode(
            QtGui.QHeaderView.ResizeToContents)
        grid.addWidget(self.table, 1, 0)