예제 #1
0
 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))
예제 #2
0
 def warningbox(self,message):
     if message == 'KMS' :
         self.kmswarning = QtGui.QMessageBox()
         self.kmswarning.setIcon(QtGui.QMessageBox.Warning)
         self.kmswarning.setText('System has halted due to Kmirror E-Stop. Please standby for user reset...')
         self.kmswarning.setStandardButtons(QtGui.QMessageBox.Ok)
         self.kmswarning.setWindowTitle('KMirror System Emergency Stopped!')
         #self.kmswarning.buttonClicked.connect(self.on_warningbutton_clicked)
         self.kmswarning.exec_()
     elif message == 'tel' :
         self.telwarning = QtGui.QMessageBox()
         self.telwarning.setIcon(QtGui.QMessageBox.Warning)
         self.telwarning.setText('The telescope has unexpectedly halted normal operations. Software must be reset by user.')
         self.telwarning.setStandardButtons(QtGui.QMessageBox.Ok)
         self.telwarning.setWindowTitle('Telescope Emergency Stop')
         #self.telwarning.buttonClicked.connect(self.on_warningbutton_clicked)
         self.telwarning.exec_()
     elif message == 'hk' :
         self.hkwarning = QtGui.QMessageBox()
         self.hkwarning.setIcon(QtGui.QMessageBox.Warning)
         self.hkwarning.setText('Housekeeping as reported an error. No files are being created.')
         self.hkwarning.setStandardButtons(QtGui.QMessageBox.Ok)
         self.hkwarning.setWindowTitle('Housekeeping Error')
         #self.hkwarning.buttonClicked.connect(self.on_warningbutton_clicked)
         self.hkwarning.exec_()
예제 #3
0
    def initheatmap(self,z1):
        #casts z as array for creating heatmap
        # z1 = np.asarray(z1)
        #z2 = np.asarray(self.z2)
        #recasting data in z as integers
        # z1.astype(int)
        #z2.astype(int)

        self.heatmapplot = pg.PlotItem()
        self.heatmapplot.setLabel('bottom', 'Row')
        self.heatmapplot.setLabel('left', 'Channel')
        self.heatmapplot.setTitle('MCE RMS Channel Noise')

        self.heatmap = pg.ImageView(view= self.heatmapplot)
        self.heatmap.setPredefinedGradient('thermal')
        self.heatmap.autoLevels()
        self.heatmap.setImage(z1)

        #changes levels for heatmap to create gradient at depending on the data rate
        self.avggrad = int(np.average(z1))
        self.stddevgrad = int(np.std(z1))
        # self.heatmap.setLevels(self.avggrad - (3 * self.stddevgrad), self.avggrad + (3 * self.stddevgrad))
        # self.grid.addWidget(self.heatmap, 3, 2, 2, 3)

        # create new window for hk and fft data
        self.heatmapwindow = QtGui.QWidget()
        self.heatmapwindow.setWindowTitle('MCE RMS Noise Map')
        self.heatgrid = QtGui.QGridLayout()
        self.heatgrid.addWidget(self.heatmap, 3, 2, 2, 3)
        self.heatmapwindow.setGeometry(10, 10, 1920, 1080)
        self.heatmapwindow.setLayout(self.heatgrid)
        self.heatmapwindow.show()
예제 #4
0
    def generatePicture(self):

        self.picture = QtGui.QPicture()
        p = QtGui.QPainter(self.picture)
        p.setPen(pg.mkPen('w'))
        p = self._generate(p)
        p.end()
예제 #5
0
파일: qt.py 프로젝트: bigdig/chanlun-1
    def generatePicture(self):
        # pre-computing a QPicture object allows paint() to run much more quickly,
        # rather than re-drawing the shapes every time.
        self.picture = QtGui.QPicture()
        p = QtGui.QPainter(self.picture)

        for bi in self.data:
            if bi.biType == 'up':
                p.setPen(pg.mkPen('r'))
                p.drawLine(
                    QtCore.QPointF(
                        chan.chanBars[bi.barIndex1].closeIndex,
                        chan.lowBar[chan.chanBars[bi.barIndex1].closeIndex]),
                    QtCore.QPointF(
                        chan.chanBars[bi.barIndex2].closeIndex,
                        chan.highBar[chan.chanBars[bi.barIndex2].closeIndex]))
            else:
                p.setPen(pg.mkPen('g'))
                p.drawLine(
                    QtCore.QPointF(
                        chan.chanBars[bi.barIndex1].closeIndex,
                        chan.highBar[chan.chanBars[bi.barIndex1].closeIndex]),
                    QtCore.QPointF(
                        chan.chanBars[bi.barIndex2].closeIndex,
                        chan.lowBar[chan.chanBars[bi.barIndex2].closeIndex]))
        p.end()
