• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python pyqtgraph.mkQApp函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyqtgraph.mkQApp函数的典型用法代码示例。如果您正苦于以下问题:Python mkQApp函数的具体用法?Python mkQApp怎么用?Python mkQApp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了mkQApp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: show

 def show(self):
     if self._view is None:
         pg.mkQApp()
         self._view_widget = pg.GraphicsLayoutWidget()
         self._view = self._view_widget.addViewBox(0, 0)
         v = self._view
         cell_ids = sorted(self.cells.keys())
         pos = np.array([self.cells[i].position[:2] for i in cell_ids])
         if len(self.connections) == 0:
             adj = np.empty((0,2), dtype='int')
         else:
             adj = np.array(self.connections) - 1
         colors = []
         for cid in cell_ids:
             cell = self.cells[cid]
             color = [0, 0, 0]
             for i,cre in enumerate(self.cre_types):
                 if cell.labels[cre] == '+':
                     color[i] = 255
             colors.append(color)
         brushes = [pg.mkBrush(c) for c in colors]
         print(pos)
         print(adj)
         print(colors)
         self._graph = pg.GraphItem(pos=pos, adj=adj, size=30, symbolBrush=brushes)
         v.addItem(self._graph)
     self._view_widget.show()
开发者ID:corinneteeter,项目名称:multipatch_analysis,代码行数:27,代码来源:experiment.py


示例2: figure

def figure(title = None, background='w'):
    if background == 'w':
        pg.setConfigOption('background', 'w')  # set background to white
        pg.setConfigOption('foreground', 'k')
    pg.mkQApp()
    win = pg.GraphicsWindow(title=title)
    return win
开发者ID:pbmanis,项目名称:pylibrary,代码行数:7,代码来源:pyqtgraphPlotHelpers.py


示例3: main

def main(modelFile=None, weightsFile=None, solverFile=None, filePath=None):
    pg.mkQApp()

    win = MainView(modelFile=modelFile, weightsFile=weightsFile, solverFile=solverFile, directory=filePath)
    win.show()

    if (sys.flags.interactive != 1) or not hasattr(QtCore, "PYQT_VERSION"):
        QtGui.QApplication.instance().exec_()
开发者ID:elleryrussell,项目名称:caffeViz,代码行数:8,代码来源:MainView.py


示例4: affichage

def affichage(name, shareddic):
    """ Ploting and Display """
    pg.mkQApp()
    pg.setConfigOptions(antialias=True)  ## this will be expensive for the local plot
    force = pg.SpinBox(value=0, int=True, minStep=1, step=10, bounds=(-128, 128))#QtGui.QLineEdit()
    phase = pg.SpinBox(value=1, minStep=0.1, step=0.1, bounds=(0, 2))#QtGui.QLineEdit()
    freq = pg.SpinBox(value=55, minStep=1, step=1, dec=True, bounds=(0, 900))#QtGui.QLineEdit()
    label = QtGui.QLabel()
    #self.data = data
    #self.fps = fps
    labelf = QtGui.QLabel()
    labelf.setText('Force')
    labelp = QtGui.QLabel()
    labelp.setText('Phase')
    labelfr = QtGui.QLabel()
    labelfr.setText('Frequence')
    lcheck = QtGui.QCheckBox('plot local')
    lcheck.setChecked(True)
    lplt = pg.PlotWidget()
    lplt.setYRange(-45, 45)
    lplt.setTitle('Position')
    fplt = pg.PlotWidget()
    fplt.setYRange(-150, 150)
    fplt.setTitle('Forces')
    fplt.getAxis('bottom').setScale(1.0/RESANG)
    layout = pg.LayoutWidget()
    layout.addWidget(labelf)
    layout.addWidget(labelp)
    layout.addWidget(labelfr)
    layout.addWidget(force, row=2, col=0)
    layout.addWidget(phase, row=2, col=1)
    layout.addWidget(freq, row=2, col=2)
    layout.addWidget(lcheck, row=3, col=0)
    layout.addWidget(label, row=3, col=1)
    layout.addWidget(lplt, row=4, col=0, colspan=3)
    layout.addWidget(fplt, row=5, col=0, colspan=3)
    layout.resize(800, 800)
    layout.setWindowTitle('Timon 12: Demo')
    layout.show()
    def update(shareddic):
        """ Every refresh of the display """
        localdata = [0]*1000
        taille = 0#shareddic['taille']
        localdata = shareddic['data']
        localvitesse = shareddic['vitesse']
        lplt.plot(localdata, clear=True)
        lplt.plot(localvitesse, pen=(0, 0, 255))
        fps = shareddic['fps']
        label.setText("Communication %0.2f Hz Taille buffer: %0.2f" % (fps, taille/3.0))
        force = shareddic['force']
        degre = shareddic['degre']
        forcenow = shareddic['forcenow']
        fplt.plot(range(-ANGLEMAX*RESANG, ANGLEMAX*RESANG), force, clear=True)
        fplt.plot([degre*RESANG], [forcenow], pen=(0, 0, 255), symbolBrush=(255, 0, 0), symbolPen='r')
    timer = QtCore.QTimer()
    timer.timeout.connect(lambda: update(shareddic))
    timer.start(50)
    QtGui.QApplication.instance().exec_()
