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

Python parametertree.Parameter类代码示例

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

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



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

示例1: 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


示例2: __init__

 def __init__(self, **opts):
     opts['type'] = 'bool'
     opts['value'] = True
     Parameter.__init__(self, **opts)
     
     self.addChild({'name': 'A = 1/B', 'type': 'float', 'value': 7, 'suffix': 'Hz', 'siPrefix': True})
     self.addChild({'name': 'B = 1/A', 'type': 'float', 'value': 1/7., 'suffix': 's', 'siPrefix': True})
     self.a = self.param('A = 1/B')
     self.b = self.param('B = 1/A')
     self.a.sigValueChanged.connect(self.aChanged)
     self.b.sigValueChanged.connect(self.bChanged)
开发者ID:calanoue,项目名称:pyqtgraph,代码行数:11,代码来源:__main__.py


示例3: ImageExporter

class ImageExporter(Exporter):
    Name = "Image File (PNG, TIF, JPG, ...)"
    def __init__(self, item):
        Exporter.__init__(self, item)
        tr = self.getTargetRect()
        
        self.params = Parameter(name='params', type='group', children=[
            {'name': 'width', 'type': 'int', 'value': tr.width(), 'limits': (0, None)},
            {'name': 'height', 'type': 'int', 'value': tr.height(), 'limits': (0, None)},
            {'name': 'antialias', 'type': 'bool', 'value': True},
            {'name': 'background', 'type': 'color', 'value': (0,0,0,255)},
        ])
        self.params.param('width').sigValueChanged.connect(self.widthChanged)
        self.params.param('height').sigValueChanged.connect(self.heightChanged)
        
    def widthChanged(self):
        sr = self.getSourceRect()
        ar = sr.height() / sr.width()
        self.params.param('height').setValue(self.params['width'] * ar, blockSignal=self.heightChanged)
        
    def heightChanged(self):
        sr = self.getSourceRect()
        ar = sr.width() / sr.height()
        self.params.param('width').setValue(self.params['height'] * ar, blockSignal=self.widthChanged)
        
    def parameters(self):
        return self.params
    
    def export(self, fileName=None):
        if fileName is None:
            filter = ["*."+str(f) for f in QtGui.QImageWriter.supportedImageFormats()]
            preferred = ['*.png', '*.tif', '*.jpg']
            for p in preferred[::-1]:
                if p in filter:
                    filter.remove(p)
                    filter.insert(0, p)
            self.fileSaveDialog(filter=filter)
            return
            
        targetRect = QtCore.QRect(0, 0, self.params['width'], self.params['height'])
        sourceRect = self.getSourceRect()
        #self.png = QtGui.QImage(targetRect.size(), QtGui.QImage.Format_ARGB32)
        #self.png.fill(pyqtgraph.mkColor(self.params['background']))
        bg = np.empty((self.params['width'], self.params['height'], 4), dtype=np.ubyte)
        color = self.params['background']
        bg[:,:,0] = color.blue()
        bg[:,:,1] = color.green()
        bg[:,:,2] = color.red()
        bg[:,:,3] = color.alpha()
        self.png = pg.makeQImage(bg, alpha=True)
        painter = QtGui.QPainter(self.png)
        try:
            self.setExportMode(True, {'antialias': self.params['antialias'], 'background': self.params['background']})
            self.getScene().render(painter, QtCore.QRectF(targetRect), sourceRect)
        finally:
            self.setExportMode(False)
        self.png.save(fileName)
        painter.end()
        
        
开发者ID:emayssat,项目名称:sandbox,代码行数:58,代码来源:ImageExporter.py


示例4: SVGExporter

