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

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

 2010-02-21 22:52:00 来源:WEB开发网   
核心提示:45 ' Divide the sentence into words46 Dim Words() As String = GetWords(sentence)47 ' Do we have enough values to describe our location?48 If Words(3) &l

45 ' Divide the sentence into words

46 Dim Words() As String = GetWords(sentence)

47 ' Do we have enough values to describe our location?

48 If Words(3) <> "" And Words(4) <> "" And Words(5) <> "" And _

49 Words(6) <> "" Then

50 ' Yes. Extract latitude and longitude

51 Dim Latitude As String = Words(3).Substring(0, 2) & "°" ' Append hours

52 Latitude = Latitude & Words(3).Substring(2) & """" ' Append minutes

53 Latitude = Latitude & Words(4) ' Append the hemisphere

54 Dim Longitude As String = Words(5).Substring(0, 3) & "°" ' Append hours

55 Longitude = Longitude & Words(5).Substring(3) & """" ' Append minutes

56 Longitude = Longitude & Words(6) ' Append the hemisphere

57 ' Notify the calling application of the change

58 RaiseEvent PositionReceived(Latitude, Longitude)

59 End If

60 ' Do we have enough values to parse satellite-derived time?

61 If Words(1) <> "" Then

62 ' Yes. Extract hours, minutes, seconds and milliseconds

63 Dim UtcHours As Integer = CType(Words(1).Substring(0, 2), Integer)

64 Dim UtcMinutes As Integer = CType(Words(1).Substring(2, 2), Integer)

65 Dim UtcSeconds As Integer = CType(Words(1).Substring(4, 2), Integer)

66 Dim UtcMilliseconds As Integer

67 ' Extract milliseconds if it is available

68 If Words(1).Length > 7 Then UtcMilliseconds = _

69 CType(Single.Parse(Words(1).Substring(6), _

70 CultureInfo.InvariantCulture) * 1000, Integer)

71 ' Now build a DateTime object with all values

72 Dim Today As DateTime = System.DateTime.Now.ToUniversalTime

73 Dim SatelliteTime As New System.DateTime(Today.Year, Today.Month, _

74 Today.Day, UtcHours, UtcMinutes, UtcSeconds, UtcMilliseconds)

上一页  13 14 15 16 17 18 19 20 21 22 23  下一页

Tags:WM 平台 开发

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