开发者ID:Leicas,项目名称:Haptic-Simulation,代码行数:58,代码来源:haptic.py


示例5: __init__

 def __init__(self, ui, view, parent=None):
   logger.debug('  ImageDisplay::__init__(%s)' % view)
   pg.mkQApp()
   self.COMData = None
   self.CCOMData = None
   self.cData = None
   self.imgData = None
   self.isocurve = 0
   self.overlays = {}
   self.vblist = []
   self.itemList = {
     'COM':[None, True], 
     'Movement':[None, True], 
     'Spiral':[None, True], 
     'spots':[None, True], 
     'TRACK':[None, True], 
     'MASK':[None, True], 
     'CALIBA':[None, True], 
     'CALIBB':[None, True], 
     'ROTATE':[None, True], 
     'INSIDE':[None, True],
     'ISOCURVE':[None, True],
     'SPLOT':[None, False]
     }
   self.overlayDict = dict(COM=None, TRACK=None, MASK=None, CALIBA=None, CALIBB=None, ROTATE=None, SIZE=None)
   self.vb = pg.ViewBox(enableMenu=False)
   self.vb.setAspectLocked()
   self.img = pg.ImageItem()
   #self.img = pg.ImageView()
   self.rotImg = None
   self.rotROI = None
   #self.addDisplayItem('IMG', self.img)
   self.vb.addItem(self.img)
   self.sp = pg.ScatterPlotItem()
   self.addDisplayItem('SPLOT', self.sp)
   self.hist = None
   if view != "Dummy":
     getattr(ui, view).setCentralItem(self.vb)
     #getattr(ui, view).setCentralItem(self.img)
   self.isRendered = False
   self.enabledOverlays = {}
   self.validOverlays = {}
   self.showCOMOverlay = False
   self.mousePos = (0, 0)
   self.saveMouseFlag = False
   #self.maskROI = None
   #self.trackingROI = None
   #self.calibROIa = None
   #self.calibROIb = None
   #print (self.vb.allChildren())
   #pl = self.ui.graphicsView.addPlot()
   #proxy = pg.SignalProxy(pl.scene().sigMouseMoved, rateLimit=60, slot=self.mouseMoved)
   if view != "Dummy":
     self.vb.scene().sigMouseMoved.connect(self.mouseMoved)
开发者ID:pearsomark,项目名称:CiliaC,代码行数:54,代码来源:cdisplay.py


示例6: __init__

  def __init__(self, points, title = None):
    pg.mkQApp();
    self.w = gl.GLViewWidget()
    self.w.opts['distance'] = 20
    self.w.show()
    self.w.setWindowTitle(title)

    self.g = gl.GLGridItem()
    self.w.addItem(self.g)
    self.sp = gl.GLScatterPlotItem(pos=points, color=(1,1,1,1), pxMode= True)
    self.w.addItem(self.sp);
