在 WM 平台上开发 GPS 导航系统
2010-02-21 22:52:00 来源:WEB开发网16 ByVal longitude As String)
17 Public Event DateTimeChanged(ByVal dateTime As DateTime)
18 Public Event BearingReceived(ByVal bearing As Double)
19 Public Event SpeedReceived(ByVal speed As Double)
20 Public Event SpeedLimitReached()
21 Public Event FixObtained()
22 Public Event FixLost()
23 Public Event SatelliteReceived(ByVal pseudoRandomCode As Integer, _
24 ByVal azimuth As Integer, _
25 ByVal elevation As Integer, _
26 ByVal signalToNoiseRatio As Integer)
27 ' Processes information from the GPS receiver
28 Public Function Parse(ByVal sentence As String) As Boolean
29 ' Discard the sentence if its checksum does not match our calculated
30 ' checksum
31 If Not IsValid(sentence) Then Return False
32 ' Look at the first word to decide where to go next
33 Select Case GetWords(sentence)(0)
34 Case "$GPRMC" ' A "Recommended Minimum" sentence was found!
35 Return ParseGPRMC(sentence)
36 Case "$GPGSV"
37 Return ParseGPGSV(sentence)
38 Case Else
39 ' Indicate that the sentence was not recognized
40 Return False
41 End Select
42 End Function
43 ' Divides a sentence into individual words
44 Public Function GetWords(ByVal sentence As String) As String()
45 Return sentence.Split(","c)
46 End Function
47 ' Interprets a $GPRMC message
48 Public Function ParseGPRMC(ByVal sentence As String) As Boolean
49 ' Divide the sentence into words
50 Dim Words() As String = GetWords(sentence)
51 ' Do we have enough values to describe our location?
52 If Words(3) <> "" And Words(4) <> "" _
53 And Words(5) <> "" And Words(6) <> "" Then
- ››开发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性能优化的一些经验
更多精彩
赞助商链接