本文整理汇总了Python中pyqtgraph.Qt.QtGui.QApplication方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QApplication方法的具体用法?Python QtGui.QApplication怎么用?Python QtGui.QApplication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph.Qt.QtGui
的用法示例。
在下文中一共展示了QtGui.QApplication方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def update():
dataOk = 0
global detObj
x = []
y = []
# Read and parse the received data
dataOk, frameNumber, detObj = readAndParseData16xx(Dataport, configParameters)
if dataOk and len(detObj["x"])>0:
#print(detObj)
x = -detObj["x"]
y = detObj["y"]
s.setData(x,y)
QtGui.QApplication.processEvents()
return dataOk
# ------------------------- MAIN -----------------------------------------
# Configurate the serial port
示例2: update
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def update():
dataOk = 0
global vitalSignsObj, heartRateMat, frameMat
# Read and parse the received data
dataOk, frameNumber, vitalSignsObj = readAndParseVitalSigns(Dataport, configParameters)
if dataOk:
#print(vitalSignsObj)
frameMat.append(frameNumber)
heartRateMat.append(vitalSignsObj["heartRateEst_FFT"])
s.setData(frameMat,heartRateMat)
QtGui.QApplication.processEvents()
return dataOk
# ------------------------- MAIN -----------------------------------------
# Configurate the serial port
示例3: update_stats
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def update_stats(text):
_window_stats_label.setText(text)
#
#def start(sleep_s):
# global _app, _update_timer
# print('gui.start')
# if update != None:
# print('gui | Starting Update')
# _update_timer = QtCore.QTimer()
# _update_timer.timeout.connect(update)
# _update_timer.start(sleep_s * 1000)
#
# print('gui | Starting QApplication')
# _app.exec_()
#
#
示例4: run
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def run(self):
app = QtGui.QApplication([])
## Create window with GraphicsView widget
win = pg.GraphicsLayoutWidget()
win.show() ## show widget alone in its own window
win.setWindowTitle('pyqtgraph example: ImageItem')
view = win.addViewBox()
## lock the aspect ratio so pixels are always square
view.setAspectLocked(True)
## Create image item
self.img = pg.ImageItem(border='w')
view.addItem(self.img)
## Set initial view bounds
view.setRange(QtCore.QRectF(0, 0, 2*self.image_hw, self.image_hw))
timer = QtCore.QTimer()
timer.timeout.connect(self._update)
timer.start(50)
app.exec_()
示例5: close
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def close(self):
timediff = datetime.datetime.now() - self.creation_time
self.close_stream()
if self.save_data and self.pcounter > 0:
print("Saving data to file...")
#print(self.df.to_string)
td_str = '-'.join(str(timediff).split(':')[:2])
_ = self.df.to_pickle(DATA_FOLDER + self.creation_time.strftime("/pulses_%Y-%m-%d_%H-%M-%S") + "___" + str(self.pcounter) + "___" + td_str + ".pkl")
print("Saving completed.")
print()
print('Number of recorded waveforms:', self.pcounter, "of",self.frame_counter, "total audio frames")
print('at least', len(self.df[self.df['ptype'] == 'alpha']) ,"alphas and")
print('at least', len(self.df[self.df['ptype'] == 'beta']) ,"electrons/betas were detected")
self.p.terminate()
app = QtGui.QApplication([])
app.closeAllWindows()
app.quit()
app.exit()
print('done.')
示例6: __init__
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def __init__(self):
"""
Initialize the graphics window and mesh surface
"""
# setup the view window
self.app = QtGui.QApplication(sys.argv)
self.window = gl.GLViewWidget()
self.window.setWindowTitle('Terrain')
self.window.setGeometry(0, 110, 1920, 1080)
self.window.setCameraPosition(distance=30, elevation=12)
self.window.show()
gx = gl.GLGridItem()
gy = gl.GLGridItem()
gz = gl.GLGridItem()
gx.rotate(90, 0, 1, 0)
gy.rotate(90, 1, 0, 0)
gx.translate(-10, 0, 0)
gy.translate(0, -10, 0)
gz.translate(0, 0, -10)
self.window.addItem(gx)
self.window.addItem(gy)
self.window.addItem(gz)
model = 'mobilenet_thin_432x368'
camera = 0
w, h = model_wh(model)
self.e = TfPoseEstimator(get_graph_path(model), target_size=(w, h))
self.cam = cv2.VideoCapture("C:\\Users\\velpu\\Desktop\\tf-pose\dance.mp4")
ret_val, image = self.cam.read()
self.poseLifting = Prob3dPose('./src/lifting/models/prob_model_params.mat')
keypoints = self.mesh(image)
self.points = gl.GLScatterPlotItem(
pos=keypoints,
color=pg.glColor((0, 255, 0)),
size=15
)
self.window.addItem(self.points)
示例7: start
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def start(self):
"""
get the graphics window open and setup
"""
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
示例8: run
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def run():
app = QtGui.QApplication([])
loader = ExampleLoader()
app.exec_()
示例9: mouseDoubleClickEvent
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def mouseDoubleClickEvent(self, event, *args, **kwargs):
print('label double clicked')
self.win = CurveModifyWin(self.id, self.mainwindow)
self.win.sigCurveChanged.connect(self.callback_sigchanged)
self.win.show()
QtGui.QApplication.processEvents()
time.sleep(0.2)
示例10: _translate
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
示例11: show_curve_property_diag
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def show_curve_property_diag(id, parent):
def func(event):
print('curve was double clicked')
print(event)
win = CurveModifyWin(id, parent)
win.show()
QtGui.QApplication.processEvents()
print('end')
return func
示例12: main
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def main():
def func():
print(app.focusWidget())
app = QtGui.QApplication(sys.argv)
app.focusChanged.connect(func)
mainwin = MainWindow()
mainwin.show()
print(app.focusWidget())
sys.exit(app.exec_())
示例13: view_batch
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def view_batch(*args, width=300, height=300, lut={}):
use_these = args
if not isinstance(use_these, (np.ndarray, np.memmap)):
use_these = list(use_these)
for i in range(len(use_these)):
item = use_these[i]
try:
import torch
if isinstance(item, torch.Tensor):
item = item.detach().cpu().numpy()
except ImportError:
pass
while len(item.shape) < 4:
item = item[None]
use_these[i] = item
use_these = np.concatenate(use_these, 0)
else:
while len(use_these.shape) < 4:
use_these = use_these[None]
global app
app = QtGui.QApplication.instance()
if app is None:
app = QtGui.QApplication(sys.argv)
sv = BatchViewer(width=width, height=height)
sv.setBatch(use_these, lut)
sv.show()
app.exit(app.exec_())
示例14: main
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def main():
app = QtGui.QApplication([])
win = PicoPyScope(app)
win.show()
# debug = pg.dbg()
try:
sys.exit(app.exec_())
except Exception as ex:
print "main:", ex.message
示例15: update
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 别名]
def update():
dataOk = 0
targetDetected = 0
global targetObj
global pointObj
x = []
y = []
# Read and parse the received data
dataOk, targetDetected, frameNumber, targetObj, pointObj = readAndParseData16xx(Dataport, configParameters)
if targetDetected:
print(targetObj)
print(targetObj["numTargets"])
x = -targetObj["posX"]
y = targetObj["posY"]
s2.setData(x,y)
QtGui.QApplication.processEvents()
if dataOk:
x = -pointObj["range"]*np.sin(pointObj["azimuth"])
y = pointObj["range"]*np.cos(pointObj["azimuth"])
s1.setData(x,y)
QtGui.QApplication.processEvents()
return dataOk
# ------------------------- MAIN -----------------------------------------
# Configurate the serial port