开发者ID:ChristophKirst,项目名称:CElegansBehaviour,代码行数:11,代码来源:plot.py


示例7: testRun

 def testRun(self, title='testing...', initfile=None):
     if initfile is None:
         raise ValueError('generate_run:testRun needs initfile name')
     self._prepareRun(inj=0.0)
     self.run_initialized = cellInit.init_model(self.cell, filename=initfile, restore_from_file=True)
     self.hf.h.t = 0.
     self.hf.h.tstop = 10
     #self.hf.h.run()
     self._executeRun(testPlot=True)
     pg.mkQApp()
     pl = pg.plot(np.array(self.monitor['time']), np.array(self.monitor['postsynapticV']))
     pl.setTitle(title)
     QtGui.QApplication.instance().exec_()
开发者ID:pbmanis,项目名称:VCNModel,代码行数:13,代码来源:generate_run.py


示例8: __init__

    def __init__(self, func):

        self.func = func
    
        app = pg.mkQApp()
        self.win = pg.GraphicsWindow(title="Bar learning")
        self.win.resize(800,800)
        self.win.addLabel("Input")
        self.win.addLabel("Feature")
        self.win.nextRow()
        
        box = self.win.addViewBox(lockAspect=True)
        self.input_vis = pg.ImageItem()
        box.addItem(self.input_vis)
        
        box = self.win.addViewBox(lockAspect=True)
        self.feature_vis = pg.ImageItem()
        box.addItem(self.feature_vis)
        self.win.nextRow()
        
        self.win.addLabel("Receptive fields", colspan=2)
        self.win.nextRow()
        box = self.win.addViewBox(lockAspect=True, colspan=2)
        self.rv_vis = pg.ImageItem()
        box.addItem(self.rv_vis)
        
        self.win.show()
开发者ID:ANNarchy,项目名称:ANNarchy,代码行数:27,代码来源:Viz.py


示例9: test_stream_between_local_nodes

def test_stream_between_local_nodes():
    # create local nodes in QApplication
    app = pg.mkQApp()

    sender = FakeSender()
    stream_spec = dict(protocol = 'tcp', interface = '127.0.0.1', port = '*',
                        transfertmode = 'plaindata', streamtype = 'analogsignal',
                        dtype = 'float32', shape = (-1, 16), compression ='',
                        scale = None, offset = None, units = '' )
    sender.configure(sample_interval = 0.001)
    sender.outputs['signals'].configure(**stream_spec)
    #sender.output.configure(**stream_spec)
    sender.initialize()
    
    receiver = FakeReceiver()
    receiver.configure()
    receiver.inputs['signals'].connect(sender.outputs['signals'])
    #receiver.input.connect(sender.output)
    receiver.initialize()
    
    # start them for a while
    sender.start()
    receiver.start()
    
    def terminate():
        sender.stop()
        receiver.stop()
        app.quit()
        
    timer = QtCore.QTimer(singleShot = True, interval = 3000)
    timer.timeout.connect(terminate)
    timer.start()
    
    app.exec_()
开发者ID:anatoleotman,项目名称:pyacq,代码行数:34,代码来源:test_node.py


示例10: test_ThreadPollInput

def test_ThreadPollInput():
    app = pg.mkQApp()
    
    outstream = OutputStream()
    outstream.configure(**stream_spec)
    instream = InputStream()
    instream.connect(outstream)
    
    sender = ThreadSender(output_stream=outstream)
    poller = ThreadPollInput(input_stream=instream, return_data=True)
    
    
    global last_pos
    last_pos= 0
    def on_new_data(pos, arr):
        assert arr.shape==(chunksize, nb_channel)
        global last_pos
        last_pos += chunksize
        assert last_pos==pos
    
    def terminate():
        sender.wait()
        poller.stop()
        poller.wait()
        app.quit()
    
    sender.finished.connect(terminate)
    poller.new_data.connect(on_new_data)
    
    poller.start()
    sender.start()
    
    app.exec_()
