阅读:1320回复:0
【转】基于Java的GPS接收机解析器 (4)
/*
* * GpsReceiver.java * * This is a simple GPS Parser program, which reads in GPS signal from either * a GPS receiver or a GPS data file, and outputs time and position information * like UTC time, Latitude, Longitude, and Altitude. * * Author : Qingye Jiang (John) * HappyFox Engineering Solutions * qjiang@tsinghua.edu * * 2001-10-15 * */ import java.io.*; import javax.comm.*; public class GpsReceiver { private GpsInfo GpsData; private GpsParser InfoParser; /** * * Constructor. * * @param filename The filename of the GPS input data file. * */ public GpsReceiver(String GpsDevice, int Factor, boolean Record) { GpsData = new GpsInfo(); InfoParser = new GpsParser(GpsDevice, Factor, Record, GpsData); } /** * * Method to start the GPS receiver. * */ public void StartReceiver() { InfoParser.start(); } /** * * Method to stop the GPS receiver. * */ public void StopReceiver() { InfoParser.stop(); } /** * * This method returns the current position of the GPS receiver, which i * acquired by the information given by $--GGA. * */ public GpsInfo GetGpsData() { return GpsData; } } |
|
|