本文整理汇总了Python中Tinker.is_in_range方法的典型用法代码示例。如果您正苦于以下问题:Python Tinker.is_in_range方法的具体用法?Python Tinker.is_in_range怎么用?Python Tinker.is_in_range使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinker
的用法示例。
在下文中一共展示了Tinker.is_in_range方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_frequency
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_frequency(cls, d):
freq = d.get("freq_mhz")
freq_min = cls._C_INTERFACE_MHZ_RANGE[0]
freq_max = cls._C_INTERFACE_MHZ_RANGE[1]
if(freq is None):
Tinker.key_error("freq_mhz", Tinker.tostr_dict(d))
if(not Tinker.is_in_range(freq, freq_min, freq_max)):
Tinker.value_error_map("freq_mhz", str(freq),
"Range(0x%x, 0x%x)" % (freq_min, freq_max),
Tinker.tostr_dict(d))
示例2: check_size
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_size(cls, d):
sz = d.get("size")
sz_min = cls._C_INTERFACE_SIZE_RANGE[0]
sz_max = cls._C_INTERFACE_SIZE_RANGE[1]
if(sz is None):
Tinker.key_error("size", Tinker.tostr_dict(d))
if(not Tinker.is_in_range(sz, sz_min, sz_max)):
Tinker.value_error_map("size", str(hex(sz)),
"Range(0x%x, 0x%x)" % (sz_min, sz_max),
Tinker.tostr_dict(d))
示例3: check_width
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_width(cls,d):
w = parse_int(d, "width")
if(not Tinker.is_in_range(w,
cls._C_INTERFACE_WIDTH_RANGE[0],
cls._C_INTERFACE_WIDTH_RANGE[1])):
Tinker.value_error_map("width", str(w),
"range(%d, %d)"
% (cls._C_INTERFACE_WIDTH_RANGE[0],
cls._C_INTERFACE_WIDTH_RANGE[1]),
Tinker.tostr_dict(d))
示例4: parse_burst
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def parse_burst(cls,d):
b = parse_int(d, "burst")
if(not Tinker.is_in_range(b,cls._C_INTERFACE_BURST_RANGE[0],
cls._C_INTERFACE_BURST_RANGE[1])):
Tinker.value_error_map("burst", str(b),
"range(%d, %d)"
% (cls._C_INTERFACE_BURST_RANGE[0],
cls._C_INTERFACE_BURST_RANGE[1]),
Tinker.tostr_dict(d))
return b
示例5: check_bandwidth_bs
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_bandwidth_bs(cls, d):
bw = d.get("bandwidth_bs")
bw_min = cls._C_BANDWIDTH_BS_RANGE[0]
bw_max = cls._C_BANDWIDTH_BS_RANGE[1]
if(bw is None):
Tinker.key_error("bandwidth_bs", Tinker.tostr_dict(d))
if(not Tinker.is_in_range(bw,bw_min,bw_max)):
Tinker.value_error_map("bandwidth_bs", str(hex(bw)),
"Range(0x%x, 0x%x)" % (bw_min, bw_max),
Tinker.tostr_dict(d))
示例6: check_quantity
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_quantity(cls,d):
q = parse_int(d, "quantity")
if(not Tinker.is_in_range(q,
cls._C_INTERFACE_QUANTITY_RANGE[0],
cls._C_INTERFACE_QUANTITY_RANGE[1])):
Tinker.value_error_map("quantity", str(q),
"range(%d, %d)"
% (cls._C_INTERFACE_QUANTITY_RANGE[0],
cls._C_INTERFACE_QUANTITY_RANGE[1]),
Tinker.tostr_dict(d))
示例7: check_latency
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_latency(cls, d):
l = d.get("latency")
l_min = cls._C_LATENCY_RANGE[0]
l_max = cls._C_LATENCY_RANGE[1]
if(l is None):
Tinker.key_error("latency", Tinker.tostr_dict(d))
if(not Tinker.is_in_range(l, l_min, l_max)):
Tinker.value_error_map("latency", str(hex(l)),
"Range(0x%x, 0x%x)" % (l_min, l_max),
Tinker.tostr_dict(d))
示例8: check_dq_pins
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_dq_pins(cls, d):
p = d.get("dq_pins")
dq_min = cls._C_DQ_PIN_RANGE[0]
dq_max = cls._C_DQ_PIN_RANGE[1]
if(p is None):
Tinker.key_error("dq_pins", Tinker.tostr_dict(d))
if(not Tinker.is_in_range(p, dq_min, dq_max)):
Tinker.value_error_map("dq_pins", str(p),
"Range(0x%x, 0x%x)" % (dq_min, dq_max),
Tinker.tostr_dict(d))
示例9: check_fphy_frequency
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_fphy_frequency(cls, d):
fphy = d.get("fphy_mhz")
fphy_min = cls._C_FPHY_MHZ_RANGE[0]
fphy_max = cls._C_FPHY_MHZ_RANGE[1]
if(fphy is None):
Tinker.key_error("fphy_mhz", Tinker.tostr_dict(d))
if(not Tinker.is_in_range(fphy, fphy_min, fphy_max)):
Tinker.value_error_map("fphy_mhz", str(fphy),
"Range(0x%x, 0x%x)" % (fphy_min, fphy_max),
Tinker.tostr_dict(d))
示例10: check_resources
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_resources(cls, d):
rs = d.get("resources")
r_min = cls._C_RESOURCE_RANGE[0]
r_max = cls._C_RESOURCE_RANGE[1]
for rt in cls._C_RESOURCE_TYPES:
r = rs.get(rt, None)
if(r is None):
Tinker.key_error(rt, Tinker.tostr_dict(d))
if(not Tinker.is_in_range(r, r_min, r_max)):
Tinker.value_error_map(rt, str(hex(r)),
"Range(0x%x, 0x%x)" % (r_min, r_max),
Tinker.tostr_dict(d))
示例11: check_base_address
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_base_address(cls, d):
cls.check_size(d)
sz = d["size"]
base = d.get("base_address")
if(base is None):
Tinker.key_error("base_address", Tinker.tostr_dict(d))
if(not Tinker.is_in_range(base, 0, (2 ** 64) - sz)):
Tinker.value_error_map("base_address", str(base),
"Range(0x%x, 0x%x)" % (0, (2**64) - sz),
Tinker.tostr_dict(d))
if((base % sz) != 0):
Tinker.value_error_map("base_address", str(base),
"Multiples of 0x%x (Size)" % sz,
Tinker.tostr_dict(d))
示例12: check_size
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_size(cls, d):
sz = d.get("size")
sz_min = cls._C_SIZE_RANGE[0]
sz_max = cls._C_SIZE_RANGE[1]
if(sz is None):
Tinker.key_error("size", Tinker.tostr_dict(d))
if(not Tinker.is_in_range(sz, sz_min, sz_max)):
Tinker.value_error_map("size", str(hex(sz)),
"Range(0x%x, 0x%x)" % (sz_min, sz_max),
Tinker.tostr_dict(d))
if(not Tinker.is_pow_2(sz)):
Tinker.value_error_map("pow2_dq_pins", str(sz),
"Integer powers of 2",
Tinker.tostr_dict(d))
示例13: check_pow_2_dq_pins
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_pow_2_dq_pins(cls, d):
p = d.get("pow2_dq_pins")
pdq_min = cls._C_POW2_DQ_PIN_RANGE[0]
pdq_max = cls._C_POW2_DQ_PIN_RANGE[1]
if(p is None):
Tinker.key_error("pow2_dq_pins", Tinker.tostr_dict(d))
if(not Tinker.is_in_range(p, pdq_min, pdq_max)):
Tinker.value_error_map("pow2_dq_pins", str(p),
"Range(0x%x, 0x%x)" % (pdq_min, pdq_max),
Tinker.tostr_dict(d))
if(not Tinker.is_pow_2(p)):
Tinker.value_error_map("pow2_dq_pins", str(p),
"Integer powers of 2",
Tinker.tostr_dict(d))
示例14: check_width
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import is_in_range [as 别名]
def check_width(cls, d):
cls.check_pow_2_dq_pins(d)
cls.check_ratio(d)
p2dqp = d["pow2_dq_pins"]
r = d["ratio"]
rw = int(p2dqp* cls._C_RATE * ratio2int(r))
width = d.get("width")
if(width is None):
Tinker.key_error("width", Tinker.tostr_dict(d))
if(not Tinker.is_pow_2(width)):
Tinker.value_error_map("width", str(width),
"Integer powers of 2",
Tinker.tostr_dict(d))
if(width % p2dqp != 0):
Tinker.value_error_map("width", str(width),
"Multiple of 0x%x (Pow2 DQ Width)" % p2dqp,
Tinker.tostr_dict(d))
if(not Tinker.is_in_range(width, 0, cls._C_MAX_DATA_BUS_WIDTH)):
Tinker.value_error_map("width", str(width),
str(list(cls._C_MAX_DATA_BUS_WIDTH)),
Tinker.tostr_dict(d))
if(rw != width):
Tinker.value_error_map("width", str(w), str(rw), Tinker.tostr_dict(d))