在 WM 平台上开发 GPS 导航系统
2010-02-21 22:52:00 来源:WEB开发网75 ' Notify of the new time, adjusted to the local time zone
76 RaiseEvent DateTimeChanged(SatelliteTime.ToLocalTime)
77 End If
78 ' Do we have enough information to extract the current speed?
79 If Words(7) <> "" Then
80 ' Yes. Convert it into MPH
81 Dim Speed As Double = CType(Words(7), Double) * 1.150779
82 ' If we're over 55MPH then trigger a speed alarm!
83 If Speed > 55 Then RaiseEvent SpeedLimitReached()
84 ' Notify of the new speed
85 RaiseEvent SpeedReceived(Speed)
86 End If
87 ' Do we have enough information to extract bearing?
88 If Words(8) <> "" Then
89 ' Indicate that the sentence was recognized
90 Dim Bearing As Double = CType(Words(8), Double)
91 RaiseEvent BearingReceived(Bearing)
92 End If
93 ' Does the device currently have a satellite fix?
94 If Words(2) <> "" Then
95 Select Case Words(2)
96 Case "A"
97 RaiseEvent FixObtained()
98 Case "V"
99 RaiseEvent FixLost()
100 End Select
101 End If
102 ' Indicate that the sentence was recognized
103 Return True
104 End Function
105 ' Interprets a "Satellites in View" NMEA sentence
106 Public Function ParseGPGSV(ByVal sentence As String) As Boolean
107 Dim PseudoRandomCode As Integer
108 Dim Azimuth As Integer
109 Dim Elevation As Integer
110 Dim SignalToNoiseRatio As Integer
111 ' Divide the sentence into words
112 Dim Words() As String = GetWords(sentence)
113 ' Each sentence contains four blocks of satellite information.
114 ' Read each block and report each satellite's information
115 Dim Count As Integer
- ››开发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性能优化的一些经验
更多精彩
赞助商链接