本文整理汇总了Python中pyqtgraph.flowchart.Flowchart类的典型用法代码示例。如果您正苦于以下问题:Python Flowchart类的具体用法?Python Flowchart怎么用?Python Flowchart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Flowchart类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent=None):
super(Demo, self).__init__()
self.setWindowTitle("Gesture Recognizer")
self.showFullScreen()
self.layout = QtGui.QGridLayout()
self.setLayout(self.layout)
self.fc = Flowchart(terminals={
'dataIn': {'io': 'in'},
'dataOut': {'io': 'out'}
})
self.layout.addWidget(self.fc.widget(), 0, 0, 2, 1)
self.path = {'x': [], 'y': []}
self.threshold = 50
self.sample_size = 64
self.default_msg = 'No template matched...'
self.error_ir_msg = 'No ir-values received'
self.error_wiimote_msg = 'No wiimote connected'
self.error_template_msg = 'No template could be created'
self.pressed_key = None
self.dollar = Recognizer()
self.config_nodes()
self.config_layout()
self.setup_templates()
self.get_wiimote()
开发者ID:CrazyCrud,项目名称:interactiondesign-python,代码行数:32,代码来源:gestures.py
示例2: __init__
def __init__(self, imagepath='images/'):
super(FlowChartWidget, self).__init__()
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
self.imagepath = imagepath
layout = QVBoxLayout()
## Create flowchart, define input/output terminals
fc = Flowchart(terminals={
'dataIn': {'io': 'in'},
'dataOut': {'io': 'out'}
})
w = fc.widget()
layout.addWidget(w)
self.setLayout(layout)
开发者ID:92briank,项目名称:chipwhisperer,代码行数:17,代码来源:FlowChartWidget.py
示例3: __init__
def __init__(self, parent=None):
super(Demo, self).__init__()
self.setWindowTitle("Plotting the Wiimote")
self.showFullScreen()
self.layout = QtGui.QGridLayout()
self.setLayout(self.layout)
self.flowchart = Flowchart(terminals={
'xDataIn': {'io': 'in'},
'yDataIn': {'io': 'in'},
'zDataIn': {'io': 'in'},
'xDataOut': {'io': 'out'},
'yDataOut': {'io': 'out'},
'zDataOut': {'io': 'out'}
})
self.layout.addWidget(self.flowchart.widget(), 0, 0, 3, 1)
fclib.registerNodeType(WiimoteNode, [('Display',)])
self.wii_node = self.flowchart.createNode('Wiimote', pos=(0, 0))
self.axes = ['x', 'y', 'z']
# positions for all nodes; order:
# raw_node xpos, raw_node ypos, filtered_node xpos, filtered_node ypos,
# filter_node xpos, filter_node ypos
self.positions = {
'x': [-450, -350, -300, -350, -375, -150],
'y': [-150, -350, 0, -350, -75, -150],
'z': [150, -350, 300, -350, 225, -150],
}
# create, style, config and connect the elements for every axis
for axis in self.axes:
index = self.axes.index(axis)
plot_raw = pyqtgraph.PlotWidget()
plot_filtered = pyqtgraph.PlotWidget()
# add widget for this axis in next row
self.layout.addWidget(plot_filtered, index, 2, 1, 2)
self.configPlotItems(axis, plot_raw, plot_filtered)
self.createNodes(axis, plot_raw, plot_filtered)
self.connectNodes(axis)
pyqtgraph.setConfigOptions(antialias=True)
self.flowchart.setInput(xDataIn=0)
self.flowchart.setInput(yDataIn=0)
self.flowchart.setInput(zDataIn=0)
开发者ID:CrazyCrud,项目名称:interactiondesign-python,代码行数:55,代码来源:analyze.py
示例4: setup_displaying_of_plots
def setup_displaying_of_plots():
"""
setup of all PyQt and PyQtGraph related objects for further use
:return: newly constructed window object, central_widget object,
layout object and flowchart object
"""
win = QtGui.QMainWindow()
win.setWindowTitle("Analyze")
central_widget = QtGui.QWidget()
win.setCentralWidget(central_widget)
layout = QtGui.QGridLayout()
central_widget.setLayout(layout)
fc = Flowchart(terminals={})
layout.addWidget(fc.widget(), 0, 0, 2, 1)
return win, central_widget, layout, fc
开发者ID:KiKiWuWu,项目名称:ITT,代码行数:22,代码来源:analyze.py
示例5: __init__
def __init__(self, parent=None):
super(Demo, self).__init__()
self.setWindowTitle("Wiimote Activity")
self.showFullScreen()
self.layout = QtGui.QGridLayout()
self.setLayout(self.layout)
self.fc = Flowchart(terminals={"dataIn": {"io": "in"}, "dataOut": {"io": "out"}})
self.layout.addWidget(self.fc.widget(), 0, 0, 4, 1)
self.createNodes()
开发者ID:CrazyCrud,项目名称:interactiondesign-python,代码行数:14,代码来源:analyze_values.py
示例6: __init__
def __init__(self, parent=None,**kwargs):
super(AppWindow, self).__init__(parent)
self.setupUi(self)
self.I=kwargs.get('I',None)
self.setWindowTitle('pyqtgraph example: FlowchartCustomNode')
## Create an empty flowchart with a single input and output
self.fc = Flowchart(terminals={
'dataIn': {'io': 'in'},
})
self.w = self.fc.widget()
self.WidgetLayout.addWidget(self.fc.widget())
self.plot1 = self.add2DPlot(self.ExperimentLayout)
self.plot2 = self.add2DPlot(self.ExperimentLayout)
self.curve1 = self.addCurve(self.plot1)
self.curve2 = self.addCurve(self.plot2)
self.curve1.setData([1,2,3],[5,6,7])
self.library = fclib.LIBRARY.copy() # start with the default node set
self.library.addNodeType(PlotViewNode, [('Display',)])
self.library.addNodeType(CaptureNode, [('Acquire',)])
self.fc.setLibrary(self.library)
## Now we will programmatically add nodes to define the function of the flowchart.
## Normally, the user will do this manually or by loading a pre-generated
## flowchart file.
self.cap = self.fc.createNode('Capture', pos=(0, 0))
self.cap.setI(self.I)
self.v1Node = self.fc.createNode('PlotView', pos=(0, -150))
self.v1Node.setView(self.curve1)
self.v2Node = self.fc.createNode('PlotView', pos=(150, -150))
self.v2Node.setView(self.curve2)
self.fc.connectTerminals(self.fc['dataIn'], self.cap['dataIn'])
self.fc.connectTerminals(self.cap['dataOut'], self.v1Node['data'])
#self.fc.connectTerminals(self.fc['dataIn'], self.v2Node['data'])
self.fc.setInput(dataIn=True)
开发者ID:fossasia,项目名称:pslab-apps,代码行数:44,代码来源:Z_hackyourown.py
示例7: __init__
def __init__(self, parent=None):
super(Demo, self).__init__()
self.setWindowTitle("Pointing Device")
self.show()
self.layout = QtGui.QGridLayout()
self.setLayout(self.layout)
self.fc = Flowchart(terminals={
'dataIn': {'io': 'in'},
'dataOut': {'io': 'out'}
})
self.layout.addWidget(self.fc.widget(), 0, 0, 2, 1)
self.configNodes()
self.configScatterPlot()
self.getWiimote()
开发者ID:CrazyCrud,项目名称:interactiondesign-python,代码行数:19,代码来源:wiipoint2d.py
示例8: __init__
def __init__(self, parent=None):
super(Demo, self).__init__()
self.setWindowTitle("Wiimote Activity")
self.showFullScreen()
self.layout = QtGui.QGridLayout()
self.setLayout(self.layout)
self.fc = Flowchart(terminals={
'dataIn': {'io': 'in'},
'dataOut': {'io': 'out'}
})
self.layout.addWidget(self.fc.widget(), 0, 0, 4, 1)
self.createNodes()
self.getWiimote()
开发者ID:CrazyCrud,项目名称:interactiondesign-python,代码行数:19,代码来源:activity.py
示例9: __init__
def __init__(self, useWiiMote, parent=None):
super(Pointer, self).__init__()
self.useWiiMote = useWiiMote
self.layout = QtGui.QGridLayout()
self.setLayout(self.layout)
self.buffer_amount = 20
self.fc = Flowchart(terminals={
'dataIn': {'io': 'in'},
'dataOut': {'io': 'out'}
})
self.layout.addWidget(self.fc.widget(), 0, 0, 2, 1)
self.configNodes()
if self.useWiiMote:
self.getWiimote()
self.outputCounter = 0
开发者ID:CrazyCrud,项目名称:interactiondesign-python,代码行数:22,代码来源:twohands.py
示例10: Flowchart
fclib.registerNodeType(WiimoteNode, [('Sensor',)])
fclib.registerNodeType(IrPlotNode, [('Display',)])
if __name__ == '__main__':
import sys
app = QtGui.QApplication([])
win = QtGui.QMainWindow()
win.setWindowTitle('Wiipoint 2D')
cw = QtGui.QWidget()
win.setCentralWidget(cw)
layout = QtGui.QGridLayout()
cw.setLayout(layout)
fc = Flowchart(terminals={
'dataIn': {'io': 'in'},
'dataOut': {'io': 'out'}
})
w = fc.widget()
layout.addWidget(fc.widget(), 0, 0, 2, 1)
view = pg.GraphicsLayoutWidget()
layout.addWidget(view, 0, 1, 2, 1)
wiimoteNode = fc.createNode('Wiimote', pos=(0, 0), )
bufferNodeIr = fc.createNode('Buffer', pos=(150, 150))
irPlotNode = fc.createNode('IrPlotNode', pos=(300, 150))
# connect 'Plus' and 'Minus' buttons
wiimoteNode.set_buffer_node(bufferNodeIr)
开发者ID:freakimkaefig,项目名称:itt_lamm_lechler,代码行数:30,代码来源:wiipoint3d.py
示例11: Flowchart
fclib.registerNodeType(WiimoteNode, [('Sensor',)])
if __name__ == '__main__':
import sys
app = QtGui.QApplication([])
win = QtGui.QMainWindow()
win.setWindowTitle('WiimoteNode demo')
cw = QtGui.QWidget()
win.setCentralWidget(cw)
layout = QtGui.QGridLayout()
cw.setLayout(layout)
## Create an empty flowchart with a single input and output
fc = Flowchart(terminals={
'dataIn': {'io': 'in'},
'dataOut': {'io': 'out'}
})
w = fc.widget()
layout.addWidget(fc.widget(), 0, 0, 2, 1)
pw1 = pg.PlotWidget()
layout.addWidget(pw1, 0, 1)
pw1.setYRange(0, 1024)
pw1Node = fc.createNode('PlotWidget', pos=(0, -150))
pw1Node.setPlot(pw1)
wiimoteNode = fc.createNode('Wiimote', pos=(0, 0), )
bufferNode = fc.createNode('Buffer', pos=(150, 0))
开发者ID:ManuKrapf,项目名称:IntTec,代码行数:30,代码来源:wiimote_node.py
示例12: save
# Save the default state of view of main window
save()
# Create and Add a ControllerWidget (for visual and serial communication)
controller_w = ControllerWidget()
controller.addWidget(controller_w)
#####################################
# Create Flow Chart and components
#####################################
# Create flowchart, define input/output terminals
fc = Flowchart(terminals={
#'sigOut': {'io': 'in'},
#'sigOut2': {'io': 'in'}#,
#'sigIn': {'io': 'out'} #We don't currently need any outputs from FC
}, name='Connections')
# Remove the unnecessary input and output nodes
fc.removeNode(fc.inputNode)
fc.removeNode(fc.outputNode)
flowchart = fc.widget()
d3.addWidget(flowchart)
flowchart_dock.addWidget(fc.widget().chartWidget)
#Register own node types
fclib.registerNodeType(OscilloscopeNode, [('SciEdu',)])
fclib.registerNodeType(FilterNode, [('SciEdu',)])
fclib.registerNodeType(CharToBinaryNode, [('SciEdu',)])
开发者ID:adikele,项目名称:SciEdu-Nodes-Simulator,代码行数:30,代码来源:sciedu.py
示例13: Demo
class Demo(QtGui.QWidget):
def __init__(self, parent=None):
super(Demo, self).__init__()
self.setWindowTitle("Pointing Device")
self.show()
self.layout = QtGui.QGridLayout()
self.setLayout(self.layout)
self.fc = Flowchart(terminals={
'dataIn': {'io': 'in'},
'dataOut': {'io': 'out'}
})
self.layout.addWidget(self.fc.widget(), 0, 0, 2, 1)
self.configNodes()
self.configScatterPlot()
self.getWiimote()
# connect to wiimote and config wiimote node
def getWiimote(self):
if len(sys.argv) == 1:
addr, name = wiimote.find()[0]
elif len(sys.argv) == 2:
addr = sys.argv[1]
name = None
elif len(sys.argv) == 3:
addr, name = sys.argv[1:3]
print("Connecting to %s (%s)" % (name, addr))
self.wiimoteNode.text.setText(addr)
self.wiimoteNode.connect_wiimote()
# create and connect nodes
def configNodes(self):
self.pointVisNode = self.fc.createNode('Vis2D', pos=(-150, 150))
self.wiimoteNode = self.fc.createNode('Wiimote', pos=(0, 0), )
self.bufferNode = self.fc.createNode('Buffer', pos=(0, -150))
self.buffer_amount = self.bufferNode.getBufferSize()
self.fc.connectTerminals(
self.wiimoteNode['irVals'],
self.bufferNode['dataIn'])
self.fc.connectTerminals(
self.bufferNode['dataOut'],
self.pointVisNode['irVals'])
# create and config scatter plot item
def configScatterPlot(self):
gview = pg.GraphicsLayoutWidget()
self.layout.addWidget(gview, 0, 1, 2, 1)
plot = gview.addPlot()
self.scatter = pg.ScatterPlotItem(
size=10, pen=pg.mkPen(None), brush=pg.mkBrush(255, 255, 255, 120))
plot.addItem(self.scatter)
plot.setXRange(-1000, 200)
plot.setYRange(-1000, 200)
def keyPressEvent(self, ev):
if ev.key() == QtCore.Qt.Key_Escape:
self.close()
# do actions in loop
def update(self):
outputValues = self.pointVisNode.outputValues()
if outputValues['irX'] is not None and outputValues['irY'] is not None:
self.scatter.setData(pos=[
[-outputValues['irX'], -outputValues['irY']]])
# raise or lower buffer amount with +/- keys
if self.wiimoteNode.wiimote is not None:
if self.wiimoteNode.wiimote.buttons['Plus']:
self.buffer_amount += 1
self.bufferNode.setBufferSize(self.buffer_amount)
elif self.wiimoteNode.wiimote.buttons['Minus']:
if self.buffer_amount > 1:
self.buffer_amount -= 1
self.bufferNode.setBufferSize(self.buffer_amount)
pyqtgraph.QtGui.QApplication.processEvents()
开发者ID:CrazyCrud,项目名称:interactiondesign-python,代码行数:84,代码来源:wiipoint2d.py
示例14: Demo
class Demo(QtGui.QWidget):
def __init__(self, parent=None):
super(Demo, self).__init__()
self.setWindowTitle("Wiimote Activity")
self.showFullScreen()
self.layout = QtGui.QGridLayout()
self.setLayout(self.layout)
self.fc = Flowchart(terminals={"dataIn": {"io": "in"}, "dataOut": {"io": "out"}})
self.layout.addWidget(self.fc.widget(), 0, 0, 4, 1)
self.createNodes()
# self.getWiimote()
# connect to wiimote with an address given as argument
def getWiimote(self):
if len(sys.argv) == 1:
addr, name = wiimote.find()[0]
elif len(sys.argv) == 2:
addr = sys.argv[1]
name = None
elif len(sys.argv) == 3:
addr, name = sys.argv[1:3]
print ("Connecting to %s (%s)" % (name, addr))
self.wiimoteNode.text.setText(addr)
self.wiimoteNode.connect_wiimote()
def update(self):
outputValues = self.activityNode.outputValues()
if outputValues["activity"] is not None:
self.label.setText(outputValues["activity"])
pg.QtGui.QApplication.processEvents()
# create and config the nodes needed to recognize activities
def createNodes(self):
pwX = pg.PlotWidget()
pwY = pg.PlotWidget()
pwZ = pg.PlotWidget()
pwX.getPlotItem().hideAxis("bottom")
pwX.setYRange(300, 700)
pwY.getPlotItem().hideAxis("bottom")
pwY.setYRange(300, 700)
pwZ.getPlotItem().hideAxis("bottom")
pwZ.setYRange(300, 700)
self.label = QtGui.QLabel()
self.label.setText("No activity yet...")
font = QtGui.QFont("Arial")
font.setPointSize(32)
self.label.setFont(font)
self.layout.addWidget(pwX, 0, 1)
self.layout.addWidget(pwY, 1, 1)
self.layout.addWidget(pwZ, 2, 1)
self.layout.addWidget(self.label, 3, 1)
pwXNode = self.fc.createNode("PlotWidget", pos=(-150, -150))
pwXNode.setPlot(pwX)
pwYNode = self.fc.createNode("PlotWidget", pos=(0, -150))
pwYNode.setPlot(pwY)
pwZNode = self.fc.createNode("PlotWidget", pos=(150, -150))
pwZNode.setPlot(pwZ)
self.activityNode = self.fc.createNode("ClassifierNode", pos=(0, 150))
"""
self.wiimoteNode = self.fc.createNode('Wiimote', pos=(-300, 0))
self.bufferXNode = self.fc.createNode('Buffer', pos=(-150, -300))
self.bufferYNode = self.fc.createNode('Buffer', pos=(0, -300))
self.bufferZNode = self.fc.createNode('Buffer', pos=(150, -300))
self.fc.connectTerminals(
self.wiimoteNode['accelX'], self.bufferXNode['dataIn'])
self.fc.connectTerminals(
self.wiimoteNode['accelY'], self.bufferYNode['dataIn'])
self.fc.connectTerminals(
self.wiimoteNode['accelZ'], self.bufferZNode['dataIn'])
self.fc.connectTerminals(self.bufferXNode['dataOut'], pwXNode['In'])
self.fc.connectTerminals(self.bufferYNode['dataOut'], pwYNode['In'])
self.fc.connectTerminals(self.bufferZNode['dataOut'], pwZNode['In'])
self.fc.connectTerminals(
self.bufferXNode['dataOut'], self.activityNode['accelX'])
self.fc.connectTerminals(
self.bufferYNode['dataOut'], self.activityNode['accelY'])
self.fc.connectTerminals(
self.bufferZNode['dataOut'], self.activityNode['accelZ'])
"""
def keyPressEvent(self, ev):
if ev.key() == QtCore.Qt.Key_Escape:
self.close()
开发者ID:CrazyCrud,项目名称:interactiondesign-python,代码行数:97,代码来源:analyze_values.py
示例15: Flowchart
return {'numberOut': output}
fclib.registerNodeType(NumberDisplayNode, [('Data',)])
if __name__ == '__main__':
import sys
app = QtGui.QApplication([])
win = QtGui.QMainWindow()
win.setWindowTitle('Noisalyzer')
cw = QtGui.QWidget()
win.setCentralWidget(cw)
layout = QtGui.QGridLayout()
cw.setLayout(layout)
# Create an empty flowchart with a single input and output
fc = Flowchart(terminals={
})
w = fc.widget()
layout.addWidget(fc.widget(), 0, 0, 2, 1)
# WiimoteNode:
wiimoteNode = fc.createNode('Wiimote', pos=(0, 0), )
wiimoteNode.text.setText(addr)
# X Axis:
pw_accelX = pg.PlotWidget()
layout.addWidget(pw_accelX, 0, 1)
pw_accelX.setYRange(0, 1024)
# plot node for x axis
pw_x_Node = fc.createNode('PlotWidget', pos=(600, 0))
开发者ID:Gr4ni,项目名称:ITT-SS15,代码行数:32,代码来源:noisalyzer.py
示例16: Flowchart
if __name__ == "__main__":
# creating main window
app = QtGui.QApplication([])
win = QtGui.QMainWindow()
win.setWindowTitle('Wiimote Accelerometer Analyze')
cw = QtGui.QWidget()
win.setCentralWidget(cw)
layout = QtGui.QGridLayout()
cw.setLayout(layout)
#creating flowchart
fc = Flowchart(terminals={
'dataIn': {'io': 'in'},
'dataOut': {'io': 'out'}
})
w = fc.widget()
layout.addWidget(fc.widget(), 0, 0, 2, 1)
# three widgets for x-, y- & z-Axis
x = pg.PlotWidget()
y = pg.PlotWidget()
z = pg.PlotWidget()
# add widgets to grid layout
layout.addWidget(x, 0, 1)
layout.addWidget(y, 0, 2)
layout.addWidget(z, 0, 3)
raw_input("Press the 'sync' button on the back of your Wiimote Plus " +
"or buttons (1) and (2) on your classic Wiimote.\n" +
开发者ID:freakimkaefig,项目名称:itt_lamm_lechler,代码行数:30,代码来源:analyze_working_without_nodes.py
示例17: Flowchart
fclib.registerNodeType(FFTNode, [('Data',)])
if __name__ == '__main__':
import sys
app = QtGui.QApplication([])
win = QtGui.QMainWindow()
win.setWindowTitle('Frequalyzer')
cw = QtGui.QWidget()
win.setCentralWidget(cw)
layout = QtGui.QGridLayout()
cw.setLayout(layout)
# Create an empty flowchart with a single input and output
fc = Flowchart(terminals={
})
w = fc.widget()
layout.addWidget(fc.widget(), 0, 0, 2, 1)
# WiimoteNode:
wiimoteNode = fc.createNode('Wiimote', pos=(0, 0), )
wiimoteNode.text.setText(addr)
# X accelerator axis:
# Plots Widget:
pw_accelX = pg.PlotWidget(name="X accelerator")
layout.addWidget(pw_accelX, 0, 1)
pw_accelX.setYRange(-15, 55)
pw_accelX.setXRange(0, 40)
pw_x_Node = fc.createNode('PlotWidget', pos=(370, -140))
开发者ID:Gr4ni,项目名称:ITT-SS15,代码行数:31,代码来源:frequalyzer.py
示例18: Demo
class Demo(QtGui.QWidget):
def __init__(self, parent=None):
super(Demo, self).__init__()
self.setWindowTitle("Plotting the Wiimote")
self.showFullScreen()
self.layout = QtGui.QGridLayout()
self.setLayout(self.layout)
self.flowchart = Flowchart(terminals={
'xDataIn': {'io': 'in'},
'yDataIn': {'io': 'in'},
'zDataIn': {'io': 'in'},
'xDataOut': {'io': 'out'},
'yDataOut': {'io': 'out'},
'zDataOut': {'io': 'out'}
})
self.layout.addWidget(self.flowchart.widget(), 0, 0, 3, 1)
fclib.registerNodeType(WiimoteNode, [('Display',)])
self.wii_node = self.flowchart.createNode('Wiimote', pos=(0, 0))
self.axes = ['x', 'y', 'z']
# positions for all nodes; order:
# raw_node xpos, raw_node ypos, filtered_node xpos, filtered_node ypos,
# filter_node xpos, filter_node ypos
self.positions = {
'x': [-450, -350, -300, -350, -375, -150],
'y': [-150, -350, 0, -350, -75, -150],
'z': [150, -350, 300, -350, 225, -150],
}
# create, style, config and connect the elements for every axis
for axis in self.axes:
index = self.axes.index(axis)
plot_raw = pyqtgraph.PlotWidget()
plot_filtered = pyqtgraph.PlotWidget()
# add widget for this axis in next row
self.layout.addWidget(plot_filtered, index, 2, 1, 2)
self.configPlotItems(axis, plot_raw, plot_filtered)
self.createNodes(axis, plot_raw, plot_filtered)
self.connectNodes(axis)
pyqtgraph.setConfigOptions(antialias=True)
self.flowchart.setInput(xDataIn=0)
self.flowchart.setInput(yDataIn=0)
self.flowchart.setInput(zDataIn=0)
# create raw, filter and filtered node
def createNodes(self, axis, plot_raw, plot_filtered):
# create filtered node
self.plot_filtered_node = self.flowchart.createNode(
'PlotWidget', pos=(
self.positions[axis][2],
self.positions[axis][3]))
self.plot_filtered_node.setPlot(plot_filtered)
# create gaussian filter
self.filter_node = self.flowchart.createNode(
'GaussianFilter', pos=(
self.positions[axis][4],
self.positions[axis][5]))
self.filter_node.ctrls['sigma'].setValue(5)
# connect nodes: flowchart -> wiinode -> plot_raw + filter_node
# -> filtered_node
def connectNodes(self, axis):
self.flowchart.connectTerminals(
self.flowchart[axis + 'DataIn'], self.wii_node[axis + 'DataIn'])
self.flowchart.connectTerminals(
self.wii_node[axis + 'DataOut'], self.filter_node['In'])
self.flowchart.connectTerminals(
self.filter_node['Out'], self.plot_filtered_node['In'])
#self.flowchart.connectTerminals(
# self.filter_node['Out'], self.flowchart[axis + 'DataOut'])
# config plot items
def configPlotItems(self, axis, plot_raw, plot_filtered):
plot_raw.getPlotItem().setTitle("The " + axis + " Accelerometer")
plot_raw.getPlotItem().setMenuEnabled(False)
plot_raw.getPlotItem().setClipToView(False)
plot_raw.getPlotItem().hideAxis('bottom')
plot_raw.getPlotItem().showGrid(x=True, y=True, alpha=0.5)
plot_filtered.getPlotItem().setTitle(
"The " + axis + " Accelerometer - Filtered")
plot_filtered.getPlotItem().setMenuEnabled(False)
#.........这里部分代码省略.........
开发者ID:CrazyCrud,项目名称:interactiondesign-python,代码行数:101,代码来源:analyze.py
示例19: __init__
def __init__(self, parent=None):
super(Demo, self).__init__()
self.setWindowTitle("Fourier Transformation")
self.showFullScreen()
self.layout = QtGui.QGridLayout()
self.setLayout(self.layout)
fc = Flowchart(terminals={
'dataIn': {'io': 'in'},
'dataOut': {'io': 'out'}
})
self.layout.addWidget(fc.widget(), 0, 0, 2, 1)
pw1 = pg.PlotWidget()
pw2 = pg.PlotWidget()
pw1.getPlotItem().setLabel('left', text='Amplitude')
pw1.getPlotItem().setLabel('bottom', text='Time')
pw2.getPlotItem().setLabel('left', text='Y(freq)')
pw2.getPlotItem().setLabel('bottom', text='F(Hz)')
self.layout.addWidget(pw1, 0, 1)
self.layout.addWidget(pw2, 1, 1)
sampling_rate = 150.0
sampling_interval = 1.0 / sampling_rate; # Abtastfrequenz f = (1/t)
time_vector = np.arange(0, 1, sampling_interval)
signal_frequency = 10
data = np.sin(2 * np.pi * signal_frequency * time_vector)
print data
fc.setInput(dataIn=data)
pw1Node = fc.createNode('PlotWidget', pos=(0, -150))
pw1Node.setPlot(pw1)
pw2Node = fc.createNode('PlotWidget', pos=(150, -150))
pw2Node.setPlot(pw2)
fNode = fc.createNode('AnalyzeNode', pos=(0, 0))
fc.connectTerminals(fc['dataIn'], fNode['dataIn'])
fc.connectTerminals(fc['dataIn'], pw1Node['In'])
fc.connectTerminals(fNode['dataOut'], pw2Node['In'])
fc.connectTerminals(fNode['dataOut'], fc['dataOut'])
开发者ID:CrazyCrud,项目名称:interactiondesign-python,代码行数:48,代码来源:fft.py
示例20: Flowchart
fclib.registerNodeType(SpectrumNode, [('Display',)])
###############################################################################################################
if __name__ == '__main__':
import sys
app = QtGui.QApplication([])
win = QtGui.QMainWindow()
win.setWindowTitle('WiimoteNode demo')
cw = QtGui.QWidget()
win.setCentralWidget(cw)
layout = QtGui.QGridLayout()
cw.setLayout(layout)
## Create an empty flowchart with a single input and output
fc = Flowchart(terminals={
'dataIn': {'io': 'in'},
'dataOut': {'io': 'out'}
})
w = fc.widget()
layout.addWidget(fc.widget(), 0, 0, 2, 1)
pw1 = pg.PlotWidget()
pw1.plot(pen='y')
layout.addWidget(pw1, 1, 1)
pw1.setYRange(0, 1024)
pw1Node = fc.createNode('PlotWidget', pos=(300, 150))
pw1Node.setPlot(pw1)
pw2 = pg.PlotWidget()
pw2.plot(pen='g')
开发者ID:freakimkaefig,项目名称:itt_lamm_lechler,代码行数:32,代码来源:wiimote_node_noise.py
注:本文中的pyqtgraph.flowchart.Flowchart类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论