Jump to content
The simFlight Network Forums

Paul Henty

Members
  • Posts

    1,652
  • Joined

  • Days Won

    74

Everything posted by Paul Henty

  1. You can see all the offsets in the Intellisense list, but it's quite long. It's best to use the classes with the official FSUIPC documentation for the PMDG Offsets. The latest docs are installed when you update FSUIPC. What offsets are available will depend of the your version of FSUIPC however. e.g. FSUIPC4 for FSX won't have the 737NGXu offsets. Paul
  2. Version 3.1.27 is now available with the updated PMDG 737 offsets and controls. Includes the NGXu. Paul
  3. Version 3.1.27 is now available with the updated PMDG 737 offsets and controls. Well I didn't do it by hand, I cheated a bit. I wrote a program that pulled the information from the .pdf and the .h file and wrote the classes for me. Paul
  4. HI Michiel, FSUIPC can report when a joystick button has been pressed. Have a look at the example code application: Input/Menu Services >> IS002_ButtonPresses That's probably the easiest way. Otherwise you'll need to find a library that will let you use the DirectX/DirectInput features of Windows to read the joystick directly. If you're using PMDG, I'll be releasing a new version of the DLL in a few days. It has a few extra offsets in the 737 helper class for the NGXu. Paul
  5. Hi Ian, All offsets will just return 0, but that's a valid value for most of them. You could try looking for an offset which can never be 0 under normal operation and test that. Something else you can try is writing an out-of-range value to one of the offsets and then read it back after a second or so and see if it's a correct value. This could be 0 but that's okay if you wrote 0xFF. If the connection to PMDG isn't working you'll read your original 0xFF back. Paul
  6. Thanks for clarifying Pete. I've found the updated PDF with the extra NGXu offsets. I will add those to the DLL helper class. I will also check the list of controls (events) to see if there are any changes/additions there and bring those into line. I expect to release a new version early next week. Paul
  7. HI, I doubt Dodosim helos have specific offsets of their own; if they did they would be documented. If they use the normal Flight Sim mechanics for a particular system then you just use the normal offsets. If they use their own internal code to model the systems (which a lot of third-party aircraft do) then your options are limited, especially if there is no SDK from the authors. It may be impossible to get the information from FSUIPC. If you want to view many offsets values at once to see what is changing you can download the FSUIPC SDK and use the program called 'FSInterrogate2std.exe'. Other possibilities are as follows: Events/Controls For controlling actions, the aircraft might use custom events (aka Controls), or make use of an unused built-in event. These can be found by using the logging facilities in FSUIPC. Select the Logging tab and check the box for Events (non-axis controls). Also check the box to "Send to console window". Then operate the control in the aircraft. If it uses an event its number will be logged in the console window. You can use this from FSUIPC directly, or via the DLL, but only for control - you can't 'listen' for these events. LVARS (Local Panel Variables) Many aircraft store data in local panel variables. To see what it available for your aircraft: Go to FSUIPC and assign a key press or joystick button to the control "List Local Panel Vars". Make sure the console logging is enabled (see above), go back to the aircraft and press the button/key. A list of LVAR names will be listed in the console. If any look useful you can use these from LUA or the DLL. (See FSUIPCConnection.ReadLVAR()) Program your own logic Simple example: If it's impossible to get the status for a low oil pressure warning light, you might be able to monitor the oil pressure using the normal offsets and use that information to light the warning lamp when it falls below a particular value. Paul
  8. Hi Peter, As it's a rectangle, I've extended the functionality of the FsLatLonQuadrilateral for this. You can now create a quad from a centre point and a width and height. // Create the centre point of the rectangle FsLatLonPoint centre = new FsLatLonPoint(49.206993, -2.206967); // Create the rectangle 100m high (north to south) and 56m wide (east to west) around the centre point FsLatLonQuadrilateral quad = FsLatLonQuadrilateral.FromCenterMetres(centre, 100, 56); The quad now has new properties to get the Min/Max longitude and latitude. E.g. FsLatitude maxLat = quad.LatitudeMaximum; This is now available for testing in version 3.1.26-BETA. (Tick 'include pre-release" in the Nuget package manager to see the Beta versions). Hopefully this meets your requirements but let me know if I've misunderstood. Paul
  9. I'm glad you fixed it. For the benefit of others searching for the same problem, the easiest way to work with Longitude and Latitude offsets is to declare them with the types 'lon' and 'lat'. var request = { command: 'offsets.declare', name: 'allSettingsOffsets', offsets: [ { name: 'playerLon', address: 0x0568, type: 'lon', size: 8 }, { name: 'playerLat', address: 0x0560, type: 'lat', size: 8 } ] } This will return the values in degrees decimal, so you won't need to do any conversion maths on the client side. Paul
  10. Hi James, For C# you'll need my .NET Client DLL. If you haven't already, please see the website for details on how to install it into your project, and to download the 'Example Code' project which gives examples of how to use the DLL. http://fsuipc.paulhenty.com Specifically, have a look at the example called "BC004: Writing to Offsets" under the 'Basic Concepts' section in the Example Code application. For your Project Magenta offset you'll need to declare it with a type of 'byte'. Then assign the value 51 and call Process(). I recommend using the grouping feature so you can better manage which offsets are processed. (See BC005: Grouping Offsets). If you're totally new to this, I recommend the "Complete Video Guide For Beginners" in the help section of the website. This will show you how everything fits together and how to get everything set up. Paul
  11. HI, I use FS2004 here for testing sometimes so it does work. You shouldn't need a registered FSUIPC for IPC activity, but Pete has made FSUIPC3 registration free. See at the bottom of this post for the free reg key. The only cause of FSUIPC_ERR_SENDMSG I've seen is a mismatch between the admin permissions for the app and the sim. Double check that both are 'as admin' or both are not. If that's definitely not the problem then the log files might tell us something. Paste here if you can't see anything obvious. The log should be in the modules folder (FSUIPC.log). Paul
  12. 07C8 is the heading lock, not the heading itself. The heading is 0x07CC. Declare as UShort. To convert to degrees, divide by 65536 then multiply by 360. Paul
  13. Yes there is a Set(x) function as well. In .NET you assign a boolean value: myBitArray.Set(3) = true; If WinDev doesn't have booleans then 0/1 should work. Paul
  14. Hi Didier, In .NET the array access for these classes is fake. The compiler will replace myBitArray[2] with myBitArray.Get(2). It looks like WinDev doesn't understand this, so try calling the Get() function directly: Lights.Value.Get(0) Lights.Value.Get(1) etc... Paul
  15. In addition to Pete's answer above... 0B4C is only 2 bytes long, so it needs to be declared as Short. (Not UShort because some land is below sea level and therefore the elevation is negative). Private groundElevation As New Offset(Of Short)(&HB4C) 0020 should also be Integer not UInteger. Here is the code with conversion to metres... Private groundElevation As New Offset(Of Integer)(&H20) aglStatus.Text = groundElevation.Value / 256D As I said in a reply above, if you want AGL you need to subtract the ground elevation from the aircraft's current altitude: Paul
  16. Hi, There doesn't seem to be much wrong with this sub you have posted. Most of it uses the payload services which manages the offsets for you. There is one small issue: Dim Parkingbrk As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&HBC8) This offset is being re-created every time you call refuel(). If you call it 3 times you will have three copies of this offset. That's obviously not enough to cause the FSUIPC_ERR_SIZE, but you might be making the same mistake elsewhere in your code. Are you creating offsets anywhere else? You should declare offsets at the form or module level. If you declare them in subs they get created again and again. Even if the variables go out of scope, the offsets are still there. If you must declare them in a sub, place them in a group and then delete the group when you are finished. E.g: Dim Parkingbrk As Offset(Of Short) = New FSUIPC.Offset(Of Short)("refuelOffsets", &HBC8) .... FSUIPCConnection.Process("refuelOffsets") .... FSUIPCConnection.DeleteGroup("refuelOffsets") Exit Sub Paul
  17. Hi Marc, MSFS has a new 'active pause' mode which is different from the real pause mode. This has caused some confusion with the pause offsets and controls in MSFS. I don't think it's resolved yet. This is the current thread about it. I haven't read all the way through it - it's quite long - but it might give you a solution. Just off the top of my head, if the pause offset doesn't work you could try the pause control: FSUIPCConnection.SendControlToFS(FsControl.PAUSE_OFF, 0); But that may have the same problem. Paul
  18. Looking at the WinDev documentation for .NET (https://doc.windev.com/en-US/?2012002&name=Using_NET_assemblies) I think you need to declare the offset like this: Offset_Airspeed is "Offset<4-byte unsigned int>"(0x02BC) Then use the value like this: AirspeedKnots is real AirspeedKnots = Offset_Airspeed.Value / 128.0 I can't test this however. The strongly-typed offset (with <>) is easier to use. If you really want to use the base Offset() class then you also need to include the length of the offset: Offset_Airspeed is Offset(0x02BC, 4) Paul
  19. Hi Didier, This happens when you try to Process() but there are no Offsets created. This will be work if we can solve your next problem: Can you post your code here (where you create offsets)?. Maybe I can see the problem. A bit, but I'm not fluent. Paul
  20. The main documentation is the example code application available on the website. http://fsuipc.paulhenty.com/#downloads There is also a video tutorial in the help section for beginners. Everything is centred around Visual Studio however because that how most people use it. Paul
  21. It's compiled to target "any cpu" so it will compile to 32bit or 64bit depending on the application it's used in. Paul
  22. Hi Didier, I only distribute it on NuGet now as it's much easier for me, and also for the users to keep up-to-date. If WinDev doesn't support NuGet you can use Visual Studio to download the package into a blank project and pick up the files from there. Or, you can download the package directly from the NuGet website: https://www.nuget.org/packages/FSUIPCClientDLL/ Rename the .nupkg to .zip, then you can just unzip it and get the DLL and XML from the 'lib' folder. Paul
  23. Version 3.1.25 is now available. Overview: There is a new class called FsLatLonPolygon. Its constructor takes in an array of FsLatLonPoint that defines the points (vertices) of a closed polygon. There can be any number of points. The polygon can be convex, concave or complex (having self-intersecting sides). Testing if a point is in a poylgon: Once the polygon has been defined you can use the ContainsPoint() method to test if the given point is contained within the polygon. FsLatLonPolygon london = new FsLatLonPolygon(londonOutline); FsLatLonPoint aircraftPosition = new FsLatLonPoint(currentLat, currentLon); if (london.ContainsPoint(aircraftPosition)) { // over London } else { // not over London } In the above code 'londonOutline' is an array of FsLatLonPoints that have been built from map data. Searching for intersections on the polygon: You can also test if you will cross the boundary of the polygon given your current location, heading and range. Use the method called GetIntersectionFromPointMetres (or use the feet or nautical mile version). In the code below we test if we'll cross the boundary given our current location and heading. The 'range' value limits the look ahead distance so you can exclude the polygon if its boundary is too far away. The return value is a struct that contains various information about the intersection. These properties are shown in the code: // Look ahead to see if we are intersecting the London boundary on our current heading. Limit to 100km ahead. FsPolygonIntersection intersection = this.london.GetIntersectionFromPointMetres(aircraftPosition, currentHeadingTrue, 100000); // examine the FsPolygonIntersection object returned to get the results. The following information is avilable: bool inside = intersection.InsidePolygon; // true if the test point (aircraft position) was inside the polygon. // If inside then any boundary crossing will be us LEAVING the zone. // If outside then any boundary crossing will be us ENTERING the zone. if (intersection.Found) { // We will cross the boundary - get more info double distanceToGo = intersection.DistanceToMetres; // distance to the boundary. also avilable in feet and nautical miles FsLatLonPoint crossingPoint = intersection.Point; // The location of the crossing FsLatLonLineSegment crossingLineSegment = intersection.LineSegment; // The line segmeent of the polygon that we will cross. } else { // We will not cross the boundary } The searches are very fast because the algorithms can very quickly reject polygons that can't possibly contain the point, or have any intersections, without an exhaustive search of every line segment. Only if an intersection is possible will it run the detailed checks using all the points and line segments. Paul
  24. Ah fair enough. I'll just leave it as an array of FsLatLonPoint[] then. It'll be simple enough to build from your data. Thanks, Paul
×
×
  • 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.