class SVGExporter(Exporter):
    Name = "Scalable Vector Graphics (SVG)"
    allowCopy = True

    def __init__(self, item):
        Exporter.__init__(self, item)
        #tr = self.getTargetRect()
        self.params = Parameter(name='params', type='group', children=[
            #{'name': 'width', 'type': 'float', 'value': tr.width(), 'limits': (0, None)},
            #{'name': 'height', 'type': 'float', 'value': tr.height(), 'limits': (0, None)},
            #{'name': 'viewbox clipping', 'type': 'bool', 'value': True},
            #{'name': 'normalize coordinates', 'type': 'bool', 'value': True},
            #{'name': 'normalize line width', 'type': 'bool', 'value': True},
        ])
        #self.params.param('width').sigValueChanged.connect(self.widthChanged)
        #self.params.param('height').sigValueChanged.connect(self.heightChanged)

    def widthChanged(self):
        sr = self.getSourceRect()
        ar = sr.height() / sr.width()
        self.params.param('height').setValue(self.params['width'] * ar, blockSignal=self.heightChanged)

    def heightChanged(self):
        sr = self.getSourceRect()
        ar = sr.width() / sr.height()
        self.params.param('width').setValue(self.params['height'] * ar, blockSignal=self.widthChanged)

    def parameters(self):
        return self.params

    def export(self, fileName=None, toBytes=False, copy=False):
        if toBytes is False and copy is False and fileName is None:
            self.fileSaveDialog(filter="Scalable Vector Graphics (*.svg)")
            return

        ## Qt's SVG generator is not complete. (notably, it lacks clipping)
        ## Instead, we will use Qt to generate SVG for each item independently,
        ## then manually reconstruct the entire document.
        xml = generateSvg(self.item)

        if toBytes:
            return xml.encode('UTF-8')
        elif copy:
            md = QtCore.QMimeData()
            md.setData('image/svg+xml', QtCore.QByteArray(xml.encode('UTF-8')))
            QtGui.QApplication.clipboard().setMimeData(md)
        else:
            with open(fileName, 'wb') as fh:
                fh.write(asUnicode(xml).encode('utf-8'))
开发者ID:PrimozGodec,项目名称:orange3,代码行数:49,代码来源:SVGExporter.py


示例5: __init__

    def __init__(self):
        super(ResultsPlotting, self).__init__()

        self.override = None

        #ResultsTable manages class
        self.table = ResultsTable()
        self.table.setKeyOverride(self.processKnownKey)

        self.graphoutput = OutputVsTime()
        self.GraphOutputDock = QDockWidget(self.graphoutput.name)
        self.GraphOutputDock.setObjectName(self.graphoutput.name)
        self.GraphOutputDock.setAllowedAreas(Qt.BottomDockWidgetArea | Qt.RightDockWidgetArea| Qt.LeftDockWidgetArea)
        self.GraphOutputDock.setWidget(self.graphoutput)
        self.graphoutput.setDock(self.GraphOutputDock)
        self.graphoutput.setKeyOverride(self.processKnownKey)

        self.pgegraph = PGEVsTrace()
        self.PGEGraphDock = QDockWidget(self.pgegraph.name)
        self.PGEGraphDock.setObjectName(self.pgegraph.name)
        self.PGEGraphDock.setAllowedAreas(Qt.BottomDockWidgetArea | Qt.RightDockWidgetArea| Qt.LeftDockWidgetArea)
        self.PGEGraphDock.setWidget(self.pgegraph)
        self.pgegraph.setDock(self.PGEGraphDock)
        self.pgegraph.setKeyOverride(self.processKnownKey)

        self.saveresults = ResultsSave()

        resultsParams = [{'name':'Knownkey Source', 'type':'list', 'values':{'Attack Module':'attack', 'GUI Override':'gui'},
                                                    'value':'attack', 'set':self.setKnownKeySrc},

                         {'name':'Override Key', 'type':'str', 'key':'knownkey', 'value':'', 'set':self.setKnownKeyStr, 'readonly':True},
                         {'name':'Save Raw Results', 'type':'bool', 'value':False, 'set':self.saveresults.setEnabled}
                      ]
        self.params = Parameter.create(name="General Parameters", type='group', children=resultsParams)
        ExtendedParameter.setupExtended(self.params, self)
开发者ID:92briank,项目名称:chipwhisperer,代码行数:35,代码来源:ResultsPlotting.py


