| |
- __builtin__.object
-
- Monsoon
- __builtin__.tuple(__builtin__.object)
-
- Power
class Monsoon(__builtin__.object) |
|
Provides a simple class to use the power meter.
mon = monsoon.Monsoon()
mon.SetVoltage(3.7)
mon.StartDataCollection()
mydata = []
while len(mydata) < 1000:
mydata.extend(mon.CollectData())
mon.StopDataCollection() |
|
Methods defined here:
- CollectData(self)
- Return some current samples. Call StartDataCollection() first.
- GetStatus(self)
- Requests and waits for status. Returns status dictionary.
- SetMaxCurrent(self, a)
- Set the max output current. the unit of |a| : Amperes
- SetStartupCurrent(self, a)
- Set the max startup output current. the unit of |a| : Amperes
- SetUsbPassthrough(self, val)
- Set the USB passthrough mode: 0 = off, 1 = on, 2 = auto.
- SetVoltage(self, v)
- Set the output voltage, 0 to disable.
- StartDataCollection(self)
- Tell the device to start collecting and sending measurement data.
- StopDataCollection(self)
- Tell the device to stop collecting measurement data.
- __init__(self, device=None, serialno=None, wait=True)
- Establish a connection to a Monsoon.
By default, opens the first available port, waiting if none are ready.
A particular port can be specified with 'device', or a particular Monsoon
can be specified with 'serialno' (using the number printed on its back).
With wait=False, IOError is thrown if a device is not immediately available.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Power(__builtin__.tuple) |
|
Power(amps, volts) |
|
- Method resolution order:
- Power
- __builtin__.tuple
- __builtin__.object
Methods defined here:
- __getnewargs__(self)
- Return self as a plain tuple. Used by copy and pickle.
- __getstate__(self)
- Exclude the OrderedDict from pickling
- __repr__(self)
- Return a nicely formatted representation string
- _asdict(self)
- Return a new OrderedDict which maps field names to their values
- _replace(_self, **kwds)
- Return a new Power object replacing specified fields with new values
Class methods defined here:
- _make(cls, iterable, new=<built-in method __new__ of type object>, len=<built-in function len>) from __builtin__.type
- Make a new Power object from a sequence or iterable
Static methods defined here:
- __new__(_cls, amps, volts)
- Create new instance of Power(amps, volts)
Data descriptors defined here:
- __dict__
- Return a new OrderedDict which maps field names to their values
- amps
- Alias for field number 0
- volts
- Alias for field number 1
Data and other attributes defined here:
- _fields = ('amps', 'volts')
Methods inherited from __builtin__.tuple:
- __add__(...)
- x.__add__(y) <==> x+y
- __contains__(...)
- x.__contains__(y) <==> y in x
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __getslice__(...)
- x.__getslice__(i, j) <==> x[i:j]
Use of negative indices is not supported.
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hash__(...)
- x.__hash__() <==> hash(x)
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __mul__(...)
- x.__mul__(n) <==> x*n
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __rmul__(...)
- x.__rmul__(n) <==> n*x
- __sizeof__(...)
- T.__sizeof__() -- size of T in memory, in bytes
- count(...)
- T.count(value) -> integer -- return number of occurrences of value
- index(...)
- T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
| |