开发者ID:pyacq,项目名称:pyacq,代码行数:33,代码来源:test_tools.py


示例11: __init__

 def __init__(self, hoc, camerapos=[200., 45., 45.],):
     if not isinstance(hoc, HocReader):
         hoc = HocReader(hoc)
     self.hr = hoc
     self.graphics = []
     self.video_file = None
     pg.mkQApp()  # make sure there is a QApplication before instantiating any QWidgets.
     super(HocViewer, self).__init__()
     self.resize(720,720)
     # self.setBackgroundColor(pg.glColor(pg.mkColor(255, 255, 255, 255)))
     # self.setBackgroundColor(pg.glColor(pg.mkColor(0, 0, 0, 0)))
     # color='w'
     # self.setBackgroundColor(color)
     self.show()
     self.setWindowTitle('hocViewer')
     self.setCameraPosition(distance=camerapos[0], elevation=camerapos[1], azimuth=camerapos[2])
开发者ID:pbmanis,项目名称:neuronvis,代码行数:16,代码来源:hoc_viewer.py


示例12: check_trigger

def check_trigger(debounce_time, debounce_mode, targeted_trigs, detected_triggers):
    app = pg.mkQApp()
    
    dev, trigger = setup_nodes()
    trigger.params['debounce_time'] = debounce_time
    trigger.params['debounce_mode'] = debounce_mode
    
    def on_new_trigger(pos, indexes):
        #~ print(pos, indexes)
        detected_triggers.extend(indexes)
    poller = ThreadPollOutput(trigger.output, return_data=True)
    poller.new_data.connect(on_new_trigger)
    
    poller.start()
    trigger.start()
    dev.start()
    
    
    def terminate():
        dev.stop()
        trigger.stop()
        poller.stop()
        poller.wait()
        assert np.array_equal(detected_triggers, targeted_trigs), '{} should be {}'.format(detected_triggers, targeted_trigs)    
        app.quit()
    
    # start for a while
    timer = QtCore.QTimer(singleShot=True, interval=5000)
    timer.timeout.connect(terminate)
    timer.start()
    
    app.exec_()
开发者ID:pyacq,项目名称:pyacq,代码行数:32,代码来源:test_trigger.py


示例13: open_catalogue_window

def open_catalogue_window():
    dataio = DataIO(dirname='test_peeler')
    catalogueconstructor = CatalogueConstructor(dataio=dataio)
    app = pg.mkQApp()
    win = CatalogueWindow(catalogueconstructor)
    win.show()
    app.exec_()
开发者ID:samuelgarcia,项目名称:tridesclous,代码行数:7,代码来源:test_peeler.py


示例14: test_eeg_emotiv_direct

def test_eeg_emotiv_direct():
    # Look for emotiv usb device
    all_devices = get_available_devices()
    device_handle = all_devices[0]
    
    # in main App
    app = pg.mkQApp()
    dev = Emotiv(name='Emotiv0')
    dev.configure(device_handle=device_handle)
    dev.outputs['signals'].configure(
        protocol='tcp', interface='127.0.0.1', transfermode='plaindata',)
    dev.outputs['impedances'].configure(
        protocol='tcp', interface='127.0.0.1', transfermode='plaindata',)
    dev.outputs['gyro'].configure(
        protocol='tcp', interface='127.0.0.1', transfermode='plaindata',)
    dev.initialize()
    viewer = QOscilloscope()
    viewer.configure(with_user_dialog=True)
    viewer.input.connect(dev.outputs['signals'])
    viewer.initialize()
    viewer.show()

    dev.start()
    viewer.start()

    def terminate():
        dev.stop()
        app.quit()

    # start for a while
    timer = QtCore.QTimer(singleShot=True, interval=3000)
    timer.timeout.connect(terminate)
    #~ timer.start()

    app.exec_()