예제 #6
0
파일: threshold.py 프로젝트: tones9/OpenNFB
    def paintEvent(self, event):
        painter = QtGui.QPainter(self)

        width = self.width()
        height = self.height()

        top, bottom = height * .1, height * .8
        left, right = width * .1, width * .8

        rect = QtCore.QRect(left, top, right, bottom)
        painter.fillRect(rect, QtGui.QColor('black'))

        #painter.setWindow(rect)

        dist = bottom - top

        relval = self.threshold.signal.buffer[-1] / self.MAX
        relval = min(1.0, relval)

        reltop = (1.0 - relval) * bottom + top
        relbottom = height * 0.9 - reltop

        rect = QtCore.QRect(left, reltop, right, relbottom)

        color = QtGui.QColor(
            'green' if self.threshold.passfail.buffer[-1] else 'red')
        painter.fillRect(rect, color)

        thr_height = self.threshold.threshold / self.MAX

        thr_top = (1.0 - thr_height) * bottom + top

        rect = QtCore.QRect(left, thr_top, right, 2)
        painter.fillRect(rect, QtGui.QColor('white'))
예제 #7
0
 def generatePicture(self):
     ## pre-computing a QPicture object allows paint() to run much more quickly, 
     ## rather than re-drawing the shapes every time.
     global last_pf
     self.picture = QtGui.QPicture()
     p = QtGui.QPainter(self.picture)
     w = 1.0/3 #(self.data[1][0] - self.data[0][0]) / 3. 
     #last_pf = self.data[0][2]
     first = True
     for (t, open, close, min, max, pf) in self.data:
         if open > close:
             #p.setBrush(pg.mkBrush('g'))
             p.setPen(pg.mkPen('g'))
         elif open < close:
             #p.setBrush(pg.mkBrush('r'))
             p.setPen(pg.mkPen('r'))
         else:
             p.setPen(pg.mkPen('w'))
         if min < max:
             p.drawLine(QtCore.QPointF(t, min), QtCore.QPointF(t, max))
         p.drawRect(QtCore.QRectF(t-w, open, w*2, close-open))
         p.setPen(pg.mkPen('y', width=1.5, style=QtCore.Qt.DashLine))
         if not first:
             p.drawLine(QtCore.QPointF(t-1, last_pf), QtCore.QPointF(t, pf))
         first = False
         last_pf = pf
     p.end()
예제 #8
0
    def addVisItem(self, name, visitem):
        print "[detector display] received visitem=", name
        self.user_items[name] = visitem
        self.user_item_checkboxes[name] = QtGui.QCheckBox('')
        self.map_user_checkboxes2name[self.user_item_checkboxes[name]] = name
        self.user_item_checkboxes[name].setChecked(True)
        # connect to signal
        # multiple sub-objects!
        if type(visitem) is list:
            self.user_subitem_cbxs[name] = []
            for ix, subitem in enumerate(visitem):
                self.user_subitem_cbxs[name].append(QtGui.QCheckBox(''))
                self.user_subitem_cbxs[name][ix].setChecked(True)

        # make tree widget item
        item = pg.TreeWidgetItem(['', name])
        item.setWidget(0, self.user_item_checkboxes[name])
        self.user_item_tree.addTopLevelItem(item)

        if type(visitem) is list:
            for ix in range(0, len(visitem)):
                subitem = visitem[ix]
                if hasattr(subitem, "uservisname"):
                    subname = subitem.uservisname + "_%d" % (ix)
                else:
                    subname = name + "_%d" % (ix)
                subitem = pg.TreeWidgetItem([subname])
                item.addChild(subitem)
                self.user_item_tree.setItemWidget(
                    subitem, 1, self.user_subitem_cbxs[name][ix])
예제 #9
0
 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)
예제 #10
0
파일: scatt_test2.py 프로젝트: sebajor/ccat
 def plot_data(self, *args):
     #ipdb.set_trace()
     color_pts = self.colormap.map(args[0][1])
     brush = [QtGui.QBrush(QtGui.QColor(*color_pts))]
     self.scatter.addPoints(x=[args[0][0][0]],
                            y=[args[0][0][1]],
                            brush=brush)
