params.py (10405:7a618c07e663) | params.py (10427:26fee6c20087) |
---|---|
1# Copyright (c) 2012-2014 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 1471 unchanged lines hidden (view full) --- 1480 1481 def getValue(self): 1482 value = float(self) 1483 return value 1484 1485 def ini_str(self): 1486 return '%f' % self.getValue() 1487 | 1# Copyright (c) 2012-2014 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 1471 unchanged lines hidden (view full) --- 1480 1481 def getValue(self): 1482 value = float(self) 1483 return value 1484 1485 def ini_str(self): 1486 return '%f' % self.getValue() 1487 |
1488class Current(float, ParamValue): 1489 cxx_type = 'double' 1490 ex_str = "1mA" 1491 cmd_line_settable = False 1492 1493 def __new__(cls, value): 1494 # convert to current 1495 val = convert.toCurrent(value) 1496 return super(cls, Current).__new__(cls, val) 1497 1498 def __call__(self, value): 1499 val = convert.toCurrent(value) 1500 self.__init__(val) 1501 return value 1502 1503 def __str__(self): 1504 return str(self.getValue()) 1505 1506 def getValue(self): 1507 value = float(self) 1508 return value 1509 1510 def ini_str(self): 1511 return '%f' % self.getValue() 1512 |
|
1488class NetworkBandwidth(float,ParamValue): 1489 cxx_type = 'float' 1490 ex_str = "1Gbps" 1491 cmd_line_settable = True 1492 1493 def __new__(cls, value): 1494 # convert to bits per second 1495 val = convert.toNetworkBandwidth(value) --- 441 unchanged lines hidden --- | 1513class NetworkBandwidth(float,ParamValue): 1514 cxx_type = 'float' 1515 ex_str = "1Gbps" 1516 cmd_line_settable = True 1517 1518 def __new__(cls, value): 1519 # convert to bits per second 1520 val = convert.toNetworkBandwidth(value) --- 441 unchanged lines hidden --- |