Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 17th, 2004, 01:03 PM
Authorized User
 
Join Date: Feb 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JAtkinson
Default Looping StreamReader

Im currently writing a GPS simulator in vb.net. I have a text file of GPS NMEA strings (thousands of lines) that I would like to read via StreamReader and display in a textbox or richtextbox. Heres the catch: I want to read the first line, wait one second (using a timer), and then read the second line... and so on.

Example of text in file:
$GPGGA,175417.00,3854.65842,N,09710.88025,W,2,9,1. 0,345.74,M,-29.96,M,5,105*62
$GPGGA,175418.00,3854.65842,N,09710.88025,W,2,9,1. 0,345.73,M,-29.96,M,6,105*69
$GPGGA,175419.00,3854.65842,N,09710.88025,W,2,9,1. 0,345.73,M,-29.96,M,7,105*69
$GPGGA,175420.00,3854.65842,N,09710.88025,W,2,9,1. 0,345.73,M,-29.96,M,8,105*6C
$GPGGA,175421.00,3854.65853,N,09710.88005,W,2,8,1. 1,347.39,M,-29.96,M,3,106*6B

The textbox should miror this.. adding a line every second while retaining the previous line.

Thanks,
James

 
Old April 19th, 2004, 10:06 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Take a look at the System.Timers namespace and classes. You should be able to find a timer class suitable for your needs.

I'd be curious how you make out with this project. GPS and caching are hobbies of mine so I'd be interested to hear how you are using this simulator.

Peter
-------------------------
Work smarter, not harder
 
Old April 19th, 2004, 04:25 PM
Authorized User
 
Join Date: Feb 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JAtkinson
Default

Ok, I got it working. Planoie, I will let you know when I get this working. It's nothing really complicated (no graphics). It will also find the average latitudes etc. for finding static GPS error. At Kansas State Univ I took a class last year that was all about GPS in agriculture. I had to do this same sort of thing, but in excel. Excel would take 45 min. to recalculate each cell after I put in 30,000 lines of GPS strings. This I would find the error and std dev and so on. This I think will work a lot faster and not bog down the ol PC.

James






Similar Threads
Thread Thread Starter Forum Replies Last Post
Asynchronous reading to console+StreamReader aashish23 C# 1 September 5th, 2007 04:16 AM
StreamReader.ReadToEnd Surre ASP.NET 1.0 and 1.1 Professional 0 March 30th, 2006 07:00 AM
C#: EOF using StreamReader shazia1 VS.NET 2002/2003 0 August 16th, 2005 04:25 AM
Streamreader question stevec VB.NET 2002/2003 Basics 1 October 10th, 2004 12:49 AM
StreamReader Loop [Resolved] JAtkinson VB How-To 0 April 17th, 2004 01:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.