5
Stump the Expert December 2015

2015 Stump the InduSoft Web Studio Expert!

Embed Size (px)

Citation preview

Page 1: 2015 Stump the InduSoft Web Studio Expert!

Stump the Expert

December 2015

Page 2: 2015 Stump the InduSoft Web Studio Expert!

THANK YOU!Together, we are stronger!

15+ years of innovation, collaboration, evolution, and success!

Page 3: 2015 Stump the InduSoft Web Studio Expert!

Q&A

Page 4: 2015 Stump the InduSoft Web Studio Expert!

Weather Information

Function GetLatLngFromAddress(address)Dim Lat, Lng, urlurl = "http://maps.googleapis.com/maps/api/geocode/xml?address=" & addressLat = GetXMLNodeValue(url, "result/geometry/location/lat")Lng = GetXMLNodeValue(url, "result/geometry/location/lng")GetLatLngFromAddress = Lat & "," & Lng

End Function

Function GetXMLNodeValue(url, nodePath)Dim oXML, oNode, retSet oXML = CreateObject("Microsoft.XMLDOM")oXML.async = FalseCall oXML.load(url)Set oNode = oXML.documentElement.selectSingleNode(nodePath)ret = oNode.TextGetXMLNodeValue = ret

End Function

Function GetMetarAviationWeather(address, variableName)Dim latLng, lat, lng, url, nodePathlatLng = Split(GetLatLngFromAddress(address), ",")lat = latLng(0)lng = latLng(1)url = "https://www.aviationweather.gov/adds/dataserver_current/httpparam?

dataSource=metars&requestType=retrieve&format=xml&radialDistance=20;" & lng & "," & lat & "&hoursBeforeNow=3"nodePath = "data/METAR/" & variableNameGetMetarAviationWeather = GetXMLNodeValue(url, nodePath)

End Function

Dim variableNamevariableName = "temp_c"$w.temp = GetMetarAviationWeather($w.address, variableName)variableName = "dewpoint_c"$w.dp = GetMetarAviationWeather($w.address, variableName)$w.rh = 100 - 5*($w.temp - $w.dp)

Page 5: 2015 Stump the InduSoft Web Studio Expert!

THANK YOU!