예제 #11
0
 def generatePicture(self):
     self.picture = QtGui.QPicture()
     painter = QtGui.QPainter(self.picture)
     painter.setFont(QtGui.QFont('times', 50))
     painter.scale(1, -1)
     paint_discovered(painter, distances=self.distances, walls=self.walls)
     painter.end()
예제 #12
0
    def init_gui(self):
        """
        General GUI setup, if it was more complex we might want to use a
        ui file built in Qt Creator.
        """

        # Create a vbox to hold the text box and both charts
        vbox = QtGui.QVBoxLayout()

        # The hbox will keep the charts side by side.
        hbox = QtGui.QHBoxLayout()

        # Create a text box and connect the changed signal to a slot
        # it would be trivial to add a 'browse' dialog, but not required for
        # a demo
        self.txt_file_path = pg.QtGui.QLineEdit()
        self.txt_file_path.textChanged[str].connect(self.set_file_path)

        # Chart specific setup
        self.setup_time_series_charts()
        self.setup_histogram_chart()

        # Build up the GUI
        vbox.addWidget(self.txt_file_path)
        hbox.addWidget(self.time_series_widget)
        hbox.addWidget(self.histogram_widget)

        vbox.addLayout(hbox)

        self.central_widget = QtGui.QWidget(self)
        self.setCentralWidget(self.central_widget)
        self.central_widget.setLayout(vbox)

        return None
예제 #13
0
 def generatePicture(self):
     self.picture = QtGui.QPicture()
     p = QtGui.QPainter(self.picture)
     p.setPen(pg.mkPen('w', width=1 / 2.))
     for (t, v) in self.data:
         p.drawLine(QtCore.QPointF(t, v - 2), QtCore.QPointF(t, v + 2))
     p.end()
예제 #14
0
    def __init__(self, *args, **kwargs):
        """
        Parameters
        ----------
        parent : QObject
        """
        super(ReconstructedHologramViewer, self).__init__(*args, **kwargs)

        self.amplitude_viewer = pg.ImageView(parent=self,
                                             name='Reconstructed amplitude')
        self.phase_viewer = pg.ImageView(parent=self,
                                         name='Reconstructed phase')
        self.fourier_mask_viewer = pg.ImageView(
            parent=self, name='Reconstruction Fourier mask')

        self.tabs = QtGui.QTabWidget()
        self.tabs.addTab(self.amplitude_viewer, 'Amplitude')
        self.tabs.addTab(self.phase_viewer, 'Phase')
        self.tabs.addTab(self.fourier_mask_viewer, 'Fourier mask')

        self.layout = QtGui.QVBoxLayout()
        self.layout.addWidget(self.tabs)
        self.setLayout(self.layout)

        # Set to maximal size, since this is the star of the show
        self.resize(self.maximumSize())
예제 #15
0
    def __init__(self, num_processes, ip, port, ifc):
        super().__init__()
        self.setWindowTitle("CUWB Monitor - Network Discovery")
        self.central = QtGui.QWidget()
        self.central.setSizePolicy(QtGui.QSizePolicy.Minimum,
                                   QtGui.QSizePolicy.Minimum)
        self.central_layout = QtGui.QVBoxLayout()
        self.central.setLayout(self.central_layout)
        self.setCentralWidget(self.central)

        self.network_discovery = CuwbNetworkInformationReceiver()
        # Save available networks to check if there are changes
        # when trying to refresh the list
        self.previous_cuwb_nets = set(
            self.network_discovery.available_networks.values())
        self.num_processes = num_processes
        self.stream_idx = 0
        # All CDP StreamInformation objects indexed by self.stream_idx
        self.cdp_streams = dict()
        # All QCheckBoxes for each CDP StreamInformation objects indexed by self.stream_idx
        self.stream_checkboxes = dict()
        # Addresses (ListeningAddrInfo objects) that we are currently listening on
        self.active_addresses = set()
        self.active_any_interface_streams = set()
        # All SocketProcessing and CdpProcess threads indexed by ListeningAddrInfo objects,
        # the values are lists of threads
        self.rx_threads = dict()

        # Add new connection if command line arguments were provided
        if (ip is not None) or (port is not None) or (ifc is not None):
            self.add_manual_connection(ip, port, ifc)

        self.display_cuwb_networks()
        self.timer = self.startTimer(1000)
