当前位置: 首页>>代码示例>>Python>>正文


Python Parameter.setParameter方法代码示例

本文整理汇总了Python中chipwhisperer.common.utils.parameter.Parameter.setParameter方法的典型用法代码示例。如果您正苦于以下问题:Python Parameter.setParameter方法的具体用法?Python Parameter.setParameter怎么用?Python Parameter.setParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在chipwhisperer.common.utils.parameter.Parameter的用法示例。


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

示例1: updateParams

# 需要导入模块: from chipwhisperer.common.utils.parameter import Parameter [as 别名]
# 或者: from chipwhisperer.common.utils.parameter.Parameter import setParameter [as 别名]
    def updateParams(self, _=None):
        rng = self.findParam("range").getValue()

        # Force to be valid values
        curval = self.findParam("curval").getValue()
        curval = max(curval, rng[0])
        curval = min(curval, rng[1])
        self.findParam("curval").setLimits(rng)
        self.findParam("curval").setValue(curval)

        self.paramRange = rng
        self.paramValueItem = self.findParam("curval")
        self.paramStep = self.findParam("step").getValue()
        self.paramRepeat = self.findParam("repeat").getValue()
        self.paramType = self.findParam("datatype").getValue()
        try:
            self.paramScript = eval(self.findParam("parampath").getValue())
        except SyntaxError as e:
            logging.error("Syntax Error: %s" % str(e))

        try:
            Parameter.setParameter(self.paramScript + [curval])
        except:
            pass
        self.tracesrequired = (
            math.ceil(((self.paramRange[1] - self.paramRange[0]) / self.paramStep) * self.paramRepeat) + 1
        )
        self.tracesreqChanged.emit(self.paramNum, self.tracesrequired)
开发者ID:,项目名称:,代码行数:30,代码来源:

示例2: findNewValue

# 需要导入模块: from chipwhisperer.common.utils.parameter import Parameter [as 别名]
# 或者: from chipwhisperer.common.utils.parameter.Parameter import setParameter [as 别名]
    def findNewValue(self, mode="linear"):
        """ Find new value for this parameter """

        if str.lower(mode) == "linear":
            self.cnt += 1
            if self.cnt == self.paramRepeat:
                # Done this one, next step
                self.cnt = 0
                newval = self.paramValueItem.getValue() + self.paramStep

                if newval > self.paramRange[1]:
                    newval = self.paramRange[0]
                    self.rangeComplete.emit(self.paramNum)

                # Cast type to required value
                newval = self.paramType(newval)

                self.paramValueItem.setValue(newval)

                parameter = self.paramScript + [newval]
                try:
                    Parameter.setParameter(parameter)
                except:
                    raise StopIteration("Choose a valid Parameter Path/Value combination. Got: " + str(parameter))
        else:
            raise ValueError("Unknown Increment Type %s" % mode)
开发者ID:,项目名称:,代码行数:28,代码来源:

示例3: dcmTimeout

# 需要导入模块: from chipwhisperer.common.utils.parameter import Parameter [as 别名]
# 或者: from chipwhisperer.common.utils.parameter.Parameter import setParameter [as 别名]
 def dcmTimeout(self):
     try:
         self.qtadc.sc.getStatus()
         # The following happen with signals, so a failure will likely occur outside of the try...except
         # For this reason we do the call to .getStatus() to verify USB connection first
         Parameter.setParameter(['OpenADC', 'Clock Setup', 'Refresh Status', None], blockSignal=True)
         Parameter.setParameter(['OpenADC', 'Trigger Setup', 'Refresh Status', None], blockSignal=True)
     except Exception as e:
         self.dis()
         raise e
开发者ID:FrankMuenzner,项目名称:chipwhisperer,代码行数:12,代码来源:OpenADC.py

示例4: setParameter

# 需要导入模块: from chipwhisperer.common.utils.parameter import Parameter [as 别名]
# 或者: from chipwhisperer.common.utils.parameter.Parameter import setParameter [as 别名]
 def setParameter(self, pathAndValue):
     """Set the parameter value, given its path. It should be registered in Parameter.registeredParameters"""
     Parameter.setParameter(pathAndValue)
开发者ID:phonchi,项目名称:chipwhisperer,代码行数:5,代码来源:CWCoreAPI.py

示例5: __init__

# 需要导入模块: from chipwhisperer.common.utils.parameter import Parameter [as 别名]
# 或者: from chipwhisperer.common.utils.parameter.Parameter import setParameter [as 别名]
    def __init__(self, parent):
        super(GlitchExplorerDialog, self).__init__(parent)
        self.setWindowTitle("Glitch Explorer")
        self.setMinimumWidth(500)

        self.mainLayout = QVBoxLayout()
        self.mainSplitter = QSplitter(self)
        self.mainSplitter.setOrientation(Qt.Vertical)

        self.tableList = []
        self.tuneParamList = []

        # Add default table
        self.table = QTableWidget(1, 1)
        # self.table.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.mainSplitter.addWidget(self.table)

        self.getParams().register()
        self.getParams().addChildren(
            [
                {"name": "Clear Output Table", "type": "action", "action": self.clearTable},
                {"name": "Plot Widget", "type": "action", "action": self.openPlotWidget},
                {
                    "name": "Reset",
                    "type": "action",
                    "action": self.reset,
                    "tip": "Resets all Tuning Parameters to its minimum value.",
                },
                {
                    "name": "Tuning Parameters",
                    "key": "numtune",
                    "type": "int",
                    "value": 0,
                    "limits": (0, 4),
                    "action": self.updateParameters,
                    "readonly": False,
                },
                {
                    "name": "Traces Required",
                    "key": "tracesreq",
                    "type": "int",
                    "value": 1,
                    "limits": (1, 1e99),
                    "readonly": True,
                    "children": [
                        {
                            "name": "Use this value",
                            "type": "action",
                            "action": lambda _: Parameter.setParameter(
                                [
                                    "Generic Settings",
                                    "Acquisition Settings",
                                    "Number of Traces",
                                    self.findParam("tracesreq").getValue(),
                                ]
                            ),
                        }
                    ],
                },
                {"name": "Normal Response", "type": "str", "key": "normalresp", "value": 's.startswith("Bad")'},
                {
                    "name": "Successful Response",
                    "type": "str",
                    "key": "successresp",
                    "value": 's.startswith("Welcome")',
                },
                {
                    "name": "Recordings",
                    "type": "group",
                    "expanded": False,
                    "children": [
                        {
                            "name": "Load existing",
                            "type": "action",
                            "key": "open",
                            "action": lambda _: self.loadRecordings(),
                        },
                        {"name": "Autosave Multi-Capture Results", "type": "bool", "key": "saveresults", "value": True},
                        {
                            "name": "Autosaved filename",
                            "type": "str",
                            "key": "savefilename",
                            "value": "",
                            "readonly": True,
                        },
                        {"name": "Notes", "type": "text", "key": "savenotes", "value": ""},
                    ],
                },
            ]
        )

        self.paramTree = ParameterTree()
        self.paramTree.addParameters(self.getParams()._PyQtGraphParameter)
        self.mainSplitter.addWidget(self.paramTree)

        self.statusLabel = QLabel("")

        self.mainSplitter.addWidget(self.statusLabel)

        # self.mainSplitter.setHandleWidth(100)
#.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:103,代码来源:


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