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

在 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

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

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

Tags:WM 平台 开发

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