Jump to content
The simFlight Network Forums

l0calhost

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by l0calhost

  1. Hello Paul thank you for your reply. I change this to get it working Dim lat As Double = Double.Parse(currentRow(2)) Dim lon As Double = Double.Parse(currentRow(3)) to this Dim lat As Double = Double.Parse(currentRow(2), CultureInfo.InvariantCulture) Dim lon As Double = Double.Parse(currentRow(3), CultureInfo.InvariantCulture) and now its working perfect, just what i need. Thank you for your time and help i appreciate. Helder
  2. Hello Paul, i'm trying this code but in vb.net and only show icao from p3d v4. From fs9/fsx sp2/p3d v3.4 is not showing. Is there another workaround to show on all simulators? Didnt find anything. Can you help me with a function to get nearest airport(s) in X miles range with makerunways files like airports.fsm? Thank you
  3. I think that's it, made the same tests as before and now seems to be working, changed between some gates and all show the correct gate. I apreciate your help, thank you very much and have a nice year. Helder Duarte
  4. I think is better to report always in the correct gate when i park instead the closest one. The g5.csv have the gate radius in meters. Something like, if airplane is inside gate "radius" show gate. Thank you Paul
  5. Hello Paul, this is my current code Public Function getgate(ByVal icaocode As String) As String Using MyReader As New FileIO.TextFieldParser(Form1.fullFSpath.Value & "g5.csv") MyReader.TextFieldType = FileIO.FieldType.Delimited MyReader.SetDelimiters(",") Dim gatename As String Dim gatenumber As String Dim gatereturn As String Dim currentRow As String() Dim smallestDifference As Double = 0 While Not MyReader.EndOfData Try currentRow = MyReader.ReadFields() If currentRow(0) = icaocode Then gatename = currentRow(1) gatenumber = currentRow(2) Dim aaa As String = currentRow(3) Dim bbb As String = currentRow(4) Dim aaaa As Double = Double.Parse(aaa, CultureInfo.InvariantCulture) Dim bbbb As Double = Double.Parse(bbb, CultureInfo.InvariantCulture) Dim distance As Double = Form1.distance(Functions.getAircraftLatFS(), Functions.getAircraftLonFS(), aaaa, bbbb, "M") If distance = smallestDifference Then smallestDifference = distance gatereturn = "" + gatename + " " + gatenumber + "" Return gatereturn MyReader.Close() MyReader.Dispose() Exit Function End If End If Catch ex As FileIO.MalformedLineException 'MsgBox("Line " & ex.Message & "is not valid and will be skipped.") End Try End While MyReader.Close() MyReader.Dispose() End Using Return "" End Function I am in LPPT on gate 104, if the distance result is 0 it show gate 104. if i change distance = to distance <= no result show if i change smallDiference to 20 and keep <= it will show gate 105 but i'm on 104. (105 is near but is on my left side) the distance function i have is 'M' is statute miles (default) 'K' is kilometers 'N' is nautical miles Public Function distance(ByVal lat1 As Double, ByVal lon1 As Double, ByVal lat2 As Double, ByVal lon2 As Double, Optional ByVal unit As Char = "M"c) As Double Dim theta As Double = lon1 - lon2 Dim dist As Double = Math.Sin(deg2rad(lat1)) * Math.Sin(deg2rad(lat2)) + Math.Cos(deg2rad(lat1)) * Math.Cos(deg2rad(lat2)) * Math.Cos(deg2rad(theta)) dist = Math.Acos(dist) dist = rad2deg(dist) dist = dist * 60 * 1.1515 If unit = "K" Then dist = dist * 1.609344 ElseIf unit = "N" Then dist = dist * 0.8684 End If Return dist End Function Thank you for your help
  6. Hello thank you for your reply. Yes i have the plane lat/lon and all gates lat/lon from g5.csv where gate = icao. I'm stuck from here. I try using the distance function and sometimes don't show the result, or the correct result and sometimes show the correct result. Dim distance As Double = distance(acLat, acLon, gateLat, gateLon, "M") If distance = smallestDifference Then smallestDifference = distance ..... I'm not a pro coder, i think is not the correct code to calculate the current gate! Thank you
  7. Hello Paul Henty, i'm using your FSUIPCClient DLL V3 and is working good. I have added the Makerwys with a function getrunway copied from here and is working too. Now i need to find how to detect the gate where the plane is, tried like function getrunway but no success. Can you help me and post a function or some code to detect gate? I apreciate. Sorry my english Thank you
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.