Jump to content
The simFlight Network Forums

Frédéric-O DUCHEMIN

Members
  • Posts

    113
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Frédéric-O DUCHEMIN

  1. No sorry it's me Nope I have read in your post to replace the function to read runway...Also I keep my function to read which runway aircraft here and ADD your function to replace AI Try depart = getActiveRunway(lblDeparture.Text) Me.lstDeparture.Items.Clear() Me.lstDeparture.Items.Add(depart.ToString()) arrival = getActiveRunway(lblArrival.Text) Me.lstArrival.Items.Clear() Me.lstArrival.Items.Add(arrival.ToString()) Catch ex As Exception End Try Well I need to put everywhere try because the FrmMain at load doesn't connect to FSUIPC :mad: . Thanks Paul
  2. I already thanks for all Paul It's not my purpose just maybe misunderstood by myself. I have understood to replace this code by mine. So your function doesn't match if I have understood right with the original function given only where the aircraft taking-off or landing don't depend to the windir, because this function is call earlier. So If I have missed something just tell me. (it's not easy to understand I'm french I don't use google translate...sorry for that) ;) Regards Fred
  3. Thanks Paul, I have two functions one for read where the aircraft takiing off and landing readind runway.csv to find runway where the plane is and return the result to the log text 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 Microsoft.VisualBasic.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 Microsoft.VisualBasic.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 and this other to find the good runway for departure and arrival return the result in listbox. This is function where I would like to change by wind direction Public Sub Activerunways() ' Get a reference to the AITrafficServices class (saves typing) Try Dim AI As AITrafficServices = FSUIPCConnection.AITrafficServices ' Refresh the traffic information AI.ApplyFilter(False, True, 0, 360, Nothing, 10000D, 30D) AI.RefreshAITrafficInformation() ' Get the arrival runways in use Dim runways As List(Of FSRunway) = AI.GetArrivalRunwaysInUse(lblArrival.Text) ' Display in the listbox Me.lstArrival.Items.Clear() For Each rw As FSRunway In runways Me.lstArrival.Items.Add(rw.ToString()) Next rw ' same for departure runways runways = AI.GetDepartureRunwaysInUse(lblDeparture.Text) Me.lstDeparture.Items.Clear() For Each rw As FSRunway In runways Me.lstDeparture.Items.Add(rw.ToString()) Next rw Catch ex As Exception End Try End Sub Private Sub BtnGetFlight_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnGetFlight.Click RegisterKey(Options.Alt, Keys.F) UiFunctions.Connect() downloadmetar(lblDeparture.Text, lblWXDep.Text) downloadmetar(lblArrival.Text, lblWXArr.Text) Activerunways() 'Try ' ui = FSUIPCConnection.UserInputServices ' AddMenuItems() 'Catch ex As Exception 'End Try End Sub Fred
  4. Thanks Paul, Why I would like use Wind direction ? I don't use VASIM or IVAO network to fly I don't use AI traffic loosing many FPS (I fly alone or real netwok like a multiplayer session) So I have already the function to my app to read runway.csv to each runway at the airport. Can you explain more please ? (a piece of code maybe) Regards Fred
  5. Hello, Using active runway by AI traffic is fine, but howto find runway by wind direction ? We can read runway.csv made by Makerunways and after ? Someone know howto this ? Thanks Regards Fred
  6. Thanks Paul,if for this reason I tell you this issue happen only with the bus by Aerosoft. PMDG works fine. I don't undestand why?! Check your PM BOX Seem to work auto spoiler and beacon lights via LUA Aircraft Used in flight is Airbus A320 easyJet G-EZTB Aircraft model is A320CFM Flight Number= SDA7794 Departure= LFPG Destination= LFBO [04:19] ZFW: 115030 lbs [04:19] TOW: 134005 [04:19] METAR for departing airport: 2015/06/04 04:00 LFPG 040400Z 02006KT 010V090 CAVOK 09/07 Q1026 NOSIG [04:19] Boarding [04:19] Parking Brakes Engaged [04:20] Transponder set to 2563 [04:20] Paused [04:21] Unpaused [04:23] NAV1 set to 110.35 [04:25] NAV1 set to 109.10 [04:28] Beacon lights ON [04:28] Engine 2 ON [04:29] Engine 1 ON [04:30] Auto spoilers armed [04:31] Flaps at Position 2 [04:31] Taxi lights ON [04:31] Parking Brakes Released [04:32] Taxiing to Runway [04:32] Landing lights ON [04:32] Strobe lights ON [04:33] Taking Off [04:33] Taking Off from Runway 26R [04:33] You Take off @ 161 Knots and Flaps at Position 2 [04:33] Pitch angle 9 degrees and 18666lbs FOB [04:33] Wind 14 @ 6 kt, Temperature 9 deg. C [04:33] Landing Gear Up @ 168 Knots and 480 Feet [04:33] Taxi lights OFF [04:33] Auto spoilers disarmed [04:34] Climbing [04:34] Flaps Retracted @ 195 Knots [04:37] Landing lights OFF @ 10830 ft [04:47] TOC reached. Cruise 31000 ft Regards Fred
  7. Hi Paul, Public autospoiler As Offset(Of BitArray) = New FSUIPC.Offset(Of BitArray)(&HBCC, 4) Public Function getspoilersarmed() Return autospoiler.Value(0) End Function Private Sub cbSpoilersarmed_CheckStateChanged(sender As Object, e As EventArgs) Handles cbSpoilersarmed.CheckStateChanged 'If cbSpoilersarmed.Checked = True Then If cbSpoilersarmed.Checked = True Then Dim vt As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto spoilers armed" & vbCrLf My.Computer.FileSystem.WriteAllText(logname, vt, True) Dim xml As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto spoilers armed " & "*" My.Computer.FileSystem.WriteAllText(reportname, xml, True) 'ElseIf cbSpoilersarmed.Checked = False Then ElseIf cbSpoilersarmed.Checked = False Then Dim vt As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto spoilers disarmed" & vbCrLf My.Computer.FileSystem.WriteAllText(logname, vt, True) Dim xml As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto spoilers disarmed " & "*" My.Computer.FileSystem.WriteAllText(reportname, xml, True) End If End Sub Working nice with keyboard but the same problem like beacon lights (before) with checklist no workRegards Fred
  8. Ok I think there is a misunderstood I don't want to send an event just check spoilers status like beacon lights it's again for Aerosoft Bus (PM) Regards Fred
  9. Paul Finding Active Runways works fine now (just add filter and make a timer) FSUIPCConnection.AITrafficServices.ApplyFilter(False, True, 0, 360, Nothing, 10000D, 30D) So I woul like to add 4 submenu like getflight startlog stoplog pause I have seen the part of code but for C# (with the class UserInputServices) So can you help me please ? And I can't give Spoilers Arm status I think LUA is needed ipc.control(66066) ipc.control(66067) And to finish you now a way where I can give LUA script to pilots ? Fred
  10. Paul, your Lua script works fine -- set the pollrate to 250ms = 4 times per second pollrate = 250 -- create a function to write the LVAR value to an offset function writeBeacon(varname, value) if value == 1 then ipc.setbitsUW(0x0D0C, 2) -- set bit 2 else ipc.clearbitsUW(0x0D0C, 2) -- clear bit 2 end end -- create an event listener to monitor the LVAR -- this will call the function above when the LVAR changes event.Lvar("L:LIGHT_BEACON", pollrate, "writeBeacon") But this no work for me Private Sub getActiveRunways() ' Get a reference to the AITrafficServices class (saves typing) Dim AI As AITrafficServices = FSUIPCConnection.AITrafficServices ' Refresh the traffic information AI.RefreshAITrafficInformation() ' Get the arrival runways in use Dim runways As List(Of FSRunway) = AI.GetArrivalRunwaysInUse("EGLL") ' Display in the listbox Me.lstArrival.Items.Clear() For Each rw As FSRunway In runways Me.lstArrival.Items.Add(rw.ToString()) Next rw ' same for departure runways runways = AI.GetDepartureRunwaysInUse("EGLL") Me.lstDeparture.Items.Clear() For Each rw As FSRunway In runways Me.lstDeparture.Items.Add(rw.ToString()) Next rw End Sub
  11. Paul I would like to say you thank you for your reply ;) -- set the pollrate to 250ms = 4 times per second pollrate = 250 -- create a function to write the LVAR value to an offset function writeBeacon(varname, value) if value == 1 then ipc.setbitsUW(0x0D0C, 2) -- set bit 2 else ipc.clearbitsUW(0x0D0C, 2) -- clear bit 2 end end -- create an event listener to monitor the LVAR -- this will call the function above when the LVAR changes event.Lvar("L:LIGHT_BEACON", pollrate, "writeBeacon") This code it's written for VB.Net ? (I'm a nobe) Yes Dim AI As AITrafficServices = FSUIPCConnection.AITrafficServices ' Refresh the traffic information AI.RefreshAITrafficInformation() ' Get the arrival runways in use Dim runways As List(Of FSRunway) = AI.GetArrivalRunwaysInUse("EGLL") I would like paste variable to your string "EGGL" when I get a flight and check if the plane is in the good ICAO. So less my source code You can't view nothing sorry for that Très bon Français Paul ;) So I'm a register FSUIPC and WideFS user so I'm using your DLL I would like to make donation where I can do that ? Fred
  12. Ok thanks Paul, I think those issues made by Aerosoft, so for L:VARS how I can use that ? For the SDK by Aerosoft I don't think exist maybe by Joshua? Once I have catch the L:VAR how I can make that in my VB.net code ? Source:http://forum.avsim.net/topic/451948-aerosoft-airbus-module-43-v2/ function Lights_BEACON_on () LVarSet = "L:LIGHT_BEACON" ipc.writeLvar(LVarSet, 1) LightSwitch () DspShow ("BCN", "on") end function Lights_BEACON_off () LVarSet = "L:LIGHT_BEACON" ipc.writeLvar(LVarSet, 0) LightSwitch () DspShow ("BCN", "off") end An other question about you latest lines docs for know active runways can you help me please ? (sorry I don't have the source code with me here) Sorry for my poor English I try todo the best ;) Fred
  13. * Strange issues with this airplane for beacon lights offset is not working by light type method * For auto spoilers detection works but strange if armed by myself is good but when the checklist run the auto spoilers are not checked in my Acars system example : view log here http://www.skydream-airlines.com/index.php/pireps/view/1594 other with Airbus http://www.skydream-airlines.com/index.php/pireps/viewreport/1587 For now I can't paste my code here (I'm not at home) Fred
×
×
  • 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.