本文整理汇总了Python中chipwhisperer.common.utils.parameter.Parameter.hide方法的典型用法代码示例。如果您正苦于以下问题:Python Parameter.hide方法的具体用法?Python Parameter.hide怎么用?Python Parameter.hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chipwhisperer.common.utils.parameter.Parameter
的用法示例。
在下文中一共展示了Parameter.hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TraceExplorerDialog
# 需要导入模块: from chipwhisperer.common.utils.parameter import Parameter [as 别名]
# 或者: from chipwhisperer.common.utils.parameter.Parameter import hide [as 别名]
class TraceExplorerDialog(AutoScript, Parameterized):
"""Open dialog to explore trace properties, data graphs, etc"""
_name = "Trace Explorer"
def __init__(self, parent):
AutoScript.__init__(self)
self.enabled = False
self.autoScriptInit()
# Add example scripts to this list
self.exampleScripts = [PartitionDisplay(self), TextDisplay(self)]
# Add Scripts
self.setupCommonScripts()
self.progressBar = ProgressBar(show=False)
def setupCommonScripts(self):
# Setup parameer tree
self.getParams().addChildren([
{'name':'Enabled', 'key':'enabled', 'type':'bool', 'default':self.getEnabled(), 'get':self.getEnabled, 'set':self.setEnabled}
])
self.commonScriptParams = []
self.paramCommonScripts = Parameter(name='Common Scripts', type='group', children=self.commonScriptParams)
for example in self.exampleScripts:
self.paramCommonScripts.append(example.getParams())
example.scriptsUpdated.connect(self.updateScripts)
example.runScriptFunction.connect(self.runScriptFunction.emit)
self.getParams().append(self.paramCommonScripts)
self.paramCommonScripts.hide()
self.updateScripts()
def getEnabled(self):
return self.enabled
@setupSetParam("Enabled")
def setEnabled(self, enabled):
self.enabled = enabled
self.paramCommonScripts.show(enabled)
self.updateChildren()
####COMMON SCRIPTING STUFF
def getProgressIndicator(self):
return self.progressBar
def updateChildren(self):
for example in self.exampleScripts:
if hasattr(example, 'updateScript'):
example.updateScript("traceexplorer_show")
self.updateScripts()
def updateScripts(self):
for index, example in enumerate(self.exampleScripts):
if hasattr(example, "_smartstatements"):
for k in example._smartstatements:
statements = example.getStatements(k)
if len(statements) > 0:
prefix = example.__class__.__name__ + "_"
self._smartstatements[prefix + k] = example._smartstatements[k]
self._smartstatements[prefix + k].addSelfReplacement("exampleScripts[%d]." % index)
for k in example.getImportStatements():
self.importsAppend(k)
self.scriptsUpdated.emit()