예제 #16
0
    def getPath(self):
        if self.path is None:
            if self.data is None or len(self.data) < 2:
                self.path = [QtGui.QPainterPath(), QtGui.QPainterPath()]
            else:
                redBars = QtGui.QPainterPath()
                greenBars = QtGui.QPainterPath()

                self.step = self.data[1][0] - self.data[0][0]
                w = self.step / 3.0
                for data in self.data:
                    if not np.isnan(data).any():
                        t, o, h, l, c = data
                        if o > c:
                            redBars.moveTo(QtCore.QPointF(t, l))
                            redBars.lineTo(QtCore.QPointF(t, h))
                            redBars.addRect(
                                QtCore.QRectF(t - w, o, w * 2, c - o))
                        else:
                            greenBars.moveTo(QtCore.QPointF(t, l))
                            greenBars.lineTo(QtCore.QPointF(t, h))
                            greenBars.addRect(
                                QtCore.QRectF(t - w, o, w * 2, c - o))

                self.path = [redBars, greenBars]

        return self.path
예제 #17
0
    def generatePicture(self):
        ## pre-computing a QPicture object allows paint() to run much more quickly,
        ## rather than re-drawing the shapes every time.
        self.picture = QtGui.QPicture()
        p = QtGui.QPainter(self.picture)
        p.setPen(pg.mkPen('w'))
        # w = (self.data[1][0] - self.data[0][0]) / 3.
        x = self.xdat[:5]
        y = self.ydat[:5]

        self.path = pg.arrayToQPath(self.xdat, self.ydat, self.connect)
        # self.path = pg.arrayToQPath(np.array([0, 1, 1, 0, 3, 1]), np.array([0, 0, 1, 1, 3, 1]))
        p2 = QtGui.QPainterPath(self.path)
        p.fillPath(p2, pg.mkBrush((100, 100, 100)))
        # for (t, open, close, min, max) in self.data:
        #     p.drawLine(QtCore.QPointF(t, min), QtCore.QPointF(t, max))
        #     self.path = pg.arrayToQPath(np.array([0, 1, 2, 1]), np.array([0, 0, 1, 1]))
        #     # self.path = self.generatePath([0, 1, 2, 1], [0, 0, 1, 1])
        #     p2 = QtGui.QPainterPath(self.path)
        #     p.fillPath(p2, pg.mkBrush((100, 100, 100)))
        #     if open > close:
        #         p.setBrush(pg.mkBrush('r'))
        #     else:
        #         p.setBrush(pg.mkBrush('g'))
        #     p.drawRect(QtCore.QRectF(t - w, open, w * 2, close - open))
        # p.drawPolygon(QtCore.)
        # p.drawLine(QtCore.QPointF(*pts[i][0]), QtCore.QPointF(*pts[i][1]))
        p.end()
예제 #18
0
 def createWidgets(self):
     """
     Create some widgets to be placed inside
     """        
     self.btn = QtGui.QPushButton('press me')
     self.text = QtGui.QLineEdit('enter text')
     self.listw = QtGui.QListWidget()
     self.plot = pg.PlotWidget()
예제 #19
0
    def __init__(self, cg):
        super(WatchlistWindow, self).__init__()

        self.cg = cg
        self.ui = watchlist_ui.Ui_WatchlistWindow()
        self.ui.setupUi(self)

        for c, col in enumerate(WatchlistModel.columns + WatchlistModel.multiColumns):
            checkbox = QtGui.QCheckBox(col)
            checkbox.clicked.connect(self.onSelectColumns)
            self.ui.showColumns.layout().addWidget(checkbox)
            setattr(self.ui, col + '_checkbox', checkbox)# for guiSave()

        self.sortedMarkets = []
        self.sortColumns = {}
        self.recalcSortKeys = False
        self.selectedMarket = None
        self.ui.tableView.setAlternatingRowColors(True)
        header = self.ui.tableView.horizontalHeader()
        header.sectionClicked.connect(self.onHeaderSectionClicked)
        header.setResizeMode(QtGui.QHeaderView.Stretch)

        self.ui.tableView.mouseMoveEvent = self.listMouseMoveEvent
        self.ui.tableView.setMouseTracking(True)

        for i in range(len(ALL_TIMEFRAMES)):
            self.ui.showCharts.addItem(', '.join(ALL_TIMEFRAMES[:i+1]))
        for i in range(-len(ALL_TIMEFRAMES)+1, 0):
            self.ui.showCharts.addItem(', '.join(ALL_TIMEFRAMES[i:]))

        self.loadWatchlists()

        firstOne = None
        for name,watchlist in sorted(self.watchlists.items()):
            item = name
            if len(watchlist):
                item += ' (%i)' % len(watchlist)
            firstOne = item if name == 'Builtin' else firstOne
            self.ui.watchlistName.addItem(item)

        guiRestore(self.ui, gSettings)

        # Set the default selected item
        #self.ui.watchlistName.setCurrentIndex(self.ui.watchlistName.findText(firstOne))

        self.procRefresh = None
        self.ui.watchlistName.currentIndexChanged.connect(self.onWatchlistSelected)
        def onFilter():
            self.ui.filterEdit.setFocus()
            self.ui.filterEdit.selectAll()
        QtGui.QShortcut(QtGui.QKeySequence('Ctrl+F'), self, onFilter)
        self.ui.filterEdit.textChanged.connect(self.onSelectColumns)

        self.model = WatchlistModel(self)
        self.ui.tableView.setModel(self.model)
        selectionModel = self.ui.tableView.selectionModel()
        selectionModel.selectionChanged.connect(self.listSelectionChanged)
