gll.java
来自「国外的一个开源gps模拟器源代码」· Java 代码 · 共 45 行
JAVA
45 行
/*
* Copyright (c) 2007 by the University of Applied Sciences Northwestern Switzerland (FHNW)
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
* This program is distributed without any warranty or implied warranty
* of merchantability or fitness for a particular purpose.
*
* See the GNU General Public License for more details.
*/
package ch.fhnw.imvs.gpssimulator.nmea;
import ch.fhnw.imvs.gpssimulator.data.GPSData;
public class GLL extends NMEASentence {
@Override
public String getName() { return "GPGLL"; }
@Override
public String getSentence(boolean content) {
String sentence;
if (content) {
String ns = GPSData.getNS().name().substring(0,1);
String ew = GPSData.getEW().name().substring(0,1);
StringBuffer buf = new StringBuffer(getName());
append(buf, NMEASentence.getNMEALatitude()); // in degree
append(buf, ns);
append(buf, NMEASentence.getNMEALongitude());
append(buf, ew);
append(buf, getTimestamp()); // time position is taken in UTC
append(buf, GPSData.getStatus().name()); // A=OK, V=warning
append(buf, GPSData.getMode().name().substring(0,1));
sentence = buf.toString();
}
else {
sentence = ("GPGLL,,,,," + getTimestamp() + ",,");
}
return sentence;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?