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

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

 2010-02-21 22:52:00 来源:WEB开发网   
核心提示:54 ' Yes. Extract latitude and longitude55 Dim Latitude As String = Words(3).Substring(0, 2) & "°" ' Append hours56 Latitude = Latitude & Word

54 ' Yes. Extract latitude and longitude

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

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

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

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

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

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

61 ' Notify the calling application of the change

62 RaiseEvent PositionReceived(Latitude, Longitude)

63 End If

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

65 If Words(1) <> "" Then

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

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

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

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

70 Dim UtcMilliseconds As Integer

71 ' Extract milliseconds if it is available

72 If Words(1).Length > 7 Then

73 UtcMilliseconds = CType(Single.Parse(Words(1).Substring(6), _

74 CultureInfo.InvariantCulture) * 1000, Integer)

75 End If

76 ' Now build a DateTime object with all values

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

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

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

80 ' Notify of the new time, adjusted to the local time zone

81 RaiseEvent DateTimeChanged(SatelliteTime.ToLocalTime)

82 End If

83 ' Do we have enough information to extract the current speed?

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

Tags:WM 平台 开发

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