def __init__(self, parent=None, **kwargs):
        super(TrainingCtlW, self).__init__(parent)

        self.setContentsMargins(0, 0, 0, 0)
        self.grid = QtWidgets.QGridLayout()
        self.grid.setContentsMargins(0, 0, 0, 0)
        self.grid.setSpacing(0)
        self.setLayout(self.grid)

        self.grid.addWidget(QtWidgets.QLabel("Training shots control"), 0, 0,
                            1, 4, QtCore.Qt.AlignHCenter)

        self.grid.addWidget(QtWidgets.QLabel("Interval,s"), 1, 0)

        self.sb_interval = CXSpinBox(cname='cxhw:0.ddm.extr_train_interval')
        self.grid.addWidget(self.sb_interval, 1, 1)

        self.grid.addWidget(QtWidgets.QLabel("run"), 1, 2)

        self.cb_run = CXCheckBox(cname='cxhw:0.ddm.extr_train')
        self.grid.addWidget(self.cb_run, 1, 3)
Exemple #2
0
    def __init__(self, parent=None):
        super(ExtractorWidget, self).__init__(parent)
        self.setContentsMargins(0, 0, 0, 0)
        self.grid = QtWidgets.QGridLayout()
        self.grid.setContentsMargins(0, 0, 0, 0)
        self.grid.setSpacing(0)
        self.setLayout(self.grid)

        self.b_start = QtWidgets.QPushButton('start')
        self.grid.addWidget(self.b_start, 0, 0)

        self.b_stop = QtWidgets.QPushButton('stop')
        self.grid.addWidget(self.b_stop, 0, 1)

        self.b_start.clicked.connect(self.extract)
        self.b_stop.clicked.connect(extr.stop)

        extr.unexpectedShot.connect(self.unexpected_shot_proc)
        extr.extractionDone.connect(self.extr_proc)

        self.st_time = 0
        self.fi_time = 0
Exemple #3
0
    def __init__(self, parent=None):
        super(LinstarterWidget, self).__init__(parent)
        self.setContentsMargins(0, 0, 0, 0)
        self.grid = QtWidgets.QGridLayout()
        self.grid.setContentsMargins(0, 0, 0, 0)
        self.grid.setSpacing(0)
        self.setLayout(self.grid)

        self.b_start = QtWidgets.QPushButton('start')
        self.grid.addWidget(self.b_start, 0, 0)

        self.b_stop = QtWidgets.QPushButton('stop')
        self.grid.addWidget(self.b_stop, 0, 1)

        self.lin_st = linstarter.LinStarter()
        self.b_start.clicked.connect(self.run_counter)
        self.b_stop.clicked.connect(self.lin_st.stop)

        self.lin_st.runmodeChanged.connect(print)
        self.lin_st.nshotsChanged.connect(print)
        self.lin_st.runDone.connect(self.rundone_proc)

        self.st_time = 0
        self.fi_time = 0
Exemple #4
0
    def __init__(self, parent=None):
        super(TrainingCtlW, self).__init__(parent)
        self.setContentsMargins(0, 0, 0, 0)
        self.grid = QtWidgets.QGridLayout()
        self.grid.setContentsMargins(0, 0, 0, 0)
        self.grid.setSpacing(0)
        self.setLayout(self.grid)

        self.grid.addWidget(QtWidgets.QLabel("Training shots control"), 0, 0,
                            1, 4)

        self.grid.addWidget(QtWidgets.QLabel("Interval,s"), 1, 0)

        self.sb_interval = FSpinBox()
        self.grid.addWidget(self.sb_interval, 1, 1)

        self.grid.addWidget(QtWidgets.QLabel("run"), 1, 2)

        self.cb_run = FCheckBox()
        self.grid.addWidget(self.cb_run, 1, 3)

        self.cb_run.stateChanged.connect(self.run_proc)

        extr.trainingStopped.connect(self.training_stopped_proc)
