<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">hi Martin<div><br class="webkit-block-placeholder"></div><div>i'm doing something about gps signal acquisition,</div><div><br class="webkit-block-placeholder"></div><div>i wrote a initial script</div><div>to produce a gml from the nmea</div><div>it read the serial port where is connected the gps-receiver and write out to gml format</div><div><br class="webkit-block-placeholder"></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><a href="http://wiki.gfoss.it/index.php/GPS_scrip_:_Parsing_del_segale_NMEA">http://wiki.gfoss.it/index.php/GPS_scrip_:_Parsing_del_segale_NMEA</a></div></div><div><br class="webkit-block-placeholder"></div><div>for now it is in "development" it is in a ugly form </div><div>(not well legible, i need to optimize its sintax, like adding</div><div>a dictionary to store the variables)</div><div><br class="webkit-block-placeholder"></div><div>it need an "excepition gestion"</div><div>beacouse if the nmea signal is low (or parts of it is empty)</div><div>the script exit ... and need to be reload.</div><div><br class="webkit-block-placeholder"></div><div>i haven't experience using "try"</div><div>mybe it could be a solution</div><div>... i.e. if the signal is not good do :</div><div>   sleep 0.5</div><div>   continue</div><div>... and so on ,  until the nmea signal is readable</div><div><br class="webkit-block-placeholder"></div><div>in the loop i've :</div><div><br></div><div><div>while 1:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>line = gps.readline()</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>datablock = line.split(',') </div><div>        if line[0:6] == '$GPGGA':</div><div>        ...</div><div> </div><div>#to manage the exception</div><div>#would be ??? :</div><div> </div><div>while 1:</div><div>        try:</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>    line = gps.readline()</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>    datablock = line.split(',') </div><div>            if line[0:6] == '$GPGGA':</div><div>                #** except ... </div><div>                sleep(0.5)</div><div>                continue</div><div>                quality = string.atof(datablock[6])</div><div>                ...</div><div> </div><div>            if line[0:6] == '$GPGGA':</div><div>                #** except ...  </div><div>                sleep(0.5)</div><div>                continue</div><div>                utctime = string.atof(datablock[1])</div><div>                ...</div><div>            ...</div><div> </div><div> </div><div>i'll try to find how to manage the "try-except" statment</div><div>maybe it must controls the case where :</div><div> </div><div>- a specific datablock[] is empty or not a number</div><div>- the numbers of the needed params is less than nedded</div><div><br></div><div>any suggestion, improvments, corrections are welcome</div></div><div><br class="webkit-block-placeholder"></div><div>regards,</div><div><br class="webkit-block-placeholder"></div><div>Massimo</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><div><div>Il giorno 07/mar/08, alle ore 02:11, <a href="mailto:qgis-user-request@lists.osgeo.org">qgis-user-request@lists.osgeo.org</a> ha scritto:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; ">On Thu, Mar 6, 2008 at 9:36 PM, victor javier morales<br><<a href="mailto:vjmorales@gmail.com">vjmorales@gmail.com</a>> wrote:<br><blockquote type="cite"><br></blockquote><blockquote type="cite">I think the same of you martin, but<br></blockquote><blockquote type="cite">the real problem is that we don't know How this machines deliver their data,<br></blockquote><blockquote type="cite">for example the format for this data or the speed in real time.<br></blockquote><blockquote type="cite"><br></blockquote><br>The data formats sent by GPS are usually well-documented, moreover<br>there is a de facto standard NMEA-0183 which is used by majority of<br>GPS producers.<br><br>Martin</span></blockquote></div><br></div></body></html>