예제 #20
0
        def __init__(self, parent=None, language='Python'):
            super(Editor, self).__init__(parent)
            self.setIndentationsUseTabs(False)
            self.setIndentationWidth(4)

            # Set the default font
            font = QtGui.QFont()
            font.setFamily('DejaVu Sans Mono')
            font.setFixedPitch(True)
            font.setPointSize(10)
            self.setFont(font)
            self.setMarginsFont(font)
            self.zoomIn()

            # Margin 0 is used for line numbers
            fontmetrics = QtGui.QFontMetrics(font)
            self.setMarginsFont(font)
            self.setMarginWidth(0, fontmetrics.width("000") + 6)
            self.setMarginLineNumbers(0, True)
            self.setMarginsBackgroundColor(QtGui.QColor("#cccccc"))

            self._marker = None
            # Clickable margin 1 for showing markers
            #self.setMarginSensitivity(1, True)
            #self.connect(self,
            #    SIGNAL('marginClicked(int, int, Qt::KeyboardModifiers)'),
            #    self.on_margin_clicked)
            self.markerDefine(QsciScintilla.RightArrow, self.ARROW_MARKER_NUM)
            self.setMarkerBackgroundColor(QtGui.QColor("#ee1111"),
                                          self.ARROW_MARKER_NUM)

            # Brace matching: enable for a brace immediately before or after
            # the current position
            #
            self.setBraceMatching(QsciScintilla.SloppyBraceMatch)

            # Current line visible with special background color
            self.setCaretLineVisible(True)
            self.setCaretLineBackgroundColor(QtGui.QColor("#ffe4e4"))

            # Set Python lexer
            # Set style for Python comments (style number 1) to a fixed-width
            # courier.
            #
            lexer = getattr(Qsci, 'QsciLexer' + language)()
            lexer.setDefaultFont(font)
            self.setLexer(lexer)
            self.SendScintilla(QsciScintilla.SCI_STYLESETFONT, 1, b'Courier')

            # Don't want to see the horizontal scrollbar at all
            # Use raw message to Scintilla here (all messages are documented
            # here: http://www.scintilla.org/ScintillaDoc.html)
            self.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0)

            self.setWrapMode(QsciScintilla.WrapWord)

            self.setEolMode(QsciScintilla.EolUnix)
예제 #21
0
 def _construct_tabs(self):
     """
     Constructs Qt.Gui.QWidgets (tabs)
     places widgets in corresponding tabs
     :return:
     """
     modelTab = QtGui.QWidget()
     self.modelTabLayout = QtGui.QGridLayout(modelTab)
     self.tabsWidget.addTab(modelTab, "Model")
예제 #22
0
 def __init__(self, datasrc):
     super().__init__()
     self.datasrc = datasrc
     self.picture = QtGui.QPicture()
     self.painter = QtGui.QPainter()
     self.dirty = True
     # generate picture
     visibleRect = QtCore.QRectF(self.datasrc.init_x0, 0, self.datasrc.init_x1-self.datasrc.init_x0, 0)
     self._generate_picture(visibleRect)
예제 #23
0
 def plot_data(self, *args):
     #ipdb.set_trace()
     color_pts = self.colormap.map(args[0][1][0])
     brush = QtGui.QBrush(QtGui.QColor(*color_pts))
     self.brushes[args[0][1][1] % self.n_points] = brush
     self.pos[args[0][1][1] % self.n_points, 0] = args[0][0][0]
     self.pos[args[0][1][1] % self.n_points, 1] = args[0][0][1]
     #self.scatter.addPoints(x=self.x_pos, y=self.y_pos, brush=self.brushes)
     self.scatter.setData(pos=self.pos, brush=self.brushes)
