123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html><head><title>Python: module gps</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>gps</strong></big></big></font></td
- ><td align=right valign=bottom
- ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/joachim/Development/INF-3910-3/GPS/gps/gps.py">/home/joachim/Development/INF-3910-3/GPS/gps/gps.py</a></font></td></tr></table>
- <p></p>
- <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="gps.html#Data">Data</a>
- </font></dt><dt><font face="helvetica, arial"><a href="gps.html#Location">Location</a>
- </font></dt><dt><font face="helvetica, arial"><a href="gps.html#NMEA">NMEA</a>
- </font></dt><dt><font face="helvetica, arial"><a href="gps.html#Value">Value</a>
- </font></dt><dd>
- <dl>
- <dt><font face="helvetica, arial"><a href="gps.html#Course">Course</a>
- </font></dt><dt><font face="helvetica, arial"><a href="gps.html#Distance">Distance</a>
- </font></dt><dt><font face="helvetica, arial"><a href="gps.html#HDOP">HDOP</a>
- </font></dt><dt><font face="helvetica, arial"><a href="gps.html#Position">Position</a>
- </font></dt><dt><font face="helvetica, arial"><a href="gps.html#Speed">Speed</a>
- </font></dt></dl>
- </dd>
- </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="Course">class <strong>Course</strong></a>(<a href="gps.html#Value">Value</a>)</font></td></tr>
-
- <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
- <td colspan=2><tt><a href="#Value">Value</a>: <a href="#Course">Course</a>/direction<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%"><dl><dt>Method resolution order:</dt>
- <dd><a href="gps.html#Course">Course</a></dd>
- <dd><a href="gps.html#Value">Value</a></dd>
- <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
- </dl>
- <hr>
- Methods defined here:<br>
- <dl><dt><a name="Course-__init__"><strong>__init__</strong></a>(self, v, t)</dt></dl>
- <hr>
- Methods inherited from <a href="gps.html#Value">Value</a>:<br>
- <dl><dt><a name="Course-__float__"><strong>__float__</strong></a>(self)</dt></dl>
- <dl><dt><a name="Course-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
- <dl><dt><a name="Course-rad"><strong>rad</strong></a>(self)</dt><dd><tt>Returns the value in radians.</tt></dd></dl>
- <dl><dt><a name="Course-time"><strong>time</strong></a>(self)</dt><dd><tt>Returns the measurment time.</tt></dd></dl>
- <dl><dt><a name="Course-unit"><strong>unit</strong></a>(self)</dt><dd><tt>Returns the unit</tt></dd></dl>
- <dl><dt><a name="Course-value"><strong>value</strong></a>(self)</dt><dd><tt>Returns the value</tt></dd></dl>
- <hr>
- Data descriptors inherited from <a href="gps.html#Value">Value</a>:<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="Data">class <strong>Data</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>Reads and stores data from the GPS<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%">Methods defined here:<br>
- <dl><dt><a name="Data-__init__"><strong>__init__</strong></a>(self, pins<font color="#909090">=('P3', 'P4')</font>, baud<font color="#909090">=9600</font>)</dt></dl>
- <dl><dt><a name="Data-get_location"><strong>get_location</strong></a>(self)</dt><dd><tt>Returns the location-data. Should be used when new_location returns True.</tt></dd></dl>
- <dl><dt><a name="Data-new_location"><strong>new_location</strong></a>(self, ttw<font color="#909090">=5</font>)</dt><dd><tt>Waits for the GPS to return data with an 'time to wait'-interval.<br>
- <br>
- Returns True if there is a new VALID location.</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="Distance">class <strong>Distance</strong></a>(<a href="gps.html#Value">Value</a>)</font></td></tr>
-
- <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
- <td colspan=2><tt><a href="#Value">Value</a>: <a href="#Distance">Distance</a><br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%"><dl><dt>Method resolution order:</dt>
- <dd><a href="gps.html#Distance">Distance</a></dd>
- <dd><a href="gps.html#Value">Value</a></dd>
- <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
- </dl>
- <hr>
- Methods defined here:<br>
- <dl><dt><a name="Distance-__init__"><strong>__init__</strong></a>(self, v, u, t)</dt></dl>
- <hr>
- Methods inherited from <a href="gps.html#Value">Value</a>:<br>
- <dl><dt><a name="Distance-__float__"><strong>__float__</strong></a>(self)</dt></dl>
- <dl><dt><a name="Distance-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
- <dl><dt><a name="Distance-rad"><strong>rad</strong></a>(self)</dt><dd><tt>Returns the value in radians.</tt></dd></dl>
- <dl><dt><a name="Distance-time"><strong>time</strong></a>(self)</dt><dd><tt>Returns the measurment time.</tt></dd></dl>
- <dl><dt><a name="Distance-unit"><strong>unit</strong></a>(self)</dt><dd><tt>Returns the unit</tt></dd></dl>
- <dl><dt><a name="Distance-value"><strong>value</strong></a>(self)</dt><dd><tt>Returns the value</tt></dd></dl>
- <hr>
- Data descriptors inherited from <a href="gps.html#Value">Value</a>:<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="HDOP">class <strong>HDOP</strong></a>(<a href="gps.html#Value">Value</a>)</font></td></tr>
-
- <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
- <td colspan=2><tt><a href="#HDOP">HDOP</a>: Horizontal dilution of precision.<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%"><dl><dt>Method resolution order:</dt>
- <dd><a href="gps.html#HDOP">HDOP</a></dd>
- <dd><a href="gps.html#Value">Value</a></dd>
- <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
- </dl>
- <hr>
- Methods defined here:<br>
- <dl><dt><a name="HDOP-__init__"><strong>__init__</strong></a>(self, v, t)</dt></dl>
- <dl><dt><a name="HDOP-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
- <dl><dt><a name="HDOP-__str__"><strong>__str__</strong></a>(self)</dt></dl>
- <hr>
- Methods inherited from <a href="gps.html#Value">Value</a>:<br>
- <dl><dt><a name="HDOP-__float__"><strong>__float__</strong></a>(self)</dt></dl>
- <dl><dt><a name="HDOP-rad"><strong>rad</strong></a>(self)</dt><dd><tt>Returns the value in radians.</tt></dd></dl>
- <dl><dt><a name="HDOP-time"><strong>time</strong></a>(self)</dt><dd><tt>Returns the measurment time.</tt></dd></dl>
- <dl><dt><a name="HDOP-unit"><strong>unit</strong></a>(self)</dt><dd><tt>Returns the unit</tt></dd></dl>
- <dl><dt><a name="HDOP-value"><strong>value</strong></a>(self)</dt><dd><tt>Returns the value</tt></dd></dl>
- <hr>
- Data descriptors inherited from <a href="gps.html#Value">Value</a>:<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="Location">class <strong>Location</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><a href="#Location">Location</a>:<br>
- Tries to read data received from the GPS.<br>
- Sometimes the GPS will return data for som<br>
- of the segments, e.g it may happens that<br>
- it wont receive the GPGGA-segment every time.<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%">Methods defined here:<br>
- <dl><dt><a name="Location-__init__"><strong>__init__</strong></a>(self)</dt></dl>
- <dl><dt><a name="Location-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
- <dl><dt><a name="Location-altitude"><strong>altitude</strong></a>(self)</dt><dd><tt>Returns the altitude</tt></dd></dl>
- <dl><dt><a name="Location-course"><strong>course</strong></a>(self)</dt><dd><tt>Returns the course</tt></dd></dl>
- <dl><dt><a name="Location-hdop"><strong>hdop</strong></a>(self)</dt><dd><tt>Returns the precision</tt></dd></dl>
- <dl><dt><a name="Location-height"><strong>height</strong></a>(self)</dt><dd><tt>Returns the height</tt></dd></dl>
- <dl><dt><a name="Location-latitude"><strong>latitude</strong></a>(self)</dt><dd><tt>Returns the latitude</tt></dd></dl>
- <dl><dt><a name="Location-longitude"><strong>longitude</strong></a>(self)</dt><dd><tt>Returns the longitude.</tt></dd></dl>
- <dl><dt><a name="Location-satellites"><strong>satellites</strong></a>(self)</dt><dd><tt>Returns the amount of satellites the GPS is connected to.</tt></dd></dl>
- <dl><dt><a name="Location-set"><strong>set</strong></a>(self, msgid, segment)</dt><dd><tt>Sets data based on the segment received<br>
- msgid, []byte: the segment type, e.g b'$GPGGA'<br>
- segment, []byte: the segment itself</tt></dd></dl>
- <dl><dt><a name="Location-speed"><strong>speed</strong></a>(self)</dt><dd><tt>Returns the speed</tt></dd></dl>
- <dl><dt><a name="Location-valid"><strong>valid</strong></a>(self)</dt><dd><tt>Returns wether or not the location is valid</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="NMEA">class <strong>NMEA</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>Just a class to describe the type of the received entry.<br>
- We should consider removing this to save space.<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%">Methods defined here:<br>
- <dl><dt><a name="NMEA-__init__"><strong>__init__</strong></a>(self, id)</dt></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="Position">class <strong>Position</strong></a>(<a href="gps.html#Value">Value</a>)</font></td></tr>
-
- <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
- <td colspan=2><tt><a href="#Value">Value</a>: <a href="#Position">Position</a><br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%"><dl><dt>Method resolution order:</dt>
- <dd><a href="gps.html#Position">Position</a></dd>
- <dd><a href="gps.html#Value">Value</a></dd>
- <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
- </dl>
- <hr>
- Methods defined here:<br>
- <dl><dt><a name="Position-__init__"><strong>__init__</strong></a>(self, v, u, t)</dt></dl>
- <dl><dt><a name="Position-__sub__"><strong>__sub__</strong></a>(self, other)</dt><dd><tt>Returns a new position with the subtracted value</tt></dd></dl>
- <hr>
- Methods inherited from <a href="gps.html#Value">Value</a>:<br>
- <dl><dt><a name="Position-__float__"><strong>__float__</strong></a>(self)</dt></dl>
- <dl><dt><a name="Position-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
- <dl><dt><a name="Position-rad"><strong>rad</strong></a>(self)</dt><dd><tt>Returns the value in radians.</tt></dd></dl>
- <dl><dt><a name="Position-time"><strong>time</strong></a>(self)</dt><dd><tt>Returns the measurment time.</tt></dd></dl>
- <dl><dt><a name="Position-unit"><strong>unit</strong></a>(self)</dt><dd><tt>Returns the unit</tt></dd></dl>
- <dl><dt><a name="Position-value"><strong>value</strong></a>(self)</dt><dd><tt>Returns the value</tt></dd></dl>
- <hr>
- Data descriptors inherited from <a href="gps.html#Value">Value</a>:<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="Speed">class <strong>Speed</strong></a>(<a href="gps.html#Value">Value</a>)</font></td></tr>
-
- <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
- <td colspan=2><tt><a href="#Value">Value</a>: <a href="#Speed">Speed</a><br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%"><dl><dt>Method resolution order:</dt>
- <dd><a href="gps.html#Speed">Speed</a></dd>
- <dd><a href="gps.html#Value">Value</a></dd>
- <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
- </dl>
- <hr>
- Methods defined here:<br>
- <dl><dt><a name="Speed-__init__"><strong>__init__</strong></a>(self, v, u, t)</dt></dl>
- <dl><dt><a name="Speed-to_kmh"><strong>to_kmh</strong></a>(self)</dt><dd><tt>Returns the speed in Km/h</tt></dd></dl>
- <dl><dt><a name="Speed-to_knot"><strong>to_knot</strong></a>(self)</dt><dd><tt>Returns the speed in knot</tt></dd></dl>
- <hr>
- Methods inherited from <a href="gps.html#Value">Value</a>:<br>
- <dl><dt><a name="Speed-__float__"><strong>__float__</strong></a>(self)</dt></dl>
- <dl><dt><a name="Speed-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
- <dl><dt><a name="Speed-rad"><strong>rad</strong></a>(self)</dt><dd><tt>Returns the value in radians.</tt></dd></dl>
- <dl><dt><a name="Speed-time"><strong>time</strong></a>(self)</dt><dd><tt>Returns the measurment time.</tt></dd></dl>
- <dl><dt><a name="Speed-unit"><strong>unit</strong></a>(self)</dt><dd><tt>Returns the unit</tt></dd></dl>
- <dl><dt><a name="Speed-value"><strong>value</strong></a>(self)</dt><dd><tt>Returns the value</tt></dd></dl>
- <hr>
- Data descriptors inherited from <a href="gps.html#Value">Value</a>:<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="Value">class <strong>Value</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>Defines a value received from the GPS<br>
- v, float: floating value<br>
- u, string: unit (e.g m, knot etc)<br>
- t, tuple: time when measured.<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%">Methods defined here:<br>
- <dl><dt><a name="Value-__float__"><strong>__float__</strong></a>(self)</dt></dl>
- <dl><dt><a name="Value-__init__"><strong>__init__</strong></a>(self, v, u, t<font color="#909090">=(0, 0, 0.0)</font>)</dt></dl>
- <dl><dt><a name="Value-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
- <dl><dt><a name="Value-rad"><strong>rad</strong></a>(self)</dt><dd><tt>Returns the value in radians.</tt></dd></dl>
- <dl><dt><a name="Value-time"><strong>time</strong></a>(self)</dt><dd><tt>Returns the measurment time.</tt></dd></dl>
- <dl><dt><a name="Value-unit"><strong>unit</strong></a>(self)</dt><dd><tt>Returns the unit</tt></dd></dl>
- <dl><dt><a name="Value-value"><strong>value</strong></a>(self)</dt><dd><tt>Returns the value</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></td></tr></table>
- </body></html>
|