本文整理汇总了Python中pyqtgraph.parametertree.ParameterTree类的典型用法代码示例。如果您正苦于以下问题:Python ParameterTree类的具体用法?Python ParameterTree怎么用?Python ParameterTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ParameterTree类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: addSettings
def addSettings(self, param):
"""Adds a dockwidget designed to store a ParameterTree, also adds to 'Windows' menu"""
parameterTree = ParameterTree()
parameterTree.addParameters(param._PyQtGraphParameter)
dock = self.addDock(parameterTree, name=param.getName(), area=Qt.TopDockWidgetArea)
dock.setMaximumWidth(560)
return dock
开发者ID:FrankMuenzner,项目名称:chipwhisperer,代码行数:7,代码来源:CWMainGUI.py
示例2: __init__
def __init__(self):
super(maintest, self).__init__()
self.values = {'module 1': module(1), 'module 2': module(2), 'module 3': module(3)}
self.module = self.values['module 2']
p = [
{'name': 'Module', 'type': 'list',
'values': self.values,
'set': self.setmodule,
'get': self.getmodule,
'childmode': "root",
'help': '%namehdr%Boatload of text is possible here. Can use markup too with external help window.'},
{'name': 'Rocks to Skips', 'type': 'int', 'value': 0, 'help': 'Another help example', 'helpwnd': None, 'linked':['1/Rocks to Skips']},
{'name': '1/Rocks to Skips', 'type': 'float', 'help': 'Another help example', 'helpwnd': None, 'get': self.getLinked}
]
self.params = Parameter(name='Root', type='group', children=p).register()
self.params.init()
self.t = ParameterTree()
self.t.addParameters(self.params.getPyQtGraphParameter())
self.test = Parameter(name='Test', type='group')
self.test.addChildren([
{'name':'baud', 'type':'int', 'key':'baud', 'limits':(500, 2000000), 'value':38400}
])
self.params.append(self.test)
self.test.remove()
self.test.getChild("baud").setValue(500)
self.params.append(self.test)
self.t2 = ParameterTree()
self.params2 = Parameter(name='Root', type='group')
self.params.getChild("Module").stealDynamicParameters(self.params2)
self.t2.addParameters(self.params2._PyQtGraphParameter)
开发者ID:FrankMuenzner,项目名称:chipwhisperer,代码行数:34,代码来源:parameter.py
示例3: _draw_text_inputs
def _draw_text_inputs(self, layout):
"""
Generates a GUI that can accept parameter values.
"""
params = [
{'name': 'damage :: Saturation Threshold', 'type': 'int',
'value': 10000, 'suffix': 'ADU'},
{'name': 'damage :: Area Threshold', 'type': 'int',
'value': 20, 'suffix': '%', 'limits': (0, 100)},
{'name': 'xtal :: Saturation Threshold', 'type': 'int',
'value': 5000, 'suffix': 'ADU'},
{'name': 'xtal :: Area Threshold', 'type': 'int',
'value': 1, 'suffix': '%', 'limits': (0, 100)},
{'name': 'diffuse :: Saturation Threshold', 'type': 'int',
'value': 1000, 'suffix': 'ADU'},
{'name': 'diffuse :: Area Threshold', 'type': 'int',
'value': 20, 'suffix': '%', 'limits': (0, 100)}
]
self._params = Parameter.create(name='params', type='group',
children=params)
self._params.sigTreeStateChanged.connect(self._enable_apply)
t = ParameterTree()
t.setParameters(self._params, showTop=False)
layout.addWidget(t, 0, 1)
return
开发者ID:tjlane,项目名称:trapdoor,代码行数:32,代码来源:gui.py
示例4: Ui_ChildWindow
class Ui_ChildWindow(object):
def setupUi(self, MainWindow, params):
#app = QtGui.QApplication([])
#self.win = QtGui.QMainWindow()
self.area = DockArea()
MainWindow.setCentralWidget(self.area)
MainWindow.resize(500, 700)
MainWindow.setWindowTitle('Action construct')
self.seq_cntr = Dock("Sequence", size=(150,200))
self.area.addDock(self.seq_cntr, 'left')
## first dock gets save/restore buttons
self.t = ParameterTree()
if params != None:
self.p_child = Parameter.create(name='params', type='group', children=params)
self.t.setParameters(self.p_child, showTop=False)
self.t.setWindowTitle('pyqtgraph example: Parameter Tree')
self.seq_cntr.addWidget(self.t)
self.seq = pg.LayoutWidget()
self.label = QtGui.QLabel("""Controls""")
self.saveBtn = QtGui.QPushButton('Add Action')
self.restoreBtn = QtGui.QPushButton('Modify table')
self.restoreBtn.setEnabled(False)
self.seq.addWidget(self.label, row=0, col=0)
self.seq.addWidget(self.saveBtn, row=1, col=0)
self.seq.addWidget(self.restoreBtn, row=2, col=0)
self.seq_cntr.addWidget(self.seq)
开发者ID:iagapov,项目名称:ocelot,代码行数:34,代码来源:ui_optim_sase.py
示例5: LayerControlTree
class LayerControlTree(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.basicParam = {'name': 'Layer','expanded':False, 'type': 'group','autoIncrementName':True, 'children': [
{'name': 'LayerType', 'type': 'list', 'values': {"RGB": 0, "LAB": 1, "ChannelWise": 2}, 'value': 0},
{'name': 'Channel', 'type': 'int', 'value': 0,'limits':[0,2]},
{'name': 'Opacity', 'type': 'float', 'value': 0.0, 'step': 0.1,'limits':[0,1]},
{'name': 'Show', 'type': 'bool', 'value': True, 'tip': "Show / Hide this layer"},
{'name': 'HideOthers', 'type': 'action','tip':"Hide all other layers"},
{'name': 'Gradient', 'type': 'colormap'},
#{'name': 'Subgroup', 'type': 'group', 'children': [
# {'name': 'Sub-param 1', 'type': 'int', 'value': 10},
# {'name': 'Sub-param 2', 'type': 'float', 'value': 1.2e6},
#]},
#{'name': 'Text Parameter', 'type': 'text', 'value': 'Some text...'},
#{'name': 'Action Parameter', 'type': 'action'},
]}
params = []
self.paramGroup = Parameter.create(name='params', type='group', children=params)
self.paramGroup.sigTreeStateChanged.connect(self.change)
self.parameterTree = ParameterTree()
self.parameterTree.setParameters(self.paramGroup, showTop=False)
# add view box to graph view layout
self.hbox = QtGui.QHBoxLayout()
self.setLayout(self.hbox)
self.hbox.addWidget(self.parameterTree)
def addLayerControl(self,layer):
layerParam = setupLayerParam(layer.layerName(),layer.baseControlTemplate(),
layer.controlTemplate())
layerParam = self.paramGroup.addChild(layerParam)
# pass parameter to layer itself
layer.setLayerParameter(layerParam)
def removeLayerControl(self,layer):
paramToRemove = layer.layerParameter
self.paramGroup.removeChild(paramToRemove)
## If anything changes in the tree, print a message
def change(self,param, changes):
#print("tree changes:")
for param, change, data in changes:
path = self.paramGroup.childPath(param)
if path is not None:
childName = '.'.join(path)
else:
childName = param.name()
开发者ID:DerThorsten,项目名称:ivigraph,代码行数:58,代码来源:viewer.py
示例6: FringeRemoveNode
class FringeRemoveNode(Node):
"""Node for removing fringes"""
nodeName = 'FringeRemove'
nodePaths = [('Analysis',)]
def __init__(self, name):
terminals = {
'sig':{'io':'in'},
'ref':{'io':'in'},
'bkg':{'io':'in'},
'sigMask': {'io':'in'},
'ref1':{'io':'out', 'bypass': 'ref'}
}
super().__init__(name, terminals=terminals)
paras_property = [
{'name': 'rank', 'type': 'int', 'readonly': True},
{'name': 'rankLimit', 'type': 'int', 'value': 100},
{'name': 'trunc', 'type': 'float'},
{'name': 'updateLib', 'type': 'bool'},
{'name': 'reset', 'type': 'action'}
]
self.paras = Parameter.create(name='params', type='group', children=paras_property)
self.paratree = ParameterTree()
self.paratree.setParameters(self.paras, showTop=False)
self.remover = FringeRemove()
self.paras.param('reset').sigActivated.connect(self.remover.reset)
def onReset(self):
self.remover.reset()
self.paras['rank'] = 0
def ctrlWidget(self):
return self.paratree
def process(self, sig, ref, bkg, sigMask, display=True):
self.remover.setTrunc(self.paras['trunc'])
ref = ref - bkg
if self.paras['updateLib'] and self.paras['rank'] <= self.paras['rankLimit']:
self.remover.updateLibrary(ref)
self.paras['rank'] = self.remover.rank
sig = sig - bkg
coef, ref = self.remover.reconstruct(np.ma.array(sig, mask=sigMask))
ref = ref.reshape(512, 512) + bkg
return {'ref1': ref}
def saveState(self):
state = super().saveState()
state['paras'] = self.paras.saveState()
return state
def restoreState(self, state):
super().restoreState(state)
self.paras.restoreState(state['paras'])
开发者ID:aipikachu,项目名称:pycoldatom,代码行数:57,代码来源:fringeNode.py
示例7: maintest
class maintest(Parameterized):
def __init__(self):
super(maintest, self).__init__()
self.values = {'module 1': module(1), 'module 2': module(2), 'module 3': module(3)}
self.module = self.values['module 2']
p = [
{'name': 'Module', 'type': 'list',
'values': self.values,
'set': self.setmodule,
'get': self.getmodule,
'childmode': "root",
'help': '%namehdr%Boatload of text is possible here. Can use markup too with external help window.'},
{'name': 'Rocks to Skips', 'type': 'int', 'value': 0, 'help': 'Another help example', 'helpwnd': None,
'linked': ['1/Rocks to Skips']},
{'name': '1/Rocks to Skips', 'type': 'float', 'help': 'Another help example', 'helpwnd': None,
'get': self.getLinked}
]
self.params = Parameter(name='Root', type='group', children=p).register()
self.params.init()
self.t = ParameterTree()
self.t.addParameters(self.params.getPyQtGraphParameter())
self.test = Parameter(name='Test', type='group')
self.test.addChildren([
{'name': 'baud', 'type': 'int', 'key': 'baud', 'limits': (500, 2000000), 'value': 38400}
])
self.params.append(self.test)
self.test.remove()
self.test.getChild("baud").setValue(500)
self.params.append(self.test)
self.t2 = ParameterTree()
self.params2 = Parameter(name='Root', type='group')
self.params.getChild("Module").stealDynamicParameters(self.params2)
self.t2.addParameters(self.params2._PyQtGraphParameter)
self.params.save("abcde.txt")
self.params.load("abcde.txt")
def printhelp(self, msg, obj):
print msg
def getmodule(self):
return self.module
@setupSetParam("Module")
def setmodule(self, module):
print "Changing Module"
self.module = module
def getLinked(self):
try:
return 1.0 / float(self.params.getChild('Rocks to Skips').getValue())
except:
return 0
开发者ID:phonchi,项目名称:chipwhisperer,代码行数:56,代码来源:parameter.py
示例8: setupTree
def setupTree():
params = [
{'name':'Update Time (s)', 'type':'float', 'value':1},
{'name':'std', 'type':'float', 'value':0},
{'name':'Save Figure', 'type':'action', 'visible':True}
]
p = Parameter.create(name = 'params', type = 'group', children = params)
t = ParameterTree()
t.setParameters(p, showTop = False)
return t,p
开发者ID:mallman777,项目名称:ttag,代码行数:10,代码来源:chartGui.py
示例9: __init__
def __init__(self,dataSet=None):
self.dataSet=dataSet
ParameterTree.__init__(self)
self.setObjectName("ConfigurationWidget")
self.setWindowTitle("Measurement Configuration")
self.setParams()
self.p.sigTreeStateChanged.connect(self.change)
self.connections=[]
self.p.param("File Configuration","Folder").sigValueChanged.connect(self.folderModeChanged)
开发者ID:gsehrlich,项目名称:diffusive-ta,代码行数:10,代码来源:configurationWidget.py
示例10: setupTree
def setupTree():
params = [
{'name':'Update Time (s)', 'type':'float', 'value':1},
{'name':'Sample Name', 'type':'int', 'value':1},
{'name':'Counter', 'type':'int', 'value':0}
]
p = Parameter.create(name = 'params', type = 'group', children = params)
t = ParameterTree()
t.setParameters(p, showTop = False)
return t,p
开发者ID:mallman777,项目名称:ttag,代码行数:10,代码来源:templateGui.py
示例11: InputCalibrationChannel
class InputCalibrationChannel(SheetForm, SheetBase):
def __init__(self, config, channel, parent=None):
SheetBase.__init__(self, parent)
SheetForm.__init__(self)
self.config = config
self.channel = channel
self.settings = self.config.get("InputCalibration.{0}".format(channel), ChannelSettings())
self.myCalibration = None
self.treeWidget = None
def setupUi(self, callback, MainWindow):
SheetForm.setupUi(self, MainWindow)
self.calibrationsCombo.addItems( list(AnalogInputCalibration.AnalogInputCalibrationMap.keys()) )
self.calibrationsCombo.currentIndexChanged["QString"].connect( self.onCalibrationChanged )
self.callback = callback
if self.settings.calibration:
self.onCalibrationChanged(self.settings.calibration)
self.calibrationsCombo.setCurrentIndex(self.calibrationsCombo.findText(self.settings.calibration))
def onCalibrationChanged(self, calibration):
calibration = str(calibration)
if self.myCalibration:
self.settings.parameters[self.settings.calibration] = self.myCalibration.parameters
self.myCalibration = AnalogInputCalibration.AnalogInputCalibrationMap[calibration]()
if calibration in self.settings.parameters:
self.myCalibration.parameters = self.settings.parameters[calibration]
if not self.treeWidget:
try:
self.param = Parameter.create(name='params', type='group', children=self.myCalibration.paramDef())
self.treeWidget = ParameterTree()
self.treeWidget.setParameters(self.param, showTop=False)
self.verticalLayout.insertWidget(2, self.treeWidget)
self.param.sigTreeStateChanged.connect(self.myCalibration.update, QtCore.Qt.UniqueConnection)
except (TypeError, AttributeError):
pass
else:
self.param = Parameter.create(name='params', type='group', children=self.myCalibration.paramDef())
self.treeWidget.setParameters(self.param, showTop=False)
try:
self.param.sigTreeStateChanged.connect(self.myCalibration.update, QtCore.Qt.UniqueConnection )
except TypeError:
pass # we want the connection to be unique
self.settings.calibration = calibration
self.callback( self.channel, self.myCalibration )
def saveConfig(self):
if self.myCalibration:
self.settings.parameters[self.settings.calibration] = self.myCalibration.parameters
self.config["InputCalibration.{0}".format(self.channel)] = self.settings
开发者ID:pyIonControl,项目名称:IonControl,代码行数:49,代码来源:InputCalibrationUi.py
示例12: __init__
def __init__(self, parent = None, savedstate=None):
super(ProjectSettingsDialog, self).__init__(parent)
self.setWindowTitle("Application Settings")
layout = QtGui.QVBoxLayout(self)
self.initKeyParamMapping()
self._settings = Parameter.create(name='params', type='group', children=settings_params)
if savedstate:
self._settings.restoreState(savedstate)
# Holds settings keys that have changed by the user when the
# dialog is closed. Used to update any needed gui values..
self._updated_settings={}
self._settings.sigTreeStateChanged.connect(self.handleSettingChange)
self.initSettingsValues()
self.ptree = ParameterTree()
self.ptree.setParameters(self._settings, showTop=False)
self.ptree.setWindowTitle('MarkWrite Application Settings')
layout.addWidget(self.ptree)
self.ptree.adjustSize()
# OK and Cancel buttons
self.buttons = QtGui.QDialogButtonBox(
QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel,
QtCore.Qt.Horizontal, self)
layout.addWidget(self.buttons)
self.buttons.accepted.connect(self.accept)
self.buttons.rejected.connect(self.reject)
self.resize(500,700)
开发者ID:Mark-Torrance,项目名称:OpenHandWrite,代码行数:34,代码来源:projectsettings.py
示例13: __init__
def __init__(self):
QtGui.QWidget.__init__(self)
self.neuron_data = None
self.setWindowTitle("Experiment Control - Data Analysis & Visualization")
self.layout = QtGui.QVBoxLayout()
self.layout.setContentsMargins(0, 0, 0, 0)
self.setLayout(self.layout)
self.splitter = QtGui.QSplitter()
self.splitter.setOrientation(QtCore.Qt.Horizontal)
self.splitter2 = QtGui.QSplitter()
self.splitter2.setOrientation(QtCore.Qt.Vertical)
self.layout.addWidget(self.splitter)
self.splitter.addWidget(self.splitter2)
self.plot_widget = pg.GraphicsLayoutWidget()
self.tree = ParameterTree(showHeader=False)
self.params = Parameter.create(
name="params",
type="group",
children=[
dict(name="Reanalyze", type="bool", value=False),
dict(name="Load", type="action"),
dict(name="GCFR-sigma (ms)", type="float", value=100.0, step=0.1, limits=[1, 5000]),
dict(name="Save", type="action"),
],
)
self.tree.setParameters(self.params, showTop=False)
# self.params.param('Save').sigActivated.connect(self.SavePlot)
self.params.param("Load").sigActivated.connect(self.OpenDataFile)
self.splitter2.addWidget(self.tree)
self.trial_list_tree = pg.TreeWidget(parent=self.splitter2)
self.splitter.addWidget(self.plot_widget)
self.trial_list_tree.setColumnCount(1)
开发者ID:umeshmohan,项目名称:ECA,代码行数:32,代码来源:plotting.py
示例14: __init__
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.basicParam = {'name': 'Layer','expanded':False, 'type': 'group','autoIncrementName':True, 'children': [
{'name': 'LayerType', 'type': 'list', 'values': {"RGB": 0, "LAB": 1, "ChannelWise": 2}, 'value': 0},
{'name': 'Channel', 'type': 'int', 'value': 0,'limits':[0,2]},
{'name': 'Opacity', 'type': 'float', 'value': 0.0, 'step': 0.1,'limits':[0,1]},
{'name': 'Show', 'type': 'bool', 'value': True, 'tip': "Show / Hide this layer"},
{'name': 'HideOthers', 'type': 'action','tip':"Hide all other layers"},
{'name': 'Gradient', 'type': 'colormap'},
#{'name': 'Subgroup', 'type': 'group', 'children': [
# {'name': 'Sub-param 1', 'type': 'int', 'value': 10},
# {'name': 'Sub-param 2', 'type': 'float', 'value': 1.2e6},
#]},
#{'name': 'Text Parameter', 'type': 'text', 'value': 'Some text...'},
#{'name': 'Action Parameter', 'type': 'action'},
]}
params = []
self.paramGroup = Parameter.create(name='params', type='group', children=params)
self.paramGroup.sigTreeStateChanged.connect(self.change)
self.parameterTree = ParameterTree()
self.parameterTree.setParameters(self.paramGroup, showTop=False)
# add view box to graph view layout
self.hbox = QtGui.QHBoxLayout()
self.setLayout(self.hbox)
self.hbox.addWidget(self.parameterTree)
开发者ID:DerThorsten,项目名称:ivigraph,代码行数:34,代码来源:viewer.py
示例15: onCalibrationChanged
def onCalibrationChanged(self, calibration):
calibration = str(calibration)
if self.myCalibration:
self.settings.parameters[self.settings.calibration] = self.myCalibration.parameters
self.myCalibration = AnalogInputCalibration.AnalogInputCalibrationMap[calibration]()
if calibration in self.settings.parameters:
self.myCalibration.parameters = self.settings.parameters[calibration]
if not self.treeWidget:
try:
self.param = Parameter.create(name='params', type='group', children=self.myCalibration.paramDef())
self.treeWidget = ParameterTree()
self.treeWidget.setParameters(self.param, showTop=False)
self.verticalLayout.insertWidget(2, self.treeWidget)
self.param.sigTreeStateChanged.connect(self.myCalibration.update, QtCore.Qt.UniqueConnection)
except (TypeError, AttributeError):
pass
else:
self.param = Parameter.create(name='params', type='group', children=self.myCalibration.paramDef())
self.treeWidget.setParameters(self.param, showTop=False)
try:
self.param.sigTreeStateChanged.connect(self.myCalibration.update, QtCore.Qt.UniqueConnection )
except TypeError:
pass # we want the connection to be unique
self.settings.calibration = calibration
self.callback( self.channel, self.myCalibration )
开发者ID:pyIonControl,项目名称:IonControl,代码行数:25,代码来源:InputCalibrationUi.py
示例16: __init__
def __init__(self, parent = None):
#print "init!!!!!"
self.parent = parent
## Dock: Labels
self.dLabels = Dock("Labels", size=(1, 1))
self.wLabels = ParameterTree()
self.wLabels.setWindowTitle('Labels')
self.dLabels.addWidget(self.wLabels)
self.labels_grp = 'Labels'
self.labels_A_str = 'Single'
self.labels_B_str = 'Multi'
self.labels_C_str = 'Dunno'
self.labelA = False
self.labelB = False
self.labelC = False
#######################
# Mandatory parameter #
#######################
self.params = [
{'name': self.labels_grp, 'type': 'group', 'children': [
{'name': self.labels_A_str, 'type': 'bool', 'value': self.labelA, 'tip': "Single"},
{'name': self.labels_B_str, 'type': 'bool', 'value': self.labelB, 'tip': "Multi"},
{'name': self.labels_C_str, 'type': 'bool', 'value': self.labelC, 'tip': "Dunno"},
]},
]
self.pLabels = Parameter.create(name='paramsLabel', type='group', \
children=self.params, expanded=True)
self.pLabels.sigTreeStateChanged.connect(self.change)
self.wLabels.setParameters(self.pLabels, showTop=False)
开发者ID:laurentroque,项目名称:psocake,代码行数:34,代码来源:LabelPanel.py
示例17: SettingsEditorDialog
class SettingsEditorDialog(QtGui.QDialog):
def __init__(self,ndViewer, parent):
super(SettingsEditorDialog, self).__init__(parent)
self.resize(800,600)
self.ndViewer = ndViewer
self.layout = QtGui.QVBoxLayout()
self.setLayout(self.layout)
self.paramTree = ParameterTree()
self.paramTree.setParameters(self.ndViewer.options.p, showTop=False)
self.layout.addWidget(self.paramTree)
def keyPressEvent(self, event):
if event.key() == QtCore.Qt.Key_Escape:
self.hide()
event.accept()
else:
super(QtGui.QDialog, self).keyPressEvent(event)
开发者ID:DerThorsten,项目名称:orthos,代码行数:20,代码来源:ndviewer.py
示例18: InstrumentLoggingSelection
class InstrumentLoggingSelection( SelectionUi ):
def __init__(self, config, classdict, instancename="ExternalParameterSelection.ParametersSequence", plotNames=None, parent=None, instrumentLoggingHandler=None ):
super(InstrumentLoggingSelection, self).__init__(config, dict(), classdict, instancename, parent)
self.instrumentLoggingHandler = instrumentLoggingHandler
self.current = None
def setupUi(self, MainWindow):
super(InstrumentLoggingSelection, self).setupUi(MainWindow)
self.loggingHandlerTreeWidget = ParameterTree(self.splitter)
self.loggingHandlerTreeWidget.setObjectName("loggingHandlerTreeWidget")
self.loggingHandlerTreeWidget.headerItem().setText(0, "1")
self.loggingHandlerTreeWidget.header().setVisible(False)
def onActiveInstrumentChanged(self, modelIndex, modelIndex2 ):
self.current = self.parameters.at(modelIndex.row()).name
super(InstrumentLoggingSelection, self).onActiveInstrumentChanged( modelIndex, modelIndex2 )
self.loggingHandlerTreeWidget.setParameters( self.instrumentLoggingHandler.parameter(self.current) )
def refreshParamTree(self):
if self.current is not None:
self.loggingHandlerTreeWidget.setParameters( self.instrumentLoggingHandler.parameter(self.current) )
开发者ID:pyIonControl,项目名称:IonControl,代码行数:21,代码来源:InstrumentLoggingSelection.py
示例19: __init__
def __init__(self,ndViewer, parent):
super(SettingsEditorDialog, self).__init__(parent)
self.resize(800,600)
self.ndViewer = ndViewer
self.layout = QtGui.QVBoxLayout()
self.setLayout(self.layout)
self.paramTree = ParameterTree()
self.paramTree.setParameters(self.ndViewer.options.p, showTop=False)
self.layout.addWidget(self.paramTree)
开发者ID:DerThorsten,项目名称:orthos,代码行数:12,代码来源:ndviewer.py
示例20: __init__
def __init__(self, parent = None, with_config = False, **kargs ):
QtGui.QWidget.__init__(self, parent)
self.resize(800,600)
mainlayout = QtGui.QVBoxLayout()
self.setLayout(mainlayout)
self.glview = gl.GLViewWidget()
mainlayout.addWidget(self.glview)
self.glview .setCameraPosition(160,160,15)
if with_config:
h = QtGui.QHBoxLayout()
mainlayout.addLayout(h)
but = QtGui.QPushButton('Config', icon = QtGui.QIcon.fromTheme('configure'))
h.addWidget(but)
but.clicked.connect(self.open_params)
but = QtGui.QPushButton('Save png', icon = QtGui.QIcon.fromTheme('save'))
h.addWidget(but)
but.clicked.connect(self.open_save_dialog)
_params = [
{'name': 'cortical_mesh', 'type': 'list', 'values': cortical_meshes.keys(), 'value' : 'BrainMesh_ICBM152'},
{'name': 'cortical_alpha', 'type': 'float', 'value': .1, 'limits': [0., 1.], 'step' : .01},
{'name': 'cortical_color', 'type': 'color', 'value': 'w'},
{'name': 'background_color', 'type': 'color', 'value': 'k'},
]
self.params = Parameter.create(name='params', type='group', children=_params)
self.tree = ParameterTree(parent = self)
self.tree.setParameters(self.params)
self.tree.setWindowFlags(QtCore.Qt.Dialog)
self.mesh = None
for k,v in kargs.items():
self.params[k] = v
self.change_background_color()
self.plot_mesh()
self.change_color_mesh()
self.params.param('cortical_mesh').sigValueChanged.connect(self.plot_mesh)
self.params.param('cortical_alpha').sigValueChanged.connect(self.change_color_mesh)
self.params.param('cortical_color').sigValueChanged.connect(self.change_color_mesh)
self.params.param('background_color').sigValueChanged.connect(self.change_background_color)
self.glview.resizeGL(self.glview.width(), self.glview.height())
开发者ID:davidmeunier79,项目名称:pyplotbrain,代码行数:51,代码来源:view.py
注:本文中的pyqtgraph.parametertree.ParameterTree类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论