예제 #24
0
 def update_picture(self):
     self._picture = QtGui.QPicture()
     pen = QtGui.QPainter(self._picture)
     pen.setPen(pg.mkPen(self._border_color))
     pen.setBrush(pg.mkBrush(self._color_bar))
     width = 1 / 3.
     for ind, bar in enumerate(self._data):
         pen.drawRect(QtCore.QRectF(ind - width, 0, width * 2, bar[0]))
     pen.end()
     self.update()
 def _get_line_chart(self):
     """Return QPicture() with line chart by self._data"""
     picture = QtGui.QPicture()
     pen = QtGui.QPainter(picture)
     pen.setPen(pg.mkPen(self.border_color))
     for ind in range(0, len(self._data) - 1):
         pen.drawLine(QtCore.QPointF(ind, self._data[ind][3]),
                      QtCore.QPointF(ind + 1, self._data[ind + 1][3]))
     pen.end()
     return picture
예제 #26
0
    def set_up_tabs(self):
        """Initiate two tabs for UI"""
        _2D_maps_tab = QtGui.QWidget()
        _3D_maps_tab = QtGui.QWidget()

        self._2D_maps_tab_placement = QtGui.QGridLayout(_2D_maps_tab)
        self._3D_maps_tab_placement = QtGui.QGridLayout(_3D_maps_tab)

        self.tab_widget.addTab(_2D_maps_tab, "2D Maps")
        self.tab_widget.addTab(_3D_maps_tab, "3D Maps")
예제 #27
0
    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
예제 #28
0
    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)
예제 #29
0
 def generatePicture(self):
     # pre-computing a QPicture object allows paint() to run much more quickly,
     # rather than re-drawing the shapes every time.
     self.picture = QtGui.QPicture()
     p = QtGui.QPainter(self.picture)
     p.setPen(pg.mkPen('w',width=15))
     p.setPen(pg.mkColor("#FF0000"))
     p.setBrush(pg.mkBrush(None))
     for i in self.data:
         p.drawPoint(i, chan.closeBar[i])
     p.end()
예제 #30
0
    def generatePicture(self):
        """generatePicture(self) -> None

        generate items for box plot
        """
        self.picture = QtGui.QPicture()
        self.p = QtGui.QPainter(self.picture)
        self.p.setPen(pg.mkPen('#FFFFFF'))
        for row in self.data:
            self.draw(row)
        self.p.end()
예제 #31
0
파일: QNImage.py 프로젝트: davtoh/RRtools
 def makeIm():
     spectroWidth=1000
     spectroHeight=1000
     a= np.random.random(spectroHeight * spectroWidth) * 255
     a=np.reshape(a, (spectroHeight, spectroWidth))
     a=np.require(a, np.uint8, 'C')
     COLORTABLE=[]
     for i in range(256): COLORTABLE.append(QtGui.qRgb(old_div(i,4),i,old_div(i,2)))
     a=np.roll(a, -5)
     QI = QtGui.QImage(a.data, spectroWidth, spectroHeight, QtGui.QImage.Format_Indexed8)
     QI.setColorTable(COLORTABLE)
     return QI
예제 #32
0
	def init(self, name):
		self.FS = 250
		self.name=name

		epoch_samples = int(self.FS * self.epoch)

		self.signal = Signal(buffer_size=epoch_samples)
		self.passfail = Signal()

		self.threshold = 1.0
		self.high_threshold = 0.0

		self.calc_cnt = 0

		self.bar = QtGui.QProgressBar(orientation=QtCore.Qt.Vertical)
		self.slider = QtGui.QSlider()

		self.slider.setRange(0, 17)
		self.bar.setRange(0, 17)

		self.pass_palette = self.bar.palette()

		if isinstance(self.input.color, QtGui.QColor):
			self.color = self.input.color
		else:
			self.color = QtGui.QColor(QtGui.qRgb(*self.input.color))


		self.bar.setStyleSheet("""
			QProgressBar::chunk { background: red; }
			QProgressBar::chunk[pass='******'] { background: %s ; }
			""" % self.color.name())


		self.button = QtGui.QPushButton("config")
		self.button.clicked.connect(self.configure_traits)