WEB开发网
开发学院手机开发Windows Mobile 开发 在 WM 平台上开发 GPS 导航系统 阅读

在 WM 平台上开发 GPS 导航系统

 2010-02-21 22:52:00 来源:WEB开发网   
核心提示:84 If Words(7) <> "" Then85 ' Yes. Parse the speed and convert it to MPH86 Dim Speed As Double = Double.Parse(Words(7), NmeaCultureInfo) _87

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

上一页  19 20 21 22 23 24 25 26  下一页

Tags:WM 平台 开发

编辑录入:coldstar [复制链接] [打 印]
赞助商链接