本文整理汇总了Python中openadc.ExtendedParameter.ExtendedParameter.findParam方法的典型用法代码示例。如果您正苦于以下问题:Python ExtendedParameter.findParam方法的具体用法?Python ExtendedParameter.findParam怎么用?Python ExtendedParameter.findParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openadc.ExtendedParameter.ExtendedParameter
的用法示例。
在下文中一共展示了ExtendedParameter.findParam方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: updateGenericScript
# 需要导入模块: from openadc.ExtendedParameter import ExtendedParameter [as 别名]
# 或者: from openadc.ExtendedParameter.ExtendedParameter import findParam [as 别名]
def updateGenericScript(self, ignored=None):
runs = ExtendedParameter.findParam(ExtendedParameter, 'runs', self.traceParams)
atraces = ExtendedParameter.findParam(ExtendedParameter, 'atraces', self.traceParams)
strace = ExtendedParameter.findParam(ExtendedParameter, 'strace', self.traceParams)
ri = ExtendedParameter.findParam(ExtendedParameter, 'reportinterval', self.traceParams)
#print "runs = %d\natraces= %d\nstrace = %d\n"%(runs.value(), atraces.value(), strace.value())
if (runs.value() * atraces.value() + strace.value()) > (self.traceMax):
solv = (self.traceMax - strace.value()) / runs.value()
solv = int(solv)
atraces.setValue(solv)
atraces.setLimits((1, solv))
self.singleEmit = True
else:
lim = (1, self.traceMax)
#WORK-AROUND: need to emit an extra sigLimitsChanged???
if atraces.setLimits(lim) is None and self.singleEmit:
self.singleEmit = False
atraces.sigLimitsChanged.emit(atraces, lim)
pointrng = (self.findParam('startpoint', self.pointsParams).value(), self.findParam('endpoint', self.pointsParams).value())
self.addFunction("init", "setTraceStart", "%d" % strace.value())
self.addFunction("init", "setTracesPerAttack", "%d" % atraces.value())
self.addFunction("init", "setIterations", "%d" % runs.value())
self.addFunction("init", "setReportingInterval", "%d" % ri.value())
self.addFunction("init", "setPointRange", "(%d,%d)" % (pointrng[0], pointrng[1]))
示例2: setTraceLimits
# 需要导入模块: from openadc.ExtendedParameter import ExtendedParameter [as 别名]
# 或者: from openadc.ExtendedParameter.ExtendedParameter import findParam [as 别名]
def setTraceLimits(self, traces, points):
self.setGenericPointRange(0, points, setlimits=True)
self.traceMax = traces
self.addFunction("init", "setPointRange", "(%d,%d)" % (0, points))
# self.addFunction("init", "setTraceStart", "%d" % 0)
# self.addFunction("init", "setTracesPerAttack", "%d" % traces)
# self.addFunction("init", "setIterations", "%d" % 1)
strace = ExtendedParameter.findParam(ExtendedParameter, 'strace', self.traceParams)
ExtendedParameter.findParam(ExtendedParameter, 'runs', self.traceParams).setValue(1)
atrace = ExtendedParameter.findParam(ExtendedParameter, 'atraces', self.traceParams)
strace.setValue(0)
strace.setLimits((0,traces))
atrace.setValue(traces)
atrace.setLimits((1, traces))
self.traceLimitsChanged.emit(traces, points)