在 WM 平台上开发 GPS 导航系统
2010-02-21 22:52:00 来源:WEB开发网84 If Words(7) <> "" Then
85 ' Yes. Parse the speed and convert it to MPH
86 Dim Speed As Double = Double.Parse(Words(7), NmeaCultureInfo) _
87 * MPHPerKnot
88 ' Notify of the new speed
89 RaiseEvent SpeedReceived(Speed)
90 ' Are we over the highway speed limit?
91 If Speed > 55 Then RaiseEvent SpeedLimitReached()
92 End If
93 ' Do we have enough information to extract bearing?
94 If Words(8) <> "" Then
95 ' Indicate that the sentence was recognized
96 Dim Bearing As Double = CType(Words(8), Double)
97 RaiseEvent BearingReceived(Bearing)
98 End If
99 ' Does the device currently have a satellite fix?
100 If Words(2) <> "" Then
101 Select Case Words(2)
102 Case "A"
103 RaiseEvent FixObtained()
104 Case "V"
105 RaiseEvent FixLost()
106 End Select
107 End If
108 ' Indicate that the sentence was recognized
109 Return True
110 End Function
111 ' Interprets a "Satellites in View" NMEA sentence
112 Public Function ParseGPGSV(ByVal sentence As String) As Boolean
113 Dim PseudoRandomCode As Integer
114 Dim Azimuth As Integer
115 Dim Elevation As Integer
116 Dim SignalToNoiseRatio As Integer
117 ' Divide the sentence into words
118 Dim Words() As String = GetWords(sentence)
119 ' Each sentence contains four blocks of satellite information.
120 ' Read each block
121 ' and report each satellite's information
122 Dim Count As Integer
123 For Count = 1 To 4
124 ' Does the sentence have enough words to analyze?
125 If (Words.Length - 1) >= (Count * 4 + 3) Then
126 ' Yes. Proceed with analyzing the block. Does it contain any
- ››开发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性能优化的一些经验
更多精彩
赞助商链接