firebug-cvs Mailing List for FireBug: wireless wildfire monitoring (Page 11)
Brought to you by:
doolin
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(36) |
Jun
(45) |
Jul
(108) |
Aug
(31) |
Sep
(2) |
Oct
(4) |
Nov
(113) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(63) |
Feb
(37) |
Mar
(24) |
Apr
(6) |
May
(5) |
Jun
(5) |
Jul
(71) |
Aug
(42) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(64) |
Jun
(71) |
Jul
(51) |
Aug
(89) |
Sep
(24) |
Oct
(1) |
Nov
(1) |
Dec
(2) |
2006 |
Jan
|
Feb
|
Mar
(3) |
Apr
(2) |
May
|
Jun
|
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: David M. D. <do...@us...> - 2005-06-07 01:26:15
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25600 Modified Files: geocodeinfo_rfs.xsl google_rfs.xml Log Message: Changed zoom to center on RFS 454. Index: google_rfs.xml =================================================================== RCS file: /cvsroot/firebug/firebug/web/google_rfs.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** google_rfs.xml 7 Jun 2005 00:44:33 -0000 1.1 --- google_rfs.xml 7 Jun 2005 01:26:06 -0000 1.2 *************** *** 4,9 **** <query>Why?</query> <request/> ! <center lat="37.9" lng="-122.33"/> ! <span lat="0.017998" lng="0.027586"/> <overlay panelStyle="sidepanel.xsl"> --- 4,13 ---- <query>Why?</query> <request/> ! <center lat="37.9177" lng="-122.332"/> ! <!-- Original --> ! <!-- ! <span lat="0.0179" lng="0.027586"/> ! --> ! <span lat="0.002" lng="0.003"/> <overlay panelStyle="sidepanel.xsl"> *************** *** 11,15 **** <location infoStyle="geocodeinfo_rfs.xsl" id="A"> ! <point lat="37.9" lng="-122.33"/> <icon image="http://libgmail.sourceforge.net/man.png" class="local"/> <info> --- 15,19 ---- <location infoStyle="geocodeinfo_rfs.xsl" id="A"> ! <point lat="37.91" lng="-122.33"/> <icon image="http://libgmail.sourceforge.net/man.png" class="local"/> <info> *************** *** 25,29 **** </location> <location infoStyle="geocodeinfo_rfs.xsl" id="B"> ! <point lat="37.9" lng="-122.33"/> <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> --- 29,33 ---- </location> <location infoStyle="geocodeinfo_rfs.xsl" id="B"> ! <point lat="37.915" lng="-122.332"/> <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> *************** *** 39,48 **** <location infoStyle="geocodeinfo_rfs.xsl" id="C"> ! <point lat="37.9" lng="-122.33"/> <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> <title xml:space="preserve"/> <address> ! <line>Some address</line> </address> <image> --- 43,52 ---- <location infoStyle="geocodeinfo_rfs.xsl" id="C"> ! <point lat="37.91862" lng="-122.3324"/> <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> <title xml:space="preserve"/> <address> ! <line>Building 454, Room 124</line> </address> <image> Index: geocodeinfo_rfs.xsl =================================================================== RCS file: /cvsroot/firebug/firebug/web/geocodeinfo_rfs.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** geocodeinfo_rfs.xsl 7 Jun 2005 00:44:33 -0000 1.1 --- geocodeinfo_rfs.xsl 7 Jun 2005 01:26:06 -0000 1.2 *************** *** 49,51 **** </xsl:template> ! </xsl:stylesheet> \ No newline at end of file --- 49,52 ---- </xsl:template> ! </xsl:stylesheet> ! |
From: Karthik D. <da...@us...> - 2005-06-07 01:19:13
|
Update of /cvsroot/firebug/firebug/web/postgres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21142 Modified Files: db_table_select.php firebug.css Log Message: More updates to the css stylesheet Index: firebug.css =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/firebug.css,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** firebug.css 7 Jun 2005 00:43:19 -0000 1.1 --- firebug.css 7 Jun 2005 01:19:03 -0000 1.2 *************** *** 1,23 **** - table.header { - font-weight:bold; - font-size:30pt; - } - - table.code { - background-color:#ffff66; - border:none; - width:80%; - } - table.db_schema { background-color:#ffff66; ! border-collapse:collapse; ! border-top:double; ! border-bottom:double; ! border-right:double; ! border-left:double; ! border-style:solid; ! align:center; /* width:80%; --- 1,7 ---- table.db_schema { background-color:#ffff66; ! border: 3px solid black; ! align: center; /* width:80%; *************** *** 26,49 **** } - table.new { - width:50%; - } - - - tr.code { - /*background-color:#ffff66; */ - } - - tr.msg_header { - background-color:#ffcc00; - text-align:center; - } - - td.code { - padding:5px; - width:100%; - } - - h1 { background-color:#ffcc00; --- 10,13 ---- Index: db_table_select.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_table_select.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** db_table_select.php 7 Jun 2005 00:43:19 -0000 1.3 --- db_table_select.php 7 Jun 2005 01:19:02 -0000 1.4 *************** *** 64,68 **** $cols = pg_numrows($stat); for ($i=0 ; $i < $cols; $i++) { ! print ("<td><b><align=center><h2>"); $header = pg_fetch_row($stat,$i); print $header[0]; --- 64,68 ---- $cols = pg_numrows($stat); for ($i=0 ; $i < $cols; $i++) { ! print ("<td style=\"border: solid\"><b><align=center><h2>"); $header = pg_fetch_row($stat,$i); print $header[0]; *************** *** 81,85 **** function print_row($item2,$key) { ! print ("<td><align=\"center\">\n"); echo "$item2\n"; print ("</td>\n"); --- 81,85 ---- function print_row($item2,$key) { ! print ("<td style=\"border-right: solid\" align=\"center\">\n"); echo "$item2\n"; print ("</td>\n"); |
From: David M. D. <do...@us...> - 2005-06-07 00:44:49
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4122 Added Files: geocodeinfo_rfs.xsl google_map_example.html google_map_rfs.html google_rfs.xml sidepanel.xsl Log Message: Added some google map scripting. --- NEW FILE: google_map_example.html --- <html> <head> <title>Demo Two for Unofficial Google Maps Embedding How To</title> <script src="http://google.com/maps?file=js&hl=en" type="text/javascript"> </script> <script type="text/javascript"> _mSiteName = 'Richmond Field Station'; _mUsePrintLink=""; function initMap() { // // frb // myMapApp = new _MapsApplication(document.getElementById("container_frb"), document.getElementById("panel"), document.getElementById("metapanel"), document.getElementById("permalink"), document.getElementById("toggle"), document.getElementById("printheader")); myMapApp.loadMap(); /* Note: All XML & XSL files must be on same domain. */ _loadXmlFileFromURL("google_rfs.xml", myMapApp); } t.dump = function(a) {alert(a);} //debugging function _loadXmlFileFromURL(url, mapApp) { // // Loads the specified external XML file into the map view. // // frb // // NOTE: URL must be on same domain as page. var _getter = _XMLHttp.create(); _getter.open("GET", url); _getter.onreadystatechange=function() { if (_getter.readyState==4) { mapApp.loadXML(_getter.responseText); } } _getter.send(null); // Whoops, IE *needs* this to be last, Moz is lenient. } </script> <style type="text/css"> #panel table { border:solid 1px grey; width:50%; margin-bottom: 5px; } #panel table td:first-child { width: 24px; } .label { font-size:smaller; font-family:sans-serif; }; </style> </head> <body onload="initMap()"> <!----> <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> <div id="container_frb" style="float:right;width:35%;" ></div> <div style="float:left;position:relative;left:10px;width:60%"> <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> <h1 style="font-family:sans-serif;font-size:medium;">Unofficial Google Maps Embedding How To : Demo Two</h1> <p><tt>_MapsApplication({container div}, {panel div}, {metapanel div}, {permalink div}, {toggle div} | null, {printheader div})</tt></p> <p><dl> <dt style="font-weight:bold;">Container div</dt> <dd>The <tt><div></tt> where the map should be displayed.</dd> <dt style="font-weight:bold;">Panel div</dt> <dd>The <tt><div></tt> where the "sidepanel" should be displayed.</dd> <dt style="font-weight:bold;">Metapanel div</dt> <dd>It appears Gmaps uses this to display error and other messages</dd> <dt style="font-weight:bold;">Permalink div</dt> <dd>It appears Gmaps uses this to display a permanent URL. (Now appears to be required.)</dd> <dt style="font-weight:bold;">Toggle div</dt> <dd>The <tt><div></tt> where the map specification toggle should be displayed. The toggle switches between different map specifications, e.g. Map view and Satellite view. </dd> <dt style="font-weight:bold;">Printheader div</dt> <dd>Presumably displayed at the head of a printed map.</dd> </dl> </p> <p style="font-size:x-small;">-- follower at rancidbacon.com <br /> (Original page: <a href="http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html">http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html</a>)</p> <p style="font-size:x-small;">26 May 2005<!--25 May 2005--></p> </div> <div style="position:absolute;left:50%;top:5px;width:50%;"> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> <div style="position:absolute;top:30px;left:5px;"> <div id="panel" style="height:90%;width:100%;"> </div> <div id="metapanel"></div> <div id="permalink"></div> <div id="printheader"></div> </div> </div> </div> </div> <!-- </body> </html> --- NEW FILE: google_map_rfs.html --- <html> <head> <title>Demo Two for Unofficial Google Maps Embedding How To</title> <script src="http://google.com/maps?file=js&hl=en" type="text/javascript"> </script> <script type="text/javascript"> _mSiteName = 'Richmond Field Station'; _mUsePrintLink=""; function initMap() { // // frb // myMapApp = new _MapsApplication(document.getElementById("container_frb"), document.getElementById("panel"), document.getElementById("metapanel"), document.getElementById("permalink"), document.getElementById("toggle"), document.getElementById("printheader")); myMapApp.loadMap(); /* Note: All XML & XSL files must be on same domain. */ _loadXmlFileFromURL("google_rfs.xml", myMapApp); } t.dump = function(a) {alert(a);} //debugging function _loadXmlFileFromURL(url, mapApp) { // // Loads the specified external XML file into the map view. // // frb // // NOTE: URL must be on same domain as page. var _getter = _XMLHttp.create(); _getter.open("GET", url); _getter.onreadystatechange=function() { if (_getter.readyState==4) { mapApp.loadXML(_getter.responseText); } } _getter.send(null); // Whoops, IE *needs* this to be last, Moz is lenient. } </script> <style type="text/css"> #panel table { border:solid 1px grey; width:50%; margin-bottom: 5px; } #panel table td:first-child { width: 24px; } .label { font-size:smaller; font-family:sans-serif; }; </style> </head> <body onload="initMap()"> <!----> <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> <div id="container_frb" style="float:right;width:35%;" ></div> <div style="float:left;position:relative;left:10px;width:60%"> <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> <h1 style="font-family:sans-serif;font-size:medium;">Unofficial Google Maps Embedding How To : Demo Two</h1> <p><tt>_MapsApplication({container div}, {panel div}, {metapanel div}, {permalink div}, {toggle div} | null, {printheader div})</tt></p> <p><dl> <dt style="font-weight:bold;">Container div</dt> <dd>The <tt><div></tt> where the map should be displayed.</dd> <dt style="font-weight:bold;">Panel div</dt> <dd>The <tt><div></tt> where the "sidepanel" should be displayed.</dd> <dt style="font-weight:bold;">Metapanel div</dt> <dd>It appears Gmaps uses this to display error and other messages</dd> <dt style="font-weight:bold;">Permalink div</dt> <dd>It appears Gmaps uses this to display a permanent URL. (Now appears to be required.)</dd> <dt style="font-weight:bold;">Toggle div</dt> <dd>The <tt><div></tt> where the map specification toggle should be displayed. The toggle switches between different map specifications, e.g. Map view and Satellite view. </dd> <dt style="font-weight:bold;">Printheader div</dt> <dd>Presumably displayed at the head of a printed map.</dd> </dl> </p> <p style="font-size:x-small;">-- follower at rancidbacon.com <br /> (Original page: <a href="http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html">http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html</a>)</p> <p style="font-size:x-small;">26 May 2005<!--25 May 2005--></p> </div> <div style="position:absolute;left:50%;top:5px;width:50%;"> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> <div style="position:absolute;top:30px;left:5px;"> <div id="panel" style="height:90%;width:100%;"> </div> <div id="metapanel"></div> <div id="permalink"></div> <div id="printheader"></div> </div> </div> </div> </div> <!-- </body> </html> --- NEW FILE: sidepanel.xsl --- <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates select="location"/> </xsl:template> <xsl:template match="location"> <table> <tr style="cursor:pointer" onclick="showLocationInfo('{@id}')"> <xsl:attribute name="id"> <xsl:value-of select="@id"/> </xsl:attribute> <xsl:if test="icon/@class != 'noicon'"> <td style="vertical-align: top; padding-right: 4px;"> <img style="width:24px; height:38px" alt=""> <!-- <xsl:attribute name="src">http://maps.google.com/mapfiles/icon.png</xsl:attribute> --> <xsl:attribute name="src"> <xsl:if test="icon/@image != 'http://maps.google.com/mapfiles/marker.png'"> <xsl:value-of select="icon/@image"/> </xsl:if> <xsl:if test="icon/@image = 'http://maps.google.com/mapfiles/marker.png'"> http://maps.google.com/mapfiles/icon.png </xsl:if> </xsl:attribute> </img> </td> </xsl:if> <td style="padding-bottom: 0.5em; padding-top: 1px; padding-left: 4px"> <xsl:if test="info/title"> <xsl:attribute name="class">label</xsl:attribute> <div> <xsl:choose> <xsl:when test="icon/@class != 'noicon'"> <a href="javascript:void(0)" onclick="this.blur()"> <xsl:attribute name="style">color: #0000cc</xsl:attribute> <xsl:copy-of select="info/title/node()"/> </a> </xsl:when> <xsl:otherwise> <xsl:attribute name="style">font-weight: bold</xsl:attribute> <xsl:copy-of select="info/title/node()"/> </xsl:otherwise> </xsl:choose> </div> </xsl:if> <xsl:apply-templates select="info/address/line"/> </td> </tr> </table> </xsl:template> <xsl:template match="line"> <div> <xsl:value-of select="."/> </div> </xsl:template> </xsl:stylesheet> --- NEW FILE: google_rfs.xml --- <?xml version="1.0"?> <page> <title>Custom XSL Demo</title> <query>Why?</query> <request/> <center lat="37.9" lng="-122.33"/> <span lat="0.017998" lng="0.027586"/> <overlay panelStyle="sidepanel.xsl"> <location infoStyle="geocodeinfo_rfs.xsl" id="A"> <point lat="37.9" lng="-122.33"/> <icon image="http://libgmail.sourceforge.net/man.png" class="local"/> <info> <title xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"> </title> <address> <line>Mr G. Oogle</line> </address> <image> http://www.google.co.nz/images/logo_sm.gif </image> </info> </location> <location infoStyle="geocodeinfo_rfs.xsl" id="B"> <point lat="37.9" lng="-122.33"/> <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> <title xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"/> <address> <line>Here be spiders...</line> </address> <image> http://libgmail.sourceforge.net/spider.png </image> </info> </location> <location infoStyle="geocodeinfo_rfs.xsl" id="C"> <point lat="37.9" lng="-122.33"/> <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> <title xml:space="preserve"/> <address> <line>Some address</line> </address> <image> http://libgmail.sourceforge.net/man.png </image> </info> </location> </overlay> </page> --- NEW FILE: geocodeinfo_rfs.xsl --- <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates select="location"/> </xsl:template> <xsl:template match="location"> <div style="padding-right: 8px; margin-top: 2px"> <xsl:apply-templates select="info"/> </div> </xsl:template> <xsl:template match="info"> <xsl:variable name="page" select="../@arg0"/> <xsl:variable name="address"> <xsl:for-each select="address/line"> <xsl:if test="position() > 1">, </xsl:if> <xsl:value-of select="."/> </xsl:for-each> </xsl:variable> <div style="font-weight: bold">Custom!</div> <div> <img> <xsl:attribute name="src"> <xsl:value-of select="image"/> </xsl:attribute> </img> </div> <div style="font-size: small; margin-top: 14px"> <xsl:apply-templates select="address/line"/> </div> </xsl:template> <xsl:template match="line"> <div style="margin-top: 2px"><xsl:value-of select="."/></div> </xsl:template> <xsl:template name="getSingleLineAddress"> <xsl:for-each select="address/line"> <xsl:if test="position() > 1">, </xsl:if> <xsl:value-of select="."/> </xsl:for-each> </xsl:template> </xsl:stylesheet> |
From: Karthik D. <da...@us...> - 2005-06-07 00:43:33
|
Update of /cvsroot/firebug/firebug/web/postgres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3177/postgres Modified Files: db_table_buttons.php db_table_select.php Added Files: firebug.css main.css Log Message: Updated the stylesheets Index: db_table_buttons.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_table_buttons.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** db_table_buttons.php 6 Jun 2005 19:23:19 -0000 1.3 --- db_table_buttons.php 7 Jun 2005 00:43:19 -0000 1.4 *************** *** 17,21 **** } else { $rows = pg_numrows($stat); ! for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($stat, $i); --- 17,21 ---- } else { $rows = pg_numrows($stat); ! /* for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($stat, $i); *************** *** 23,26 **** --- 23,35 ---- print ("<input type=submit name=tbl1 value=\"" . $data[0] . "\">"); } + */ + print ("<input type=hidden name=db1 value=\"$dbname\">"); + print ("<input type=submit value=GO>"); + print("<select name=tbl1>"); + for ($i = 0; $i < $rows; $i++) { + $data = pg_fetch_row($stat, $i); + print ("<option value=$data[0]> $data[0] </option>"); + } + print ("<\select>"); } --- NEW FILE: main.css --- BODY, TD, P { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;} .black { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #000000;} .grey { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #676767;} .white { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #FFFFFF;} a.white { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight:bold; color: #FFFFFF;} .orange {color: #FF6600;} .titlered {color: #960707; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; font-weight:bold;} .titleorange {color: #CC6633; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; font-weight:bold;} .red { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #990000;} .small {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; font-weight:normal;} a.nav-main { font-size: 10px; color: #FFFFFF; font-weight:bold; text-decoration:none; } a.nav-main:hover { font-size: 10px; color: #FFF; font-weight:bold; text-decoration:none; } a.nav-sub { font-size: 10px; color: #FFFFFF; text-decoration:none; } a.nav-sub:hover { font-size: 10px; color: #CCCCCC; text-decoration:none; } A { font-family: Verdana, Arial, Helvetica, sans-serif; color: #0066CC;} A:HOVER { color: #FF9900; text-decoration: underline;} A:HOVER.white { color: #FFFFDD; text-decoration: underline;} A:HOVER.black { color: #FF9900; text-decoration: underline;} A:HOVER.orange { color: #993300; text-decoration: underline;} A.small { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #0066CC;} .topnav { font-size: 10px;} .topnav_active {background-color:#FDCD85; color:#394D73; font-weight: bold; font-size: 10px;} a.topnav{font-weight: bold; text-decoration:none; color:#394D73;} a.topnav:hover{background-color:#FDCD85; color:#394D73; text-decoration:none;} .header { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px; color: #000000; font-weight: bold;} .headerwhite { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px; color: #FFFFFF; font-weight: bold;} .wl {font-family:verdana, Helvetica, Sans-Serif; font-size: 12px; font-weight:bold; color:#666633;} .wlt {font-family:verdana, Helvetica, Sans-Serif; font-size: 11px; color:#666633;} .blueh {font-family:verdana, Helvetica, Sans-Serif; font-size: 13px;font-weight:bold;color:#336699;} .bluet {font-family:verdana, Helvetica, Sans-Serif; font-size: 12px;color:#336699;} .bluetsml {font-family:verdana, Helvetica, Sans-Serif; font-size: 10px; color:#336699;} .bluetout {font-family:verdana, Helvetica, Sans-Serif; font-size: 10px;color:#336699;} .boldsmall {font-family:verdana, Helvetica, Sans-Serif; font-size: 10px;color:#000000; font-weight:bold} .spacer1p {margin-top:1px;} .spacer2p {margin-top:2px;} .spacer4p {margin-top:4px;} .spacer5p {margin-top:5px;} .spacer7p {margin-top:7px;} .spacer10p {margin-top:10px;} .spacer12p {margin-top:12px;} .spacer15p {margin-top:15px;} .spacer20p {margin-top:20px;} .spacer25p {margin-top:25px;} .navbox {margin-top:2px;} TR.NavRow TD { vertical-align: middle; border: 1px solid; border-color: #369 #003 #003; border-left: none; cursor: pointer; } .Nav { background-color: #384ccc; color: #fff; cursor: pointer; } .NavText, .NavHighlightText, .NavGroupText { font-family: verdana, arial, sans-serif; font-size: 10px; font-weight: bold; line-height: 14px; padding-left: 6px; text-decoration: none; } .Nav A:link, .Nav A:visited { color: #fff; Text-decoration: none;} .NavHilite { background-color: #5A6B94; color: #fff; } .NavHilite A:link, .NavHilite A:visited { color: #fff; } TR TD.NavHilite A:link, TR TD.NavHilite A:visited { text-decoration: none; } TR.NavHiliteRow TD { vertical-align: middle; border: 1px solid; border-color: #000 #5A6B94 #000; border-left: none; } --- NEW FILE: firebug.css --- table.header { font-weight:bold; font-size:30pt; } table.code { background-color:#ffff66; border:none; width:80%; } table.db_schema { background-color:#ffff66; border-collapse:collapse; border-top:double; border-bottom:double; border-right:double; border-left:double; border-style:solid; align:center; /* width:80%; font-size:75%; */ } table.new { width:50%; } tr.code { /*background-color:#ffff66; */ } tr.msg_header { background-color:#ffcc00; text-align:center; } td.code { padding:5px; width:100%; } h1 { background-color:#ffcc00; color:#ff3300; font-family:tahoma,helvetica,arial; font-size:150%; } h2 { background-color:#ffcc00; color:#ff3300; font-family:tahoma,helvetica,arial; font-size:100%; } h3 { color:#0E37D0; font-family:Georgia; font-weight:bold; font-size:200%; } h4 { /*background-color:#072285;*/ color:#5A7CFC; font-family:Courier New; font-style:normal; font-weight:bold; font-size:150%; } p.jazzy { color:#1841D8; font-family:Comic Sans MS; } p.nice { color:#465BAA; font-family:Lucida Console; } pre.code { background-color:#ffff66; } code.progname { font-weight:bold; } BODY { color:black; background-color:#FFFFF5; } SPAN.title {color:green} SPAN.author {color:purple;} SPAN.publication {color:green} SPAN.fortran { font-variant: small-caps; } span.invisible { color:#FFFFF5; } P.abstract {color:blue; margin-left: 10%; /* width: 80%; */ margin-right: auto; /* background-color: gray; */ } /* a:active { color:red; } a:visited { color:yellow; background-color:blue; } a:link { color:green; } a:hover { color:green; font:bold; } */ /* IMG.inlinemath { text-align: bottom } */ /************************************************/ body { margin:9px 9px 0 9px; padding:0; background-color:#ffffff; } #level0{ background-color:#ffcc00; } #level1 { margin-left:143px; padding-left:9px; background-color:#FFFFFF; } #level2 { background:#FFF3AC; position:relative; } #level3 { margin-right:143px; padding-right:9px; background:#FFFFFF; } #main { background:#fff3ac; } #topBar { background:#ffffff; } #advBar { background:#fff3ac; } #tipDay { float:right; width:175px; background:#FFF3AC; } #lftBar { position:absolute; width:143px; top:9px; left:9px; } #rgtBar { position:absolute; width:143px; top:0; right:0; } Index: db_table_select.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_table_select.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_table_select.php 19 Aug 2004 21:59:57 -0000 1.2 --- db_table_select.php 7 Jun 2005 00:43:19 -0000 1.3 *************** *** 30,37 **** <?php - //if (!isset($HTTP_SESSION_VARS["tblname"])) { if ($HTTP_POST_VARS["tbl1"]!=Null){ ! $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; ! $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; } --- 30,36 ---- <?php if ($HTTP_POST_VARS["tbl1"]!=Null){ ! $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; ! $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; } *************** *** 54,72 **** <?php $dbh = connect_postgres($dbname); ! $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname = '$tblname' and a.attrelid = c.oid and a.attnum > 0"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not retrieve table header column names for<strong>".strtoupper($tblname)."</strong>."; ! } else { // Build the table header column names. Make this into a function. - print("<tr>\n"); $cols = pg_numrows($stat); for ($i=0 ; $i < $cols; $i++) { ! print ("<td>"); $header = pg_fetch_row($stat,$i); print $header[0]; ! print ("</td>"); } print("</tr>\n"); --- 53,71 ---- <?php $dbh = connect_postgres($dbname); ! $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname ='$tblname' and a.attrelid = c.oid and a.attnum > 0"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not retrieve table header column names for<strong>".strtoupper($tblname)."</strong>."; ! } ! else { // Build the table header column names. Make this into a function. print("<tr>\n"); $cols = pg_numrows($stat); for ($i=0 ; $i < $cols; $i++) { ! print ("<td><b><align=center><h2>"); $header = pg_fetch_row($stat,$i); print $header[0]; ! print ("<//h2></b></td>"); } print("</tr>\n"); *************** *** 82,86 **** function print_row($item2,$key) { ! print ("<td>\n"); echo "$item2\n"; print ("</td>\n"); --- 81,85 ---- function print_row($item2,$key) { ! print ("<td><align=\"center\">\n"); echo "$item2\n"; print ("</td>\n"); *************** *** 101,104 **** --- 100,105 ---- } pg_close($dbh); + + } ?> |
From: Karthik D. <da...@us...> - 2005-06-06 19:23:37
|
Update of /cvsroot/firebug/firebug/web/postgres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24575 Modified Files: config.php connect.php db_list.php db_list_databases.php db_select.php db_table_buttons.php Log Message: Updated postgres access to php code Index: db_list.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_list.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_list.php 19 Aug 2004 16:27:38 -0000 1.1 --- db_list.php 6 Jun 2005 19:23:19 -0000 1.2 *************** *** 15,24 **** <center> ! <form action="db_select.php" method="post"> ! ! <?php ! include("db_list_databases.php"); ! ?> ! <input type="submit" value="Show tables"> </form> --- 15,22 ---- <center> ! <form action="db_select.php" method="post"> ! <!-- Make sure you include this inside the form action !> ! <!-- the variable scoping will get messed up otherwise; !> ! <?php include("db_list_databases.php"); ?> <input type="submit" value="Show tables"> </form> Index: config.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/config.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.php 4 Jun 2005 08:35:57 -0000 1.1 --- config.php 6 Jun 2005 19:23:19 -0000 1.2 *************** *** 1,4 **** ! $webroot=192.168.1.131 ! $defaultdb='task' ! $port=5432 ! $user='postgres' --- 1,6 ---- ! <?php ! $webroot='192.168.1.131'; ! $defaultdb='task'; ! $port=5432; ! $user='postgres'; ! ?> \ No newline at end of file Index: db_table_buttons.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_table_buttons.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_table_buttons.php 19 Aug 2004 21:59:57 -0000 1.2 --- db_table_buttons.php 6 Jun 2005 19:23:19 -0000 1.3 *************** *** 9,13 **** print("<table class='db_schema'>"); ! $dbh = connect_postgres($dbname); $statement = "SELECT TABLENAME FROM pg_tables WHERE NOT TABLENAME~'pg_.*' and not tablename~'sql_.*'"; --- 9,13 ---- print("<table class='db_schema'>"); ! $dbh = connect_postgres($dbname) or die("Unable to connect to database"); $statement = "SELECT TABLENAME FROM pg_tables WHERE NOT TABLENAME~'pg_.*' and not tablename~'sql_.*'"; Index: db_list_databases.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_list_databases.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** db_list_databases.php 4 Jun 2005 08:35:57 -0000 1.3 --- db_list_databases.php 6 Jun 2005 19:23:19 -0000 1.4 *************** *** 7,12 **** <?php include("connect.php"); ! $dbh = connect_postgres($defaultdb) or die("Unable to connect to database"); ! $statement = "SELECT DATNAME FROM pg_database where not datname=$defaultdb and not datname='template0'"; $stat = @pg_exec($dbh,$statement) or die("Unable to select database name"); if (!stat) { --- 7,12 ---- <?php include("connect.php"); ! $dbh = connect_postgres("task") or die("Unable to connect to database"); ! $statement = "SELECT DATNAME FROM pg_database where not datname='template1' and not datname='template0'"; $stat = @pg_exec($dbh,$statement) or die("Unable to select database name"); if (!stat) { *************** *** 16,20 **** for ($i = 0; $i < $rows; $i++) { ! $data = pg_fetch_row($stat, $i) or die("Could not fetch data"); print ("<tr><td>"); print $data[0]; --- 16,20 ---- for ($i = 0; $i < $rows; $i++) { ! $data = pg_fetch_row($stat, $i) or perr("db_list_databases", "Could not fetch data"); print ("<tr><td>"); print $data[0]; *************** *** 28,32 **** } } ! pg_close($dbh) or die("Could not close database"); ?> --- 28,32 ---- } } ! pg_close($dbh) or perr("db_list_databases", "Could not close database"); ?> Index: connect.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/connect.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** connect.php 4 Jun 2005 08:35:57 -0000 1.4 --- connect.php 6 Jun 2005 19:23:19 -0000 1.5 *************** *** 6,16 **** include("config.php"); function connect_postgres($db) { ! $connstr = "dbname=$db user=$user host=$webroot port=$port"; if(!($dbh = @pg_connect($connstr))) { ! die("<strong>ERROR</strong>: Could not connect"); } return $dbh; } - ?> \ No newline at end of file --- 6,20 ---- include("config.php"); + function perr($fname, $err) { + $pstring = "<strong>ERROR</strong>: ".$err. " in ".$fname; + die($pstring); + } + function connect_postgres($db) { ! $connstr = "dbname=$db user=postgres host=192.168.1.131 port=5432"; if(!($dbh = @pg_connect($connstr))) { ! print("connect". "Could not connect to database\n"); } return $dbh; } ?> \ No newline at end of file Index: db_select.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_select.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_select.php 19 Aug 2004 21:59:57 -0000 1.2 --- db_select.php 6 Jun 2005 19:23:19 -0000 1.3 *************** *** 13,21 **** <?php include("connect.php"); ! $dbname = $HTTP_POST_VARS["db1"]; ! $dbh = connect_postgres($dbname); ! print("<h1>Database $dbname tables</h1>"); print("<center>\n"); --- 13,21 ---- <?php include("connect.php"); ! $db = $HTTP_POST_VARS["db1"]; ! $dbh = connect_postgres($db) or perr("db_select", "Unable to connect"); ! print("<h1>Database $db tables</h1>"); print("<center>\n"); *************** *** 23,29 **** $statement = "SELECT TABLENAME FROM pg_tables WHERE NOT TABLENAME~'pg_.*' and not tablename~'sql_.*'"; $stat = @pg_exec($dbh,$statement); if (!$stat) { ! print "<strong>ERROR</strong>: Could not access list of tables for database <strong>".strtoupper($dbname)."</strong>."; } else { $rows = pg_numrows($stat); --- 23,30 ---- $statement = "SELECT TABLENAME FROM pg_tables WHERE NOT TABLENAME~'pg_.*' and not tablename~'sql_.*'"; + //$statement = "SELECT TABLENAME FROM pg_tables"; $stat = @pg_exec($dbh,$statement); if (!$stat) { ! perr("db_select", "Could not access list of tables for database ".strtoupper($d). "."); } else { $rows = pg_numrows($stat); *************** *** 45,49 **** print ("</table>"); ! print ("<input type=hidden name=db1 value=\"$dbname\">"); print ("<input type=submit value=SUBMIT>"); } --- 46,50 ---- print ("</table>"); ! print ("<input type=hidden name=db1 value=\"$db\">"); print ("<input type=submit value=SUBMIT>"); } |
From: David M. D. <do...@us...> - 2005-06-02 23:17:52
|
Update of /cvsroot/firebug/firebug/doc/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22213/demo Log Message: Directory /cvsroot/firebug/firebug/doc/demo added to the repository |
From: Karthik D. <da...@us...> - 2005-06-02 00:00:33
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14307 Modified Files: Makefile Log Message: Using arm-linux-gcc 3.4.1 and added INCLUDES for arm build Index: Makefile =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile 1 Jun 2005 23:34:20 -0000 1.6 --- Makefile 2 Jun 2005 00:00:24 -0000 1.7 *************** *** 3,8 **** CC = gcc ARMCC = arm-linux-gcc ! INCDIR = /usr/local/arm/3.3.2/pgsql/include ! LIBDIR = /usr/local/arm/3.3.2/pgsql/lib LFLAGS = -lpq -lm CFLAGS = -O2 -Wall -Wno-format --- 3,8 ---- CC = gcc ARMCC = arm-linux-gcc ! INCDIR = /usr/local/arm/3.4.1/pgsql/include ! LIBDIR = /usr/local/arm/3.4.1/pgsql/lib LFLAGS = -lpq -lm CFLAGS = -O2 -Wall -Wno-format *************** *** 43,47 **** xlisten-arm: $(SRCS) ! $(ARMCC) -I$(INCDIR) $(CFLAGS) -o $@ $(SRCS) -L$(LIBDIR) $(LFLAGS) clean: --- 43,47 ---- xlisten-arm: $(SRCS) ! $(ARMCC) -I$(INCDIR) $(INCLUDES) $(CFLAGS) -o $@ $(SRCS) -L$(LIBDIR) $(LFLAGS) clean: |
From: David M. D. <do...@us...> - 2005-06-01 23:56:10
|
Update of /cvsroot/firebug/fireboard/beta/apps/XSensorMTS400 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11893 Modified Files: TestMTS400M.nc sensorboardApp.h Log Message: Weather data is now stored in processed form in database table weather. Index: TestMTS400M.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/apps/XSensorMTS400/TestMTS400M.nc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TestMTS400M.nc 28 May 2005 00:36:46 -0000 1.12 --- TestMTS400M.nc 1 Jun 2005 23:56:01 -0000 1.13 *************** *** 268,272 **** norace uint8_t iNextPacketID; ! char gga_fields[GGA_FIELDS][GPS_CHAR_PER_FIELD]; // = {{0}}; --- 268,272 ---- norace uint8_t iNextPacketID; ! //char gga_fields[GGA_FIELDS][GPS_CHAR_PER_FIELD]; // = {{0}}; *************** *** 566,590 **** } - - #if 0 - // Pack everything into xbow structs so that - // xlisten can process it. - // TODO: Write a module that translates firebug - // structs into xbow structs, along with a dummy - // module that can be wired in if the xbow - // translation is not needed. - pack->xData.dataGps.hour = gga_data_ptr->hours; - pack->xData.dataGps.minute = gga_data_ptr->minutes; - temp = (uint32_t)(gga_data_ptr->dec_sec * 1000); - pack->xData.dataGps.dec_sec = temp; - pack->xData.dataGps.lat_deg= gga_data_ptr->Lat_deg; - temp = (uint32_t)(gga_data_ptr->Lat_dec_min * 10000); - pack->xData.dataGps.lat_dec_min = temp; - pack->xData.dataGps.long_deg = gga_data_ptr->Long_deg; - temp = (uint32_t)(gga_data_ptr->Long_dec_min * 10000); - pack->xData.dataGps.long_dec_min= temp; - pack->xData.dataGps.nsewind = gga_data_ptr->NSEWind; - #endif - if (gps_pwr_on)call GpsCmd.TxRxSwitch(0); // stop receive from gpsuart atomic state = GPS_DONE; --- 566,569 ---- Index: sensorboardApp.h =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/apps/XSensorMTS400/sensorboardApp.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sensorboardApp.h 27 May 2005 22:22:50 -0000 1.5 --- sensorboardApp.h 1 Jun 2005 23:56:01 -0000 1.6 *************** *** 51,60 **** }; typedef struct XDataMsg { XSensorHeader xSensorHeader; union { ! XSensorMTS400DataMsg data1; ! GGAMsg dataGps; GGA_Data gga_data; }xData; } __attribute__ ((packed)) XDataMsg; --- 51,84 ---- }; + + typedef struct weather_data { + + uint16_t vref; + uint16_t humidity; + uint16_t temperature; + uint16_t cal_word1; + uint16_t cal_word2; + uint16_t cal_word3; + uint16_t cal_word4; + uint16_t intersematemp; + uint16_t pressure; + uint16_t taosch0; + uint16_t taosch1; + + } Weather_Data; + + + enum { + AM_WEATHER_DATA = 251, + }; + + typedef struct XDataMsg { XSensorHeader xSensorHeader; union { ! XSensorMTS400DataMsg data1; ! GGAMsg dataGps; GGA_Data gga_data; + Weather_Data weather_data; }xData; } __attribute__ ((packed)) XDataMsg; |
From: David M. D. <do...@us...> - 2005-06-01 23:34:29
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv421/boards Modified Files: fireboard.c pg_test.c Log Message: Weather data is now stored in processed form in database table weather. Index: pg_test.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/pg_test.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pg_test.c 1 Jun 2005 22:19:07 -0000 1.4 --- pg_test.c 1 Jun 2005 23:34:20 -0000 1.5 *************** *** 18,27 **** "CREATE TABLE %s%s ( " "result_time timestamp without time zone, " - "epoch integer, " "nodeid integer, " - "parent integer, " "voltage integer, " ! "humid integer, " ! "humtemp integer, " "intersemacal1 integer, " "intersemacal2 integer, " --- 18,27 ---- "CREATE TABLE %s%s ( " "result_time timestamp without time zone, " "nodeid integer, " "voltage integer, " ! "humidity float, " ! "temperature float, " ! "pressure float)"; ! #if 0 "intersemacal1 integer, " "intersemacal2 integer, " *************** *** 32,37 **** "taosch0 integer, " "taosch1 integer, " ! "accel_x integer, " ! "accel_y integer)"; // TODO: Remove the SQL command. --- 32,37 ---- "taosch0 integer, " "taosch1 integer, " ! #endif ! // TODO: Remove the SQL command. Index: fireboard.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/fireboard.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** fireboard.c 1 Jun 2005 22:19:06 -0000 1.11 --- fireboard.c 1 Jun 2005 23:34:20 -0000 1.12 *************** *** 16,19 **** --- 16,20 ---- #include <math.h> #include <NMEA.h> + #include <sensorboardApp.h> #include "../xdb.h" *************** *** 164,173 **** * @version 2004/3/29 husiquan Initial revision */ ! int fireboard_convert_temp(uint16_t TempData) { ! float fTemp; - fTemp = -38.4 + 0.0098*(float)TempData; - return (int)fTemp; - } /** --- 165,185 ---- * @version 2004/3/29 husiquan Initial revision */ ! int fireboard_convert_temp(uint16_t TempData) { ! float fTemp; ! ! fTemp = -38.4 + 0.0098*(float)TempData; ! return (int)fTemp; ! } ! ! ! float ! fb_convert_temp(uint16_t TempData) { ! ! float fTemp; ! ! fTemp = -38.4 + 0.0098*(float)TempData; ! return fTemp; ! } /** *************** *** 188,192 **** * @version 2004/3/29 husiquan Initial revision */ ! int fireboard_convert_humidity( uint16_t HumData, uint16_t TempData){ float fTemp,fHumidity; --- 200,204 ---- * @version 2004/3/29 husiquan Initial revision */ ! int fireboard_convert_humidity(uint16_t HumData, uint16_t TempData){ float fTemp,fHumidity; *************** *** 199,202 **** --- 211,227 ---- } + + float + fb_convert_humidity(uint16_t HumData, uint16_t TempData){ + + float fTemp,fHumidity; + + fTemp = -38.4 + 0.0098*(float)TempData; + fHumidity = -4.0 + 0.0405 * HumData -0.0000028 * HumData * HumData; + fHumidity= (fTemp-25.0)* (0.01 + 0.00008 * HumData) + fHumidity; + + return fHumidity; + } + /** *************** *** 281,284 **** --- 306,341 ---- + float + fb_convert_intersemapressure(uint16_t cal_word1,uint16_t cal_word2,uint16_t cal_word3,uint16_t + cal_word4,uint16_t TempData,uint16_t PressureData) { + + float UT1,dT; + float OFF,SENS,X,Press; + uint16_t calibration[4]; //intersema calibration words + uint16_t C1,C2,C3,C4,C5;//,C6; //intersema calibration coefficients + + calibration[0] = cal_word1; + calibration[1] = cal_word2; + calibration[2] = cal_word3; + calibration[3] = cal_word4; + + C1 = calibration[0] >> 1; + C2 = ((calibration[2] & 0x3f) << 6) | (calibration[3] & 0x3f); + C3 = calibration[3] >> 6; + C4 = calibration[2] >> 6; + C5 = ((calibration[0] & 1) << 10) | (calibration[1] >> 6); + // C6 = calibration[1] & 0x3f; + + UT1=8*(float)C5+20224; + dT = (float)TempData-UT1; + OFF = (float)C2*4 + (((float)C4-512.0)*dT)/1024; + SENS = (float)C1 + ((float)C3*dT)/1024 + 24576; + X = (SENS*((float)PressureData-7168.0))/16384 - OFF; + Press = X/32.0 + 250.0; + + return Press; + } + + /** * Converts mica2 battery reading from raw ADC data to engineering units. *************** *** 546,551 **** } ! void fireboard_print_cooked_1(XbowSensorboardPacket *packet) ! { XSensorMTS400Data1 *pd; --- 603,609 ---- } ! void ! fireboard_print_cooked_1(XbowSensorboardPacket *packet) { ! XSensorMTS400Data1 *pd; *************** *** 775,778 **** --- 833,872 ---- + void + fb_pg_log_xbow_weather_cooked(XbowSensorboardPacket *packet) { + + Weather_Data * data; + + char command[512]; + data = (Weather_Data *) packet->data; + int voltage; + float humidity; + float temperature; + float pressure; + //float light = fireboard_convert_light(data->taosch0,data->taosch1); + + voltage = fireboard_convert_battery(data->vref); + humidity = fb_convert_humidity(data->humidity,data->temperature); + temperature = fb_convert_temp(data->temperature); + pressure = fireboard_convert_intersemapressure(data->cal_word1, + data->cal_word2, + data->cal_word3, + data->cal_word4, + data->intersematemp, + data->pressure); + + sprintf(command, "INSERT into %s (result_time,nodeid,voltage,humidity,temperature,pressure) values (now(),%u,%u,%f,%f,%f)", + "xbow_weather", + packet->node_id, + voltage, + humidity, + temperature, + pressure); + + xdb_execute(command); + } + + + // drop table fireboard_results; // drop table fireboard_results_l; *************** *** 836,841 **** case 1:{ #if 1 ! fb_pg_log_xbow_weather(packet); ! //fb_pg_log_xbow_weather_cooked(packet); return; #else --- 930,935 ---- case 1:{ #if 1 ! //fb_pg_log_xbow_weather(packet); ! fb_pg_log_xbow_weather_cooked(packet); return; #else |
From: David M. D. <do...@us...> - 2005-06-01 23:34:29
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv421 Modified Files: Makefile Log Message: Weather data is now stored in processed form in database table weather. Index: Makefile =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile 1 Jun 2005 01:46:20 -0000 1.5 --- Makefile 1 Jun 2005 23:34:20 -0000 1.6 *************** *** 19,23 **** ! INCLUDES = ../../../tos/sensorboards/mts400/GPS # Add Mote Data Aquisition board support --- 19,24 ---- ! INCLUDES = -I../../../tos/sensorboards/mts400/GPS ! INCLUDES += -I../../../apps/XSensorMTS400 # Add Mote Data Aquisition board support *************** *** 39,43 **** xlisten: $(SRCS) ! $(CC) $(CFLAGS) -o $@ $(SRCS) -I$(INCLUDES) $(LFLAGS) xlisten-arm: $(SRCS) --- 40,44 ---- xlisten: $(SRCS) ! $(CC) $(CFLAGS) -o $@ $(SRCS) $(INCLUDES) $(LFLAGS) xlisten-arm: $(SRCS) |
From: David M. D. <do...@us...> - 2005-06-01 22:19:16
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25276/boards Modified Files: fireboard.c pg_test.c Log Message: Reworked tables for cumulative and latest results. Index: pg_test.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/pg_test.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pg_test.c 1 Jun 2005 18:06:08 -0000 1.3 --- pg_test.c 1 Jun 2005 22:19:07 -0000 1.4 *************** *** 10,13 **** --- 10,16 ---- #include "../xsensors.h" + // TODO: Condense tables down to gga, weather, etc. + + // TODO: Change these to cooked values. // TODO: Remove the SQL command. *************** *** 33,37 **** // TODO: Remove the SQL command. ! const char *fb_pg_location_schema = "CREATE TABLE %s%s ( " "nodeid integer, " --- 36,40 ---- // TODO: Remove the SQL command. ! const char *fb_pg_gga_schema = "CREATE TABLE %s%s ( " "nodeid integer, " *************** *** 46,85 **** ! /* ! * Want 4 tables for asset tracking: ! * cumulative_weather ! * current weather ! * cumulative_location ! * current_location ! */ static char pg_statement[512]; - void - fb_pg_create_cum_weather_table (void) { - - sprintf(pg_statement, fb_pg_weather_schema, "cumulative_weather", ""); - xdb_execute(pg_statement); - } - void - fb_pg_create_cur_weather_table (void) { - - sprintf(pg_statement, fb_pg_weather_schema, "current_weather", ""); - xdb_execute(pg_statement); - } void ! fb_pg_create_cum_location_table (void) { ! sprintf(pg_statement, fb_pg_location_schema, "cumulative_location", ""); xdb_execute(pg_statement); } void ! fb_pg_create_cur_location_table (void) { ! sprintf(pg_statement, fb_pg_location_schema, "current_location", ""); xdb_execute(pg_statement); } /** * Use this function for creating all of the tables --- 49,91 ---- ! const char *fb_pg_cache_rule = ! "CREATE RULE cache_%s AS ON INSERT TO %s DO ( " ! "DELETE FROM %s_L WHERE nodeid = NEW.nodeid; " ! "INSERT INTO %s_L VALUES (NEW.*); )"; ! ! static char pg_statement[512]; void ! fb_pg_create_xbow_weather_table (void) { ! ! const char * table = "xbow_weather"; ! sprintf(pg_statement, fb_pg_weather_schema, table, ""); ! xdb_execute(pg_statement); ! sprintf(pg_statement, fb_pg_weather_schema, table, "_L"); ! xdb_execute(pg_statement); ! // Add rule to update "latest results" table. ! sprintf(pg_statement, fb_pg_cache_rule, table, table, table, table); xdb_execute(pg_statement); } + void ! fb_pg_create_gga_table (void) { ! const char * table = "gga"; ! ! sprintf(pg_statement, fb_pg_gga_schema, table, ""); ! xdb_execute(pg_statement); ! sprintf(pg_statement, fb_pg_gga_schema, table, "_L"); ! xdb_execute(pg_statement); ! // Add rule to populate latest result table ! sprintf(pg_statement, fb_pg_cache_rule, table, table, table, table); xdb_execute(pg_statement); } + /** * Use this function for creating all of the tables *************** *** 89,96 **** fb_pg_create_tables(void) { ! fb_pg_create_cum_weather_table(); ! fb_pg_create_cur_weather_table(); ! fb_pg_create_cum_location_table(); ! fb_pg_create_cur_location_table(); } --- 95,100 ---- fb_pg_create_tables(void) { ! fb_pg_create_xbow_weather_table(); ! fb_pg_create_gga_table(); } *************** *** 111,118 **** fb_pg_delete_tables(void) { ! fb_pg_delete_table("cumulative_weather"); ! fb_pg_delete_table("current_weather"); ! fb_pg_delete_table("cumulative_location"); ! fb_pg_delete_table("current_location"); } --- 115,122 ---- fb_pg_delete_tables(void) { ! fb_pg_delete_table("xbow_weather"); ! fb_pg_delete_table("xbow_weather_L"); ! fb_pg_delete_table("gga"); ! fb_pg_delete_table("gga_L"); } *************** *** 131,134 **** --- 135,139 ---- + // TODO: Switch this to non-xbow specific packet. void *************** *** 142,146 **** "NSEWind) " "values (%u,%u,%u,%f,%u,%f,%u,%f,%u)", ! "cumulative_location", packet->node_id, data->hours, --- 147,151 ---- "NSEWind) " "values (%u,%u,%u,%f,%u,%f,%u,%f,%u)", ! "gga", packet->node_id, data->hours, *************** *** 153,177 **** data->NSEWind); - //printf("pg_statement: %s\n", pg_statement); - //printf("table: %s\n", xdb_get_table()); - xdb_execute(pg_statement); - - // TODO: Replace this with a rules cache statement. - #if 0 - // TODO: This needs to be changed to a REPLACE statement. - sprintf(pg_statement, - "INSERT into %s " - "(result_time,nodeid,parent,Hours,Minutes,seconds," - "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," - "NSEWind)" - " values (now(),%u,%u,%u,%u,%f,%u,%f,%u,%f,%u)", - "current_location", - packet->node_id, packet->parent, - data->hours, data->minutes, data->dec_sec, - data->Lat_deg, data->Lat_dec_min, - data->Long_deg, data->Long_dec_min, data->NSEWind); - - xdb_execute(pg_statement); - #endif } --- 158,161 ---- Index: fireboard.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/fireboard.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** fireboard.c 1 Jun 2005 18:06:08 -0000 1.10 --- fireboard.c 1 Jun 2005 22:19:06 -0000 1.11 *************** *** 751,757 **** - void - fb_pg_log(XbowSensorboardPacket *packet) { } --- 751,775 ---- + void + fb_pg_log_xbow_weather(XbowSensorboardPacket *packet) { + + XSensorMTS400Data1 *data = (XSensorMTS400Data1 *)packet->data; + + char command[512]; + sprintf(command, + "INSERT into %s " + "(result_time,nodeid,parent,voltage,humid,humtemp," + "intersemacal1,intersemacal2,intersemacal3,intersemacal4," + "prtemp,press,taosch0,taosch1,accel_x,accel_y)" + " values (now(),%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u)", + "xbow_weather", + packet->node_id, packet->parent, + data->vref, data->humidity, data->temp, + data->cal_word1,data->cal_word2,data->cal_word3,data->cal_word4, + data->intersematemp, data->intersemapressure, + data->taosch0,data->taosch1, data->accel_x, GET_ACCEL_Y + ); + xdb_execute(command); } *************** *** 817,822 **** switch(packet->packet_id){ case 1:{ XSensorMTS400Data1 *data = (XSensorMTS400Data1 *)packet->data; - sprintf(command, "INSERT into %s " --- 835,844 ---- switch(packet->packet_id){ case 1:{ + #if 1 + fb_pg_log_xbow_weather(packet); + //fb_pg_log_xbow_weather_cooked(packet); + return; + #else XSensorMTS400Data1 *data = (XSensorMTS400Data1 *)packet->data; sprintf(command, "INSERT into %s " *************** *** 834,837 **** --- 856,860 ---- ); break; + #endif } case 2:{ |
From: David M. D. <do...@us...> - 2005-06-01 18:06:17
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18091/boards Modified Files: fireboard.c pg_test.c Log Message: GGA_Data pg logging handled in external function with new location table rather than firebug_results table. Index: pg_test.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/pg_test.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pg_test.c 1 Jun 2005 13:14:19 -0000 1.2 --- pg_test.c 1 Jun 2005 18:06:08 -0000 1.3 *************** *** 11,14 **** --- 11,15 ---- // TODO: Change these to cooked values. + // TODO: Remove the SQL command. const char *fb_pg_weather_schema = "CREATE TABLE %s%s ( " *************** *** 31,45 **** "accel_y integer)"; const char *fb_pg_location_schema = "CREATE TABLE %s%s ( " "Hours integer, " "Minutes integer, " ! "seconds integer, " "Latitudedegree integer, " ! "Latitudeminutes integer, " "Longitudedegree integer, " ! "Longitudeminute integer, " ! "NSEWind integer, " ! "Fixed integer)"; --- 32,47 ---- "accel_y integer)"; + // TODO: Remove the SQL command. const char *fb_pg_location_schema = "CREATE TABLE %s%s ( " + "nodeid integer, " "Hours integer, " "Minutes integer, " ! "seconds float, " "Latitudedegree integer, " ! "Latitudeminutes float, " "Longitudedegree integer, " ! "Longitudeminute float, " ! "NSEWind integer)"; *************** *** 136,151 **** sprintf(pg_statement, "INSERT into %s " ! "(result_time,nodeid,parent,Hours,Minutes,seconds," "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," ! "NSEWind,Fixed)" ! " values (now(),%u,%u,%u,%u,%f,%u,%f,%u,%f,%u)", "cumulative_location", ! packet->node_id, packet->parent, ! data->hours, data->minutes, data->dec_sec, ! data->Lat_deg, data->Lat_dec_min, ! data->Long_deg, data->Long_dec_min, data->NSEWind); xdb_execute(pg_statement); // TODO: This needs to be changed to a REPLACE statement. sprintf(pg_statement, --- 138,163 ---- sprintf(pg_statement, "INSERT into %s " ! "(nodeid,Hours,Minutes,seconds," "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," ! "NSEWind) " ! "values (%u,%u,%u,%f,%u,%f,%u,%f,%u)", "cumulative_location", ! packet->node_id, ! data->hours, ! data->minutes, ! data->dec_sec, ! data->Lat_deg, ! data->Lat_dec_min, ! data->Long_deg, ! data->Long_dec_min, ! data->NSEWind); ! ! //printf("pg_statement: %s\n", pg_statement); ! //printf("table: %s\n", xdb_get_table()); xdb_execute(pg_statement); + // TODO: Replace this with a rules cache statement. + #if 0 // TODO: This needs to be changed to a REPLACE statement. sprintf(pg_statement, *************** *** 153,157 **** "(result_time,nodeid,parent,Hours,Minutes,seconds," "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," ! "NSEWind,Fixed)" " values (now(),%u,%u,%u,%u,%f,%u,%f,%u,%f,%u)", "current_location", --- 165,169 ---- "(result_time,nodeid,parent,Hours,Minutes,seconds," "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," ! "NSEWind)" " values (now(),%u,%u,%u,%u,%f,%u,%f,%u,%f,%u)", "current_location", *************** *** 162,165 **** xdb_execute(pg_statement); ! } --- 174,177 ---- xdb_execute(pg_statement); ! #endif } Index: fireboard.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/fireboard.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** fireboard.c 1 Jun 2005 13:14:19 -0000 1.9 --- fireboard.c 1 Jun 2005 18:06:08 -0000 1.10 *************** *** 773,776 **** --- 773,778 ---- char command[512]; char *table = xdb_get_table(); + + if (!*table) table = "fireboard_results"; *************** *** 851,857 **** } case AM_GGA_DATA:{ ! fb_pg_log_gga_data(packet); ! /* GGA_Data * data = (GGA_Data*)packet->data; sprintf(command, --- 853,860 ---- } case AM_GGA_DATA:{ ! #if 1 fb_pg_log_gga_data(packet); ! return; ! #else GGA_Data * data = (GGA_Data*)packet->data; sprintf(command, *************** *** 859,873 **** "(result_time,nodeid,parent,Hours,Minutes,seconds," "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," ! "NSEWind,Fixed)" " values (now(),%u,%u,%u,%u,%f,%u,%f,%u,%f,%u)", table, ! //timestring, ! packet->node_id, packet->parent, ! data->hours, data->minutes, data->dec_sec, ! data->Lat_deg, data->Lat_dec_min, ! data->Long_deg, data->Long_dec_min, data->NSEWind); break; ! */ ! return; } case 3: { --- 862,880 ---- "(result_time,nodeid,parent,Hours,Minutes,seconds," "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," ! "NSEWind)" " values (now(),%u,%u,%u,%u,%f,%u,%f,%u,%f,%u)", table, ! packet->node_id, ! packet->parent, ! data->hours, ! data->minutes, ! data->dec_sec, ! data->Lat_deg, ! data->Lat_dec_min, ! data->Long_deg, ! data->Long_dec_min, ! data->NSEWind); break; ! #endif } case 3: { *************** *** 943,947 **** xpacket_add_type(&fireboard_packet_handler); // Use this for testing the db setup. ! //fb_pg_recreate_tables(); } --- 950,954 ---- xpacket_add_type(&fireboard_packet_handler); // Use this for testing the db setup. ! fb_pg_recreate_tables(); } |
From: David M. D. <do...@us...> - 2005-06-01 13:14:28
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25025/boards Modified Files: fireboard.c pg_test.c Log Message: Moved GPS logging out of fireboard code. Index: pg_test.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/pg_test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pg_test.c 1 Jun 2005 01:46:21 -0000 1.1 --- pg_test.c 1 Jun 2005 13:14:19 -0000 1.2 *************** *** 5,8 **** --- 5,10 ---- */ + #include <NMEA.h> + #include "../xdb.h" #include "../xsensors.h" *************** *** 126,127 **** --- 128,165 ---- } + + // TODO: Switch this to non-xbow specific packet. + void + fb_pg_log_gga_data(XbowSensorboardPacket *packet) { + + GGA_Data * data = (GGA_Data*)packet->data; + sprintf(pg_statement, + "INSERT into %s " + "(result_time,nodeid,parent,Hours,Minutes,seconds," + "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," + "NSEWind,Fixed)" + " values (now(),%u,%u,%u,%u,%f,%u,%f,%u,%f,%u)", + "cumulative_location", + packet->node_id, packet->parent, + data->hours, data->minutes, data->dec_sec, + data->Lat_deg, data->Lat_dec_min, + data->Long_deg, data->Long_dec_min, data->NSEWind); + + xdb_execute(pg_statement); + + // TODO: This needs to be changed to a REPLACE statement. + sprintf(pg_statement, + "INSERT into %s " + "(result_time,nodeid,parent,Hours,Minutes,seconds," + "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," + "NSEWind,Fixed)" + " values (now(),%u,%u,%u,%u,%f,%u,%f,%u,%f,%u)", + "current_location", + packet->node_id, packet->parent, + data->hours, data->minutes, data->dec_sec, + data->Lat_deg, data->Lat_dec_min, + data->Long_deg, data->Long_dec_min, data->NSEWind); + + xdb_execute(pg_statement); + + } Index: fireboard.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/fireboard.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** fireboard.c 1 Jun 2005 01:46:21 -0000 1.8 --- fireboard.c 1 Jun 2005 13:14:19 -0000 1.9 *************** *** 646,649 **** --- 646,650 ---- XSensorMTS420GPSData *data; + // TODO: This should be GGA_Data *? data = (XSensorMTS420GPSData *) packet->data; printf("FIREBOARD [gps data converted to engineering units]:\n" *************** *** 850,853 **** --- 851,857 ---- } case AM_GGA_DATA:{ + + fb_pg_log_gga_data(packet); + /* GGA_Data * data = (GGA_Data*)packet->data; sprintf(command, *************** *** 862,867 **** data->hours, data->minutes, data->dec_sec, data->Lat_deg, data->Lat_dec_min, ! data->Long_deg, data->Long_dec_min, data->NSEWind); break; } case 3: { --- 866,873 ---- data->hours, data->minutes, data->dec_sec, data->Lat_deg, data->Lat_dec_min, ! data->Long_deg, data->Long_dec_min, data->NSEWind); break; + */ + return; } case 3: { |
From: David M. D. <do...@us...> - 2005-06-01 01:46:31
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27915/boards Modified Files: fireboard.c Added Files: pg_test.c Log Message: Started abstracting out the postgres driver code. --- NEW FILE: pg_test.c --- /** * Test code for developing postgres c code for * xlisten. */ #include "../xdb.h" #include "../xsensors.h" // TODO: Change these to cooked values. const char *fb_pg_weather_schema = "CREATE TABLE %s%s ( " "result_time timestamp without time zone, " "epoch integer, " "nodeid integer, " "parent integer, " "voltage integer, " "humid integer, " "humtemp integer, " "intersemacal1 integer, " "intersemacal2 integer, " "intersemacal3 integer, " "intersemacal4 integer," "prtemp integer, " "press integer, " "taosch0 integer, " "taosch1 integer, " "accel_x integer, " "accel_y integer)"; const char *fb_pg_location_schema = "CREATE TABLE %s%s ( " "Hours integer, " "Minutes integer, " "seconds integer, " "Latitudedegree integer, " "Latitudeminutes integer, " "Longitudedegree integer, " "Longitudeminute integer, " "NSEWind integer, " "Fixed integer)"; /* * Want 4 tables for asset tracking: * cumulative_weather * current weather * cumulative_location * current_location */ static char pg_statement[512]; void fb_pg_create_cum_weather_table (void) { sprintf(pg_statement, fb_pg_weather_schema, "cumulative_weather", ""); xdb_execute(pg_statement); } void fb_pg_create_cur_weather_table (void) { sprintf(pg_statement, fb_pg_weather_schema, "current_weather", ""); xdb_execute(pg_statement); } void fb_pg_create_cum_location_table (void) { sprintf(pg_statement, fb_pg_location_schema, "cumulative_location", ""); xdb_execute(pg_statement); } void fb_pg_create_cur_location_table (void) { sprintf(pg_statement, fb_pg_location_schema, "current_location", ""); xdb_execute(pg_statement); } /** * Use this function for creating all of the tables * in the data logging database. */ void fb_pg_create_tables(void) { fb_pg_create_cum_weather_table(); fb_pg_create_cur_weather_table(); fb_pg_create_cum_location_table(); fb_pg_create_cur_location_table(); } /** Add the tablename as an argument. */ void fb_pg_delete_table(const char * tablename) { sprintf(pg_statement,"drop table %s", tablename); xdb_execute(pg_statement); } /** * Easy to delete tables before recreating them. */ void fb_pg_delete_tables(void) { fb_pg_delete_table("cumulative_weather"); fb_pg_delete_table("current_weather"); fb_pg_delete_table("cumulative_location"); fb_pg_delete_table("current_location"); } /** * When the schema changes, or for whatever other * reason, the firebug tables may need to be recreated * from scratch. */ void fb_pg_recreate_tables(void) { fb_pg_delete_tables(); fb_pg_create_tables(); } Index: fireboard.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/fireboard.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** fireboard.c 1 Jun 2005 00:22:47 -0000 1.7 --- fireboard.c 1 Jun 2005 01:46:21 -0000 1.8 *************** *** 731,735 **** ! const char *fireboard_db_create_table = "CREATE TABLE %s%s ( result_time timestamp without time zone, " --- 731,735 ---- ! /** This is xbow code. */ const char *fireboard_db_create_table = "CREATE TABLE %s%s ( result_time timestamp without time zone, " *************** *** 750,767 **** - const char *fb_pg_create_weather_table = - "CREATE TABLE %s%s ( result_time timestamp without time zone, " - "epoch integer, nodeid integer, parent integer, " - "voltage integer, humid integer, humtemp integer," - "intersemacal1 integer,intersemacal2 integer,intersemacal3 integer,intersemacal4 integer," - "prtemp integer,press integer," - "taosch0 integer,taosch1 integer," - "accel_x integer, accel_y integer)"; - - const char *fb_pg_create_location_table = - "Hours integer,Minutes integer,seconds integer,Latitudedegree integer,Latitudeminutes integer," - "Longitudedegree integer,Longitudeminute integer," - "NSEWind integer,Fixed integer)"; - void fb_pg_log(XbowSensorboardPacket *packet) { --- 750,753 ---- *************** *** 948,951 **** --- 934,942 ---- void fireboard_initialize() { + xpacket_add_type(&fireboard_packet_handler); + // Use this for testing the db setup. + //fb_pg_recreate_tables(); } + + |
From: David M. D. <do...@us...> - 2005-06-01 01:46:29
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27915 Modified Files: Makefile Log Message: Started abstracting out the postgres driver code. Index: Makefile =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 27 May 2005 20:17:34 -0000 1.4 --- Makefile 1 Jun 2005 01:46:20 -0000 1.5 *************** *** 16,19 **** --- 16,21 ---- SRCS += boards/mep500.c boards/mep401.c boards/ggbacltst.c SRCS += boards/mica2.c boards/mica2dot.c boards/micaz.c boards/fireboard.c + SRCS += boards/pg_test.c + INCLUDES = ../../../tos/sensorboards/mts400/GPS |
From: David M. D. <do...@us...> - 2005-06-01 00:22:56
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14559/boards Modified Files: fireboard.c Log Message: Fixed cast error for AM_GGA_DATA for pg logging. Index: fireboard.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/fireboard.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** fireboard.c 31 May 2005 23:49:40 -0000 1.6 --- fireboard.c 1 Jun 2005 00:22:47 -0000 1.7 *************** *** 770,773 **** --- 770,776 ---- + // drop table fireboard_results; + // drop table fireboard_results_l; + /** * Logs raw readings to a Postgres database. *************** *** 861,865 **** } case AM_GGA_DATA:{ ! XSensorMTS420GPSData *data = (XSensorMTS420GPSData *)packet->data; sprintf(command, "INSERT into %s " --- 864,868 ---- } case AM_GGA_DATA:{ ! GGA_Data * data = (GGA_Data*)packet->data; sprintf(command, "INSERT into %s " *************** *** 867,871 **** "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," "NSEWind,Fixed)" ! " values (now(),%u,%u,%u,%u,%f,%u,%f,%u,%f,%u,%u)", table, //timestring, --- 870,874 ---- "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," "NSEWind,Fixed)" ! " values (now(),%u,%u,%u,%u,%f,%u,%f,%u,%f,%u)", table, //timestring, *************** *** 873,878 **** data->hours, data->minutes, data->dec_sec, data->Lat_deg, data->Lat_dec_min, ! data->Long_deg, data->Long_dec_min, data->NSEWind,data->Fixed ! ); break; } --- 876,880 ---- data->hours, data->minutes, data->dec_sec, data->Lat_deg, data->Lat_dec_min, ! data->Long_deg, data->Long_dec_min, data->NSEWind); break; } |
From: David M. D. <do...@us...> - 2005-05-31 23:49:50
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31234/boards Modified Files: fireboard.c Log Message: Added floating point to pg handler for AM_GGA_DATA. Index: fireboard.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/fireboard.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** fireboard.c 31 May 2005 23:39:50 -0000 1.5 --- fireboard.c 31 May 2005 23:49:40 -0000 1.6 *************** *** 740,745 **** "taosch0 integer,taosch1 integer," "accel_x integer, accel_y integer," ! "Hours integer,Minutes integer,seconds integer,Latitudedegree integer,Latitudeminutes integer," ! "Longitudedegree integer,Longitudeminute integer," "NSEWind integer,Fixed integer)"; --- 740,745 ---- "taosch0 integer,taosch1 integer," "accel_x integer, accel_y integer," ! "Hours integer,Minutes integer,seconds float,Latitudedegree integer,Latitudeminutes float," ! "Longitudedegree integer,Longitudeminute float," "NSEWind integer,Fixed integer)"; *************** *** 867,871 **** "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," "NSEWind,Fixed)" ! " values (now(),%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u)", table, //timestring, --- 867,871 ---- "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," "NSEWind,Fixed)" ! " values (now(),%u,%u,%u,%u,%f,%u,%f,%u,%f,%u,%u)", table, //timestring, |
From: David M. D. <do...@us...> - 2005-05-31 23:43:06
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28166 Modified Files: xsensors.h Log Message: Added GGA am type pg handler. Index: xsensors.h =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/xsensors.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** xsensors.h 24 May 2005 21:50:42 -0000 1.3 --- xsensors.h 31 May 2005 23:42:57 -0000 1.4 *************** *** 204,207 **** --- 204,208 ---- void mts400_initialize(); /* From boards/mts400.c */ void mts420_initialize(); /* From boards/mts400.c */ + void fireboard_initialize(); /* From boards/mts400.c */ void mts510_initialize(); /* From boards/mts510.c */ |
From: David M. D. <do...@us...> - 2005-05-31 23:39:59
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26614/boards Modified Files: fireboard.c Log Message: Added GGA am type pg handler. Index: fireboard.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/fireboard.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** fireboard.c 31 May 2005 23:30:45 -0000 1.4 --- fireboard.c 31 May 2005 23:39:50 -0000 1.5 *************** *** 749,752 **** --- 749,773 ---- "INSERT INTO %s_L VALUES (NEW.*); )"; + + const char *fb_pg_create_weather_table = + "CREATE TABLE %s%s ( result_time timestamp without time zone, " + "epoch integer, nodeid integer, parent integer, " + "voltage integer, humid integer, humtemp integer," + "intersemacal1 integer,intersemacal2 integer,intersemacal3 integer,intersemacal4 integer," + "prtemp integer,press integer," + "taosch0 integer,taosch1 integer," + "accel_x integer, accel_y integer)"; + + const char *fb_pg_create_location_table = + "Hours integer,Minutes integer,seconds integer,Latitudedegree integer,Latitudeminutes integer," + "Longitudedegree integer,Longitudeminute integer," + "NSEWind integer,Fixed integer)"; + + void + fb_pg_log(XbowSensorboardPacket *packet) { + + } + + /** * Logs raw readings to a Postgres database. *************** *** 757,763 **** * */ ! void fireboard_log_raw(XbowSensorboardPacket *packet) ! { ! char command[512]; --- 778,783 ---- * */ ! void ! fireboard_log_raw(XbowSensorboardPacket *packet) { char command[512]; *************** *** 905,909 **** } default: ! printf("MTS420 error: unknown packet_id (%i)\n", packet->packet_id); } --- 925,929 ---- } default: ! printf("FIREBOARD error: unknown packet_id (%i)\n", packet->packet_id); } |
From: David M. D. <do...@us...> - 2005-05-31 23:30:54
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21282/boards Modified Files: fireboard.c Log Message: Added GGA am type pg handler. Index: fireboard.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/fireboard.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** fireboard.c 27 May 2005 22:22:02 -0000 1.3 --- fireboard.c 31 May 2005 23:30:45 -0000 1.4 *************** *** 840,844 **** break; } ! case 3:{ XSensorMTS400Data3 *data = (XSensorMTS400Data3 *)packet->data; sprintf(command, --- 840,861 ---- break; } ! case AM_GGA_DATA:{ ! XSensorMTS420GPSData *data = (XSensorMTS420GPSData *)packet->data; ! sprintf(command, ! "INSERT into %s " ! "(result_time,nodeid,parent,Hours,Minutes,seconds," ! "Latitudedegree,Latitudeminutes,Longitudedegree,Longitudeminute," ! "NSEWind,Fixed)" ! " values (now(),%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u)", ! table, ! //timestring, ! packet->node_id, packet->parent, ! data->hours, data->minutes, data->dec_sec, ! data->Lat_deg, data->Lat_dec_min, ! data->Long_deg, data->Long_dec_min, data->NSEWind,data->Fixed ! ); ! break; ! } ! case 3: { XSensorMTS400Data3 *data = (XSensorMTS400Data3 *)packet->data; sprintf(command, |
From: David M. D. <do...@us...> - 2005-05-28 00:37:47
|
Update of /cvsroot/firebug/fireboard/beta/tos/sensorboards/mts400/GPS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20695/sensorboards/mts400/GPS Modified Files: NMEAM.nc Log Message: GSV parsing now implemented. Index: NMEAM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tos/sensorboards/mts400/GPS/NMEAM.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NMEAM.nc 27 May 2005 20:28:16 -0000 1.3 --- NMEAM.nc 28 May 2005 00:37:14 -0000 1.4 *************** *** 167,175 **** ! return FAIL; } command result_t NMEA.gsv_parse (GSV_Data * gsv_data, const char * gsv_string) { ! return FAIL; } --- 167,218 ---- ! return SUCCESS; } + + + #define char_to_int_m(foo) (*foo-'0') + #define extract_sats_in_view_m(foo) (10*(foo[0]-'0') + (foo[1]-'0')) + #define extract_sat_number_m(foo) (10*(foo[0]-'0') + (foo[1]-'0')) + #define extract_azimuth_m(foo) (100*(foo[0]-'0') + 10*(foo[1]-'0') + (foo[2]-'0')) + command result_t NMEA.gsv_parse (GSV_Data * gsv_data, const char * gsv_string) { ! ! const char * p = gsv_string; ! int i; ! uint8_t num_sats,mess_num; ! uint8_t numchannels; ! ! find_next_field_m(p); ! gsv_data->num_messages = char_to_int_m(p); ! ! find_next_field_m(p); ! mess_num = char_to_int_m(p); ! gsv_data->message_number = mess_num; ! ! find_next_field_m(p); ! num_sats = extract_sats_in_view_m(p); ! gsv_data->satellites_in_view = num_sats; ! ! // This is convenient for determining how many ! // channels to parse. ! if (mess_num*4 < num_sats) { ! numchannels = 4; ! } else { ! numchannels = num_sats % 4; ! } ! ! for (i=0; i<numchannels; i++) { ! ! find_next_field_m(p); ! gsv_data->channel[i].sat_id = extract_sat_number_m(p); ! find_next_field_m(p); ! gsv_data->channel[i].elevation = extract_sat_number_m(p); ! find_next_field_m(p); ! gsv_data->channel[i].azimuth = extract_azimuth_m(p); ! find_next_field_m(p); ! gsv_data->channel[i].SNR = extract_sat_number_m(p); ! } ! return SUCCESS; } |
From: David M. D. <do...@us...> - 2005-05-28 00:36:55
|
Update of /cvsroot/firebug/fireboard/beta/apps/XSensorMTS400 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20609 Modified Files: TestMTS400M.nc Log Message: Fixed unused variable warning. Index: TestMTS400M.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/apps/XSensorMTS400/TestMTS400M.nc,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TestMTS400M.nc 27 May 2005 22:22:50 -0000 1.11 --- TestMTS400M.nc 28 May 2005 00:36:46 -0000 1.12 *************** *** 542,547 **** event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { ! uint32_t temp; ! GGA_Data gga_data = {0}; char * leadtek_string; GGA_Data * gga_data_ptr; --- 542,547 ---- event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { ! //uint32_t temp; ! //GGA_Data gga_data = {0}; char * leadtek_string; GGA_Data * gga_data_ptr; |
From: David M. D. <do...@us...> - 2005-05-28 00:33:06
|
Update of /cvsroot/firebug/fireboard/beta/tos/sensorboards/mts400/GPS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18118/GPS Modified Files: NMEA.h Log Message: AM types added for nmea messages. Index: NMEA.h =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tos/sensorboards/mts400/GPS/NMEA.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NMEA.h 27 May 2005 20:28:16 -0000 1.3 --- NMEA.h 28 May 2005 00:32:57 -0000 1.4 *************** *** 144,147 **** --- 144,150 ---- } GLL_Data; + enum { + AM_GLL_DATA = 234 + }; typedef struct gsa_data { *************** *** 160,163 **** --- 163,169 ---- } GSA_Data; + enum { + AM_GSA_DATA = 235 + }; typedef struct _gsv_channel { *************** *** 180,187 **** --- 186,203 ---- } GSV_Data; + + enum { + AM_GSV_DATA = 236 + }; + + typedef struct rmc_data { NMEA_Data nd; } RMC_Data; + enum { + AM_RMC_DATA = 237 + }; + typedef struct vtg_data { NMEA_Data nd; *************** *** 194,197 **** --- 210,216 ---- } VTG_Data; + enum { + AM_VTG_DATA = 238 + }; typedef struct mss_data { *************** *** 205,208 **** --- 224,230 ---- } MSS_Data; + enum { + AM_MSS_DATA = 239 + }; |
From: David M. D. <do...@us...> - 2005-05-28 00:09:51
|
Update of /cvsroot/firebug/fireboard/beta/tos/sensorboards/mts400 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6481 Modified Files: GpsPacket.nc Log Message: Cleaned up some gps driver code. Index: GpsPacket.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tos/sensorboards/mts400/GpsPacket.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GpsPacket.nc 27 May 2005 00:38:32 -0000 1.2 --- GpsPacket.nc 28 May 2005 00:09:40 -0000 1.3 *************** *** 68,73 **** /* This component handles the gps control and packet abstraction */ includes sensorboard; module GpsPacket { ! provides { interface StdControl as Control; interface BareSendMsg as Send; --- 68,75 ---- /* This component handles the gps control and packet abstraction */ includes sensorboard; + module GpsPacket { ! ! provides { interface StdControl as Control; interface BareSendMsg as Send; *************** *** 78,83 **** command result_t txBytes(uint8_t *bytes, uint8_t numBytes); /* Effects: start sending 'numBytes' bytes from 'bytes' */ ! // command result_t GpsPower(uint8_t PowerState); ! // /* 0 => gps power off; 1 => gps power on */ } uses { --- 80,85 ---- command result_t txBytes(uint8_t *bytes, uint8_t numBytes); /* Effects: start sending 'numBytes' bytes from 'bytes' */ ! // command result_t GpsPower(uint8_t PowerState); ! // /* 0 => gps power off; 1 => gps power on */ } uses { *************** *** 96,108 **** #include "gps.h" ! GPS_Msg buffer; ! //GPS_Msg* bufferPtr; ! TOS_MsgPtr bufferPtr; //really a GPS_Msg pointer ! enum {GPS_SWITCH_IDLE, //GPS I2C switches are not using the I2C bus ! GPS_PWR_SWITCH_WAIT, //Waiting for GPS I2C power switch to set ! GPS_EN_SWITCH_WAIT, //Waiting for GPS I2C enable switch to set ! GPS_TX_SWITCH_WAIT, //Waiting for GPS I2C tx switch to set ! GPS_RX_SWITCH_WAIT, //Waiting for GPS I2C rx switch to set ! }; uint8_t state_gps; //state of I2C switches --- 98,110 ---- #include "gps.h" ! GPS_Msg buffer; ! //GPS_Msg* bufferPtr; ! TOS_MsgPtr bufferPtr; //really a GPS_Msg pointer ! enum {GPS_SWITCH_IDLE, //GPS I2C switches are not using the I2C bus ! GPS_PWR_SWITCH_WAIT, //Waiting for GPS I2C power switch to set ! GPS_EN_SWITCH_WAIT, //Waiting for GPS I2C enable switch to set ! GPS_TX_SWITCH_WAIT, //Waiting for GPS I2C tx switch to set ! GPS_RX_SWITCH_WAIT, //Waiting for GPS I2C rx switch to set ! }; uint8_t state_gps; //state of I2C switches *************** *** 121,127 **** PACKET, BYTES, ! NO_GPS_START_BYTE = 0, ! GPS_START_BYTE = 1, ! GPS_BUF_NOT_AVAIL = 2 }; uint8_t state; --- 123,129 ---- PACKET, BYTES, ! NO_GPS_START_BYTE = 0, ! GPS_START_BYTE = 1, ! GPS_BUF_NOT_AVAIL = 2 }; uint8_t state; *************** *** 137,145 **** --- 139,152 ---- packet abstraction. One such example is the UART. + 27 May 2005: This is fine, but why not abstract those functionalities + into different modules to make the code easier to maintain + and debug? -dmd */ + /* Initialization of this component */ command result_t Control.init() { + atomic recPtr = (uint8_t *)&buffer; bufferIndex = 0; *************** *** 158,166 **** command result_t Control.start() { // apply your power management algorithm ! call SwitchControl.start(); ! return call ByteControl.start(); ! } ! /* Command to control the power of the network stack */ command result_t Control.stop() { // apply your power management algorithm --- 165,173 ---- command result_t Control.start() { // apply your power management algorithm ! call SwitchControl.start(); ! return call ByteControl.start(); ! } ! /* Command to control the power of the network stack */ command result_t Control.stop() { // apply your power management algorithm *************** *** 171,182 **** if (txCount == 0) { ! txCount = 1; ! txLength = numBytes; ! sendPtr = bytes; /* send the first byte */ ! if (call ByteComm.txByte(sendPtr[0])) ! return SUCCESS; else ! txCount = 0; } return FAIL; --- 178,189 ---- if (txCount == 0) { ! txCount = 1; ! txLength = numBytes; ! sendPtr = bytes; /* send the first byte */ ! if (call ByteComm.txByte(sendPtr[0])) ! return SUCCESS; else ! txCount = 0; } return FAIL; *************** *** 199,203 **** task void sendDoneFailTask() { atomic{ ! txCount = 0; state = IDLE; } --- 206,210 ---- task void sendDoneFailTask() { atomic{ ! txCount = 0; state = IDLE; } *************** *** 207,211 **** task void sendDoneSuccessTask() { atomic{ ! txCount = 0; state = IDLE; } --- 214,218 ---- task void sendDoneSuccessTask() { atomic{ ! txCount = 0; state = IDLE; } *************** *** 215,219 **** task void sendVarLenFailTask() { atomic{ ! txCount = 0; state = IDLE; } --- 222,226 ---- task void sendVarLenFailTask() { atomic{ ! txCount = 0; state = IDLE; } *************** *** 230,257 **** void sendComplete(result_t success) { ! atomic{ ! if (state == PACKET){ ! TOS_MsgPtr msg = (TOS_MsgPtr)sendPtr; if (success) { /* This is a non-ack based layer */ ! msg->ack = TRUE; ! post sendDoneSuccessTask(); ! } ! else { ! post sendDoneFailTask(); ! } } ! else if (state == BYTES) { ! if (success) { ! post sendVarLenSuccessTask(); } else { ! post sendVarLenFailTask(); } ! } ! else { ! txCount = 0; ! state = IDLE; ! } ! } //atomic } --- 237,265 ---- void sendComplete(result_t success) { ! ! atomic{ ! if (state == PACKET){ ! TOS_MsgPtr msg = (TOS_MsgPtr)sendPtr; if (success) { /* This is a non-ack based layer */ ! msg->ack = TRUE; ! post sendDoneSuccessTask(); ! } ! else { ! post sendDoneFailTask(); ! } } ! else if (state == BYTES) { ! if (success) { ! post sendVarLenSuccessTask(); ! } ! else { ! post sendVarLenFailTask(); ! } } else { ! txCount = 0; ! state = IDLE; } ! } //atomic } *************** *** 268,326 **** /* Byte level component signals it is ready to accept the next byte. Send the next byte if there are data pending to be sent */ ! async event result_t ByteComm.txByteReady(bool success) { ! atomic{ ! if (txCount > 0){ ! if (!success){ ! dbg(DBG_ERROR, "TX_packet failed, TX_byte_failed"); ! sendComplete(FAIL); ! } ! else if (txCount < txLength){ ! dbg(DBG_PACKET, "PACKET: byte sent: %x, COUNT: %d\n", ! sendPtr[txCount], txCount); ! if (!call ByteComm.txByte(sendPtr[txCount++])) sendComplete(FAIL); ! } ! } ! } //atomic return SUCCESS; } ! async event result_t ByteComm.txDone() { ! atomic{ ! if (txCount == txLength) ! sendComplete(TRUE); } return SUCCESS; } ! /****************************************************************************** ! * Signal gps buffer avail ! * Only one buffer ! *****************************************************************************/ task void receiveTask() { ! bufferPtr = signal Receive.receive(bufferPtr); //no pointer change on return ! atomic state_gps_pkt = NO_GPS_START_BYTE; ! } ! /****************************************************************************** ! * Byte received from GPS ! * First byte in gps packet is reserved to count number of bytes rcvd. ! * Gps messages start with '$' (0x24) and end with <cr><lf> (0x0D, 0x0A) ! *****************************************************************************/ async event result_t ByteComm.rxByteReady(uint8_t data, bool error, ! uint16_t strength) { ! // SODbg(DBG_USR2, "PACKET: byte arrived: %x, COUNT: %i\n", data, rxCount); ! if (error){ ! rxCount = 0; ! return FAIL; ! } ! //if gps buffer not avail if (state_gps_pkt == GPS_BUF_NOT_AVAIL) return SUCCESS; ! if ((state_gps_pkt == NO_GPS_START_BYTE) && (data != GPS_PACKET_START)){ ! rxCount = 1; ! return SUCCESS; } else{ ! state_gps_pkt = GPS_START_BYTE; } --- 276,334 ---- /* Byte level component signals it is ready to accept the next byte. Send the next byte if there are data pending to be sent */ ! async event result_t ByteComm.txByteReady(bool success) { ! atomic{ ! if (txCount > 0){ ! if (!success){ ! dbg(DBG_ERROR, "TX_packet failed, TX_byte_failed"); ! sendComplete(FAIL); ! } ! else if (txCount < txLength){ ! dbg(DBG_PACKET, "PACKET: byte sent: %x, COUNT: %d\n", ! sendPtr[txCount], txCount); ! if (!call ByteComm.txByte(sendPtr[txCount++])) sendComplete(FAIL); ! } ! } ! } //atomic return SUCCESS; } ! async event result_t ByteComm.txDone() { ! atomic{ ! if (txCount == txLength) ! sendComplete(TRUE); } return SUCCESS; } ! /****************************************************************************** ! * Signal gps buffer avail ! * Only one buffer ! *****************************************************************************/ task void receiveTask() { ! bufferPtr = signal Receive.receive(bufferPtr); //no pointer change on return ! atomic state_gps_pkt = NO_GPS_START_BYTE; ! } ! /****************************************************************************** ! * Byte received from GPS ! * First byte in gps packet is reserved to count number of bytes rcvd. ! * Gps messages start with '$' (0x24) and end with <cr><lf> (0x0D, 0x0A) ! *****************************************************************************/ async event result_t ByteComm.rxByteReady(uint8_t data, bool error, ! uint16_t strength) { ! // SODbg(DBG_USR2, "PACKET: byte arrived: %x, COUNT: %i\n", data, rxCount); ! if (error){ ! rxCount = 0; ! return FAIL; ! } ! //if gps buffer not avail if (state_gps_pkt == GPS_BUF_NOT_AVAIL) return SUCCESS; ! if ((state_gps_pkt == NO_GPS_START_BYTE) && (data != GPS_PACKET_START)){ ! rxCount = 1; ! return SUCCESS; } else{ ! state_gps_pkt = GPS_START_BYTE; } *************** *** 328,351 **** recPtr[0] = rxCount; ! if (rxCount == GPS_DATA_LENGTH ){ ! SODbg(DBG_USR2, "gps packet too large- flushed \n"); state_gps_pkt = NO_GPS_START_BYTE; ! return SUCCESS; } ! if (data == GPS_PACKET_END2 ){ ! state_gps_pkt = GPS_BUF_NOT_AVAIL; rxCount = 1; ! post receiveTask(); ! return SUCCESS; } ! // bufferIndex = bufferIndex ^ 1; ! // recPtr = (uint8_t*)bufferPtr; ping pong buffers !!!!!!!!!!!!!!!!!! ! // SODbg(DBG_USR2, "got gps packet; # of bytes = %i \n", rxCount); ! // rxCount = 0; ! // post receiveTask(); ! // return FAIL; //} --- 336,359 ---- recPtr[0] = rxCount; ! if (rxCount == GPS_DATA_LENGTH ){ ! SODbg(DBG_USR2, "gps packet too large- flushed \n"); state_gps_pkt = NO_GPS_START_BYTE; ! return SUCCESS; } ! if (data == GPS_PACKET_END2 ){ ! state_gps_pkt = GPS_BUF_NOT_AVAIL; rxCount = 1; ! post receiveTask(); ! return SUCCESS; } ! // bufferIndex = bufferIndex ^ 1; ! // recPtr = (uint8_t*)bufferPtr; ping pong buffers !!!!!!!!!!!!!!!!!! ! // SODbg(DBG_USR2, "got gps packet; # of bytes = %i \n", rxCount); ! // rxCount = 0; ! // post receiveTask(); ! // return FAIL; //} *************** *** 353,365 **** } ! /****************************************************************************** ! * Turn Gps on/off ! * PowerState = 0 then GPS power off, GPS enable off ! * = 1 then GPS power on, GPS enable on ! * NOTE - GPS switching power supply is enabled by a lo, disabled by a hi ! *****************************************************************************/ ! command result_t GpsCmd.PowerSwitch(uint8_t PowerState){ if (state_gps == GPS_SWITCH_IDLE){ ! power_gps = PowerState; if (power_gps){ if (call Switch1.set(MICAWB_GPS_POWER,0) == SUCCESS) state_gps = GPS_PWR_SWITCH_WAIT; --- 361,373 ---- } ! /****************************************************************************** ! * Turn Gps on/off ! * PowerState = 0 then GPS power off, GPS enable off ! * = 1 then GPS power on, GPS enable on ! * NOTE - GPS switching power supply is enabled by a lo, disabled by a hi ! *****************************************************************************/ ! command result_t GpsCmd.PowerSwitch(uint8_t PowerState){ if (state_gps == GPS_SWITCH_IDLE){ ! power_gps = PowerState; if (power_gps){ if (call Switch1.set(MICAWB_GPS_POWER,0) == SUCCESS) state_gps = GPS_PWR_SWITCH_WAIT; *************** *** 371,387 **** } return FAIL; ! } ! // Power or Enabled switch set event result_t Switch1.setDone(bool local_result) { if (state_gps == GPS_PWR_SWITCH_WAIT) { ! if (call Switch1.set(MICAWB_GPS_ENABLE ,power_gps) == SUCCESS) { ! state_gps = GPS_EN_SWITCH_WAIT; } } else if (state_gps == GPS_EN_SWITCH_WAIT) { ! signal GpsCmd.PowerSet(power_gps); ! state_gps = GPS_SWITCH_IDLE; } --- 379,395 ---- } return FAIL; ! } ! // Power or Enabled switch set event result_t Switch1.setDone(bool local_result) { if (state_gps == GPS_PWR_SWITCH_WAIT) { ! if (call Switch1.set(MICAWB_GPS_ENABLE ,power_gps) == SUCCESS) { ! state_gps = GPS_EN_SWITCH_WAIT; } } else if (state_gps == GPS_EN_SWITCH_WAIT) { ! signal GpsCmd.PowerSet(power_gps); ! state_gps = GPS_SWITCH_IDLE; } *************** *** 390,427 **** } ! event result_t Switch1.getDone(char value) { return SUCCESS; } ! /****************************************************************************** ! * Turn Gps Rx,Tx signals on/off ! * state = 0 then tx and rx disabled ! * = 1 then tx and rx enabled ! * NOTE - rx,tx share pressure lines. ! *****************************************************************************/ ! command result_t GpsCmd.TxRxSwitch(uint8_t rtstate){ power_gps = rtstate; if (state_gps == GPS_SWITCH_IDLE){ if (call SwitchI2W.set( MICAWB_GPS_TX_SELECT ,power_gps) == SUCCESS) { ! state_gps = GPS_TX_SWITCH_WAIT; return SUCCESS; } } ! return FAIL; ! } ! // Tx or Rx switch set event result_t SwitchI2W.setDone(bool local_result) { if (state_gps == GPS_TX_SWITCH_WAIT) { if (call SwitchI2W.set( MICAWB_GPS_RX_SELECT ,power_gps) == SUCCESS) { ! state_gps = GPS_RX_SWITCH_WAIT; } } else if (state_gps == GPS_RX_SWITCH_WAIT) { ! SODbg(DBG_USR2, "GpsPacket: all switches set \n"); ! state_gps = GPS_SWITCH_IDLE; ! signal GpsCmd.TxRxSet(power_gps); } --- 398,435 ---- } ! event result_t Switch1.getDone(char value) { return SUCCESS; } ! /****************************************************************************** ! * Turn Gps Rx,Tx signals on/off ! * state = 0 then tx and rx disabled ! * = 1 then tx and rx enabled ! * NOTE - rx,tx share pressure lines. ! *****************************************************************************/ ! command result_t GpsCmd.TxRxSwitch(uint8_t rtstate){ power_gps = rtstate; if (state_gps == GPS_SWITCH_IDLE){ if (call SwitchI2W.set( MICAWB_GPS_TX_SELECT ,power_gps) == SUCCESS) { ! state_gps = GPS_TX_SWITCH_WAIT; return SUCCESS; } } ! return FAIL; ! } ! // Tx or Rx switch set event result_t SwitchI2W.setDone(bool local_result) { if (state_gps == GPS_TX_SWITCH_WAIT) { if (call SwitchI2W.set( MICAWB_GPS_RX_SELECT ,power_gps) == SUCCESS) { ! state_gps = GPS_RX_SWITCH_WAIT; } } else if (state_gps == GPS_RX_SWITCH_WAIT) { ! SODbg(DBG_USR2, "GpsPacket: all switches set \n"); ! state_gps = GPS_SWITCH_IDLE; ! signal GpsCmd.TxRxSet(power_gps); } |
From: David M. D. <do...@us...> - 2005-05-27 22:22:59
|
Update of /cvsroot/firebug/fireboard/beta/apps/XSensorMTS400 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4221 Modified Files: TestMTS400M.nc sensorboardApp.h Log Message: Test code now returns firebug gga code. Index: TestMTS400M.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/apps/XSensorMTS400/TestMTS400M.nc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TestMTS400M.nc 27 May 2005 20:28:02 -0000 1.10 --- TestMTS400M.nc 27 May 2005 22:22:50 -0000 1.11 *************** *** 543,548 **** uint32_t temp; - char * leadtek_string; GGA_Data gga_data = {0}; GGA_Data * gga_data_ptr; --- 543,548 ---- uint32_t temp; GGA_Data gga_data = {0}; + char * leadtek_string; GGA_Data * gga_data_ptr; *************** *** 550,555 **** GPS_MsgPtr gps_data = (GPS_MsgPtr)data; ! gga_data_ptr = &gga_data; // if gps have been scaned then stop receiving gps uart packet --- 550,556 ---- GPS_MsgPtr gps_data = (GPS_MsgPtr)data; ! //gga_data_ptr = &gga_data; + gga_data_ptr = &(pack->xData.gga_data); // if gps have been scaned then stop receiving gps uart packet *************** *** 565,572 **** } - if (gga_data_ptr->num_sats > 2) { - pack->xData.dataGps.fixed = 1; - } // Pack everything into xbow structs so that // xlisten can process it. --- 566,571 ---- } + #if 0 // Pack everything into xbow structs so that // xlisten can process it. *************** *** 586,590 **** pack->xData.dataGps.long_dec_min= temp; pack->xData.dataGps.nsewind = gga_data_ptr->NSEWind; ! if (gps_pwr_on)call GpsCmd.TxRxSwitch(0); // stop receive from gpsuart atomic state = GPS_DONE; --- 585,590 ---- pack->xData.dataGps.long_dec_min= temp; pack->xData.dataGps.nsewind = gga_data_ptr->NSEWind; ! #endif ! if (gps_pwr_on)call GpsCmd.TxRxSwitch(0); // stop receive from gpsuart atomic state = GPS_DONE; Index: sensorboardApp.h =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/apps/XSensorMTS400/sensorboardApp.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sensorboardApp.h 27 May 2005 00:38:13 -0000 1.4 --- sensorboardApp.h 27 May 2005 22:22:50 -0000 1.5 *************** *** 4,7 **** --- 4,8 ---- #define SENSORBOARDAPP_H + #include "NMEA.h" typedef struct XSensorHeader { *************** *** 55,58 **** --- 56,60 ---- XSensorMTS400DataMsg data1; GGAMsg dataGps; + GGA_Data gga_data; }xData; } __attribute__ ((packed)) XDataMsg; |