convert.py (12247:c627617910e8) convert.py (12251:5c3d3a1db483)
1# Copyright (c) 2005 The Regents of The University of Michigan
2# Copyright (c) 2010 Advanced Micro Devices, Inc.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 228 unchanged lines hidden (view full) ---

237 raise ValueError, 'invalid port %s' % port
238 return (ip, int(port))
239
240def toVoltage(value):
241 return toMetricFloat(value, 'voltage', 'V')
242
243def toCurrent(value):
244 return toMetricFloat(value, 'current', 'A')
1# Copyright (c) 2005 The Regents of The University of Michigan
2# Copyright (c) 2010 Advanced Micro Devices, Inc.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 228 unchanged lines hidden (view full) ---

237 raise ValueError, 'invalid port %s' % port
238 return (ip, int(port))
239
240def toVoltage(value):
241 return toMetricFloat(value, 'voltage', 'V')
242
243def toCurrent(value):
244 return toMetricFloat(value, 'current', 'A')
245
246def toEnergy(value):
247 return toMetricFloat(value, 'energy', 'J')