def __init__(self, parent): QWidget.__init__(self, parent) font = QFont(get_family(MONOSPACE), 10, QFont.Normal) info_icon = QLabel() icon = get_std_icon("MessageBoxInformation").pixmap(24, 24) info_icon.setPixmap(icon) info_icon.setFixedWidth(32) info_icon.setAlignment(Qt.AlignTop) self.service_status_label = QLabel() self.service_status_label.setWordWrap(True) self.service_status_label.setAlignment(Qt.AlignTop) self.service_status_label.setFont(font) self.desc_label = QLabel() self.desc_label.setWordWrap(True) self.desc_label.setAlignment(Qt.AlignTop) self.desc_label.setFont(font) self.group_desc = QGroupBox("Description", self) layout = QHBoxLayout() layout.addWidget(info_icon) layout.addWidget(self.desc_label) layout.addStretch() layout.addWidget(self.service_status_label) self.group_desc.setLayout(layout) self.editor = CodeEditor(self) self.editor.setup_editor(linenumbers=True, font=font) self.editor.setReadOnly(False) self.group_code = QGroupBox("Source code", self) layout = QVBoxLayout() layout.addWidget(self.editor) self.group_code.setLayout(layout) self.enable_button = QPushButton(get_icon("apply.png"), "Enable", self) self.save_button = QPushButton(get_icon("filesave.png"), "Save", self) self.disable_button = QPushButton(get_icon("delete.png"), "Disable", self) self.refresh_button = QPushButton(get_icon("restart.png"), "Refresh", self) hlayout = QHBoxLayout() hlayout.addWidget(self.save_button) hlayout.addWidget(self.enable_button) hlayout.addWidget(self.disable_button) hlayout.addWidget(self.refresh_button) vlayout = QVBoxLayout() vlayout.addWidget(self.group_desc) vlayout.addWidget(self.group_code) self.html_window = HTMLWindow() vlayout.addWidget(self.html_window) vlayout.addLayout(hlayout) self.setLayout(vlayout) self.current_file = None
def __init__(self): QWidget.__init__(self) self.setWindowTitle( 'Biofeedback' ) self.button_start = QPushButton() self.button_start.setText("START") self.button_stop = QPushButton() self.button_stop.setText("STOP") layout = QHBoxLayout(self) layout.addWidget(self.button_start) layout.addWidget(self.button_stop) self.connect(self.button_start, SIGNAL("clicked(bool)"), self.start_session) self.connect(self.button_stop, SIGNAL("clicked(bool)"), self.stop_session) self.setLayout(layout) self.setGeometry(300,100,250,100) self.show() #self.datastorage = DataStorage() #settings = {'db_host':'amber','db_user':'******','db_pwd':'dbrootpass','db_dbname':'biodb'} #self.datastorage.enableDbStorage(settings) self.thread = ConnectionThread()
def __init__(self, parent, xdata=[], ydata=[], xfit=[], yfit=[], sizex=100, sizey=100): QWidget.__init__(self, parent) self.sizex = sizex self.sizey = sizey self.setMinimumSize(self.sizex, self.sizey) self.xdata = xdata self.ydata = ydata self.xfit = xfit self.yfit = yfit self.plot = None self.data_cut = None self.fit_cut = None self.setup_widget()
def __init__(self, parent, x, y, func): QWidget.__init__(self, parent) self.setMinimumSize(320, 200) self.x = x self.y = y self.func = func #---guiqwt curve item attribute: self.curve_item = None
def __init__(self, parent=None, op=None): QWidget.__init__(self, parent) self.widget_layout = QVBoxLayout() self.minimumHeight = 200 # FIXME: hab noch nie verstanden warum das net einfach einfach ist... self.setLayout(self.widget_layout) self._op = None self._widgets = [] self._par_names = []
def __init__(self, parent=None, tdms_file=None, group_label="Data group", channel_labels=["X channel", "Y channel", "Z channel", "Z2 channel", ]): """ Params ====== twin_z : bool Allow to select two Z (data) channels group_label : str: Label text for group combo box channel_labels : list of str Label texts for channel combo boxes """ QWidget.__init__(self, parent) self.widget_layout = QVBoxLayout() self.group_widgets = [] self.channel_widgets = [] for i, label_text in enumerate([group_label] + channel_labels): label = QLabel(label_text) channel_widget = QComboBox() channel_widget.addItem(label_text) channel_widget.setMinimumWidth(250) channel_widget.setDisabled(True) group_widget = QComboBox() group_widget.addItem(label_text) group_widget.setMinimumWidth(250) group_widget.setDisabled(True) layout = QHBoxLayout() layout.addWidget(label) layout.addWidget(group_widget) if i != 0: layout.addWidget(channel_widget) self.widget_layout.addLayout(layout) if i == 0: self.group_combo = group_widget self.group_combo.currentIndexChanged.connect(self.change_sub_channels) else: self.group_widgets.append(group_widget) self.channel_widgets.append(channel_widget) group_widget.currentIndexChanged.connect(self._populate_channels) self.setLayout(self.widget_layout) self.tdms_file = tdms_file
def __init__(self, wintitle=None, icon="guiqwt.svg", toolbar=False, options=None, parent=None, panels=None, param_cols=1, legend_anchor='TR', auto_fit=False): QWidget.__init__(self, parent) FitWidgetMixin.__init__(self, wintitle, icon, toolbar, options, panels, param_cols, legend_anchor, auto_fit)
def __init__(self, parent=None): QWidget.__init__(self, parent) self.layout = QHBoxLayout() self.widgets = [] for i, label_text in enumerate(["start", "stop", "step"]): label = QLabel(label_text) argument_widget = QLineEdit() self.layout.addWidget(label) self.layout.addWidget(argument_widget) self.widgets.append(argument_widget) self.setLayout(self.layout) self.slice = slice(None)
def __init__(self, parent, x, y, data, sizex, sizey): QWidget.__init__(self, parent) self.setMinimumSize(sizex, sizey) self.x = x self.y = y self.data = data #---guiqwt related attributes: self.plot = None self.image = None self.ROI = None self.background = None #--- self.setup_widget()
def __init__(self, parent=None, x=[], y=[], data=[]): QWidget.__init__(self, parent) if len(x) < 2: x = np.linspace(0, 1392, 1392) y = np.linspace(0, 1040, 1040) data = np.zeros((1040, 1392)) self.x = x self.y = y self.data = data sx = 600 sy = int(sx / 1.338) stretch_x = 3 stretch_y = 3 #self.setGeometry(QRect(0,0,sx,sy)) layout = QGridLayout(self) layout.setMargin(0) self.screen = ImageScreen(self, x, y, data) self.cutX = CutScreen(self) self.cutY = CutScreen(self) layout.addWidget(self.screen, 1, 0) layout.addWidget(self.cutX, 0, 0) layout.addWidget(self.cutY, 1, 1) layout.setColumnStretch(0, stretch_x) layout.setColumnStretch(1, 1) layout.setRowStretch(0, 1) layout.setRowStretch(1, stretch_y) self.setLayout(layout) self.updateGeometry() self.manager = PlotManager(self) self.manager.add_plot(self.screen.plot) self.manager.add_plot(self.cutX.plot) self.manager.add_plot(self.cutY.plot) #roi = ROISelectTool #bkgnd = BKGNDSelectTool self.tools = [tools.SelectTool, tools.RectZoomTool, tools.ColormapTool] self.manager.register_all_curve_tools()
def __init__(self, parent, options=None): QWidget.__init__(self, parent=parent) if options is None: options = {} self.imagewidget = ImageWidget(self, **options) self.imagewidget.register_all_image_tools() hlayout = QHBoxLayout() self.add_buttons_to_layout(hlayout) vlayout = QVBoxLayout() vlayout.addWidget(self.imagewidget) vlayout.addLayout(hlayout) self.setLayout(vlayout)
def __init__(self, parent, x, y, data): QWidget.__init__(self, parent) #self.setMinimumSize(sizex, sizey) self.x = x self.y = y self.data = data self.level_xy = [[[0, 0], [0, 0]] for i in range(8)] #---guiqwt related attributes: self.plot = None self.image = None self.ROI = None self.background = None self.levels = [] #--- self.setup_widget()
def __init__(self, parent=None): QWidget.__init__(self, parent) self.widget_layout = QVBoxLayout() title_layout = QHBoxLayout() title_layout.addStretch() style = "<span style=\'color: #444444\'><b>%s</b></span>" title = QLabel(style % "Operations") title_layout.addWidget(title) title_layout.addStretch() self.widget_layout.addLayout(title_layout) # Create ListWidget and add 10 items to move around. self.list_widget = QListWidget() # self.list_widget.setDragDropMode(QAbstractItemView.InternalMove) self.list_widget.setSelectionMode(QAbstractItemView.ExtendedSelection) self.list_widget.setSortingEnabled(False) self.list_widget.currentItemChanged.connect(self._populate_settings_update) self.widget_layout.addWidget(self.list_widget) otitle_layout = QHBoxLayout() otitle_layout.addStretch() otitle = QLabel(style % "Operation settings") otitle_layout.addWidget(otitle) otitle_layout.addStretch() self.widget_layout.addLayout(otitle_layout) self.operations_combo = QComboBox() self.operations_combo.currentIndexChanged.connect(self._populate_settings_add) self.widget_layout.addWidget(self.operations_combo) self.operation_settings = GenericOperationWidget() self.widget_layout.addWidget(self.operation_settings) self.toolbar = QToolBar() self.toolbar.addAction(get_icon('apply.png'), "Apply/Replace", self._change_operation) self.toolbar.addAction(get_icon('editors/edit_add.png'), "Add after", self._add_operation) self.toolbar.addAction(get_icon('trash.png'), "Remove", self._remove_operation) self.widget_layout.addWidget(self.toolbar) self.setLayout(self.widget_layout)
def __init__(self, parent=None, x=[], y=[], data=[]): QWidget.__init__(self, parent) if len(x) < 2: x = np.linspace(0, 1392, 1392) y = np.linspace(0, 1040, 1040) data = np.zeros((1040, 1392)) self.x = x self.y = y self.data = data layout = QGridLayout(self) ''' self.screen = ImageScreen(self,x,y,data,int(self.sizex*5.0/6.0),int(self.sizey*5.0/6.0)) self.cutX = CutScreen(self,sizex=int(self.sizex*5.0/6.0),sizey=int(self.sizey*1.0/6.0)) self.cutY = CutScreen(self,sizex=int(self.sizex*1.0/6.0),sizey=int(self.sizey*5.0/6.0)) ''' sx = 500 sy = int(sx / 1.338) a = 0.2 self.screen = ImageScreen(self, x, y, data, sizex=sx, sizey=sy) self.cutX = CutScreen(self, sizex=sx, sizey=int(a * sy)) self.cutY = CutScreen(self, sizex=int(a * sx), sizey=sy) layout.addWidget(self.screen, 1, 0) layout.addWidget(self.cutX, 0, 0) layout.addWidget(self.cutY, 1, 1) self.setLayout(layout) self.updateGeometry() self.manager = PlotManager(self) self.manager.add_plot(self.screen.plot) self.manager.add_plot(self.cutX.plot) self.manager.add_plot(self.cutY.plot) roi = RegionSelectTool self.tools = [ tools.SelectTool, tools.RectZoomTool, roi, tools.ColormapTool ] self.manager.register_all_curve_tools()
def __init__(self, parent): QWidget.__init__(self, parent) layout = QGridLayout() self.setLayout(layout) self.plot1 = ImagePlot(self) layout.addWidget(self.plot1, 0, 0, 1, 1) self.plot2 = ImagePlot(self) layout.addWidget(self.plot2, 1, 0, 1, 1) self.contrast = ContrastAdjustment(self) layout.addWidget(self.contrast, 2, 0, 1, 2) self.itemlist = PlotItemList(self) layout.addWidget(self.itemlist, 0, 1, 2, 1) self.manager = PlotManager(self) for plot in (self.plot1, self.plot2): self.manager.add_plot(plot) for panel in (self.itemlist, self.contrast): self.manager.add_panel(panel)
def __init__(self, parent): QWidget.__init__(self, parent) font = QFont(get_family(MONOSPACE), 10, QFont.Normal) info_icon = QLabel() icon = get_std_icon('MessageBoxInformation').pixmap(24, 24) info_icon.setPixmap(icon) info_icon.setFixedWidth(32) info_icon.setAlignment(Qt.AlignTop) self.desc_label = QLabel() self.desc_label.setWordWrap(True) self.desc_label.setAlignment(Qt.AlignTop) self.desc_label.setFont(font) group_desc = QGroupBox(_("Description"), self) layout = QHBoxLayout() layout.addWidget(info_icon) layout.addWidget(self.desc_label) group_desc.setLayout(layout) self.editor = CodeEditor(self) self.editor.setup_editor(linenumbers=True, font=font) self.editor.setReadOnly(True) group_code = QGroupBox(_("Source code"), self) layout = QVBoxLayout() layout.addWidget(self.editor) group_code.setLayout(layout) self.run_button = QPushButton(get_icon("apply.png"), _("Run this script"), self) self.quit_button = QPushButton(get_icon("exit.png"), _("Quit"), self) hlayout = QHBoxLayout() hlayout.addWidget(self.run_button) hlayout.addStretch() hlayout.addWidget(self.quit_button) vlayout = QVBoxLayout() vlayout.addWidget(group_desc) vlayout.addWidget(group_code) vlayout.addLayout(hlayout) self.setLayout(vlayout)
def __init__(self, parent): QWidget.__init__(self, parent) layout = QHBoxLayout() row_nb = 14 cindex = 0 for child in dir(QStyle): if child.startswith('SP_'): if cindex == 0: col_layout = QVBoxLayout() icon_layout = QHBoxLayout() icon = get_std_icon(child) label = QLabel() label.setPixmap(icon.pixmap(32, 32)) icon_layout.addWidget( label ) icon_layout.addWidget( QLineEdit(child.replace('SP_', '')) ) col_layout.addLayout(icon_layout) cindex = (cindex+1) % row_nb if cindex == 0: layout.addLayout(col_layout) self.setLayout(layout) self.setWindowTitle('Standard Platform Icons') self.setWindowIcon(get_std_icon('TitleBarMenuButton'))
def __init__(self, parent): QWidget.__init__(self, parent) layout = QHBoxLayout() row_nb = 14 cindex = 0 for child in dir(QStyle): if child.startswith('SP_'): if cindex == 0: col_layout = QVBoxLayout() icon_layout = QHBoxLayout() icon = get_std_icon(child) label = QLabel() label.setPixmap(icon.pixmap(32, 32)) icon_layout.addWidget(label) icon_layout.addWidget(QLineEdit(child.replace('SP_', ''))) col_layout.addLayout(icon_layout) cindex = (cindex + 1) % row_nb if cindex == 0: layout.addLayout(col_layout) self.setLayout(layout) self.setWindowTitle('Standard Platform Icons') self.setWindowIcon(get_std_icon('TitleBarMenuButton'))
def __init__(self): QWidget.__init__(self) self.setWindowTitle("Signal filtering (guiqwt)") self.setWindowIcon(get_icon('guiqwt.svg')) hlayout = QHBoxLayout() self.setLayout(hlayout)
def __init__(self, parent): if PYQT5: super(DockableWidget, self).__init__(parent, parent=parent) else: QWidget.__init__(self, parent) DockableWidgetMixin.__init__(self, parent)
def __init__(self, parent): QWidget.__init__(self, parent) DockableWidgetMixin.__init__(self, parent)
def __init__(self, parent): QWidget.__init__(self, parent) font = QFont(get_family(MONOSPACE), 10, QFont.Normal) info_icon = QLabel() icon = get_std_icon('MessageBoxInformation').pixmap(24, 24) info_icon.setPixmap(icon) info_icon.setFixedWidth(32) info_icon.setAlignment(Qt.AlignTop) self.service_status_label = QLabel() self.service_status_label.setWordWrap(True) self.service_status_label.setAlignment(Qt.AlignTop) self.service_status_label.setFont(font) self.desc_label = QLabel() self.desc_label.setWordWrap(True) self.desc_label.setAlignment(Qt.AlignTop) self.desc_label.setFont(font) self.group_desc = QGroupBox("Description", self) layout = QHBoxLayout() layout.addWidget(info_icon) layout.addWidget(self.desc_label) layout.addStretch() layout.addWidget(self.service_status_label) self.group_desc.setLayout(layout) self.editor = CodeEditor(self) self.editor.setup_editor(linenumbers=True, font=font) self.editor.setReadOnly(False) self.group_code = QGroupBox("Source code", self) layout = QVBoxLayout() layout.addWidget(self.editor) self.group_code.setLayout(layout) self.enable_button = QPushButton(get_icon("apply.png"), "Enable", self) self.save_button = QPushButton(get_icon("filesave.png"), "Save", self) self.disable_button = QPushButton(get_icon("delete.png"), "Disable", self) self.refresh_button = QPushButton(get_icon("restart.png"), "Refresh", self) hlayout = QHBoxLayout() hlayout.addWidget(self.save_button) hlayout.addWidget(self.enable_button) hlayout.addWidget(self.disable_button) hlayout.addWidget(self.refresh_button) vlayout = QVBoxLayout() vlayout.addWidget(self.group_desc) vlayout.addWidget(self.group_code) self.html_window = HTMLWindow() vlayout.addWidget(self.html_window) vlayout.addLayout(hlayout) self.setLayout(vlayout) self.current_file = None
def __init__(self, parent): QWidget.__init__(self, parent) font = QFont(get_family(MONOSPACE), 10, QFont.Normal) info_icon = QLabel() icon = get_std_icon('MessageBoxInformation').pixmap(24, 24) info_icon.setPixmap(icon) info_icon.setFixedWidth(32) info_icon.setAlignment(Qt.AlignTop) self.service_status_label = QLabel() self.service_status_label.setWordWrap(True) self.service_status_label.setAlignment(Qt.AlignTop) self.service_status_label.setFont(font) self.desc_label = QLabel() self.desc_label.setWordWrap(True) self.desc_label.setAlignment(Qt.AlignTop) self.desc_label.setFont(font) group_desc = QGroupBox("Description", self) layout = QHBoxLayout() layout.addWidget(info_icon) layout.addWidget(self.desc_label) layout.addStretch() layout.addWidget(self.service_status_label ) group_desc.setLayout(layout) self.editor = CodeEditor(self) self.editor.setup_editor(linenumbers=True, font=font) self.editor.setReadOnly(False) group_code = QGroupBox("Source code", self) layout = QVBoxLayout() layout.addWidget(self.editor) group_code.setLayout(layout) self.enable_button = QPushButton(get_icon("apply.png"), "Enable", self) self.save_button = QPushButton(get_icon("filesave.png"), "Save", self) self.edit_datadog_conf_button = QPushButton(get_icon("edit.png"), "Edit agent settings", self) self.disable_button = QPushButton(get_icon("delete.png"), "Disable", self) self.view_log_button = QPushButton(get_icon("txt.png"), "View log", self) self.menu_button = QPushButton(get_icon("settings.png"), "Manager", self) hlayout = QHBoxLayout() hlayout.addWidget(self.save_button) hlayout.addStretch() hlayout.addWidget(self.enable_button) hlayout.addStretch() hlayout.addWidget(self.disable_button) hlayout.addStretch() hlayout.addWidget(self.edit_datadog_conf_button) hlayout.addStretch() hlayout.addWidget(self.view_log_button) hlayout.addStretch() hlayout.addWidget(self.menu_button) vlayout = QVBoxLayout() vlayout.addWidget(group_desc) vlayout.addWidget(group_code) vlayout.addLayout(hlayout) self.setLayout(vlayout) self.current_file = None