<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module telemetry.internal.platform.profiler.monsoon</title>
<meta charset="utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.internal.html"><font color="#ffffff">internal</font></a>.<a href="telemetry.internal.platform.html"><font color="#ffffff">platform</font></a>.<a href="telemetry.internal.platform.profiler.html"><font color="#ffffff">profiler</font></a>.monsoon</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/internal/platform/profiler/monsoon.py">telemetry/internal/platform/profiler/monsoon.py</a></font></td></tr></table>
<p><tt>Interface for a USB-connected <a href="#Monsoon">Monsoon</a> power meter.<br>
<br>
<a href="http://msoon.com/LabEquipment/PowerMonitor/">http://msoon.com/LabEquipment/PowerMonitor/</a><br>
Currently Unix-only. Relies on fcntl, /dev, and /tmp.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="collections.html">collections</a><br>
<a href="logging.html">logging</a><br>
</td><td width="25%" valign=top><a href="os.html">os</a><br>
<a href="select.html">select</a><br>
</td><td width="25%" valign=top><a href="serial.html">serial</a><br>
<a href="struct.html">struct</a><br>
</td><td width="25%" valign=top><a href="time.html">time</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.internal.platform.profiler.monsoon.html#Monsoon">Monsoon</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="__builtin__.html#tuple">__builtin__.tuple</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.internal.platform.profiler.monsoon.html#Power">Power</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Monsoon">class <strong>Monsoon</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Provides a simple class to use the power meter.<br>
<br>
mon = monsoon.<a href="#Monsoon">Monsoon</a>()<br>
mon.<a href="#Monsoon-SetVoltage">SetVoltage</a>(3.7)<br>
mon.<a href="#Monsoon-StartDataCollection">StartDataCollection</a>()<br>
mydata = []<br>
while len(mydata) < 1000:<br>
mydata.extend(mon.<a href="#Monsoon-CollectData">CollectData</a>())<br>
mon.<a href="#Monsoon-StopDataCollection">StopDataCollection</a>()<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Monsoon-CollectData"><strong>CollectData</strong></a>(self)</dt><dd><tt>Return some current samples. Call <a href="#Monsoon-StartDataCollection">StartDataCollection</a>() first.</tt></dd></dl>
<dl><dt><a name="Monsoon-GetStatus"><strong>GetStatus</strong></a>(self)</dt><dd><tt>Requests and waits for status. Returns status dictionary.</tt></dd></dl>
<dl><dt><a name="Monsoon-SetMaxCurrent"><strong>SetMaxCurrent</strong></a>(self, a)</dt><dd><tt>Set the max output current. the unit of |a| : Amperes</tt></dd></dl>
<dl><dt><a name="Monsoon-SetStartupCurrent"><strong>SetStartupCurrent</strong></a>(self, a)</dt><dd><tt>Set the max startup output current. the unit of |a| : Amperes</tt></dd></dl>
<dl><dt><a name="Monsoon-SetUsbPassthrough"><strong>SetUsbPassthrough</strong></a>(self, val)</dt><dd><tt>Set the USB passthrough mode: 0 = off, 1 = on, 2 = auto.</tt></dd></dl>
<dl><dt><a name="Monsoon-SetVoltage"><strong>SetVoltage</strong></a>(self, v)</dt><dd><tt>Set the output voltage, 0 to disable.</tt></dd></dl>
<dl><dt><a name="Monsoon-StartDataCollection"><strong>StartDataCollection</strong></a>(self)</dt><dd><tt>Tell the device to start collecting and sending measurement data.</tt></dd></dl>
<dl><dt><a name="Monsoon-StopDataCollection"><strong>StopDataCollection</strong></a>(self)</dt><dd><tt>Tell the device to stop collecting measurement data.</tt></dd></dl>
<dl><dt><a name="Monsoon-__init__"><strong>__init__</strong></a>(self, device<font color="#909090">=None</font>, serialno<font color="#909090">=None</font>, wait<font color="#909090">=True</font>)</dt><dd><tt>Establish a connection to a <a href="#Monsoon">Monsoon</a>.<br>
<br>
By default, opens the first available port, waiting if none are ready.<br>
A particular port can be specified with 'device', or a particular <a href="#Monsoon">Monsoon</a><br>
can be specified with 'serialno' (using the number printed on its back).<br>
With wait=False, IOError is thrown if a device is not immediately available.</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Power">class <strong>Power</strong></a>(<a href="__builtin__.html#tuple">__builtin__.tuple</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt><a href="#Power">Power</a>(amps, volts)<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="telemetry.internal.platform.profiler.monsoon.html#Power">Power</a></dd>
<dd><a href="__builtin__.html#tuple">__builtin__.tuple</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Power-__getnewargs__"><strong>__getnewargs__</strong></a>(self)</dt><dd><tt>Return self as a plain <a href="__builtin__.html#tuple">tuple</a>. Used by copy and pickle.</tt></dd></dl>
<dl><dt><a name="Power-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Exclude the OrderedDict from pickling</tt></dd></dl>
<dl><dt><a name="Power-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Return a nicely formatted representation string</tt></dd></dl>
<dl><dt><a name="Power-_asdict"><strong>_asdict</strong></a>(self)</dt><dd><tt>Return a new OrderedDict which maps field names to their values</tt></dd></dl>
<dl><dt><a name="Power-_replace"><strong>_replace</strong></a>(_self, **kwds)</dt><dd><tt>Return a new <a href="#Power">Power</a> <a href="__builtin__.html#object">object</a> replacing specified fields with new values</tt></dd></dl>
<hr>
Class methods defined here:<br>
<dl><dt><a name="Power-_make"><strong>_make</strong></a>(cls, iterable, new<font color="#909090">=<built-in method __new__ of type object></font>, len<font color="#909090">=<built-in function len></font>)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Make a new <a href="#Power">Power</a> <a href="__builtin__.html#object">object</a> from a sequence or iterable</tt></dd></dl>
<hr>
Static methods defined here:<br>
<dl><dt><a name="Power-__new__"><strong>__new__</strong></a>(_cls, amps, volts)</dt><dd><tt>Create new instance of <a href="#Power">Power</a>(amps, volts)</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>Return a new OrderedDict which maps field names to their values</tt></dd>
</dl>
<dl><dt><strong>amps</strong></dt>
<dd><tt>Alias for field number 0</tt></dd>
</dl>
<dl><dt><strong>volts</strong></dt>
<dd><tt>Alias for field number 1</tt></dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>_fields</strong> = ('amps', 'volts')</dl>
<hr>
Methods inherited from <a href="__builtin__.html#tuple">__builtin__.tuple</a>:<br>
<dl><dt><a name="Power-__add__"><strong>__add__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__add__">__add__</a>(y) <==> x+y</tt></dd></dl>
<dl><dt><a name="Power-__contains__"><strong>__contains__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__contains__">__contains__</a>(y) <==> y in x</tt></dd></dl>
<dl><dt><a name="Power-__eq__"><strong>__eq__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__eq__">__eq__</a>(y) <==> x==y</tt></dd></dl>
<dl><dt><a name="Power-__ge__"><strong>__ge__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__ge__">__ge__</a>(y) <==> x>=y</tt></dd></dl>
<dl><dt><a name="Power-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
<dl><dt><a name="Power-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
<dl><dt><a name="Power-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br>
<br>
Use of negative indices is not supported.</tt></dd></dl>
<dl><dt><a name="Power-__gt__"><strong>__gt__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__gt__">__gt__</a>(y) <==> x>y</tt></dd></dl>
<dl><dt><a name="Power-__hash__"><strong>__hash__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__hash__">__hash__</a>() <==> hash(x)</tt></dd></dl>
<dl><dt><a name="Power-__iter__"><strong>__iter__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__iter__">__iter__</a>() <==> iter(x)</tt></dd></dl>
<dl><dt><a name="Power-__le__"><strong>__le__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__le__">__le__</a>(y) <==> x<=y</tt></dd></dl>
<dl><dt><a name="Power-__len__"><strong>__len__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__len__">__len__</a>() <==> len(x)</tt></dd></dl>
<dl><dt><a name="Power-__lt__"><strong>__lt__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__lt__">__lt__</a>(y) <==> x<y</tt></dd></dl>
<dl><dt><a name="Power-__mul__"><strong>__mul__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__mul__">__mul__</a>(n) <==> x*n</tt></dd></dl>
<dl><dt><a name="Power-__ne__"><strong>__ne__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__ne__">__ne__</a>(y) <==> x!=y</tt></dd></dl>
<dl><dt><a name="Power-__rmul__"><strong>__rmul__</strong></a>(...)</dt><dd><tt>x.<a href="#Power-__rmul__">__rmul__</a>(n) <==> n*x</tt></dd></dl>
<dl><dt><a name="Power-__sizeof__"><strong>__sizeof__</strong></a>(...)</dt><dd><tt>T.<a href="#Power-__sizeof__">__sizeof__</a>() -- size of T in memory, in bytes</tt></dd></dl>
<dl><dt><a name="Power-count"><strong>count</strong></a>(...)</dt><dd><tt>T.<a href="#Power-count">count</a>(value) -> integer -- return number of occurrences of value</tt></dd></dl>
<dl><dt><a name="Power-index"><strong>index</strong></a>(...)</dt><dd><tt>T.<a href="#Power-index">index</a>(value, [start, [stop]]) -> integer -- return first index of value.<br>
Raises ValueError if the value is not present.</tt></dd></dl>
</td></tr></table></td></tr></table>
</body></html>