示例6: __init__

    def __init__(self, showScriptParameter=None, CWMainWindow=None):

        self.cwAdv = CWAdvTrigger()   
        

        paramSS = [
                 {'name':'Serial Settings', 'type':'group', 'children':[
                      {'name':'Baud', 'key':'baud', 'type':'int', 'limits':(100, 500000), 'value':38400, 'step':100, 'set':self.updateSampleRate},
                      {'name':'Start Bits', 'key':'startbits', 'type':'int', 'limits':(1, 10), 'value':1},
                      {'name':'Stop Bits', 'key':'stopbits', 'type':'int', 'limits':(1, 10), 'value':1},
                      {'name':'Parity', 'key':'parity', 'type':'list', 'values':['none', 'even'], 'value':'none'},
                    ]},

                 # TODO: Need to confirm oversample rate stuff
                 {'name':'Oversample Rate', 'key':'osrate', 'type':'int', 'limits':(2, 5), 'value':3, 'set':self.updateSampleRate},
                 {'name':'Calculated Clkdiv', 'key':'calcclkdiv', 'type':'int', 'readonly':True},
                 {'name':'Calculated Error', 'key':'calcerror', 'type':'int', 'suffix':'%', 'readonly':True},
                 {'name':'Trigger Character', 'key':'trigpatt', 'type':'str', 'value':'""', 'set':self.setPattern},
                 {'name':'Binary Pattern', 'key':'binarypatt', 'type':'str', 'value':''},
                 {'name':'Reset Module', 'type':'action', 'action':self.reset},
                 
                {'name':'Advanced Settings', 'type':'group', 'children':[
                 {'name':'Threshold', 'key':'threshold', 'type':'int', 'value':1, 'limits':(1, 10), 'set':self.reset},
                 {'name':'Initial Bit Correction', 'key':'initialcorrect', 'type':'int', 'value':3, 'limits':(0, 10), 'set':self.reset},
                 ]}
                ]
            
        self.oa = None
        self.params = Parameter.create(name='Digital Pattern Trigger Module', type='group', children=paramSS)
        ExtendedParameter.setupExtended(self.params, self)
        self.showScriptParameter = showScriptParameter
开发者ID:92briank,项目名称:chipwhisperer,代码行数:31,代码来源:ChipWhispererDigitalPattern.py


示例7: __init__

 def __init__(self, dictFiltPara=None):
     self.dictFiltPara = dictFiltPara
     self.bandDict = {"bandpass": 0, "lowpass": 1, "highpass": 2}
     self.filtDict = {'name': 'Filter', 'type': 'group', 'children': [
         {'name': 'band', 'type': 'list', 'values': self.bandDict, 'value': 0},
         {'name': 'order', 'type': 'int', 'value': 2},
         {'name': 'lowFreq', 'type': 'float', 'value': 0.02, 'step': 0.1, 'suffix': ' Hz'},
         {'name': 'highFreq', 'type': 'float', 'value': 2.0, 'step': 0.1, 'suffix': ' Hz'},
         {'name': 'reversepass', 'type': 'bool', 'value': False, 'tip': "This is a checkbox"},
         {'name': 'seis', 'type': 'list', 'values': {"Stack": 0, "Trace": 1}, 'value': 0},
         {'name': 'apply', 'type': 'bool', 'value': False, 'tip': "This is a checkbox"},
         {'name': 'Confirm_Filt_Parameters', 'type': 'action'},
         ]}
     self.filtKeys = ['lowFreq', 'highFreq', 'order', 'apply', 'reversepass']
     self.params = [
         RadioParameter(name='Sort'),
         self.filtDict,
         ]
     ## Create tree of Parameter objects
     self.paraTree = Parameter.create(name='params', type='group', children=self.params)
     self.paraTree.sigTreeStateChanged.connect(self.treeChanged)
     self.paraSort = self.paraTree.children()[0]
     self.paraFilt = self.paraTree.children()[1]
     self.onStack = True
     # get parameters for action:
     self.getSortPara()
     self.setFiltTree()
     self.getFiltPara()
开发者ID:pysmo,项目名称:aimbat,代码行数:28,代码来源:prepplot.py


示例8: __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


示例9: setupParameters

 def setupParameters(self):
     ssParams = [{'name':'STK500.exe Path', 'type':'str', 'key':'stk500path', 'value':r'C:\Program Files (x86)\Atmel\AVR Tools\STK500\Stk500.exe'},
                 {'name':'AVR Part', 'type':'list', 'key':'part', 'values':['atmega328p'], 'value':'atmega328p'},
                 {'name':'Test Reset', 'type':'action', 'action':self.testReset}
                 ]
     self.params = Parameter.create(name='Reset AVR via STK500', type='group', children=ssParams)
     ExtendedParameter.setupExtended(self.params, self)
开发者ID:EwanLu,项目名称:chipwhisperer,代码行数:7,代码来源:ResetAVR.py


示例10: __init__

    def __init__(self, parameterView):
        """Constructor. Defines all default parameters."""
        super(ParameterTreeWidget, self).__init__()
        defaultParams = [
            {'name': 'General', 'type': 'group', 'children': [
                {'name': 'General Config File Path',
                    'type': 'str', 'value': "config.cfg"},
            ]},
            {'name': 'Video', 'type': 'group', 'children': [
                {'name': 'GStreamer Video Source', 'type': 'list', 'values': {"Test Source": "videotestsrc", "Webcam": "v4l2src", "network": "udp"}, 'value': "videotestsrc", 'children': [
                    {'name': 'Network Source IP',
                        'type': 'str', 'value': "127.0.0.1"},
                ]},
                {'name': 'Video Frame Rate', 'type': 'float',
                    'value': 5e1, 'siPrefix': True, 'suffix': 'Hz'},
                {'name': 'Video Output File', 'type': 'str', 'value': "outvideo.mp4"},
                {'name': 'Video Output File Policy', 'type': 'list', 'values': {
                    "Overwrite": "overwrite", "Append": "append", "Enumerate": "enumerate"}, 'value': "overwrite"},
            ]},
            {'name': 'Annotation', 'type': 'group', 'children': [
                {'name': 'Data Sample Rate', 'type': 'float',
                    'value': 5e1, 'siPrefix': True, 'suffix': 'Hz'},
                {'name': 'Concurrent Labels', 'type': 'bool', 'value': False},
                {'name': 'Save Annotator Key Mapping',
                    'type': 'bool', 'value': True},
                {'name': 'Annotator Key Mapping Save File',
                    'type': 'str', 'value': "keymap.cfg"},
                {'name': 'Annotator Data Output Target', 'type': 'list', 'values': {
                    "File": "file", "Standard Output": "stdout"}, 'value': "file"},
                {'name': 'Data Output Filename', 'type': 'str',
                    'value': "annotated_data.txt"},
            ]},
            {'name': 'Plotting', 'type': 'group', 'children': [
                {'name': 'Plotted Samples', 'type': 'int', 'value': 500},
                {'name': 'Plotter Refresh Rate', 'type': 'float',
                    'value': 2e1, 'siPrefix': True, 'suffix': 'Hz'},
            ]},
        ]

        # MORE PARAMS TO BE IMPLEMENTED
        # - output video file path
        # - overwrite / append / create new output video file
        # - custom Gstreamer source string

        self.p = Parameter.create(
            name='params', type='group', children=defaultParams)

        """
        def flatten(param):
            items = []
            for ch in param.children():
                items.extend(flatten(ch).items())

            items.extend({param.name() : param.value()}.items())
            return dict(items)
        """

        self.t = parameterView  # use the ID of the promoted graphicsView
        self.t.setParameters(self.p, showTop=False)
        self.t.show()
开发者ID:schlagenhauf,项目名称:LiveAnnotation,代码行数:60,代码来源:liveannotation.py


示例11: set_paratree

 def set_paratree(self):
     global p, name
     params = []
     dicti = {'name': u'Settings', 'type': 'group', 'expanded': True}
     kinder = []
     for seti in sets:  
         kind = {'name':seti.get('Name')}
         if seti.get('Typ') == None:
             kind['type'] = 'str'
             kind['value'] = seti.get('Value')
         elif '[' in seti.get('Typ'):
             kind['type'] = 'list'
             kind['values']=self.__return_enum__(seti.get('Typ'))
             kind['value']  = seti.get('Value')
         else:                    
             kind['type'] =seti.get('Typ')
             kind['value']  = eval(seti.get('Value'))
         kinder.append(kind)
     dicti['children'] = kinder
     inp_dict = {'name': 'Aktionen', 'type': 'group', 'children': [
             {'name': 'Speichern', 'type': 'action'}
         ]}   
     params.append(dicti)
     params.append(inp_dict)        
     self.p = Parameter.create(name='params', type='group', children=params)
     self.p.param('Aktionen', 'Speichern').sigActivated.connect(self.save)
开发者ID:chrihuc,项目名称:steuerzentrale,代码行数:26,代码来源:gui_schalttafel.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: setupParameters

 def setupParameters(self):
     ssParams = [{'name':'Interface', 'type':'list', 'key':'target', 'values':['xmega (PDI)', 'avr (ISP)'], 'value':'xmega (PDI)'},
                 {'name':'Post-Reset Delay', 'type':'int', 'key':'toggledelay', 'limits':(0, 10E3), 'value':0, 'suffix':'mS'},
                 {'name':'Test Reset', 'type':'action', 'action':self.testReset}
                 ]
     self.params = Parameter.create(name='Reset AVR/XMEGA via CW-Lite', type='group', children=ssParams)
     ExtendedParameter.setupExtended(self.params, self)
开发者ID:EwanLu,项目名称:chipwhisperer,代码行数:7,代码来源:ResetCW1173Read.py


示例14: setupParameters

    def setupParameters(self):
        cpaalgos = {'Progressive':CPAProgressive,
                    'Simple':CPASimpleLoop}

        #if CPACython is not None:
        #    cpaalgos['Progressive-Cython'] = CPACython.AttackCPA_Progressive

        if CPAProgressive_CAccel is not None:
            cpaalgos['Progressive-C Accel'] = CPAProgressive_CAccel

        attackParams = [{'name':'CPA Algorithm', 'key':'CPA_algo', 'type':'list', 'values':cpaalgos, 'value':CPAProgressive, 'set':self.updateAlgorithm},
                        {'name':'Hardware Model', 'type':'group', 'children':[
                        {'name':'Crypto Algorithm', 'key':'hw_algo', 'type':'list', 'values':{'AES-128 (8-bit)':models_AES128_8bit}, 'value':'AES-128', 'set':self.updateScript},
                        {'name':'Leakage Model', 'key':'hw_leak', 'type':'list', 'values':models_AES128_8bit.leakagemodels, 'value':1, 'set':self.updateScript},
                        ]},

                       #TODO: Should be called from the AES module to figure out # of bytes
                       {'name':'Attacked Bytes', 'type':'group', 'children':
                         self.getByteList()
                        },
                      ]

        self.params = Parameter.create(name='Attack', type='group', children=attackParams)
        ExtendedParameter.setupExtended(self.params, self)

        self.setAnalysisAlgorithm(CPAProgressive, None, None)
        self.updateBytesVisible()
        self.updateScript()
开发者ID:EwanLu,项目名称:chipwhisperer,代码行数:28,代码来源:CPA.py


示例15: __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


示例16: setupParameters

    def setupParameters(self):
        ssParams = [{'name':'connection', 'type':'list', 'key':'con', 'values':{"System Serial Port":SimpleSerial_serial(showScriptParameter=self.showScriptParameter),
                                                                                "ChipWhisperer":SimpleSerial_ChipWhisperer(showScriptParameter=self.showScriptParameter),
                                                                                "ChipWhisperer-Lite":SimpleSerial_ChipWhispererLite(showScriptParameter=self.showScriptParameter)},
                                                                                'value':"System Serial Port", 'set':self.setConnection},
                    {'name':'Key Length', 'type':'list', 'values':[128, 256], 'value':128, 'set':self.setKeyLen},
                 #   {'name':'Plaintext Command', 'key':'ptcmd', 'type':'list', 'values':['p', 'h'], 'value':'p'},
                    {'name':'Init Command', 'key':'cmdinit', 'type':'str', 'value':''},
                    {'name':'Load Key Command', 'key':'cmdkey', 'type':'str', 'value':'k$KEY$\\n'},
                    {'name':'Load Input Command', 'key':'cmdinput', 'type':'str', 'value':''},
                    {'name':'Go Command','key':'cmdgo', 'type':'str', 'value':'p$TEXT$\\n'},
                    {'name':'Output Format', 'key':'cmdout', 'type':'str', 'value':'r$RESPONSE$\\n'},
                    #{'name':'Data Format', 'key':'datafmt', 'type':'list', 'values':{'DEADBEEF':'',
                    #                                                                 'DE AD BE EF':' ',
                    #                                                                 'DE:AD:BE:EF':':',
                    #                                                                 'DE-AD-BE-EF':'-'}, 'value':''},
                    ]
        self.params = Parameter.create(name='Target Connection', type='group', children=ssParams)
        ExtendedParameter.setupExtended(self.params, self)
        self.ser = None
        self.keylength = 16
        self.input = ""

        self.oa = None
        self.setConnection(self.findParam('con').value())
开发者ID:EwanLu,项目名称:chipwhisperer,代码行数:25,代码来源:SimpleSerial.py


示例17: __init__

    def __init__(self,console=None,showScriptParameter=None):
        super(VisaScope, self).__init__()
        self.showScriptParameter = showScriptParameter
        self.console = console
        self.visaInst = None

        scopeParams = [
                      {'name':'X-Scale', 'key':'xscale', 'type':'list', 'values':self.xScales},
                      {'name':'Y-Scale', 'key':'yscale', 'type':'list', 'values':self.yScales},
                      {'name':'Y-Offset', 'key':'yoffset', 'type':'float', 'step':1E-3, 'siPrefix': True, 'suffix': 'V'},
                      {'name':'X-Offset', 'key':'xoffset', 'type':'float', 'step':1E-6, 'siPrefix': True, 'suffix': 'S'},
                      {'name':'Download Offset', 'key':'xdisporigin', 'type':'int',  'limits':(0,1E9)},
                      {'name':'Download Size', 'key':'xdisprange', 'type':'int', 'limits':(0,1E9)},
                  ]




        for t in self.getAdditionalParams():
            scopeParams.append(t)



        self.params = Parameter.create(name='Scope Settings', type='group', children=scopeParams)
        ExtendedParameter.setupExtended(self.params, self)
开发者ID:92briank,项目名称:chipwhisperer,代码行数:25,代码来源:VisaScope.py


示例18: get_gop_index

def get_gop_index( index ):
	global allframeinfo,gopinfo,coded_video_frames
	frame_number = int( framerlog.currentItem().statusTip() )  
	params = [{'name': 'Frame Information', 'type': 'group', 'children': []}]
	params[0]['children'].append({'name': "key_frame", 'type': 'str', 'value':coded_video_frames[frame_number].key_frame, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "pkt_pts", 'type': 'str', 'value':coded_video_frames[frame_number].pkt_pts, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "pkt_pts_time", 'type': 'str', 'value':coded_video_frames[frame_number].pkt_pts_time, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "pkt_dts", 'type': 'str', 'value':coded_video_frames[frame_number].pkt_dts, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "pkt_dts_time", 'type': 'str', 'value':coded_video_frames[frame_number].pkt_dts_time, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "best_effort_timestamp", 'type': 'str', 'value':coded_video_frames[frame_number].best_effort_timestamp, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "best_effort_timestamp_time", 'type': 'str', 'value':coded_video_frames[frame_number].best_effort_timestamp_time, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "pkt_duration", 'type': 'str', 'value':coded_video_frames[frame_number].pkt_duration, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "pkt_duration_time", 'type': 'str', 'value':coded_video_frames[frame_number].pkt_duration_time, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "pkt_pos", 'type': 'str', 'value':coded_video_frames[frame_number].pkt_pos, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "pkt_size", 'type': 'str', 'value':coded_video_frames[frame_number].pkt_size, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "width", 'type': 'str', 'value':coded_video_frames[frame_number].width, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "height", 'type': 'str', 'value':coded_video_frames[frame_number].height, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "pix_fmt", 'type': 'str', 'value':coded_video_frames[frame_number].pix_fmt, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "sample_aspect_ratio", 'type': 'str', 'value':coded_video_frames[frame_number].sample_aspect_ratio, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "pict_type", 'type': 'str', 'value':coded_video_frames[frame_number].pict_type, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "coded_picture_number", 'type': 'str', 'value':coded_video_frames[frame_number].coded_picture_number, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "display_picture_number", 'type': 'str', 'value':coded_video_frames[frame_number].display_picture_number, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "interlaced_frame", 'type': 'str', 'value':coded_video_frames[frame_number].interlaced_frame, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "top_field_first", 'type': 'str', 'value':coded_video_frames[frame_number].top_field_first, 'siPrefix': False, 'suffix': '', 'readonly': True})
	params[0]['children'].append({'name': "repeat_pict", 'type': 'str', 'value':coded_video_frames[frame_number].repeat_pict, 'siPrefix': False, 'suffix': '', 'readonly': True})
	fp = Parameter.create(name='params', type='group', children=params)
	gopinfo.setParameters(fp, showTop=False)
开发者ID:Emerica,项目名称:tsmate,代码行数:27,代码来源:tsmate.py


示例19: setupUi

    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,代码行数:33,代码来源:ui_optim_sase.py


示例20: setupParameters

    def setupParameters(self):
        cpaalgos = {'Progressive':CPAProgressive,
                    'Simple':CPASimpleLoop}

        #if CPACython is not None:
        #    cpaalgos['Progressive-Cython'] = CPACython.AttackCPA_Progressive

        attackParams = [{'name':'CPA Algorithm', 'key':'CPA_algo', 'type':'list', 'values':cpaalgos, 'value':CPAProgressive, 'set':self.updateAlgorithm},
                        {'name':'Hardware Model', 'type':'group', 'children':[
                        {'name':'Crypto Algorithm', 'key':'hw_algo', 'type':'list', 'values':{'AES-128 (8-bit)':models_AES128_8bit, 'AES-256 (8-bit)':models_AES256_8bit}, 'value':'AES-128', 'set':self.updateScript},
                        {'name':'Key Round', 'key':'hw_round', 'type':'list', 'values':{'first':0, 'last':-1}, 'value':0, 'set':self.updateScript},
                        {'name':'Power Model', 'key':'hw_pwrmodel', 'type':'list', 'values':{'Hamming Weight':'HypHW', 'Hamming Distance':'HypHD'}, 'value':'Hamming Weight', 'set':self.updateScript},
                        {'name':'Direction', 'key':'aes_dir', 'type':'list', 'values':{'Encryption (PT=Input)':'enc', 'Decryption (PT=Input)':'dec'}, 'value':'enc', 'set':self.updateScript},
                        ]},

                       #TODO: Should be called from the AES module to figure out # of bytes
                       {'name':'Attacked Bytes', 'type':'group', 'children':
                         self.getByteList()
                        },
                      ]

        self.params = Parameter.create(name='Attack', type='group', children=attackParams)
        ExtendedParameter.setupExtended(self.params, self)

        self.setAnalysisAlgorithm(CPAProgressive, None, None)
        self.updateBytesVisible()
        self.updateScript()
开发者ID:92briank,项目名称:chipwhisperer,代码行数:27,代码来源:CPA.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python parametertree.ParameterTree类代码示例发布时间:2022-05-27
下一篇:
Python graphicsItems.ScatterPlotItem类代码示例发布时间: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