whyerect
路人甲
路人甲
  • 注册日期2003-10-16
  • 发帖数2827
  • QQ
  • 铜币14枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1320回复:0

【转】基于Java的GPS接收机解析器 (4)

楼主#
更多 发布于:2004-02-20 02:18
/*
 *
 * 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;
        }
}
喜欢0 评分0
[face=隶书]
强极则辱 情深不寿
谦谦君子 温润如玉
[/face]
______________________________________
游客

返回顶部