-
Posts
113 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Frédéric-O DUCHEMIN
-
VB.net Detect gate g5.csv
Frédéric-O DUCHEMIN replied to l0calhost's topic in FSUIPC Client DLL for .NET
Ok Paul I have 2 errors with those changes. But the problem why the reader stop to read in first line ? And why if my Sim not running give me a Gate ? Just I woul like understand. Thanks Fred FsuipcData.vb -
VB.net Detect gate g5.csv
Frédéric-O DUCHEMIN replied to l0calhost's topic in FSUIPC Client DLL for .NET
the code Public Function getgate(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) ' Returns the current gate or "" is not parked at any gate. Dim pathto As String = My.Application.Info.DirectoryPath Using MyReader As New FileIO.TextFieldParser(pathto & "\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() 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 rwyThresholdLat As FsLatitude = New FsLatitude(aaaa) 'Dim rwyThresholdLon As FsLongitude = New FsLongitude(bbbb) Dim gateRadius As String = currentRow(5) Dim gateRadiusKm As Double = Double.Parse(gateRadius, CultureInfo.InvariantCulture) / 1000D 'Dim thresholdCentre As FsLatLonPoint = New FsLatLonPoint(rwyThresholdLat, rwyThresholdLon) 'Dim trueHeading As Double = rwyMagHeading + rwyMagVariation 'runwayQuad = FsLatLonQuadrilateral.ForRunway(thresholdCentre, trueHeading, rwyWidth, rwyLength) Dim LatitudeAircraft As Offset(Of Long) = New FSUIPC.Offset(Of Long)(&H560) 'Latitude Dim LongitudeAircraft As Offset(Of Long) = New FSUIPC.Offset(Of Long)(&H568) 'Longitude ' *** Distance now returned in Km *** Dim distance As Double = FsuipcData.distance(LatitudeAircraft.Value, LongitudeAircraft.Value, aaaa, bbbb, "K") If distance <= gateRadiusKm Then 'gatereturn = gatename + " " + gatenumber gatereturn = gatename + gatenumber MyReader.Close() MyReader.Dispose() Return gatereturn 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() Return "" ' Not near any gate End Using End Function 'convert decimal degreees to radians Function deg2rad(ByVal Deg) deg2rad = CDbl(Deg * pi / 180) End Function 'convert radians to decimal degrees Function rad2deg(ByVal Rad) rad2deg = CDbl(Rad * 180 / pi) End Function Public Function distance(ByVal lat As Double, ByVal lon As Double, ByVal lat2 As Double, ByVal lon2 As Double, Optional ByVal unit As Char = "M"c) As Double Dim LatitudeAircraft As Offset(Of Long) = New FSUIPC.Offset(Of Long)(&H560) 'Latitude Dim LongitudeAircraft As Offset(Of Long) = New FSUIPC.Offset(Of Long)(&H568) 'Longitude Lat1 = LatitudeAircraft.Value Lon1 = LongitudeAircraft.Value Lat1 = Lat1 * 90 / (10001750D * 65536D * 65536D) Lon1 = Lon1 * 360 / (65536D * 65536D * 65536D * 65536D) 'd = distance(Lat1, Lon1, lat2, lon2, "N") 'distance between 2 Pos 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 distance End Function call departure_gate = FsuipcData.getgate(lblDeparture.Text) Me.lstGateDeparture.Items.Clear() Me.lstGateDeparture.Items.Add(departure_gate.ToString()) The problem it's give me the first entry to airport from g5.csv LFML,Park,83,43.446349,5.216847,20.0,277.0,5,WLX,FPO,TAY LFML,Park,82,43.445926,5.217253,15.0,274.5,5,WLX,FPO,TAY LFML,Park,7,43.434318,5.205118,5.0,315.4,13 LFML,Park,11,43.434292,5.225378,14.0,329.8,3,CIV LFML,Park,12,43.434142,5.225051,10.0,328.5,2,CIV LFML,A,1,43.439212,5.224703,18.0,264.9,4,AFR,RAE LFML,A,2,43.438822,5.224675,18.0,266.2,4,AFR LFML,A,5,43.439184,5.222840,18.0,26.9,4,AFR,CCM,RAL,RAE,BZH LFML,C,8,43.440494,5.220750,36.0,49.6,4,MDG,CRL,REU,XLF,XLA,IYE,RAM,DAH,SVA,ELY,SYR,TSC LFML,A,9,43.441017,5.220390,23.0,24.8,4 LFML,C,9,43.441089,5.219935,18.0,55.3,4,AAF,REU,RAM,DAH,TUN,ELY,OHY,KLM,SWR,DLH,BAW,AMC,BIE,BMM,CSA,DBK,LGL,SYR,TAP,XLA,XLF,TAR,MSA,MDP,RNV,DBK,TCV LFML,Park,19,43.439581,5.223592,5.0,331.7,13 LFML,Park,81,43.445413,5.217760,35.0,55.8,5,FXI,ICE,TNT LFML,C,10,43.441624,5.219152,18.0,64.6,4,AAF,REU,RAM,DAH,TUN,ELY,OHY,DLH,BAW,AMC,BIE,BMM,CSA,DBK,LGL,SYR,TA,XLA,XLFP,TAR,MSA,MDP,RNV,DBK,TCV LFML,C,2,43.438494,5.224803,18.0,308.0,4,AFR LFML,A,20,43.438083,5.224739,14.0,332.7,2,TJT,CCM,RAE,RLA,AFRX,TLB,HOP LFML,C,20,43.437962,5.224119,14.0,3.8,2,TJT,CCM,RAE,RLA,AFRX,TLB,HOP LFML,A,3,43.438032,5.223518,23.0,3.6,4,AFR LFML,C,3,43.438147,5.223014,18.0,73.4,4,AFR LFML,B,4,43.438602,5.222990,18.0,73.2,4,AFR,CCM,RAL,RAE,BZH LFML,A,6,43.439695,5.222241,18.0,28.7,4 LFML,C,6,43.439698,5.221780,18.0,62.1,4,SAB,SNB,KLM,AFR,CCM,DLH,BAW,SAS,IBE,TAP,EIN,AEE,AMC,CSA,KLC,LGL,TAP,XLA,XLF,MSA,MDP,RNV LFML,A,7,43.440092,5.221551,18.0,31.6,4,DLH,BAW,SAS,IBE,TAP,EIN,SAB,SNB,KLM,SWR,AEE,AMC,BIE,BMM,CSA,DBK,KLC,LGL,SYR,TAP,XLA,XLF,TAR,MSA,MDP,RNV,DBK,TCV LFML,A,10,43.441522,5.219599,18.0,30.8,4,AAF,REU,RAM,DAH,TUN,ELY,OHY,DLH,BAW,AMC,BIE,BMM,CSA,DBK,LGL,SYR,TAP,XLA,XLF,TAR,MSA,MDP,RNV,DBK,TCV LFML,E,46,43.440977,5.216507,23.0,313.4,3 LFML,C,46,43.441264,5.216926,23.0,314.5,3 LFML,Park,40,43.440156,5.218395,36.0,314.6,4,MDG,ELY,REU,XLF,TSC LFML,C,34,43.438978,5.219587,17.0,135.3,2,TJT,CCM,RAE,RLA,BZH,PWF,ANS,IBEX,DNM,AFRX,PGA,DLHX,CLH,MDM,ANS,TLB,HOP,TUX,DNM,FCT LFML,E,34,43.439334,5.219940,18.0,136.0,2,CCM,TJT,RAE,RLA,BZH,PWF,ANS,IBEX,DNM,AFRX,PGA,DLHX,CLH,MDM,ANS,TLB,TUX,DNM,HOP,FCT LFML,D,30,43.438905,5.220578,17.0,315.2,2,TJT,CCM,RAE,RLA,BZH,PWF,ANS,IBEX,DNM,AFRX,PGA,DLHX,CLH,MDM,ANS,TLB,TUX,DNM,HOP,FCT LFML,B,30,43.438589,5.220160,17.0,313.8,2,CCM,TJT,RAE,RLA,BZH,PWF,ANS,IBEX,DNM,AFRX,PGA,DLHX,CLH,MDM,ANS,TLB,TUX,DNM,HOP,FCT LFML,PkN,61,43.443193,5.211945,35.0,300.0,5,DHL,EAT,BCS LFML,PkN,68,43.444329,5.214451,25.0,33.8,5 LFML,A,48,43.443161,5.217429,18.0,268.4,3,PGT,RYR,EZY,EZS,GWI,JFU,NAX,TUI LFML,C,48,43.442578,5.216753,18.0,244.0,3,RYR,EZY,EZS,JFU,GWI,PGT,NAX,TUI,JAF LFML,E,48,43.442099,5.216753,18.0,153.6,3,RYR,EZY,EZS,BMI,JFU,PGT,NAX,TUI,JAF LFML,E,47,43.441613,5.217415,18.0,89.1,3,RYR,EZY,EZS,PGT,NAX,TUI,JAF LFML,C,47,43.442123,5.218132,18.0,90.8,3,JFU,RYR,EZY,EZS,NAX,TUI,JAF LFML,A,47,43.442537,5.218663,18.0,89.6,3,GWI,RYR,EZY,EZS,GWI,TUI,JAF LFML,C,5,43.439281,5.222365,23.0,61.5,4 LFML,Park,25,43.437561,5.221096,14.0,313.9,3,TJT,CCM,RAE,RLA,BZH,PWF,ANS,IBEX,DNM,AFRX,PGA,DLHX,CLH,MDM,ANS,TLB,TUX,DNM,HOP,FCT LFML,D,25,43.437837,5.221438,14.0,313.9,3,TJT,CCM,RAE,RLA,BZH,PWF,ANS,IBEX,DNM,AFRX,PGA,DLHX,CLH,MDM,ANS,TLB,TUX,DNM,HOP,FCT LFML,Park,48,43.442341,5.214728,30.0,309.7,6 LFML,Park,49,43.442726,5.215217,30.0,308.6,5 LFML,Park,50,43.443000,5.215647,25.0,309.7,5,FPO,VIZ LFML,Park,51,43.444883,5.215483,10.0,341.4,2 LFML,Park,52,43.445013,5.215917,10.0,340.5,2 LFML,Park,53,43.445121,5.216378,10.0,347.2,2 LFML,Park,84,43.434610,5.224591,10.0,326.6,2,CIV LFML,Park,85,43.433932,5.224705,10.0,326.7,2,CIV LFML,Park,86,43.435038,5.224918,10.0,327.3,2,CIV LFML,Park,87,43.433750,5.226086,10.0,308.9,2,CIV LFML,Park,88,43.433365,5.226423,10.0,316.1,2,CIV LFML,Park,11,43.435624,5.223327,10.0,327.2,2,CIV LFML,Park,10,43.435789,5.223701,10.0,323.7,2,CIV LFML,Park,18,43.436082,5.222770,10.0,329.3,2,CIV LFML,Park,17,43.436204,5.223065,10.0,325.3,2,CIV LFML,Park,16,43.436324,5.223344,10.0,321.1,2,CIV LFML,Park,15,43.436369,5.223698,10.0,329.2,2,CIV LFML,Park,14,43.436518,5.223943,10.0,326.7,2,CIV LFML,Park,96,43.436682,5.222985,10.0,327.7,2,CIV,FDO LFML,Park,21,43.436761,5.222358,10.0,328.6,2,CIV,FDO LFML,PkN,60,43.442832,5.211579,35.0,294.9,5,DHL,EAT,BCS LFML,PkW,63,43.443649,5.212673,14.0,61.9,3 LFML,PkSW,63,43.443452,5.212726,10.0,60.9,2 LFML,PkSE,63,43.443233,5.212963,10.0,62.0,2 LFML,Park,65,43.443398,5.213506,10.0,244.1,2 LFML,Park,71,43.443929,5.215219,7.0,331.1,2 LFML,Park,72,43.444016,5.215457,8.0,332.7,2 LFML,Park,73,43.444111,5.215707,7.0,332.8,2 LFML,Park,74,43.444238,5.215910,6.0,315.7,2 LFML,Park,75,43.444377,5.216093,6.0,313.7,2 -
VB.net Detect gate g5.csv
Frédéric-O DUCHEMIN replied to l0calhost's topic in FSUIPC Client DLL for .NET
Thanks Paul I have understood this part (you make for me runways using runways.csv, thanks again) 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 So missing so explaination here : lat1 ? lon1 ? lat2 ? lon2 ? to adapt to my code 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 -
VB.net Detect gate g5.csv
Frédéric-O DUCHEMIN replied to l0calhost's topic in FSUIPC Client DLL for .NET
Hello, Can you please share the complete code ? and explain please this Dim distance As Double = Form1.distance(Functions.getAircraftLatFS(), Functions.getAircraftLonFS(), aaaa, bbbb, "M") Regards Fred -
Draw Wind - Detect gate via G5.CSv
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
I try also to translate this function to my form so I never detect the good gate -
Draw Wind - Detect gate via G5.CSv
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Just function To draw in real time with values of wind component. I have already offset and formation to receive values. I try now rotate arrow depending of where come from wind. Here the code : Function Rotation(ByVal AngleDegre As Integer) Dim G As Graphics 'on mémorise la longueur de l'image 'je pars de l'hypothèse que j'utilise une image carré Dim Largeur As Integer = FrmMain.Windirimg.Image.Width Dim Hauteur As Integer = FrmMain.Windirimg.Image.Height 'on mémorise l'image présente dans la picture box Dim IMG = FrmMain.Windirimg.Image 'définition de la picturebox comme espace de dessin G = FrmMain.Windirimg.CreateGraphics() 'on efface G.Clear(FrmMain.BackColor) 'on transforme l'angle en radians Dim Angle As Double = AngleDegre / 180 * Math.PI 'on calcule les nouvelles coord X et Y de l'image Dim PosX As Single = Math.Sqrt(2) * (Largeur) * Math.Sin(Angle / 2) * Math.Cos(Math.PI / 4 + Angle / 2) Dim PosY As Single = -Math.Sqrt(2) * (Largeur) * Math.Sin(Angle / 2) * Math.Cos(Math.PI / 4 - Angle / 2) 'on fait la rotation G.RotateTransform(AngleDegre) 'on dessine l'image rotée aux nouvelles coordonnées G.DrawImage(IMG, PosX, PosY, Largeur, Hauteur) 'on libère ! G.Dispose() End Function Trying also to find runways in use by METAR and if AI Trafic are in use works with AI Trafic and not by METAR Regards Fred -
Hello Paul, What's the way to catch Wind & speed and draw in realtime an Arrow to a form, for my acars system reports in vb.net ? I'm looking for a function you to do that. 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 Public Function getWindDirectionFromMETAR(metar As String) Dim heading As Integer = 0 Try Dim endPos As Integer = metar.IndexOf("KT") If endPos >= 0 Then Dim startPos As Double = metar.LastIndexOf(" ", endPos) If startPos >= 0 Then heading = metar.Substring(startPos + 1, 3) End If End If Catch ex As Exception End Try Return heading End Function Thanks Regards Fred
-
VAS Monitoring VB.net
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Seems to work, need to remove XP Styles to work ;) But I'm not sure the pourcentage is good. Thanks for all Paul Fred -
VAS Monitoring VB.net
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Sorry Paul I don't understand this part ProgressBar1.Value = VASMb If VASMb = 4096 Then ProgressBar1.ForeColor = Color.Green If VASMb <> 3072 Then ProgressBar1.ForeColor = Color.Orange End If If VASMb < 2048 Then ProgressBar1.ForeColor = Color.Orange End If End If Fred -
VAS Monitoring VB.net
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Thanks Paul, It's working great so there is a way to indicate in the form all memory and used memory with color like green:good , orange:middle, red: bad Thanks again Fred -
VAS Monitoring VB.net
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Both if you can you told me to learn C# Fred -
VAS Monitoring VB.net
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Hi Paul, Can you please make for me a form to monitoring VAS available and used with the correct way to connect to FSX. In that way in can view howto do in the correct way, Thanks Fred -
Hello, Happy New year for all ;) 1) Howto monitoring VAS Value to Vb.net in my ACARS system ? 2) Request Pay Service to help me to make good ACARS system (in the good way) communicate to phpvms and an other for monitoring simple Google MAP datas via Php / MySQL (with source code) Thanks hope receive answers. Regards Fred
-
PMDG Offsets
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Thanks Raimund, for the explanations send you a PM. Regards Fred -
PMDG Offsets
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
If I put the function in FsuipcData.vb in the window log each time timer makes loop I have Strobes lights, etc populate my window log. So I need to place pmdg737sdk() in FrmMain.vb to avoid crash but now I have information only when Get flight I give you some files if you can look please. ------------------------------------------------------- I would like make function for displaying GS, TAS, Mach, Fuel Flow in Real-Time Flight Information How can do that? Thanks Fred FsuipcData.vb FrmMain.vb -
PMDG Offsets
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Yes I have do this. (I'm using Fs2crew needs SDK enabled). the offset in the first start seems to be active but after nothing. Maybe need to make a timer or hold old value somewhere? Fred -
PMDG Offsets
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
I'm working to Strobe lights (777) to make a test, but nothing are returned...And I would like save status state in one offset Fred -
PMDG Offsets
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Paul, A ploblem occur because some lights are present here: Private Enum LightType Navigation Beacon Landing Taxi Strobes Instruments Recognition Wing Logo Cabin End Enum I would like to check if PMDG in use and use only PMDG offsets For Public Sub pmdg777sk() Try FSUIPCConnection.Process() Catch ex As Exception End Try 'Dim autopilot_A As Boolean = MCP_AP_Sw_Pushed.Value > 0 'If MCP_AP_Sw_Pushed.Value > 0 Then ' Dim vtg As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot On" & vbCrLf ' My.Computer.FileSystem.WriteAllText(logname, vtg, True) ' Dim xmlg As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot On " & "*" ' My.Computer.FileSystem.WriteAllText(reportname, xmlg, True) 'End If 'If MCP_AP_Sw_Pushed.Value = 0 Then ' Dim vte As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot Off" & vbCrLf ' My.Computer.FileSystem.WriteAllText(logname, vte, True) ' Dim xmle As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot Off " & "*" ' My.Computer.FileSystem.WriteAllText(reportname, xmle, True) 'End If Dim strobeLights As Boolean = LTS_Strobe_Sw_ON.Value > 0 If LTS_Strobe_Sw_ON.Value > 0 Then Dim vta As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Steady On" & vbCrLf My.Computer.FileSystem.WriteAllText(logname, vta, True) Dim xmla As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Steady On " & "*" My.Computer.FileSystem.WriteAllText(reportname, xmla, True) End If If LTS_Strobe_Sw_ON.Value = 0 Then ' Off Dim vtb As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Strobe lights Off" & vbCrLf My.Computer.FileSystem.WriteAllText(logname, vtb, True) Dim xmlb As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Strobe lights Off " & "*" My.Computer.FileSystem.WriteAllText(reportname, xmlb, True) End If 'Dim autopilot_B As Boolean = MCP_annunCMD_B.Value > 0 'If MCP_annunCMD_B.Value > 0 Then ' Dim vtd As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot CMD B On" & vbCrLf ' My.Computer.FileSystem.WriteAllText(logname, vtd, True) ' Dim xmld As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot CMD B On " & "*" ' My.Computer.FileSystem.WriteAllText(reportname, xmld, True) 'Else ' Dim vtd As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot CMD B On" & vbCrLf ' My.Computer.FileSystem.WriteAllText(logname, vtd, True) ' Dim xmld As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot CMD B On " & "*" ' My.Computer.FileSystem.WriteAllText(reportname, xmld, True) 'End If End Sub now I have do this but not working in FsuipcData.vb i have already posted [18:15] PMDG 777-21HLR Emirates B77L [18:15] Flight SDAK003 is ready to depart EHAM with a final destination of LEBL [18:15] Zero Fuel Weight: 408011 lbs - 185071 kg [18:15] Take-Off Weight: 725444 lbs - 329056 kg [18:15] Max Gross Weight: 768000.0 lbs - 348359 kg [18:15] METAR For Departure: 2016/09/28 17:55 EHAM 281755Z 23012KT 9999 FEW035 18/14 Q1021 NOSIG [18:15] Boarding [18:15] Refueling Mid-Flight suspect !!! [18:15] Steady On [18:15] Engine 1 ON [18:15] Engine 2 ON [18:15] Parking Brake Applied -
PMDG Offsets
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Thanks Paul for the details Regards -
PMDG Offsets
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
PMDG 777 SDK 6485 3 BYTE x 3 LTS_LandingLights_Sw_ON[3] Booleans Left/Right/Nose 6488 1 BYTE LTS_Beacon_Sw_ON Boolean 6489 1 BYTE LTS_NAV_Sw_ON Boolean 648A 1 BYTE LTS_Logo_Sw_ON Boolean 648B 1 BYTE LTS_Wing_Sw_ON Boolean 648C 2 BYTE x 2 LTS_RunwayTurnoff_Sw_ON[2] Boolean 648E 1 BYTE LTS_Taxi_Sw_ON Boolean 648F 1 BYTE LTS_Strobe_Sw_ON Boolean how to translate ? -
PMDG Offsets
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Ok thanks Paul I have put this in my fsuipcData.vb Public Sub pmdg737sk() 'FSUIPCConnection.Process() Dim MCP_annunCMD_A As Offset(Of Byte) = New Offset(Of Byte)(&H6545) Dim MCP_annunCMD_B As Offset(Of Byte) = New Offset(Of Byte)(&H6547) Dim LTS_TaxiSw As Offset(Of Byte) = New Offset(Of Byte)(&H64FA) Dim LTS_AntiCollisionSw As Offset(Of Byte) = New Offset(Of Byte)(&H6501) Dim LTS_PositionSw As Offset(Of Byte) = New Offset(Of Byte)(&H6500) Dim autopilot_A As Boolean = MCP_annunCMD_A.Value > 0 If MCP_annunCMD_A.Value > 0 Then Dim vt As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot CMD A On" & vbCrLf My.Computer.FileSystem.WriteAllText(logname, vt, True) Dim xml As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot CMD A On " & "*" My.Computer.FileSystem.WriteAllText(reportname, xml, True) Else Dim vt As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot CMD A Off" & vbCrLf My.Computer.FileSystem.WriteAllText(logname, vt, True) Dim xml As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot CMD A Off " & "*" My.Computer.FileSystem.WriteAllText(reportname, xml, True) End If Dim strobeLights As Boolean = LTS_AntiCollisionSw.Value > 0 If LTS_PositionSw.Value = 0 Then ' Steady Dim vta As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Steady On" & vbCrLf My.Computer.FileSystem.WriteAllText(logname, vta, True) Dim xmla As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Steady On " & "*" My.Computer.FileSystem.WriteAllText(reportname, xmla, True) ElseIf LTS_PositionSw.Value = 1 Then ' Off Dim vtb As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Strobe lights Off" & vbCrLf My.Computer.FileSystem.WriteAllText(logname, vtb, True) Dim xmlb As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Strobe lights Off " & "*" My.Computer.FileSystem.WriteAllText(reportname, xmlb, True) ElseIf LTS_PositionSw.Value = 2 Then ' Stobe and Steady Dim vtc As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Strobe lights On" & vbCrLf My.Computer.FileSystem.WriteAllText(logname, vtc, True) Dim xmlc As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Strobe lights On " & "*" My.Computer.FileSystem.WriteAllText(reportname, xmlc, True) End If Dim autopilot_B As Boolean = MCP_annunCMD_B.Value > 0 If MCP_annunCMD_B.Value > 0 Then Dim vtd As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot CMD B On" & vbCrLf My.Computer.FileSystem.WriteAllText(logname, vtd, True) Dim xmld As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot CMD B On " & "*" My.Computer.FileSystem.WriteAllText(reportname, xmld, True) Else Dim vtd As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot CMD B Off" & vbCrLf My.Computer.FileSystem.WriteAllText(logname, vtd, True) Dim xmld As String = DateTime.UtcNow.ToString("[HH:mm]") & Chr(32) & "Auto-pilot CMD B Off " & "*" My.Computer.FileSystem.WriteAllText(reportname, xmld, True) End If End Sub Auto Pilot doesn't work and Strobe is not logged like Steady state. help please ? Fred -
PMDG Offsets
Frédéric-O DUCHEMIN replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Thanks Paul for your quick answer so, I have a litle problem You tell me to do this: Dim MCP_annunCMD_A As Offset(Of Byte) = New Offset(Of Byte)(&H6545) Dim MCP_annunCMD_B As Offset(Of Byte) = New Offset(Of Byte)(&H6547) Dim LTS_TaxiSw As Offset(Of Byte) = New Offset(Of Byte)(&H64FA) Dim LTS_AntiCollisionSw As Offset(Of Byte) = New Offset(Of Byte)(&H6501) Dim LTS_PositionSw As Offset(Of Byte) = New Offset(Of Byte)(&H6500) So I don't know how to put this in my file. Can you help me please? Regards Fred FsuipcData.vb -
Hello Paul, I don't understand how I can use PMDG offsets in VB.net. I know dand I have read two PDF talking about those offsets I would like check AP, taxi lights, navigation lights and strobe lights. 6545 1 BYTE MCP_annunCMD_A Boolean 6547 1 BYTE MCP_annunCMD_B Boolean 6564 1 BYTE MAIN_annunAUTO_BRAKE_DISARM Boolean 6500 1 BYTE LTS_PositionSw 0: STEADY 1: OFF 2: STROBE & STEADY 6501 1 BYTE LTS_AntiCollisionSw Boolean 64F4 2 BYTE x 2 LTS_LandingLtRetractableSw[2] 0: RETRACT 1: EXTEND 2: ON 64F6 2 BYTE x 2 LTS_LandingLtFixedSw[2] Boolean 64F8 2 BYTE x 2 LTS_RunwayTurnoffSw[2] Boolean 64FA 1 BYTE LTS_TaxiSw Boolean This is for 737NGX offsets. Someone can help me to do this please? If easiest to do in C# Where I can find a converter translate vn.net to C# ? Thanks Regards Fred