
Paul Henty
Members-
Posts
1,728 -
Joined
-
Days Won
78
Everything posted by Paul Henty
-
p3dv6 P3Dv6 Black Screen When FSUIPC Selected
Paul Henty replied to David Wilkinson's topic in FSUIPC Client DLL for .NET
Hi David, You've posted this in the wrong sub-forum (this one is for .NET programming). You'll need to repost in the main FSUIPC support forum here: https://forum.simflight.com/forum/30-fsuipc-support-pete-dowson-modules/ Paul -
WebSocketServer. Just a quickie
Paul Henty replied to cknipe's topic in FSUIPC Support Pete Dowson Modules
Version 1.1.2 is now on the website: http://fsuipcwebsockets.paulhenty.com/index.html#home I've added two 'wildcard' addresses to the dropdown list. (Note that these are not my invention, they are built into Windows. How they work is down to Windows not me.) * (Handles requests on all physical IP Addresses. Doesn't seem to work with any host names or the 127.0.0.1 loopback address.) + (Handles requests on all IP Addresses and host names. This creates a secure URL that needs admin permissions.) Paul -
WebSocketServer. Just a quickie
Paul Henty replied to cknipe's topic in FSUIPC Support Pete Dowson Modules
As John pointed out the Socket Server runs with any version of FSUIPC from 3 onwards. The only difference is that the 'vars' command will run in a legacy mode for all versions before 7. This is significantly slower than the way 'vars' are handled with MSFS. Certain URLs and Ports are secured by Windows. To use them, the account the application is running under needs permission. You can achieve this is two ways: 1. By running the application as Admin. 2. By giving the required permission to the current user. This is done using the following command: (You can execute this in the command window or in code): netsh http add urlacl url=[URL TO REGISTER] user=[DOMAIN]\[USER OR GROUP] e.g. my PC here is call PJH. My user name is Paul. If I want to use the URL http://PJH:2048/fsuipc I would need this command: netsh http add urlacl url=http://PJH:2048/fsuipc/ user=PJH\Paul To run this command you need to be running 'as admin'. But once you've given permissions the socket server will be able to work without admin privileges. I will add this information to the website. A listener can only bind to a one URL. Binding to multiple IPs would require starting multiple listeners on the server side and handling requests from any of them. I don't want to make such a fundamental change to the application at this point. Listening on all IPs might be possible as it looks like the URL can include wildcard symbols. So something like http://*:2048/fsuipc will listen on all IPs. At the moment there's no way of typing this in as you need to choose from the dropdown list. I'll look into change this to allow any URL to be typed in. (If the wildcards work). This will not get around the Windows security however. You'll still need to grant permissions to the wildcard URL or be running 'as administrator'. Paul -
Your C# code shows Keys.D1. Did you paste the wrong line? The log shows you sent the 2 key... 867593 FSUIPC Control Action: Ctrl=1070, Param=4658 867593 SendKeyToFS(00030032=[alt+ctl+2], KEYDOWN) ctr=0 I'm assuming you are calling FSUIPCConnection.SendKeyToFS(Keys.D2, SendModifierKeys.Control | SendModifierKeys.Alt); You can see from the log (in bold above) that my DLL has passed on the correct key code to FSUIPC. @John DowsonMight be able to tell you why this key combination is working from the keyboard but not through the IPC interface. Paul
-
Hi Dirk, If you are using MSFS, the ALT key is not supported in FSUIPC7. It does work with FSX and P3D. If you are using either of those simulators, please show your code. Paul
-
You're using "UB" which is 1 byte. Offset 0x281C is 4 bytes. So you're only testing the first byte. This will always be 0 because the entire 4-byte offset only stores 0 and 1. The actual bit you want to test is in offset 0x281F. You can with target that byte: event.offsetmask(0x281F, 1,"UB","Batteryswitch") or tell LUA read the full 4 bytes from the original offset with "UD" (unsigned double word) event.offsetmask(0x281C, 1,"UD","Batteryswitch") You don't really need to test the individual bit as only one bit is ever flipped - the entire offset value can only be 0 or 1. So you could also use the plain event.offset function like this and test the entire value (0 or 1): event.offset(0x281C,"UD","Batteryswitch") Paul
-
I don't know sorry, I've never used SODE before. You'll probably need to ask their support. It looks like they have a forum here: https://sode.12bpilot.ch/?forum=support Paul
-
There's no way that I know of. FSUIPC cannot change any scenery objects. Its main use it to get real-time data out of the flight sim and control the aircraft systems. Paul
-
Writing in one Payload Station
Paul Henty replied to alancordez's topic in FSUIPC Client DLL for .NET
Hi Patrick, You can search for a PayloadStation by name using the Find() method: private void btnSendData_Click(object sender, RoutedEventArgs e) { FSUIPCConnection.PayloadServices.RefreshData(); // Assign the payload stations to our class level variable for easier access this.payloadStations = FSUIPCConnection.PayloadServices.PayloadStations; //Assigning only one Cabin // Find PayloadStation by name (NOTE: The matching is case-sensitive) FsPayloadStation CabOA = this.payloadStations.Find(ps => ps.Name == "CAB OA"); if (CabOA != null) { // Payload station found double newWeightKGs = 0; if (double.TryParse(txtboxCabOa.Text, out newWeightKGs)) { CabOA.WeightKgs = newWeightKGs; } } FSUIPCConnection.PayloadServices.WriteChanges(); } Paul -
Writing in only one specific tank
Paul Henty replied to alancordez's topic in FSUIPC Client DLL for .NET
Hi Patrick, There are a few problems I can see. I've marked the corrected code to match the numbered points below: 1. Before you change any payload/fuel data you need to read the current payload/fuel state. 2. Your code never assigns the variable 'this.fuelTanks' to anything. It's always null. There's no need to have this variable. 3. 'tankControl' is specific to my example application. Instead you need to use one of the FSFuelTanks enum values. 4. You can't use the text in the textbox as a number. It's a string. You need to manually convert (parse) it to a number type (in this case double). Here's the corrected code: private void btnWrite_Click(object sender, RoutedEventArgs e) { // Get reference to save typing PayloadServices ps = FSUIPCConnection.PayloadServices; // Get latest values (1) ps.RefreshData(); // Get the centre tank (3) FsFuelTank centreMainTank = ps.FuelTanks[FSFuelTanks.Centre_Main]; // Convert the text (string) in the textbox to a number (double) (4) double newWeightKGs = 0; if (double.TryParse(txtboxCenterTank.Text, out newWeightKGs)) { // Number converted okay // Assign new value to the fuel tank weight centreMainTank.WeightKgs = newWeightKGs; } // Change more fueltanks here.... // Write any changes to the sim ps.WriteChanges(); } Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
Hi Robert, The diagram makes things much clearer. You could achieve this without using my DLL. If your main application is in C++ and you're using SimConnect there doesn't seem to be any reason to use a .NET DLL. You can use SimConnect to get data from MSFS. (Instead of FSUIPC Offsets). You can also talk to the FSUIPC WASM Module directly from C++. Check the download on the FSUIPC website called "FSUIPC WASM Module 1.0.2 + WAPI 1.0.2". That includes all the C++ libraries/examples you need. http://fsuipc.com That would seem much simpler to me. Only one language, one fewer component, no communication layer between C++ and the VB component, and no .NET runtime. The WASM will handle the L:Vars (XML Vars) and the SimConnect will handle Events and SimVars. Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
No, my DLL can't process SimConnect Events. It doesn't use SimConnect. The Offsets are how FSUIPC handles data. These mainly map to what I think SimConnect calls "SimVars". There is another, separate example project for the MSFSVariableServices. Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
Looking at that link it would seem the XML Vars are L: vars. Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
The MSFSVariableServices in my DLL uses FSUIPC WASM Module. (You could also use C++ if you want to roll your own implementation). MSFSVariableServices allows you to execute calculator code. Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
Not sure. They usually have the L: prefix, so these might be something different. I've not heard of XML variables and I don't know how you can read them. Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
If you mean local panel variables (or L:Vars) you can use my DLL. For all sims you can use use: FSUIPCConnection.ReadLVar() For MSFS you can also use the MSFSVariableServices class. This also allows you to set H:Vars as well. This is more complicated, but is thousands of times faster than ReadLVar(). There is an example project dedicated to MSFSVariableServices on the website... http://fsuipc.paulhenty.com/#downloads Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
Ah brilliant! Glad it's working. That was an obscure problem. Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
Yes that looks to be what the problem is. It's going for the 32 bit files not the 64 bit ones. Look for the Path variable in the System list (not the user list). You should see them there... Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
Hmm.. Your dotnet --info is clearly saying there are no .NET SDKs installed. So something has gone wrong. The only thing I can suggest now is to download and manually install the .NET Visual Studio SDK from Microsoft: https://dotnet.microsoft.com/en-us/download/visual-studio-sdks You need the .NET 6.0 Visual Studio 2022 SDK - either x86 or x64 depending on your machine. Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
Go to the individual components tab and check you have NET SDK checked: That seems to be the part you're missing. Are you on Windows 10/11? Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
Strange. Seems like something very wrong with your .NET/Visual Studio installation. What does your dotnet --info say now? What version of Windows are you using? Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
Try this: Just unzip it and open the .sln. KK2023_FSUIPCforNET.zip Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
One last suggestion I have is to go back to the developer command prompt (as admin) and run this: devenv /InstallVSTemplates Then open Visual Studio and try again. If that doesn't work I'll just create a new project from that template here and sent it to you. That's probably the simplest thing. Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET
Okay - that's some progress. Are my templates still giving the same error? Paul -
NuGet is not automatically downloading DLL?
Paul Henty replied to Demon's topic in FSUIPC Client DLL for .NET