def __init__(self, parent=None, pendant=None): QFrame.__init__(self, parent) self.pendant = pendant self.setFrameStyle(QFrame.StyledPanel) layout = QVBoxLayout() layout.addWidget(QLabel(self.pendant.config["gui_frame_probe_title"])) plate_frame = QFrame() plate_layout = QHBoxLayout() plate_layout.setContentsMargins(0, 0, 0, 0) plate_layout.addWidget(QLabel("Touch plate:")) self.plate_combobox = ProbeComboBox(pendant=self.pendant, key_prefix="probe_plate") self.plate_combobox.currentIndexChanged.connect( self.change_plate_selection) self.change_plate_selection(1) plate_layout.addWidget(self.plate_combobox) plate_layout.addStretch() plate_frame.setLayout(plate_layout) layout.addWidget(plate_frame) grid_frame = QWidget() grid_layout = QGridLayout() grid_layout.setContentsMargins(0, 0, 0, 0) rb = QRadioButton("Z") rb.axis = "Z" rb.setChecked(True) rb.toggled.connect(self.change_axis_selection) grid_layout.addWidget(rb, 0, 0) rb = QRadioButton("X") rb.axis = "X" rb.toggled.connect(self.change_axis_selection) grid_layout.addWidget(rb, 0, 1) rb = QRadioButton("Y") rb.axis = "Y" rb.toggled.connect(self.change_axis_selection) grid_layout.addWidget(rb, 0, 2) self.tool_combobox = ProbeComboBox(pendant=self.pendant, key_prefix="probe_tool") self.tool_combobox.currentIndexChanged.connect( self.change_tool_selection) self.change_tool_selection(1) grid_layout.addWidget(QLabel("Select Tool for X/Y:"), 1, 1, 1, 2) grid_layout.addWidget(self.tool_combobox, 2, 1, 1, 2) grid_frame.setLayout(grid_layout) layout.addWidget(grid_frame) self.setLayout(layout)
def create_main_frame(self): self.main_frame = QWidget() # Create the navigation toolbar, tied to the canvas # Other GUI controls """RD order""" RDTextbox_label = QLabel('RD order:') self.RDTextbox = QLineEdit() self.RDTextbox.setMinimumWidth(0.5) RecLength_label = QLabel('Record length [s]:') self.RecLength_textbox = QLineEdit() self.RecLength_textbox.setMinimumWidth(0.5) self.RecLength_textbox.setReadOnly(True) spinBox_label = QLabel('Decimation') self.spinBox = QSpinBox() self.spinBox.setGeometry(QRect(440, 260, 71, 22)) self.spinBox.setMinimum(1) self.spinBox.setMaximum(10) self.spinBox.setSingleStep(1) self.spinBox.setObjectName("spinBox") Sampling_label = QLabel('Sampling Frequency [Hz]') self.Sampling_textbox = QLineEdit() self.Sampling_textbox.setMinimumWidth(0.5) self.Sampling_textbox.setReadOnly = (True) self.draw_button = QPushButton("&GO!") self.draw_button.clicked.connect(self.on_draw) slider_label = QLabel('Trigger Level (%):') self.slider = QSlider(Qt.Horizontal) self.slider.setRange(1, 100) self.slider.setValue(25) self.slider.setTracking(True) self.slider.setTickPosition(QSlider.TicksBothSides) self.slider.setMinimumWidth(0.8) checkbox_label = QLabel('Highpass') self.checkbox = QCheckBox() self.checkbox.toggle() # # Layout with box sizers # control_box = QHBoxLayout() grid_box = QGridLayout() radiobutton = QRadioButton("x") radiobutton.axis = "x" radiobutton.toggled.connect(self.on_radio_button_toggled) grid_box.addWidget(radiobutton, 0, 0) radiobutton = QRadioButton("y") radiobutton.axis = "y" radiobutton.toggled.connect(self.on_radio_button_toggled) grid_box.addWidget(radiobutton, 1, 0) radiobutton = QRadioButton("z") radiobutton.setChecked(True) radiobutton.axis = "z" radiobutton.toggled.connect(self.on_radio_button_toggled) grid_box.addWidget(radiobutton, 2, 0) """ Infoboxes Input Data""" grid_box.addWidget(Sampling_label, 0, 1) grid_box.addWidget(self.Sampling_textbox, 1, 1) grid_box.addWidget(RecLength_label, 0, 2) grid_box.addWidget(self.RecLength_textbox, 1, 2) control_box.addLayout(grid_box) """ Signal Processing""" grid_box.addWidget(checkbox_label, 0, 3) grid_box.addWidget(self.checkbox, 1, 3) grid_box.addWidget(spinBox_label, 0, 4) grid_box.addWidget(self.spinBox, 1, 4) """ RD Estimation""" grid_box.addWidget(slider_label, 0, 5) grid_box.addWidget(self.slider, 1, 5) grid_box.addWidget(RDTextbox_label, 0, 6) grid_box.addWidget(self.RDTextbox, 1, 6) control_box.addWidget(self.draw_button) vbox = QVBoxLayout() vbox.addLayout(control_box) self.main_frame.setLayout(vbox) self.setCentralWidget(self.main_frame)