
Paul Henty
Members-
Posts
1,724 -
Joined
-
Days Won
77
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by Paul Henty
-
FSUIPC Client DLL for .NET - Version 3 Released
Paul Henty replied to Paul Henty's topic in FSUIPC Client DLL for .NET
Thanks. It's not open source. I actively maintain the library in terms of fixing bugs and adding new features requested by users. Paul -
Version 3 Released FSUIPCClientDLL is a library that make it easy for .NET developers to use FSUIPC. Version 3 is now available as a NuGet package called FSUIPCClientDLL. Full instructions on how to install it are on the new website below. Be sure to download the new example code application in either C# or VB. This is the main documentation for the library and covers all features of the library from beginners to advanced. http://fsuipc.paulhenty.com The website has: Installation instructions for Version 3 Upgrade instructions from Version 2.4 & 3.0RC Change history New project templates for WinForms and WPF in both C# and VB.NET New and improved example code applications in C# and VB.NET Complete Video Guide for Beginners (C# and VB.NET) The main features added from V2.4 are: Helper method to Read/Write LVARs Weather Services Airports/Runways Database Helper method to send controls (events) Helper method to move the aircraft and save/restore position snapshots DLL no longer limited to 32bit. You can now write 64bit applications.
-
Hi Aryeh, I cannot answer your question.You are posting in the wrong forum. Please click this link to get to the correct forum: http://forum.simflight.com/forum/30-fsuipc-support-pete-dowson-modules/ Start a new topic there and ask your question again. Thanks, Paul
-
Hi Aryeh, Please repost your question in the main forum so Pete can answer it. http://forum.simflight.com/forum/30-fsuipc-support-pete-dowson-modules/ This is a sub-forum for questions about programming. Paul
-
Is the error 12 coming from a program you wrote yourself using the FSUIPCClient.dll? If not, you need to repost your question in the main support forum. It might not be seen here in this sub-forum for programmers. Paul
-
Hi Benny, Yes this is normal behaviour for ACTIdentifier. As the DLL says this is the Airline + Flight Number, or if there isn't one (GA Aircraft) then it's the tail number. To always get the tail number you have two choices: 1. Override the FSUIPC.INI file file settings in code to always bring back the tail number in ATCIdentifier. Call this before you refresh the traffic info: FSUIPCConnection.AITrafficServices.OverrideAirbourneTrafficINISettings(ATCIdentifier.TailNumber, null); There is a similar one for ground traffic. Note that this will affect all FSUIPC applications reading AI Traffic. 2. The other method is to use the extended information properties: Call this once after you open the connection: FSUIPCConnection.AITrafficServices.UpdateExtendedPlaneIndentifiers(true, false, false, false); This will fill the property AIPlaneInfo.TailNumber. However, this will be a bit slow the first time you refresh the AI traffic as the DLL has to make additional calls to FSUIPC for each aircraft. After that the additional calls will only be made when a new plane is seen. But, this won't be very noticeable if you're only getting the tail number. Paul
-
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Yes the code looks fine, and works for me with FSX. Have you checked what values you are getting for these two lines? Dim lat As FsLatitude = New FsLatitude(gps_next_lat.Value) Dim lon As FsLongitude = New FsLongitude(gps_next_lon.Value) Is sounds like gps_next_lat and gps_next_lon.Value might be 0. If so then it's the same problem as the distance offset. It's not working in P3DV4. I've attached a new version of the DLL. This should load your AirportsDatabase now. Paul FSUIPCClient3.0_RC8.zip -
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
You could try 60AC and 60B4 (Lon/Lat of next waypoint). If those are okay you can make a FsLatLonPoint with them. Then make another from the Player's Lat/Lon. Then you can get distance between both points (FsLatLonPoint.DistanceFromInNauticalMiles()). You can use Math.Abs() to make a number positive. Math.Abs(5) = 5. Math.Abs(-5) = 5. Paul -
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Thanks for the file. I will investigate... I see you're using P3DV4. I know there are some things that don't work with V4. Maybe this is one of them. I would ask Pete in the main forum about this distance offset in P3dV4. I think he's back from holiday tomorrow. I have FSX and it works okay. I don't have P3D so I can't test it there. Paul -
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
This code works fine for me: Dim gps_distance As Offset(Of Double) = New Offset(Of Double)(&H60EC) Dim gps_nextWaypoint As Offset(Of String) = New Offset(Of String)(&H60A4, 6) FSUIPCConnection.Process() Dim distanceNM As Double = Math.Round(gps_distance.Value / 1852, 0) Me.TextBox1.Text = gps_nextWaypoint.Value.ToString() & ": " & distanceNM.ToString() + "NM" First check unconverted (metres) value in gps_distance.Value. Is that 0 as well? These offsets are only active when you have a flight plan active in Flight Sim. Are you sure you have one loaded? Are there waypoints defined in the flight plan? If you load the default Cessna with the G1000 GPS do you see the route on the GPS in the cockpit? It should be a magenta line. For the AirportsDatabase error - it seems there is a problem with one of the coms frequencies at an airport. As you have different scenery to me, I can't reproduce this. Could you zip these two files from your main flight sim install folder and attach them here please? F5.csv Runways.xml Thanks, Paul -
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
1 NM is 1852 metres. Divide gps_distance by 1852 to convert metres to nautical miles. Use the Math.Round() function to round to however many decimal places you need. Paul -
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Okay - So does your project compile with the new DLL now? If so, I just need the exception details. Paul -
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
This is now called SetReferenceLocation - just change the name in your code. Paul -
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Sorry Fred, I didn't see your reply. I think you edited the post. I don't get notified of edits, only new posts. Yes the message will be the same, but this time the stack trace has line numbers. However, my source code has changed a lot since I sent that .pdb. Can you please use the current version attached, get the error and show me the full exception as above. There might be a few changes to the DLL that break your code. I have renamed a few properties and methods. Let me know if you get any errors and I'll tell you the new names. Thanks, Paul FSUIPCClient3.0_RC8.zip -
Play with GPS Offsets
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
I'll answer on that thread. Paul -
Play with GPS Offsets
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Hi Fred, There is a table in the UserGuide.pdf that tells you how to work out which VB Types to use. This is in the 2.4 download package found here: http://forum.simflight.com/topic/74848-fsuipc-client-dll-for-net-version-24/ See page 6. For the offsets you listed: If they are 8 Bytes and the description says "floating point double" then declare them (Of Double). If the description says string then declare as string and set the stated size: e.g. for 60A4: Dim gps_nextWaypoint As Offset(Of String) = New Offset(Of String)(&H60A4, 6) 4 byte (32-bit) integers are (Of Integer). 2 byte (16-bit) Integers are (Of Short). Paul -
Hi José, You have posted in a sub-forum about programming for FSUIPC using .NET languages. You should repost your question in the main FSUIPC support forum. http://forum.simflight.com/forum/30-fsuipc-support-pete-dowson-modules/ It's unlikely to be answered here. Paul
-
vb.net Help with my simple program
Paul Henty replied to neume's topic in FSUIPC Client DLL for .NET
Hi Luke, Welcome to the Sub-forum. The best way to start is to download the full V2.4 package for my .NET FSUIPC Client DLL from here: http://forum.simflight.com/topic/74848-fsuipc-client-dll-for-net-version-24/ in that Zip you will find my DLL that you can use in your VB.NET applications. This makes it much easier to work with FSUIPC in .NET languages. Included in the Docs folder is a UserGuide.PDF that explains everything you need to know about connecting and reading/writing data. There is also a Sample Project in VB (and C#) that is a simple working application that reads data on a timer. It also shows the connection/disconnection logic. That should be your first starting point to get familiar with everything. You also need to refer to Pete's list of Offsets that is found in the Modules\FSUIPC Documentation folder in the main P3D install folder. For FSUIPC4 it's called "FSUIPC4 Offset Status.pdf". I don't know what the equivalent is for FSUIPC5 but I'm sure it'll be obvious. I am soon (hopefully in February) releasing version 3 which has all sorts of new features, and much better and more extensive code examples. All your 2.4 knowledge will still apply however. Paul -
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Still not enough info. I've attached the latest DLL with a debug file (.pdb). Please use this latest DLL - make sure you copy the .pdb into the same folder. With this new file, the exception report should be different, paste the new one. Paul FSUIPCClient3.0_RC7.zip -
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
Hi Fred, That code runs fine here. No problems. I can't really see what's going wrong without the exception details and the call stack. In the openFSUIPC() method, can you comment out the lines: Try Catch messagebox(... End Try Then run it again. You need to get the exception details and show me the call stack. Use the 'Copy Details' link and paste it here. Paul -
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
There should only be one place where you call Open(). It should be when your application starts. If you have added these two lines somewhere else then you should remove them. Find the original place where you call Open() and add the Load() after it. Paul -
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
I can't see how the disconnection would be related to reading the surface for the runway. You'll need to trace the code and set break points to see how and why the disconnection is happening. Paul -
Yes, I'm quite sure it's possible. I don't have VB6 any more, so I can only tell you the method, I can't give you any working code. 1. You'll need to use two offsets: &H3114 - This should be 4 bytes and an integer (Long in VB6) - This is the 'Parameter Value' &H3110 - This should also be 4 bytes and an Integer - This is the 'Control (or Event) Number' You MUST write 3114 first, then 3110. You can write both in the same process() call, just make sure 3114 goes first. To send an event to PMDG, you need the list of events from the .h file in the SDK. (PMDG_NGX_SDK.h I think) 2. If I remember correctly, the parameter is set to one of the codes for the mouse buttons. Here is an example line from the .h file #define MOUSE_FLAG_LEFTSINGLE 0x20000000 So, to send a single left mouse click you set the value of 3114 to &H20000000 3. The control (or Event) number is also in the .h file: To get the full number you need to add the event number to the value of THIRD_PARTY_EVENT_ID_MIN (69632) Here is another example line from that file... #define EVT_MCP_CMD_A_SWITCH (THIRD_PARTY_EVENT_ID_MIN + 402) To send the event for the MCP autopilot CMD A switch you need 69632 + 402 = 70034 In summary: To send a single left mouse click to the CMD A autopilot button on the MCP: Write &H20000000 to offset &H3114 Write 70034 to offset &H3110 Process(). Paul
-
Vb.NET Closest NAVAIDS SQlite
Paul Henty replied to Frédéric-O DUCHEMIN's topic in FSUIPC Client DLL for .NET
The code looks okay. Please check the following: a. The airport code must be all upper case. So maybe use this: Dim surfaceType As FsSurface = db.Airports(lblArrival.Text.ToUpper()).Runways(Getrunaway(lblDeparture.Text)).Surface b. The runway code must be two digits e.g. "09". "9" will not work. Plus an optional suffix of L, C or R (capitals). e.g. 09L. No spaces. These will NOT work: 9 (only one digit) 9L (only one digit) 09 L (space between 9 and L) 09l (Lower case L) These WILL work 09 36 27L 09R If you can't get it working I'll need to know more information: 1. What is the problem? Is there an error? Does it return the wrong surface, or nothing? 2. Which airport and runway are you trying? 3. What's being returned from the GetRunway() function? 4. Maybe show me the GetRunway() function. I can't really help any more with that. I can write code for something that complicated that you can just paste directly into your application. The code I wrote there is just an example or how it could be done. It shows you a strategy for achieving what you want. I've no idea how to integrate it into your application because I don't know your application. I can give general advice but you need to write your own code. Paul