开发者ID:Enchufa2,项目名称:pyacq,代码行数:35,代码来源:test_eeg_emotiv.py


示例15: test_AnalogTrigger_after_stable

def test_AnalogTrigger_after_stable():
    app = pg.mkQApp()
    
    dev, trigger = setup_nodes()
    trigger.params['debounce_time'] = 0.1
    trigger.params['debounce_mode'] = 'after-stable'
    
    all_triggers = []
    def on_new_trigger(pos, indexes):
        #~ print(pos, indexes)
        all_triggers.extend(indexes)
    poller = ThreadPollOutput(trigger.output)
    poller.new_data.connect(on_new_trigger)
    
    dev.start()
    trigger.start()
    poller.start()
    
    def terminate():
        dev.stop()
        trigger.stop()
        poller.stop()
        poller.wait()
        app.quit()
    
    # start for a while
    timer = QtCore.QTimer(singleShot=True, interval=5000)
    timer.timeout.connect(terminate)
    timer.start()
    
    app.exec_()
    #~ print(all_triggers)
    assert np.array_equal(all_triggers, [1001, 2001,  3025, 4001])
开发者ID:Enchufa2,项目名称:pyacq,代码行数:33,代码来源:test_trigger.py


示例16: pg_setup

 def pg_setup(self, title=None):
     self.app = pg.mkQApp()
     if title is None:
         wintitle = 'NEURON run plots'
     else:
         wintitle = title
     self.view = pg.GraphicsView()
     self.lo = pg.GraphicsLayout()  #(border=(100,100,100))
     self.view.setCentralItem(self.lo)
     self.view.resize(800, 600)
     self.view.show()
     #self.win = pg.GraphicsWindow(title=wintitle)
     #self.win.show()
     #self.win.resize(800,600)
     #self.win.nextRow()
     #self.GL = pg.GraphicsLayoutWidget(parent=self.win)
     self.lo.addLabel('Cell: {0:s}'.format(title), colspan=9, size='12pt')
     self.plots = {}
     for i in range(1, 6):
         self.plots['p%d' % i] = None
     nr1 = 6
     for i in range(1,nr1+1):
         self.lo.addLayout(row=i, col=10)
     for i in range(1,11):
         self.lo.addLayout(row=nr1+2, col = i)
     self.plots['p1'] = self.lo.addPlot(title="Vsoma", row=1, col=1, rowspan=nr1-2, colspan=9)
     self.plots['Dendrite'] = self.lo.addPlot(title="Vdend", row=nr1-1, col=1, rowspan=1, colspan=9)
     self.plots['Iinj'] = self.lo.addPlot(title="IInj", row=nr1, col=1, rowspan=1, colspan=9)
开发者ID:pbmanis,项目名称:VCNModel,代码行数:28,代码来源:IVPlots.py


示例17: __init__

    def __init__(self):

        # create application window
        self._win = pg.GraphicsWindow( title="ATH9K Spectral Scan")
        self._app = QtGui.QApplication.instance()

        if self._app is None:
            #pg.setConfigOption( 'background', 'w')
            #pg.setConfigOption( 'foreground', 'k')
            self._app = pg.mkQApp()

        if self._win is None:
            self._win = pg.GraphicsWindow( title="ATH9K Spectral Scan")
        self._win.clear()

        # create dummy data
        self.f = list(range(0,SPECTRAL_HT20_NUM_BINS,1))
        self.avg = -120*np.ones(SPECTRAL_HT20_NUM_BINS)
        #self.env = -120*np.ones(SPECTRAL_HT20_NUM_BINS)

        # create plot layout
        self._plt = self._win.addPlot(row=1, col=1)
        self._plt.showGrid(x = True, y = True, alpha = 0.3)
        self._plt.setTitle(title = "RX Spectrum")
        self._plt.setLabel('left', 'Receive Power [dBm]')
        self._plt.setLabel('bottom', 'Frequency [MHz]')
        self._plt.enableAutoRange(x = False, y = False)
        self._plt.setXRange(0- 0.25, 55 + 0.25)
        self._plt.setYRange(-120, -40)
        self._plt.clear()
        self._plt.plot(self.f, self.avg, pen=(0, 0, 255))
        #self._plt.plot(self.f, self.env, pen=(255, 0, 0))
        self._app.processEvents()
