Jump to content
The simFlight Network Forums

Frédéric-O DUCHEMIN

Members
  • Content count

    84
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Frédéric-O DUCHEMIN

  • Rank
    Advanced Member
  • Birthday 01/04/1977

Contact Methods

  • Website URL
    http://www.skydream-airlines.com
  • Skype
    dj.fred.d

Profile Information

  • Gender
    Male
  • Location
    Nîmes, France
  • Interests
    ATPL Training course

Recent Profile Visitors

1,234 profile views
  1. Vb.NET Closest NAVAIDS SQlite

    I know, I have seen your sample code in vb.net easy to understand. But you have seen the project, and fsuipc is open and call too many time. I think the first person write the code need to catch datas in real-time before track data with start button. On the top real-time flight information is given before the flight is started means (fsuipc connection is open). Try to remove this part of code to use to good way but it's an other story !!! Disconnect FSUIPC even it's harcoded Private Sub CbOver70_CheckStateChanged(sender As Object, e As EventArgs) Handles cbOver70.CheckStateChanged If cbOver70.Checked = True And chkonground.Checked = True And cbTakeOff.Checked = False Then runaway = Getrunaway(lblDeparture.Text) Dim db As AirportsDatabase = FSUIPCConnection.AirportsDatabase Dim surfaceType As FsSurface = db.Airports("EHAM").Runways("22").Surface Surface = surfaceType.ToString() Dim flightypeSchedules As Boolean = Me.lblFlightNumber.Text Like "SDC?*" If Label19.Text = "Cargo:" Then Dim vt As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off with " & lblPAX.Text & " lbs Cargo on board" & vbCrLf My.Computer.FileSystem.WriteAllText(Logname, vt, True) Dim xml As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off with " & lblPAX.Text & " lbs Cargo on board" & "*" My.Computer.FileSystem.WriteAllText(Reportname, xml, True) Dim vt1 As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off from Runway " & runaway & vbCrLf My.Computer.FileSystem.WriteAllText(Logname, vt1, True) Dim xml1 As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off from Runway " & runaway & "*" My.Computer.FileSystem.WriteAllText(Reportname, xml1, True) cbTakeOff.Checked = True stopwatch.Start() startTime = DateTime.UtcNow() Else Dim vt As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off with " & lblPAX.Text & " passengers on board" & vbCrLf My.Computer.FileSystem.WriteAllText(Logname, vt, True) Dim xml As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off with " & lblPAX.Text & " passengers on board" & "*" My.Computer.FileSystem.WriteAllText(Reportname, xml, True) runaway = Getrunaway(lblDeparture.Text) Dim vt1 As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off from Runway " & runaway & Surface & vbCrLf My.Computer.FileSystem.WriteAllText(Logname, vt1, True) Dim xml1 As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off from Runway " & runaway & Surface & "*" My.Computer.FileSystem.WriteAllText(Reportname, xml1, True) cbTakeOff.Checked = True stopwatch.Start() startTime = DateTime.UtcNow() 'stopwatch.Reset() 'stopwatch.Start() End If End If End Sub Fred
  2. Vb.NET Closest NAVAIDS SQlite

    Maybe this part of code is on wrong place in my app FSUIPCConnection.Open() FSUIPCConnection.AirportsDatabase.Load() Fred
  3. Vb.NET Closest NAVAIDS SQlite

    Hi Paul, 1) No error just Disconnect Fsuipc when I takeoff 2) EHAM 3) Runway by wind Output: [18:03] Taxiing to Runway [18:03] Taking Off with 119 passengers on board [18:03] Taking Off from Runway 36C Public Function GetActiveRunway(ByVal ICAOcode As String, ByVal WindDirection As Double) As String Dim runwayReturn As String = "" ' Now get the runways at the airport ' For each one we test how far they are from the wind direction ' We keep the closest one. Dim pathto As String = My.Application.Info.DirectoryPath Using MyReader As New FileIO.TextFieldParser(pathto & "\runways.csv") MyReader.TextFieldType = FileIO.FieldType.Delimited MyReader.SetDelimiters(",") Dim runwayst As String Dim runwaynum As String Dim runwaydes1 As String Dim runwaydes2 As String = "" Dim currentRow As String() Dim smallestDifference As Double = 360 While Not MyReader.EndOfData Try currentRow = MyReader.ReadFields() If currentRow(0) = ICAOcode Then runwayst = currentRow(1) runwaynum = runwayst.Substring(1, 2) runwaydes1 = runwayst.Substring(3, 1) If runwaydes1 = "0" Then runwaydes2 = "" If runwaydes1 = "1" Then runwaydes2 = "L" If runwaydes1 = "2" Then runwaydes2 = "R" If runwaydes1 = "3" Then runwaydes2 = "C" If runwaydes1 = "4" Then runwaydes2 = "W" Dim rwyMagHeading As Double = CDbl(currentRow(5)) Dim rwyMagVariation As Double = 0 ' I think winds are magnetic. If not we must use true heading instead (second line) Dim rwyHeading As Double = rwyMagHeading ' Dim rwyHeading As Double = rwyMagHeading + rwyMagVariation ' Calculate the difference between the wind heading and the runway heading ' You might need to expand this to ignore short runways Dim difference As Double = 180D - Math.Abs(Math.Abs(WindDirection - rwyHeading) - 180D) If difference < smallestDifference Then smallestDifference = difference runwayReturn = runwaynum & runwaydes2 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 runwayReturn End Function Public Function Getrunaway(ByVal icaocode As String) As String Dim lon As FsLongitude = New FsLongitude(playerLongitude.Value) Dim lat As FsLatitude = New FsLatitude(playerLatitude.Value) ' Get the point for the current plane position Dim currentPosition As FsLatLonPoint = New FsLatLonPoint(lat, lon) Dim pathto As String = My.Application.Info.DirectoryPath Using MyReader As New FileIO.TextFieldParser(pathto & "\runways.csv") MyReader.TextFieldType = FileIO.FieldType.Delimited MyReader.SetDelimiters(",") Dim runawayst As String Dim runawaynum As String Dim runawaydes1 As String Dim runawaydes2 As String = "" Dim runawayreturn As String Dim currentRow As String() While Not MyReader.EndOfData Try currentRow = MyReader.ReadFields() If currentRow(0) = icaocode Then runawayst = currentRow(1) runawaynum = runawayst.Substring(1, 2) runawaydes1 = runawayst.Substring(3, 1) If runawaydes1 = "0" Then runawaydes2 = "" If runawaydes1 = "1" Then runawaydes2 = "L" If runawaydes1 = "2" Then runawaydes2 = "R" If runawaydes1 = "3" Then runawaydes2 = "C" If runawaydes1 = "4" Then runawaydes2 = "W" Dim aaa As String = currentRow(2) Dim bbb As String = currentRow(3) Dim aaaa As Double Dim bbbb As Double aaaa = System.Convert.ToDouble(aaa) bbbb = System.Convert.ToDouble(bbb) Dim rwyThresholdLat As FsLatitude = New FsLatitude(aaaa) Dim rwyThresholdLon As FsLongitude = New FsLongitude(bbbb) Dim rwyMagHeading As Double = CDbl(currentRow(5)) Dim rwyMagVariation As Double = 0 Dim rwyLength As Double = CDbl(currentRow(6)) / 2 Dim rwyWidth As Double = 254D Dim thresholdCentre As FsLatLonPoint = New FsLatLonPoint(rwyThresholdLat, rwyThresholdLon) Dim trueHeading As Double = rwyMagHeading + rwyMagVariation runwayQuad = FsLatLonQuadrilateral.ForRunway(thresholdCentre, trueHeading, rwyWidth, rwyLength) If runwayQuad.ContainsPoint(currentPosition) = True Then runawayreturn = runawaynum & runawaydes2 Return runawayreturn 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 know Paul
  4. Vb.NET Closest NAVAIDS SQlite

    Hi Paul, I have a problem with your code : Dim db As AirportsDatabase = FSUIPCConnection.AirportsDatabase Dim surfaceType As FsSurface = db.Airports(lblArrival.Text).Runways(Getrunaway(lblDeparture.Text)).Surface Surface = surfaceType.ToString() in your example here: Dim db As AirportsDatabase = FSUIPCConnection.AirportsDatabase Dim surfaceType As FsSurface = db.Airports("EGJJ").Runways("09").Surface Me.txtSurface.Text = surfaceType.ToString() complete code : Private Sub CbOver70_CheckStateChanged(sender As Object, e As EventArgs) Handles cbOver70.CheckStateChanged If cbOver70.Checked = True And chkonground.Checked = True And cbTakeOff.Checked = False Then Dim db As AirportsDatabase = FSUIPCConnection.AirportsDatabase Dim surfaceType As FsSurface = db.Airports(lblArrival.Text).Runways(Getrunaway(lblDeparture.Text)).Surface Surface = surfaceType.ToString() Dim flightypeSchedules As Boolean = Me.lblFlightNumber.Text Like "SDC?*" If Label19.Text = "Cargo:" Then Dim vt As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off with " & lblPAX.Text & " lbs Cargo on board" & vbCrLf My.Computer.FileSystem.WriteAllText(Logname, vt, True) Dim xml As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off with " & lblPAX.Text & " lbs Cargo on board" & "*" My.Computer.FileSystem.WriteAllText(Reportname, xml, True) runaway = Getrunaway(lblDeparture.Text) Dim vt1 As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off from Runway " & runaway & Surface & vbCrLf My.Computer.FileSystem.WriteAllText(Logname, vt1, True) Dim xml1 As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off from Runway " & runaway & Surface & "*" My.Computer.FileSystem.WriteAllText(Reportname, xml1, True) cbTakeOff.Checked = True stopwatch.Start() startTime = DateTime.UtcNow() Else Dim vt As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off with " & lblPAX.Text & " passengers on board" & vbCrLf My.Computer.FileSystem.WriteAllText(Logname, vt, True) Dim xml As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off with " & lblPAX.Text & " passengers on board" & "*" My.Computer.FileSystem.WriteAllText(Reportname, xml, True) runaway = Getrunaway(lblDeparture.Text) Dim vt1 As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off from Runway " & runaway & Surface & vbCrLf My.Computer.FileSystem.WriteAllText(Logname, vt1, True) Dim xml1 As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Taking Off from Runway " & runaway & Surface & "*" My.Computer.FileSystem.WriteAllText(Reportname, xml1, True) cbTakeOff.Checked = True stopwatch.Start() startTime = DateTime.UtcNow() 'stopwatch.Reset() 'stopwatch.Start() End If End If End Sub and I don't know how adding this: http://forum.simflight.com/topic/84752-vbnet-closest-navaids-sqlite/?do=findComment&comment=512376 Some helps please regards Fred
  5. Vb.NET Closest NAVAIDS SQlite

    Thanks Paul maybe to hard for me. Even if I have some ideas by simconnect but I don't know how works simconnect Regards Fred
  6. Vb.NET Closest NAVAIDS SQlite

    Hello Paul, Big problem most of my add-ons I have doesn't use GPS to follow a flight plan or a flightpath.ex: PMDG DASH-8 Majestic GTN . For PMDG I have seen offsets to give NAVAID ID and distance somewhere Majestic Software use NAV 1&2 GTN 750& 650 no idea So have you an idea to know the nearest Navaid with an other method. Or have you a sample somewhere to share ? Thanks Fred
  7. Vb.NET Closest NAVAIDS SQlite

    Thanks Paul for your time & your help Regards Fred
  8. Vb.NET Closest NAVAIDS SQlite

    Type of runway Status Wet Dry Icing Fred
  9. Vb.NET Closest NAVAIDS SQlite

    Only on the server. No way to have a better or simple method to do this even I need a pln ? if yes how to adapt your code ? Forget one thing sorry for that need to catch also the status of the runways in realtime. Thanks again Fred
  10. Vb.NET Closest NAVAIDS SQlite

    Thanks Paul, So the flight plan is not loaded in Simulator the NAVAIDS pilot put into the route are send to the website. You mean when the route field is not empty || NULL ? Regards Fred
  11. Vb.NET Closest NAVAIDS SQlite

    The Tracker pass the route into php and plot the result to a map. I mean in Route form point are read and looking to the db to plot route Lat/Lon frequency type (FIX, VOR, VOR-DME) Region [{"id":"5","pilotid":"SDA0001","flightnum":"SDA8127","pilotname":"Frederic Duchemin","aircraft":"B-77D6","lat":"45.724445851774","lng":"5.0830752739348","heading":"180","alt":"0","gs":"0","depicao":"LFLL","depapt":"Lyon-Saint-Exup\u00e9ry","arricao":"CYYZ","arrapt":"Toronto Pearson Int\\'L. Ont.","deptime":"00:00:00","timeremaining":"00:00","arrtime":"14:26:06","route":"BUSIL UT133 AMORO UT140 PIBAT UM976 OKRIX UH10 AMODO UM729 RESMI UN491 LGL UN502 JSY UN160 NAKID UN83 LEDGO DOGAL . NATD55 . PORTI N112C ALLEX Q822 CAM Q84 PAYGE V490 UCA V2 BUF","route_details":{"BUSIL":{"id":"195475","name":"BUSIL","title":"BUSIL","airway":null,"airway_type":null,"seq":"0","loc":"EUR","lat":"46.293610","lng":"4.721944","freq":"","type":"5"},"AMORO":{"id":"322179","name":"AMORO","title":"AMORO","airway":"UT140","airway_type":"H","seq":"1","loc":"EUR","lat":"46.500000","lng":"4.538056","freq":"","type":"5"},"PIBAT":{"id":"316922","name":"PIBAT","title":"PIBAT","airway":"UM976","airway_type":"H","seq":"9","loc":"EUR","lat":"46.805832","lng":"4.259167","freq":"","type":"5"},"CACHI":{"id":"316923","name":"CACHI","title":"CACHI","airway":"UM976","airway_type":"H","seq":"10","loc":"EUR","lat":"47.066666","lng":"4.106667","freq":"","type":"5"},"AVLON":{"id":"316924","name":"AVLON","title":"AVLON","airway":"UM976","airway_type":"H","seq":"11","loc":"EUR","lat":"47.560001","lng":"3.813333","freq":"","type":"5"},"OKRIX":{"id":"309424","name":"OKRIX","title":"OKRIX","airway":"UH10","airway_type":"H","seq":"14","loc":"EUR","lat":"47.966110","lng":"3.567500","freq":"","type":"5"},"AMODO":{"id":"316015","name":"AMODO","title":"AMODO","airway":"UM729","airway_type":"H","seq":"2","loc":"EUR","lat":"48.419445","lng":"2.980278","freq":"","type":"5"},"RESMI":{"id":"317861","name":"RESMI","title":"RESMI","airway":"UN491","airway_type":"H","seq":"15","loc":"EUR","lat":"48.568611","lng":"2.191944","freq":"","type":"5"},"LGL":{"id":"317883","name":"LGL","title":"LAIGLE","airway":"UN502","airway_type":"H","seq":"8","loc":"EUR","lat":"48.790611","lng":"0.530278","freq":"115.00","type":"5"},"JSY":{"id":"317433","name":"JSY","title":"JERSEY","airway":"UN160","airway_type":"H","seq":"7","loc":"EUR","lat":"49.221104","lng":"-2.046153","freq":"112.20","type":"5"},"NAKID":{"id":"318531","name":"NAKID","title":"NAKID","airway":"UN83","airway_type":"H","seq":"2","loc":"EUR","lat":"49.715000","lng":"-4.623056","freq":"","type":"5"},"LEDGO":{"id":"318530","name":"LEDGO","title":"LEDGO","airway":"UN83","airway_type":"H","seq":"1","loc":"EUR","lat":"51.240002","lng":"-7.568056","freq":"","type":"5"},"DOGAL":{"id":"225471","name":"DOGAL","title":"DOGAL","airway":null,"airway_type":null,"seq":"0","loc":"NAT","lat":"54.000000","lng":"-15.000000","freq":"","type":"5"},"PORTI":{"id":"196243","name":"PORTI","title":"PORTI","airway":null,"airway_type":null,"seq":"0","loc":"NAT","lat":"46.500000","lng":"-52.000000","freq":"","type":"5"},"ALLEX":{"id":"186769","name":"ALLEX","title":"ALLEX","airway":null,"airway_type":null,"seq":"0","loc":"NAM","lat":"44.416668","lng":"-67.000000","freq":"","type":"5"},"CAM":{"id":"297907","name":"CAM","title":"CAMBRIDGE","airway":"Q84","airway_type":"H","seq":"5","loc":"NAM","lat":"42.994289","lng":"-73.344017","freq":"115.00","type":"5"},"PAYGE":{"id":"340995","name":"PAYGE","title":"PAYGE","airway":"V490","airway_type":"L","seq":"3","loc":"NAM","lat":"43.014023","lng":"-74.253548","freq":"","type":"5"},"UCA":{"id":"333083","name":"UCA","title":"UTICA","airway":"V2","airway_type":"L","seq":"128","loc":"NAM","lat":"43.026512","lng":"-75.164520","freq":"111.20","type":"5"},"BUF":{"id":"333071","name":"BUF","title":"BUFFALO","airway":"V2","airway_type":"L","seq":"116","loc":"NAM","lat":"42.928997","lng":"-78.646339","freq":"116.40","type":"5"}},"distremain":"3441","phasedetail":"Boarding","online":"","lastupdate":"2018-01-08 14:26:06","client":"SDAcars","network":"0","aircraftname":"B77L","registration":"B-77D6","code":"SDA","firstname":"Frederic","lastname":"Duchemin","depname":"Lyon-Saint-Exup\u00e9ry","deplat":"45.7204","deplng":"5.07951","arrname":"Toronto Pearson Int'L. Ont.","arrlat":"43.6772","arrlng":"-79.6306","distremaining":"3441"}]
  12. Vb.NET Closest NAVAIDS SQlite

    Correct
  13. Vb.NET Closest NAVAIDS SQlite

    All information needed include lat/lon ticker set to ?
  14. Vb.NET Closest NAVAIDS SQlite

    Yes my software have a flight plan. I'm talking about the function you give me. Fred
  15. Vb.NET Closest NAVAIDS SQlite

    Thanks but without db is Lat/Lon can't help me. Maybe use name and distance. Like: NIC (12NM) --> STP (15NM) --> MTG (23NM) Holding the first nearest in the array lock to a value take the second lock to a value etc.. (tree) And put all to the form. Ok need a timer to loop but at what frequency I do that ? please. Thanks Paul Fred
×