def __init__(self, *args, **kwargs): super(TimeSeriesControls, self).__init__(*args, **kwargs) self.time_points = None self.filename_label = QtGui.QLabel('', self) self.filename_label.setAlignment(QtCore.Qt.AlignCenter) self.time_point_label = QtGui.QLabel('', self) self.time_point_label.setAlignment(QtCore.Qt.AlignLeft) self.time_point_slider = QtGui.QSlider(parent=self) self.time_point_slider.setTracking(True) self.time_point_slider.setOrientation(QtCore.Qt.Horizontal) # Update label with time_point self.time_point_slider.valueChanged.connect( self.time_point_label.setNum) self.time_point_slider.valueChanged.connect(self._update) time_label = QtGui.QLabel('Time point: ', self) time_label.setAlignment(QtCore.Qt.AlignLeft) controls = QtGui.QHBoxLayout() controls.addWidget(time_label) controls.addWidget(self.time_point_label) controls.addWidget(self.time_point_slider) title = QtGui.QLabel('<h3>Time-series controls</h3>') title.setAlignment(QtCore.Qt.AlignCenter) layout = QtGui.QVBoxLayout() layout.addWidget(title) layout.addWidget(self.filename_label) layout.addLayout(controls) self.setLayout(layout)
def initkmirrordata(self): # start the kms QThread ''' Add back in once KMS is running ''' # self.kms_updater = KMS_Thread() # self.kms_updater.new_kms_data.connect(self.updatekmirrordata) # self.kms_updater.start() #place holder data self.parallacticangle = rm.randint(10, 170) self.positionalerror = rm.randint(0, 90) self.kmsstatus = 'Normal' self.parallacticangletext = QtGui.QLabel('Parallactic Angle: %s' %(self.parallacticangle)) self.parallacticangletext.setAlignment(QtCore.Qt.AlignCenter) self.positionalerrortext = QtGui.QLabel('Positional Error: %s' %(self.positionalerror)) self.positionalerrortext.setAlignment(QtCore.Qt.AlignCenter) self.kmsstatustext = QtGui.QLabel('KMS Status Flag: %s' %(self.kmsstatus)) self.kmsstatustext.setAlignment(QtCore.Qt.AlignCenter) self.kmstitle = QtGui.QLabel('Kmirror System Position and Status') self.kmstitle.setAlignment(QtCore.Qt.AlignCenter) self.kmsgui = QtGui.QWidget() self.kmsFrame = QtGui.QFrame() self.kmsFrame.setStyleSheet("background-color: blue;") self.kmsFrame.setFrameShape(QtGui.QFrame.StyledPanel) self.kmsFrame.setFrameShadow(QtGui.QFrame.Raised) self.kmsparams = QtGui.QVBoxLayout() self.kmsparams.addWidget(self.kmsFrame) self.kmsparams.addWidget(self.kmstitle) self.kmsparams.addWidget(self.kmsstatustext) self.kmsparams.addWidget(self.parallacticangletext) self.kmsparams.addWidget(self.positionalerrortext) self.kmsgui.setLayout(self.kmsparams) self.grid.addWidget(self.kmsgui, 4, 1, 1, 1)
def createMessageWidget(self): '''create message box widget. return group ''' GridStartVal = '2' vbox = QtGui.QVBoxLayout() hbox = QtGui.QHBoxLayout() hbox2 = QtGui.QHBoxLayout() self.lbl = QtGui.QLineEdit("Step 1) Open configuration file", self) self.lbl2 = QtGui.QLineEdit() self.lbl2.setText(os.getcwd()) self.directoryButton = QtGui.QPushButton("Change Directory") hbox.addWidget(QtGui.QLabel("Message")) hbox.addWidget(self.lbl) hbox2.addWidget(QtGui.QLabel("Set Directory")) hbox2.addWidget(self.lbl2) hbox2.addWidget(self.directoryButton) vbox.addLayout(hbox) vbox.addLayout(hbox2) messageGroup = QtGui.QGroupBox("Message Box") messageGroup.setLayout(vbox) if self.tab_widget.currentIndex() == 1: self.lbl.setText("click hotspot, press n or press S to skip frame") else: self.lbl.setText("") return messageGroup
def initUI(self): self.sld = QtGui.QSlider(QtCore.Qt.Horizontal, self) self.lcd = QtGui.QLCDNumber(self) self.combo = QtGui.QComboBox(self) self.combo2 = QtGui.QComboBox(self) self.combo3 = QtGui.QComboBox(self) self.lbl1 = QtGui.QLabel("Set the size of the hotspot") self.lbl3 = QtGui.QLabel() self.lbl3.setText("Set a group number of the hot spot") for i in arange(5): self.combo2.addItem(str(i + 1)) self.btn = QtGui.QPushButton("Hotspots to a line") self.btn2 = QtGui.QPushButton("Hotspots to a sine curve") self.btn3 = QtGui.QPushButton("set y") self.btn4 = QtGui.QPushButton("Clear hotspot data") vb = QtGui.QVBoxLayout() vb.addWidget(self.combo) vb.addWidget(self.lbl1) vb.addWidget(self.lcd) vb.addWidget(self.sld) vb.addWidget(self.combo3) hb1 = QtGui.QVBoxLayout() hb1.addWidget(self.lbl3, 0) hb1.addWidget(self.combo2) vb.addLayout(hb1) vb.addWidget(self.btn) vb.addWidget(self.btn2) vb.addWidget(self.btn3) vb.addWidget(self.btn4) self.setLayout(vb)
def initUI(self): self.show() hb3 = QtGui.QHBoxLayout() self.file_name_title = QtGui.QLabel("_") lbl1 = QtGui.QLabel("x pos") self.lbl2 = QtGui.QLabel("") lbl3 = QtGui.QLabel("y pos") self.lbl4 = QtGui.QLabel("") btn1 = QtGui.QPushButton("position") hb3.addWidget(lbl1) hb3.addWidget(self.lbl2) hb3.addWidget(lbl3) hb3.addWidget(self.lbl4) hb3.addWidget(btn1) btn1.clicked.connect(self.updatePanel) hb2 = QtGui.QHBoxLayout() hb1 = QtGui.QHBoxLayout() vb1 = QtGui.QVBoxLayout() self.view = IView2() self.sld = QtGui.QSlider(QtCore.Qt.Horizontal, self) self.lcd = QtGui.QLCDNumber(self) self.hist = pg.HistogramLUTWidget() self.hist.setImageItem(self.view.projView) self.hist.setMaximumWidth(110) hb2.addWidget(self.lcd) hb2.addWidget(self.sld) vb1.addWidget(self.file_name_title) vb1.addLayout(hb3) vb1.addWidget(self.view) vb1.addLayout(hb2) hb1.addLayout(vb1) hb1.addWidget(self.hist, 10) self.setLayout(hb1)
def initUI(self): self.grid = QtGui.QGridLayout() self.setLayout(self.grid) self.lbl1 = QtGui.QLabel("Select beamline") self.lbl2 = QtGui.QLabel( "Enter theta position pv if other than default") self.lbl3 = QtGui.QLabel("Warning Message") self.lbl4 = QtGui.QLabel( "NOTE: PV for 2-IDE data processed before Feb 2018 is 657") self.btn = QtGui.QPushButton("Okay") self.txtfield = QtGui.QLineEdit("8") self.txtfield2 = QtGui.QLineEdit("663") self.button = QtGui.QCheckBox("Bionanoprobe") self.button2 = QtGui.QCheckBox("2-IDE") self.setWindowTitle('Configuration') self.btn.setAutoRepeat(True) vb = QtGui.QVBoxLayout() vb.addWidget(self.lbl1, 1) vb.addWidget(self.button, 2) vb.addWidget(self.button2, 3) vb2 = QtGui.QVBoxLayout() vb2.addWidget(self.lbl2, 1) vb2.addWidget(self.txtfield, 2) vb2.addWidget(self.txtfield2, 3) vb3 = QtGui.QVBoxLayout() vb3.addWidget(self.lbl3) vb3.addWidget(self.lbl4) vb4 = QtGui.QVBoxLayout() vb4.addWidget(self.btn) self.grid.addLayout(vb, 0, 0, 2, 1) self.grid.addLayout(vb2, 0, 1, 2, 2) self.grid.addLayout(vb3, 4, 0, 2, 3) self.grid.addLayout(vb4, 6, 1, 1, 1)
def __init__(self, num_processes, ip=None, port=None, ifc=None): super().__init__() self.central = QtGui.QWidget() # This will be our central widget self.grid_layout = QtGui.QGridLayout() self.setWindowTitle("CUWB Monitor - MAIN") self.sub_windows = dict() self.plot_windows = dict() self.network_discovery_window = NetworkDiscoveryWindow(num_processes, ip, port, ifc) self.aggregate_plot_window = AggregatePlotWindow() self.type_filter_window = TypeFilterWindow() self.network_discovery_window.show() self.type_filter_button = QtGui.QPushButton('Filter Data Types') self.type_filter_button.clicked.connect(self.open_type_filter_window) self.grid_layout.addWidget(self.type_filter_button, 2, 1) self.aggregate_plot_button = QtGui.QPushButton('Aggregate Plots') self.aggregate_plot_button.clicked.connect(self.open_aggregate_plots_window) self.grid_layout.addWidget(self.aggregate_plot_button, 1, 1) self.network_discovery_btn = QtGui.QPushButton('Network Discovery') self.network_discovery_btn.clicked.connect(self.open_discovery_window) self.grid_layout.addWidget(self.network_discovery_btn, 1, 0) self.reset_btn = QtGui.QPushButton('Reset All Windows') self.reset_btn.clicked.connect(self.reset_all_windows) self.grid_layout.addWidget(self.reset_btn, 2, 0) self.toggle_pause_play_btn = QtGui.QPushButton('Pause') self.toggle_pause_play_btn.clicked.connect(self.toggle_pause_play) self.grid_layout.addWidget(self.toggle_pause_play_btn, 3, 0, 1, 2) self.paused = False self.serial_title = QtGui.QLabel('SERIAL NUM') self.serial_title.setStyleSheet('color: black') self.serial_title.setAlignment(QtCore.Qt.AlignCenter) self.serial_title.setMargin(5) self.total_count_title = QtGui.QLabel('CDP CNT') self.total_count_title.setStyleSheet('color: black') self.total_count_title.setAlignment(QtCore.Qt.AlignCenter) self.serial_title.setMargin(5) self.grid_layout.addWidget(self.serial_title, 4, 0) self.grid_layout.addWidget(self.total_count_title, 4, 1) self.serial_labels = dict() self.total_count_labels = dict() self.count = 0 self.central.setLayout(self.grid_layout) self.setCentralWidget(self.central) self.resize(300, 100) self.startTimer(250) self.currently_filtering = False self.previous_nodes = set(UwbNetwork.nodes.keys())
def initUI(self): names = list() for i in arange(self.numlabels): names.append("") self.grid = QtGui.QGridLayout() self.lbl = QtGui.QLabel() self.lbl2 = QtGui.QLabel() self.lbl.setText( "closing this window won't affect your selection of the files") self.lbl2.setText( "You should convert the files in order to generate sinogram or reconstructed data" ) self.btn = QtGui.QPushButton('Save Data in Memory', self) self.btn2 = QtGui.QPushButton("set Image Tag", self) self.btn3 = QtGui.QPushButton("set Element", self) self.btn4 = QtGui.QPushButton("Sort data by angle") columns = np.ceil(np.sqrt(self.numlabels)) rows = 10 j = 0 pos = list() for y in arange(columns): for x in arange(rows): pos.append((x, y)) self.button = list() for i in names: self.button.append(QtGui.QCheckBox(i)) self.grid.addWidget(self.button[j], pos[j][0], pos[j][1]) j = j + 1 self.setLayout(self.grid) self.vb = QtGui.QVBoxLayout() self.vb2 = QtGui.QVBoxLayout() self.vb.addWidget(self.lbl, 12) self.vb.addWidget(self.lbl2, 13) hb = QtGui.QHBoxLayout() hb.addWidget(self.btn2) hb.addWidget(self.btn3) hb.addWidget(self.btn4) self.vb2.addLayout(hb) self.vb2.addWidget(self.btn) self.grid.addLayout(self.vb, 11, 0, 1, 7) self.grid.addLayout(self.vb2, 13, 1, 1, 3) self.move(100, 100) self.setWindowTitle('Calculator') self.show()
def display_active_addresses_widget(self): self.addr_widget = QtGui.QWidget() self.addr_widget.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) addr_layout = QtGui.QVBoxLayout() self.addr_widget.setLayout(addr_layout) if len(self.active_addresses) > 0: label = QtGui.QLabel('Currently listening on:') addr_layout.addWidget(label) for stream in sorted(self.active_addresses, key=attrgetter('ip', 'port', 'interface')): label = QtGui.QLabel('{}:{} - Interface: {}'.format( stream.ip, stream.port, stream.interface)) addr_layout.addWidget(label) self.central_layout.addWidget(self.addr_widget)
def __init__(self): super().__init__() self.setWindowTitle('CUWB Monitor - CDP Data Type Filtering') self.num_columns = 10 self.central = QtGui.QWidget() self.grid_layout = QtGui.QGridLayout() self.central.setLayout(self.grid_layout) self.setCentralWidget(self.central) self.resize(1000, 400) self.current_types = set() self.filtering = False self.filter_toggle_button = QtGui.QPushButton('Start Filter') self.filter_toggle_button.clicked.connect(self.toggle_filter) self.grid_layout.addWidget(self.filter_toggle_button, 0, 0, 1, self.num_columns) self.type_count = 0 self.type_checkboxes = dict() self.type_labels = dict() self.types = dict() for cdp_type in cdp.CDP.data_item_classes.keys(): self.types[cdp_type] = cdp.CDP.data_item_classes[cdp_type].__name__ self.type_checkboxes[cdp_type] = QtGui.QCheckBox() self.type_labels[cdp_type] = QtGui.QLabel() self.type_count += 1 self.types[UNKNOWN_FILTER_TYPE] = 'Unknown Types' self.type_checkboxes[UNKNOWN_FILTER_TYPE] = QtGui.QCheckBox() self.type_labels[UNKNOWN_FILTER_TYPE] = QtGui.QLabel() type_per_col = (int(self.type_count / (self.num_columns / 2)) + 1) row = 1 col = 0 for cdp_type in sorted(self.types.keys()): self.grid_layout.addWidget(self.type_checkboxes[cdp_type], row, col) self.grid_layout.addWidget(self.type_labels[cdp_type], row, col + 1) self.type_labels[cdp_type].setText(self.types[cdp_type]) self.type_labels[cdp_type].setAlignment(QtCore.Qt.AlignLeft) row += 1 if row > type_per_col: col += 2 row = 1 self.timer = self.startTimer(QPLOT_FREQUENCY)
def __init__(self, group_name, button_name, default_path=None, stdout=False, filter="yaml (*.yaml)"): ''' ex: PathSelector('plot.yaml', 'select', '/path/to/default/plot.yaml') :param widget parent: parent widget :param str group_name: name of this item displayed on left up :param str button_name: name displayed on button :param str default_path: default path to file ''' self.path = str(default_path) QtGui.QVBoxLayout.__init__(self, group_name) # make layouts vbox = QtGui.QVBoxLayout() hbox = QtGui.QHBoxLayout() # label and button self.label = QtGui.QLabel(self.path) self.button = QtGui.QPushButton() self.button.setText(button_name) self.button.setAutoDefault(True) # set parents hbox.addWidget(self.button) hbox.addWidget(self.label) vbox.addLayout(hbox) self.setLayout(vbox) self.button.clicked.connect(functools.partial(self.select_path, filter))
def initUI(self): self.sld = QtGui.QSlider(QtCore.Qt.Horizontal, self) self.lcd = QtGui.QLCDNumber(self) self.combo = QtGui.QComboBox(self) self.btn = QtGui.QPushButton('Click2') self.btn.setText("Sinogram") self.btn2 = QtGui.QPushButton("shift data") self.btn3 = QtGui.QPushButton("X 10") self.btn4 = QtGui.QPushButton("/ 10") hb = QtGui.QHBoxLayout() hb.addWidget(self.btn3) hb.addWidget(self.btn4) self.btn3.setVisible(False) self.btn4.setVisible(False) self.lbl = QtGui.QLabel() self.lbl.setText("") vb = QtGui.QVBoxLayout() vb.addWidget(self.combo) vb.addWidget(self.btn) vb.addWidget(self.btn2) vb.addWidget(self.lcd) vb.addWidget(self.sld) vb.addWidget(self.lbl) vb.addLayout(hb) self.setLayout(vb)
def timerEvent(self, e): if not UwbNetwork.running: self.close() return current_nodes = set(UwbNetwork.nodes.keys()) node_diff = current_nodes - self.previous_nodes if node_diff: if self.currently_filtering: for serial in node_diff: UwbNetwork.nodes[serial].start_filtering(self.type_filter_window.current_types) if self.paused: for serial in node_diff: UwbNetwork.nodes[serial].pause() self.previous_nodes = current_nodes if self.type_filter_window.filtering and not self.currently_filtering: for serial in UwbNetwork.nodes: UwbNetwork.nodes[serial].start_filtering(self.type_filter_window.current_types) self.currently_filtering = True elif not self.type_filter_window.filtering and self.currently_filtering: for serial in UwbNetwork.nodes: UwbNetwork.nodes[serial].stop_filtering() self.currently_filtering = False while len(UwbNetwork.nodes) > self.count: self.serial_labels.update([(self.count, QtGui.QLabel())]) self.serial_labels[self.count].setAlignment(QtCore.Qt.AlignCenter) self.serial_labels[self.count].mouseReleaseEvent = partial(self.labelClickEvent, self.count) self.serial_labels[self.count].setStyleSheet('color: blue') self.total_count_labels.update([(self.count, QtGui.QLabel())]) self.total_count_labels[self.count].setAlignment(QtCore.Qt.AlignCenter) _row = self.count % 25 _column = 2 * int((self.count) / 25) self.grid_layout.addWidget(self.serial_labels[self.count], _row + 5, _column + 0) self.grid_layout.addWidget(self.total_count_labels[self.count], _row + 5, _column + 1) self.count += 1 if UwbNetwork.nodes.keys(): _ids = np.sort(list(UwbNetwork.nodes.keys())) for _row in range(self.count): self.serial_labels[_row].setText('0x{:08X}'.format(_ids[_row])) self.total_count_labels[_row].setText('{:7d}'.format(UwbNetwork.nodes[_ids[_row]].cdp_total))
def inittelescope(self): # start the telescope QThread self.tel_updater = Tel_Thread() self.tel_updater.new_tel_data.connect(self.updatetelescopedata) self.tel_updater.start() # initialize printouts of current tele values not plotted self.patext = QtGui.QLabel('PA: %s' %('-')) self.slewtext = QtGui.QLabel('Slew Flag: %s' %('-')) self.timetext = QtGui.QLabel('UTC Time: %s' %('-')) # create space for tele printout values self.telescopedata = QtGui.QVBoxLayout() self.telescopedata.addWidget(self.patext) self.telescopedata.addWidget(self.slewtext) self.telescopedata.addWidget(self.timetext) # create plot object for alt-az graph self.altazgraph = pg.PlotWidget() self.altazgraphdata = pg.ScatterPlotItem() self.altazgraph.addItem(self.altazgraphdata) self.altazgraph.showGrid(x=True, y=True) self.altazgraph.setTitle('Alt-Az Graph') self.altazgraph.setLabel('left', 'alt') self.altazgraph.setLabel('bottom', 'az') # create plot object for ra-dec graph self.radecgraph = pg.PlotWidget() self.radecgraphdata = pg.ScatterPlotItem() self.radecgraph.addItem(self.radecgraphdata) self.radecgraph.showGrid(x=True, y=True) self.radecgraph.setTitle('Ra-Dec Graph') self.radecgraph.setLabel('left', 'DEC (deg)') self.radecgraph.setLabel('bottom', 'RA (deg)') # create new window for telescope graphs self.telescopewindow = QtGui.QWidget() self.telescopewindow.setWindowTitle('Telescope Data') self.telegrid = QtGui.QGridLayout() self.telegrid.addLayout(self.telescopedata, 1, 1, 1, 1) self.telegrid.addWidget(self.altazgraph, 1, 2, 2, 2) self.telegrid.addWidget(self.radecgraph, 1, 4, 2, 2) self.telescopewindow.setGeometry(10, 10, 1920, 1080) self.telescopewindow.setLayout(self.telegrid) self.telescopewindow.show() self.repeat = False
def initkmirrordata(self): #place holder data self.parallacticangle = rm.randint(10, 170) self.positionalerror = rm.randint(0, 90) self.parallacticangletext = QtGui.QLabel() self.positionalerrortext = QtGui.QLabel() self.parallacticangletext.setText('Parallactic Angle: %s' % (self.parallacticangle)) self.positionalerrortext.setText('Positonal Error: %s' % (self.positionalerror)) self.kmirrordatatext = QtGui.QVBoxLayout() self.kmirrordatatext.addWidget(self.parallacticangletext) self.kmirrordatatext.addWidget(self.positionalerrortext) self.grid.addLayout(self.kmirrordatatext, 4, 1, 1, 1)
def __init__(self, dataGenerator, parent=None): super(SpeedButton, self).__init__(parent=parent) self.verticalLayout = QtGui.QVBoxLayout(self) self.speed = 0.25 self.label = QtGui.QLabel(self) self.label.setText("Speed Control") self.label.setFixedHeight(25) self.label.setAlignment(QtCore.Qt.AlignCenter) self.startButton = QtGui.QPushButton('Apply Contingency', self) self.startButton.clicked.connect(dataGenerator.start) self.stopButton = QtGui.QPushButton('Reset', self) #self.stopButton.clicked.connect(dataGenerator.stop) self.fullPlotButton = QtGui.QPushButton("View Full Plot", self) self.zoomButton = QtGui.QPushButton("Zoom Out", self) self.sb1 = QtGui.QRadioButton("x1") self.sb1.toggled.connect(lambda: self.setSpeed(1)) self.sb2 = QtGui.QRadioButton("x0.5") self.sb2.toggled.connect(lambda: self.setSpeed(0.5)) self.sb3 = QtGui.QRadioButton("x0.25") self.sb3.toggled.connect(lambda: self.setSpeed(0.25)) self.sb3.setChecked(True) self.sb4 = QtGui.QRadioButton("x0.10") self.sb4.toggled.connect(lambda: self.setSpeed(0.1)) #self.speedLayout = QtGui.QVBoxLayout() #self.speedLayout.addWidget(self.label) #self.speedLayout.addWidget(self.sb1) self.verticalLayout.setAlignment(QtCore.Qt.AlignTop) self.checkboxLayout = QtGui.QHBoxLayout() self.hl1 = QtGui.QHBoxLayout() self.hl2 = QtGui.QHBoxLayout() self.hl1.addWidget(self.startButton) self.hl1.addWidget(self.stopButton) self.hl2.addWidget(self.fullPlotButton) self.hl2.addWidget(self.zoomButton) self.verticalLayout.addLayout(self.hl1) self.verticalLayout.addLayout(self.hl2) self.verticalLayout.addWidget(self.label) self.checkboxLayout.addWidget(self.sb1) self.checkboxLayout.addWidget(self.sb2) self.checkboxLayout.addWidget(self.sb3) self.checkboxLayout.addWidget(self.sb4) self.verticalLayout.addLayout(self.checkboxLayout)
def add_row(self, name, checkbox_name=None): current_row = self.layout.rowCount() if self.layout.count != 0: current_row +=1 l = QtGui.QLabel(name) # graph width label sp = QtGui.QSpinBox() # graph width spinbox sp.setMaximum(max(QtGui.QApplication.desktop().size().width(), QtGui.QApplication.desktop().size().height())) self.rows[name] = (l, sp) self.layout.addWidget(l,current_row, 0) self.layout.addWidget(sp,current_row, 1) if checkbox_name is not None: l_check = QtGui.QLabel(checkbox_name) check = QtGui.QCheckBox() self.layout.addWidget(l_check, current_row, 2) self.layout.addWidget(check, current_row, 3) return l, sp, check return l, sp
def __init__(self, image, parent=None): super(SystemState, self).__init__(parent=parent) self.layout = QtGui.QHBoxLayout(self) self.image = QtGui.QPixmap(image).scaledToHeight(120) self.imageLabel = QtGui.QLabel(self) self.imageLabel.setPixmap(self.image) self.bbinfo = BBInfo() self.layout.addWidget(self.imageLabel) self.layout.addWidget(self.bbinfo)
def __init__(self, parent=None, node=None): super(HDFAttributeWidget, self).__init__(parent) self.name = '' self.nameLabel = QtGui.QLabel('', self) self.nameLabel.setWordWrap(True) self.nameLabel.setTextInteractionFlags( QtCore.Qt.TextSelectableByKeyboard | QtCore.Qt.TextSelectableByMouse) self.fileLabel = QtGui.QLabel('', self) self.fileLabel.setWordWrap(True) self.fileLabel.setTextInteractionFlags( QtCore.Qt.TextSelectableByKeyboard | QtCore.Qt.TextSelectableByMouse) self.attributeView = QtGui.QTableView(self) self.setLayout(QtGui.QVBoxLayout()) self.layout().addWidget(self.nameLabel) self.layout().addWidget(self.fileLabel) self.layout().addWidget(self.attributeView) if node is not None: self.setNode(node)
def channelselection(self): self.channelreadoutbox = QtGui.QFormLayout() #adds readout card dropbox if All if self.readoutcard == 'All': for i in range(8): if i < 4: self.readoutcardselect.addItem('MCE 1 RC %s' % (i % 4 + 1)) else: self.readoutcardselect.addItem('MCE 2 RC %s' % (i % 4 + 1)) self.readoutcardlabel = QtGui.QLabel('Readout Card') self.channelreadoutbox.addRow(self.readoutcardlabel, self.readoutcardselect) #creates channel dropbox self.selectchannel.addItems(['1', '2', '3', '4', '5', '6', '7', '8']) self.channellabel = QtGui.QLabel('Channel') self.channelreadoutbox.addRow(self.channellabel, self.selectchannel) self.grid.addLayout(self.channelreadoutbox, 3, 1, 1, 1)
def __init__( self, minimum, maximum, value=None, suffix="", prec=1, parent=None, **kwargs ): super().__init__(parent=parent) self.suffix = suffix self.prec = prec self.outerLayout = QtGui.QHBoxLayout(self) self.outerLayout.setContentsMargins(0, 0, 0, 0) self.outerLayout.setSpacing(0) self.label = QtGui.QLabel(self) self.outerLayout.addWidget(self.label) # Start of innerLayout - slider with spacer items on its sides self.innerLayout = QtGui.QHBoxLayout() spacerItem = QtGui.QSpacerItem( 0, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum ) self.innerLayout.addItem(spacerItem) self.slider = QtGui.QSlider(self) self.slider.setOrientation(QtCore.Qt.Horizontal) self.innerLayout.addWidget(self.slider) spacerItem1 = QtGui.QSpacerItem( 0, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum ) self.innerLayout.addItem(spacerItem1) # End of innerLayout self.outerLayout.addLayout(self.innerLayout) self.resize(self.sizeHint()) self.minimum = minimum self.maximum = maximum self.slider.valueChanged.connect( self._setLabelValue_based_on_slider_value ) if value: self.slider.setValue(self._value_to_slider_value(value)) self.x = value else: self.x = self.minimum self._setLabelValue_based_on_slider_value(self.slider.value())
def __init__(self, parent=None): super(BBInfo, self).__init__(parent=parent) self.label1text = "" self.label2text = "" self.label3text = "Normal Operation" self.layout = QtGui.QVBoxLayout(self) self.label1 = QtGui.QLabel(self) # self.label1.setText("Normal Operation") self.label2 = QtGui.QLabel(self) # self.label2.setText("Issue detected") self.label3 = QtGui.QLabel(self) self.label3.setStyleSheet("QLabel { color : red; }") self.label3.setText(self.label3text) self.layout.addWidget(self.label1) self.layout.addWidget(self.label2) self.layout.addWidget(self.label3)
def __init__(self): self.plot_traces = pg.PlotWidget(parent=None) self.plot_semblance = pg.ImageView(parent=None) self.cdp_obj = cdp.CDP("traces.su", 123) self.spin = pg.SpinBox() self.spin_label = QtGui.QLabel('CDP') #Max e min cdps from tape self.spin.setRange(1, self.cdp_obj.ncdps) #Default value for visualization self.spin.setValue(self.cdp_obj.cdp_index) self.spin.setSingleStep(1) self.spin.sigValueChanged.connect(self.plot_cdp) self.trace_pick_index = 24
def __init__(self, parent=None): super(DemoWindow, self).__init__(parent=parent) self.showMaximized() self.graph = GraphWidget(self) self.verticalLayout = QtGui.QVBoxLayout(self) self.verticalLayout.addWidget(self.graph) self.logoPixmap = QtGui.QPixmap(WSU_LOGO) self.logoLabel = QtGui.QLabel(self) self.logoLabel.setPixmap( self.logoPixmap.scaledToWidth(self.frameGeometry().width() * 1.6)) self.verticalLayout.addWidget(self.logoLabel)
def __init__(self, parent = None): super(StaticInfo, self).__init__(parent = parent) self.layout = QtGui.QHBoxLayout(self) self.logoPixmap = QtGui.QPixmap(WSU_LOGO) self.logoLabel = QtGui.QLabel(self) self.logoLabel.setPixmap(self.logoPixmap.scaledToWidth(900)) #self.graphPixmap = QtGui.QPixmap(GRAPH_IMAGE) #self.graphLabel = QtGui.QLabel(self) #self.graphLabel.setPixmap(self.graphPixmap.scaledToWidth(550)) self.layout.addWidget(self.logoLabel)
def channelselection(self): self.channelreadoutbox = QtGui.QFormLayout() #adds readout card dropbox if All if self.readoutcard == 'All': for i in range(32): self.selectchannel.addItem(str(i)) else: self.selectchannel.addItems(['0', '1', '2', '3', '4', '5', '6', '7']) #creates channel dropbox for i in range(33): self.selectrow.addItem(str(i)) self.channellabel = QtGui.QLabel('Column') self.rowlabel = QtGui.QLabel('Row') self.channelreadoutbox.addRow(self.channellabel, self.selectchannel) self.channelreadoutbox.addRow(self.rowlabel, self.selectrow) self.grid.addLayout(self.channelreadoutbox, 3, 1, 1, 1)
def __init__(self, parent = None): super(LineDiagram, self).__init__(parent = parent) self.layout = QtGui.QVBoxLayout(self) self.lineLabel = QtGui.QLabel(self) self.linePixmap = QtGui.QPixmap(LINE_DIAGRAM) self.lineLabel.setPixmap(self.linePixmap.scaledToHeight(400)) # self.graphLabel = QtGui.QLabel(self) # self.graphPixmap = QtGui.QPixmap(GRAPH_IMAGE) # self.graphLabel.setPixmap(self.graphPixmap.scaledToHeight(300)) self.layout.addWidget(self.parent().demoWindow.graph.w1) self.layout.addWidget(self.lineLabel)
def __init__(self, image, node_id=0, parent=None): super(SystemState, self).__init__(parent=parent) self.node_id = node_id self.layout = QtGui.QHBoxLayout(self) self.image = QtGui.QPixmap(image).scaledToHeight(150) self.imageLabel = QtGui.QLabel(self) self.imageLabel.setPixmap(self.image) self.bbinfo = BBInfo() self.failureButton = QtGui.QPushButton(self) self.failureButton.setText("Shut Down") self.layout.addWidget(self.failureButton) self.layout.addWidget(self.imageLabel) self.layout.addWidget(self.bbinfo)
def display_cuwb_networks(self): label = QtGui.QLabel("Select a network:") label.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) self.central_layout.addWidget(label) self.scroll_area = QtGui.QScrollArea() self.scroll_area.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) self.scroll_area.setFrameStyle(QtGui.QFrame.Panel | QtGui.QFrame.Sunken) self.scroll_area.setBackgroundRole(QtGui.QPalette.Light) self.scroll_area.setVerticalScrollBarPolicy( QtCore.Qt.ScrollBarAsNeeded) self.scroll_area.setHorizontalScrollBarPolicy( QtCore.Qt.ScrollBarAlwaysOff) self.scroll_area.setWidgetResizable(True) self.central_layout.addWidget(self.scroll_area) self.display_cuwb_networks_widget() self.display_active_addresses_widget()
def __init__(self, parent=None): super(DirReader, self).__init__(parent=parent) self.settings = QtCore.QSettings('dataviz', 'dirreader') self.baseDirLabel = QtGui.QLabel('Base directory') self.baseDirEdit = QtGui.QLineEdit('.') self.baseDirButton = QtGui.QPushButton('Open') self.baseDirButton.clicked.connect(self.selectBaseDir) self.baseDirWidget = QtGui.QWidget() layout = QtGui.QHBoxLayout() self.baseDirWidget.setLayout(layout) layout.addWidget(self.baseDirLabel) layout.addWidget(self.baseDirEdit) layout.addWidget(self.baseDirButton) self.pathTree = ptree.ParameterTree(showHeader=False) self.pathRules = PathParams(name='Path rules') self.pathTree.setParameters(self.pathRules, showTop=True) self.setLayout(QtGui.QVBoxLayout()) self.layout().addWidget(self.baseDirWidget) self.layout().addWidget(self.pathTree)