开发者ID:WiFiZero,项目名称:module_spectral_scan_ath9k,代码行数:33,代码来源:plotter.py


示例18: veiw_commit

    def veiw_commit(self, X, Y):
        """
        .. py:attribute:: veiw_custom()


           :param X: 
           :type X: 
           :param Y: 
           :type Y: 
           :rtype: UNKNOWN

        .. note:: 

        .. todo:: 
        """
        if isinstance(X[0],tuple):
            X = sorted([time.mktime(datetime(*i).timetuple()) for i in X])
        else:
            X = sorted(map(float, X))
        coords = zip(X, Y)
        app = pg.mkQApp()
        pw = pg.PlotWidget(viewBox=self.vb, axisItems={'bottom': self.axis}, enableMenu=False,
            title="PROJECT_NAME git log changes",clickable=True)
        def mouseMoved(pos):
                display_text = pg.TextItem(text='salooom',color=(176,23,31),anchor=pos)
                pw.addItem(display_text)
        pw.plot(X, Y, symbol='o')
        pw.show()
        pw.setWindowTitle('PROJECT_NAME Git Log: customPlot')
        r = pg.PolyLineROI([(0,0), (10,10)])
        pw.addItem(r)
        pw.scene().sigMouseClicked.connect(mouseMoved)
        if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
            QtGui.QApplication.instance().exec_()
开发者ID:kasramvd,项目名称:Visualgit,代码行数:34,代码来源:visualgit.py


示例19: __init__

 def __init__(self):
 
     app = pg.mkQApp()
     self.win = pg.GraphicsWindow(title="Bar learning")
     self.win.resize(800,800)
     self.win.addLabel("Input")
     self.win.addLabel("Feature")
     self.win.nextRow()
     
     box = self.win.addViewBox(lockAspect=True)
     self.input_vis = pg.ImageItem()
     box.addItem(self.input_vis)
     
     box = self.win.addViewBox(lockAspect=True)
     self.feature_vis = pg.ImageItem()
     box.addItem(self.feature_vis)
     self.win.nextRow()
     
     self.win.addLabel("Receptive fields", colspan=2)
     self.win.nextRow()
     box = self.win.addViewBox(lockAspect=True, colspan=2)
     self.rv_vis = pg.ImageItem()
     box.addItem(self.rv_vis)
     
     self.count = 0
     self.update_period = 200 # every 200 input presentations update weight plot
     self.win.show()
开发者ID:rougier,项目名称:ANNarchy,代码行数:27,代码来源:BarLearningGPU.py


示例20: test_local_app_in_out

def test_local_app_in_out():
    # connect Node.output to Node.input
    # so copy inaudio buffer to out audio buffer
    
    app = pg.mkQApp()
    
    dev = PyAudio()
    dev.configure(nb_channel=2, sample_rate=44100.,
                    input_device_index=0, output_device_index=0,
                    format='int16', chunksize=1024)
    dev.output.configure(protocol='tcp', interface='127.0.0.1', transfertmode='plaindata')
    dev.input.connect(dev.output)
    dev.initialize()
    dev.start()
    
    def terminate():
        dev.stop()
        dev.close()
        app.quit()
    
    # start for a while
    timer = QtCore.QTimer(singleShot=True, interval=3000)
    timer.timeout.connect(terminate)
    timer.start()
    app.exec_()
开发者ID:Enchufa2,项目名称:pyacq,代码行数:25,代码来源:test_audio_pyaudio.py



注:本文中的pyqtgraph.mkQApp函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pyqtgraph.plot函数代码示例发布时间:2022-05-27
下一篇:
Python pyqtgraph.mkPen函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap