本文整理汇总了Python中pyqtgraph.parametertree.Parameter.create方法的典型用法代码示例。如果您正苦于以下问题:Python Parameter.create方法的具体用法?Python Parameter.create怎么用?Python Parameter.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph.parametertree.Parameter
的用法示例。
在下文中一共展示了Parameter.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onCalibrationChanged
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
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 )
示例2: __init__
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
def __init__(self,display, prefDock):
self.Gui = prefDock.Gui
self.prefDock = prefDock
self.display = display
super(preferenceTab, self).__init__()
self.p = Parameter.create(name='params', type='group')
#add parameters
self.pRemoveWidget = self.p.addChild(
{'name': 'Remove widget', 'type': 'action'})
self.plot_merge_dims = self.p.addChild(
plotMergeDims(self, self.display, name='Plot merge-dimensions'))
self.slice_image = self.p.addChild(
sliceImage(self, self.display, name='Slice Image'))
self.plot_basis_dims = self.p.addChild(
plotBasisDims(self, self.display, name='Plot basis-dimensions'))
self.pAddContentOf = self.p.addChild(
addContentOf(self, self.display, name='add Content of...'))
self.pViewOptions = self.p.addChild(
viewOptions(self, self.display, name='View Options'))
self.pPlotOptions = self.p.addChild(
plotOptions(self, self.display, name='Plot Options'))
self.save_restore = self.p.addChild(
saveRestorePrefs(self, name='Save/Restore preferences'))
#signals
self.pRemoveWidget.sigActivated.connect(self.remove)
if self.Gui.printChanges:
self.p.sigTreeStateChanged.connect(self.printChange)
self.setParameters(self.p, showTop=False)
#autosave
self.statePreferences = self.p.saveState()
self.showTabOnClick()
示例3: __init__
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
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()
示例4: __init__
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
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)
示例5: setupParameters
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
def setupParameters(self):
self.oa=None
self.driver = None
supported_readers = dicttype()
supported_readers["Select Reader"] = None
supported_readers["ChipWhisperer-SER"] = ReaderChipWhispererSER()
supported_readers["ChipWhisperer-USI"] = ReaderChipWhispererUSI()
supported_readers["ChipWhisperer-SCARD"] = ReaderChipWhispererSCard()
supported_readers["System Serial (SASEBO-W)"] = ReaderSystemSER()
try:
supported_readers["PC/SC Reader"] = ReaderPCSC()
except ImportError:
pass
ssParams = [{'name':'Reader Hardware', 'type':'list', 'values':supported_readers, 'value':None, 'set':self.setConnection},
#"BasicCard v7.5 (INCOMPLETE"):None,
#"Custom (INCOMPLETE)":None, "DPAContestv4 (INCOMPLETE)":None
{'name':'SmartCard Protocol', 'type':'list', 'values':{"SASEBO-W SmartCard OS":ProtocolSASEBOWCardOS(),
"ChipWhisperer-Dumb":None,
"JCard Test":ProtocolJCardTest(),
"DPA Contest 4.2":ProtocolDPAv42(),
}, 'value':None, 'set':self.setProtocol}
]
self.params = Parameter.create(name='Target Connection', type='group', children=ssParams)
ExtendedParameter.setupExtended(self.params, self)
示例6: setupUi
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
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)
示例7: set_paratree
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
def set_paratree(self):
global p, name
params = []
if self.isInputs:
inp_dict = {'name': u'Eingänge', 'type': 'group', 'expanded': True}
else:
inp_dict = {'name': u'Befehle', 'type': 'group', 'expanded': True}
inp_kinder = []
for aktuator in sorted(self.inputs):
if (aktuator.get('Description') <> None and self.inputsGroup in aktuator.get('Name') and self.isInputs) or (not self.isInputs and not aktuator.get('Name') in ['Name']):
if self.isInputs:
title = aktuator.get('Description')
else:
title = str(aktuator.get('Name'))
akt_dict = {'name': str(aktuator.get('Id')), 'title':title , 'type': 'group', 'expanded': False}
if self.expand == aktuator.get('Name'):
akt_dict['expanded']= True
kinder1 = []
kinder2 = []
kinder3, kinder4 = [], []
for sub in sorted(aktuator):
if sub in ['Logging','Setting','Doppelklick']:
if aktuator.get(sub) == '1':
kinder1.append({'name': sub, 'type': 'bool', 'value':True})
elif aktuator.get(sub) in ['0', None]:
kinder1.append({'name': sub, 'type': 'bool', 'value':False})
else:
kinder1.append({'name': sub, 'type': 'bool', 'value':eval(aktuator.get(sub))})
elif sub in ['Description']:
kinder2.append({'name': sub, 'title':'Beschreibung', 'type': 'str', 'value':aktuator.get(sub)})
elif sub in ['Value_lt','Value_eq','Value_gt']:
kinder3.append({'name': sub, 'type': 'str', 'value':aktuator.get(sub)})
elif sub in ['Immer','Wach','Wecken','Schlafen','Schlummern','Leise','AmGehen','Gegangen','Abwesend','Urlaub','Besuch','Doppel','Dreifach']:
kinder4.append({'name': sub, 'type': 'list','value': aktuator.get(sub), 'values':self._szn_lst})
elif sub in ['Id']:
pass
else:
kinder2.append({'name': sub, 'type': 'str', 'value':aktuator.get(sub)})
kinder = kinder1 + kinder2 + kinder3 + kinder4
akt_dict['children'] = kinder
inp_kinder.append(akt_dict)
inp_dict['children'] = inp_kinder
params.append(inp_dict)
if self.isInputs:
inp_dict = {'name': 'Aktionen', 'type': 'group', 'children': [
{'name': 'Speichere Inputs', 'type': 'action'}
]}
params.append(inp_dict)
else:
inp_dict = {'name': 'Aktionen', 'type': 'group', 'children': [
{'name': 'Speichere', 'type': 'action'},
{'name': 'Neues Kommando', 'type': 'action'}
]}
params.append(inp_dict)
self.p = Parameter.create(name='params', type='group', children=params)
if self.isInputs:
self.p.param('Aktionen', 'Speichere Inputs').sigActivated.connect(self.save)
else:
self.p.param('Aktionen', 'Speichere').sigActivated.connect(self.save)
self.p.param('Aktionen', 'Neues Kommando').sigActivated.connect(self.newCommand)
示例8: __init__
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
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)
示例9: __init__
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
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)
示例10: setupParameters
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
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())
示例11: __init__
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
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
示例12: __init__
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
def __init__(self, subkeys=16, permPerSubkey=256):
super(ResultsPlotData, self).__init__()
self.numKeys = subkeys
self.numPerms = permPerSubkey
self._knownkey = None
self.enabledbytes = [False] * subkeys
self.doRedraw = True
self.orfunction = None
self.byteNumAct = []
for i in range(0, self.numKeys):
self.byteNumAct.append(QAction("%d" % i, self))
self.byteNumAct[i].triggered[bool].connect(partial(self.setBytePlot, i))
self.byteNumAct[i].setCheckable(True)
byteNumAllOn = QAction("All On", self)
byteNumAllOff = QAction("All Off", self)
byteNumAllOn.triggered.connect(partial(self.setByteAll, False))
byteNumAllOff.triggered.connect(partial(self.setByteAll, True))
self.bselection = QToolBar()
for i in range(0, self.numKeys):
self.bselection.addAction(self.byteNumAct[i])
self.bselection.addAction(byteNumAllOn)
self.bselection.addAction(byteNumAllOff)
self.layout().addWidget(self.bselection)
self.highlightTop = True
resultsParams = self.genericParameters()
self.params = Parameter.create(name=self.name, type="group", children=resultsParams)
ExtendedParameter.setupExtended(self.params, self)
示例13: _draw_text_inputs
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
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
示例14: __init__
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
def __init__(self, parent, showScriptParameter=None, tmanager=None, console=None):
super(ProfilingTemplate, self).__init__()
if console:
self.console = console
self.setParent(parent)
self._tmanager = None
self._project = None
resultsParams = [{'name':'Load Template', 'type':'group', 'children':[
]},
{'name':'Generate New Template', 'type':'group', 'children':[
{'name':'Trace Start', 'key':'tgenstart', 'value':0, 'type':'int', 'set':self.updateScript},
{'name':'Trace End', 'key':'tgenstop', 'value':self.parent().traceMax, 'type':'int', 'set':self.updateScript},
{'name':'POI Selection', 'key':'poimode', 'type':'list', 'values':{'TraceExplorer Table':0, 'Read from Project File':1}, 'value':0, 'set':self.updateScript},
{'name':'Read POI', 'type':'action', 'action':self.updateScript},
{'name':'Generate Templates', 'type':'action', 'action': lambda:self.runScriptFunction.emit("generateTemplates")}
]},
]
self.params = Parameter.create(name='Template Attack', type='group', children=resultsParams)
if showScriptParameter is not None:
self.showScriptParameter = showScriptParameter
# print self.showScriptParameter
ExtendedParameter.setupExtended(self.params, self)
self.addGroup("generateTemplates")
self.sr = None
self.stats = DataTypeDiffs()
self.setProfileAlgorithm(TemplateBasic)
示例15: setupParameters
# 需要导入模块: from pyqtgraph.parametertree import Parameter [as 别名]
# 或者: from pyqtgraph.parametertree.Parameter import create [as 别名]
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()