Exemple #5
0
    def __init__(self, parent=None):
        super().__init__(parent)
        self.modes_db = ModesDB()

        #filter controls
        self.grid_filter = QtWidgets.QGridLayout()
        self.grid.addLayout(self.grid_filter, 0, 0, 1, 1)

        self.grid_filter.addWidget(QtWidgets.QLabel("search"), 0, 0)

        self.filter_line = QtWidgets.QLineEdit()
        self.grid_filter.addWidget(self.filter_line, 0, 1, 1, 6)
        self.filter_line.editingFinished.connect(self.filter_cb)

        self.prev_b = QtWidgets.QPushButton("<<")
        self.grid_filter.addWidget(self.prev_b, 1, 0)
        self.prev_b.clicked.connect(self.prev_cb)

        self.nrows_box = PSpinBox()
        self.grid_filter.addWidget(self.nrows_box, 1, 1)
        self.nrows_box.done.connect(self.nrows_cb)

        self.grid_filter.addWidget(QtWidgets.QLabel("@"), 1, 2)

        self.startrow_box = PSpinBox()
        self.grid_filter.addWidget(self.startrow_box, 1, 3)
        self.startrow_box.done.connect(self.startrow_cb)

        self.grid_filter.addWidget(QtWidgets.QLabel("of"), 1, 4)

        self.maxrows_box = PSpinBox()
        self.grid_filter.addWidget(self.maxrows_box, 1, 5)
        self.maxrows_box.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons)
        self.maxrows_box.setReadOnly(True)

        self.next_b = QtWidgets.QPushButton(">>")
        self.grid_filter.addWidget(self.next_b, 1, 6)
        self.next_b.clicked.connect(self.next_cb)

        # List
        self.listw = ModeList(db=self.modes_db)
        self.grid.addWidget(self.listw, 1, 0)
        self.listw.modeSelected.connect(self.mode_sel_cb)

        # Bottom controls
        self.grid_bottom = QtWidgets.QGridLayout()
        self.grid.addLayout(self.grid_bottom, 2, 0, 1, 1)

        self.grid_bottom.addWidget(QtWidgets.QLabel("mark"), 0, 0, 2, 1)

        self.buttons = []
        self.marks = ['einj', 'eext', 'pinj', 'pext', 'e2v4', 'p2v4', 'e2v2', 'p2v2']
        m_len = len(self.marks)
        rlen = 4
        crow = 0
        for ind in range(m_len):
            if ind == rlen:
                crow += 1
            btn = QtWidgets.QPushButton(self.marks[ind])
            btn.setStyleSheet("background-color: " + mode_colors[self.marks[ind]])
            btn.setFixedWidth(100)
            self.grid_bottom.addWidget(btn, crow, ind - crow * rlen + 1)
            self.buttons.append(btn)
            btn.clicked.connect(self.mark_buttons_cb)

        hSpacer = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.grid_bottom.addItem(hSpacer, 0, rlen + 2)

        self.btn_archive = QtWidgets.QPushButton('Archive')
        self.grid_bottom.addWidget(self.btn_archive, 0, rlen + 3)
        self.btn_archive.setStyleSheet("background-color: red")
        self.btn_archive.setFixedWidth(110)
        self.btn_archive.clicked.connect(self.btn_archive_cb)

        self.btn_load = QtWidgets.QPushButton('Load')
        self.grid_bottom.addWidget(self.btn_load, 0, rlen + 4)
        self.btn_load.setFixedWidth(110)
        self.btn_load.clicked.connect(self.btn_load_cb)

        self.btn_zeros = QtWidgets.QPushButton('Zeros')
        self.grid_bottom.addWidget(self.btn_zeros, 1, rlen + 3)
        self.btn_zeros.setStyleSheet("background-color: yellow")
        self.btn_zeros.clicked.connect(self.setZeros)

        # Save Block
        self.grid_save = QtWidgets.QGridLayout()
        self.grid.addLayout(self.grid_save, 3, 0, 1, 1)

        self.grid_save.addWidget(QtWidgets.QLabel("Comment:"), 0, 0)
        self.grid_save.addWidget(QtWidgets.QLabel("author:"), 1, 0)

        self.comment_line = QtWidgets.QLineEdit()
        self.grid_save.addWidget(self.comment_line, 0, 1)

        self.author_line = QtWidgets.QLineEdit()
        self.grid_save.addWidget(self.author_line, 1, 1)

        self.btn_save = QtWidgets.QPushButton('save')
        self.grid_save.addWidget(self.btn_save, 0, 2, 2, 1)
        self.btn_save.clicked.connect(self.btn_save_cb)

        self.nrows, self.maxrows, self.startrow, self.filter = 100, 0, 0, None
        self.update_modenum()
        self.nrows_box.setValue(self.nrows)

        self.selected_mode = None