在 WM 平台上开发 GPS 导航系统
2010-02-21 22:52:00 来源:WEB开发网5 '*******************************************************
6
7 Public Class NmeaInterpreter
8
9 ' Raised when the current location has changed
10
11 Public Event PositionReceived(ByVal latitude As String, _
12 ByVal longitude As String)
13 Public Event DateTimeChanged(ByVal dateTime As DateTime)
14 Public Event BearingReceived(ByVal bearing As Double)
15 Public Event SpeedReceived(ByVal speed As Double)
16 Public Event SpeedLimitReached()
17 Public Event FixObtained()
18 Public Event FixLost()
19 Public Event SatelliteReceived(ByVal pseudoRandomCode As Integer, _
20 ByVal azimuth As Integer, _
21 ByVal elevation As Integer, _
22 ByVal signalToNoiseRatio As Integer)
23 ' Processes information from the GPS receiver
24 Public Function Parse(ByVal sentence As String) As Boolean
25 ' Discard the sentence if its checksum does not match our calculated
26 ' checksum
27 If Not IsValid(sentence) Then Return False
28 ' Look at the first word to decide where to go next
29 Select Case GetWords(sentence)(0)
30 Case "$GPRMC" ' A "Recommended Minimum" sentence was found!
31 Return ParseGPRMC(sentence)
32 Case "$GPGSV" ' A "Satellites in View" message was found
33 Return ParseGPGSV(sentence)
34 Case Else
35 ' Indicate that the sentence was not recognized
36 Return False
37 End Select
38 End Function
39 ' Divides a sentence into individual words
40 Public Function GetWords(ByVal sentence As String) As String()
41 Return sentence.Split(","c)
42 End Function
43 ' Interprets a $GPRMC message
44 Public Function ParseGPRMC(ByVal sentence As String) As Boolean
- ››开发Android 日历教程
- ››开发学院总结 Win 8实用技巧大全
- ››开发学院原创教程:把win8的IE10放桌面上方法(非...
- ››开发者眼中的Windows Phone和Android
- ››开发学院教你用SQL 语句最快速清空MySQL 数据表的...
- ››WM 无法连接到win 7及webservice的异类原因
- ››开发一个自己的HTML在线编辑器(一)
- ››开发一个自己的HTML在线编辑器(二)
- ››开发者在App Store上赚的钱比在Android Market上多...
- ››开发者应深入学习的10个Android开源应用项目
- ››WM/WP上最完美的背光控制软件
- ››WM性能优化的一些经验
更多精彩
赞助商链接