Jump to content
The simFlight Network Forums

Paul Henty

Members
  • Posts

    1,652
  • Joined

  • Days Won

    74

Everything posted by Paul Henty

  1. That's okay - it just filters the list of templates to VB only. Please can you try creating a project using the built-in template called "Windows Forms App" (Not the one with '.NET Framework' at the end). When it asks for the .NET version select NET 6.0. Make sure you can run it and get the blank form up. Let me know if that's okay. Paul
  2. The new templates are now on the website: http://fsuipc.paulhenty.com/#downloads They are for Visual Studio 2022 and target NET6 as that's the current version on Long Term Support. There's now an extra installation step: after you copy the files from the zip you need to run: devenv /updateconfiguration from the developer command prompt (as administrator). This will update the templates cache. Full instructions are on the download page. If you have Visual Studio 2022 installed you will also have the required NET6 development environment. That's all you need. Make a new project from the new templates and everything should work properly. Paul
  3. Hi Demon, I've just checked the templates. They were written 5 years ago so they're a bit out-of-date now. The main problem is that the templates target the .NET 4.0 framework, but the DLL stopped supporting that earlier this year. That's probably why NuGet isn't downloading it. I'll update them sometime this weekend to Visual Studio 2022, targeting .NET 6. I'll post back here when the new ones are on the website. Apologies for the issues. I forgot they'd still be on .NET 4. Paul
  4. Thanks for all the extra investigation. I managed to reproduce the problem here and I think I've tracked it down to a threading issue in the websocket server. Please try the attached and let me know how you get on. FSUIPCWebSocketServer_V1.1.2-Beta.zip Paul
  5. Hi Joe, I've tested the user interface here and I can't get it to throw that exception. Tried lots of reloads, lvar lists, running a client against it for 20mins etc. Does it happen every time you press reload? I also tested changing the Calc Code while it's running. Again no problems at all. I was able to send a new calc message with different code and it just executed the last one. e.g. {command: 'vars.calc',name: 'calc',code: '(L:ParkingBrake_Position) (>L:PJH)', interval: 200} then {command: 'vars.calc',name: 'calc',code: '(L:TAXI_LIGHTING_1) (>L:PJH)', interval: 200} then {command: 'vars.calc',name: 'calc',code: '222 (>L:PJH)', interval: 200} I'm not sure what's going on on your system, but I'm pretty sure the WebSocketServer code is not the problem. Paul
  6. I meant how to reproduce the exception you posted. From the call stack it looks like you pressed one of the buttons on the UI. Can you remember which one? Paul
  7. I'll look at that as well, but I need to know how to reproduce it. The call stack suggests it's after a button press. Which one? Paul
  8. Hi Joe, I'll check this tomorrow and see if I can reproduce the problem. I'll let you know what I find. Paul
  9. Version 3.3.6-beta is now on NuGet. You'll need to tick "Show Pre-Release" in the Nuget package manager to see it. Please try with this version and see if it fixes the exceptions. Paul
  10. HI Nabeel, It looks like a threading issue. It seems like my DLL is receiving simultaneous callbacks from the WASM library on different threads. It nothing to do with your code. John did change the WASM library to automatically report new LVar discoveries about two weeks ago. It could be related to that. I'll add some thread-safety to this part of my DLL tomorrow. Hopefully that will fix it. Paul
  11. I have access to MSFS for a month so I was able to try this here and it seems to work fine. Here is the code I ran in the Chrome console (I just modified yours to copy the parking brake into a custom LVar): function Sleep(milliseconds) { return new Promise(resolve => setTimeout(resolve, milliseconds)); }; let calccode = {command: 'vars.calc',name: 'calc',code: '(L:ParkingBrake_Position) (>L:PJH)', interval: 200} let declare = {command: "vars.declare",name: "myVarSet",changesOnly: true,vars: [{ name: "PJH" }]} let read = {command: "vars.read",name: "myVarSet",changesOnly: true, interval:200} let socket = new WebSocket("ws://localhost:2048/fsuipc/", "fsuipc"); socket.onopen = function(e) { socket.send(JSON.stringify(calccode)); Sleep(200); socket.send(JSON.stringify(declare)); Sleep(200); socket.send(JSON.stringify(read)); }; socket.onmessage = function(event) { console.log(`[message] Data received from server: ${event.data}`); }; socket.onclose = function(event) { if (event.wasClean) { console.log(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`); } else { console.log('[close] Connection died'); } }; socket.onerror = function(error) { console.log(`[error] ${error.message}`); }; If I change the parking brake the L:PJH variable gets reported as changed with the correct value. Ran fine for about 10 mins until I stopped it. Maybe you could try the same. If it works, it would suggest the problem is somewhere other than the socket server. Paul
  12. Yes, thanks. That narrows it down a bit. I'll look into it over the next few days and get back to you.
  13. That shouldn't be an issue. My dll detects the reload from the "fsuipcw_registerUpdateCallback" callback. Then it gets the new LVars list and re-registers all for callbacks (-1 parameter). Paul
  14. Can you monitor those LVars (A20N_L_TK_Pump_1_Off and A32NX_OVHD_INTLT_ANN) from somewhere else (e.g. The sim, John's WASM Client) and see if they are changing or not. I need to know if the calculator code is not updating them, or if my server is just not sending them to you. When did you get this? It look like you pressed a button on the UI. Can you rememeber which button? Paul
  15. Hi Peercat, There isn't a DisplayText() method unfortunately. You can display a message on the simulator screen using offsets 0x3380 and 0x32FA. (Both should have the Write-Only parameter set to True). Note however that this isn't working in MSFS (FSUIPC7). It does work in P3D and FSX. 1. Declare the offsets in a group (e.g. "message") private Offset<string> messageWrite = new Offset<string>("message", 0x3380, 128, true); private Offset<short> messageControl = new Offset<short>("message", 0x32FA, true); 2. Send a message string Message = "my message test"; this.messageWrite.Value = Message; this.messageControl.Value = 2; // Display for 2 seconds FSUIPCConnection.Process("message"); See the documentation about 0x32FA for the different values you can send for the messageControl. Paul
  16. I'm not sure how FSUIPC determines if the AI aircraft is airborne or on the ground. My dll just uses the two offsets provided (0xE000 for ground, 0xF000 for airborne). Maybe @John Dowsoncan give you more info about how FSUIPC populates these two areas. Paul
  17. Version 3.3.5 is now on NuGet. After updating you will need to rebuild the database to get the Airlines. Paul
  18. Hi Ruediger, I've just checked my code and it's not saving the airlines in the database. I'll get a new version out tomorrow with this fixed. Paul
  19. The WAPID.dll is dynamically loaded so the compiler can't check it. I have just gone through each function and checked all the signatures (and callback signatures) manually and everything is okay. According to GitHub the .h file hasn't changed for 5 months. There's obviously something behaving differently in the latest WAPID/WASMIF that's causing some issues directly, or causing my use of the WAPID.DLL to be a problem now. King: What version of the FSUIPC_WAPID.DLL were you using before? I think the next step would be to get the logs that John asked for to see if those can shed any light on this. Paul
  20. Hi, Which version of my DLL are you using? The WASM system and the old FSUIPC connection do not interact at all, so I'm not sure that closing the connection is the cause. You should stop the WAPI connection (MSFSVariableServices.Stop()) before you application (and therefore my DLL) gets unloaded. But the WAPI runs independently from the normal FSUIPC Connection and shouldn't be affected by opening/closing it. I can't test here as I don't have MSFS, but here are some suggestions: 1. Post the details of the event log error. @John Dowson might be able to tell the cause of the crash from that. 2. Enable the full logging (TRACE) in MSFSVariableServices. This might give some clues before it crashes. 3. Try running the MSFSVariableServices Example Application. You'll need to update the FSUIPC_WAPID.dll to the same one you're using, and update my DLL to the latest via NuGet. See if that has any problems. If it's fine, try adding code to open and close the normal FSUIPCConnection. Paul
  21. Version 3.3.4 is now on Nuget. FSUIPCConnection.AirportsDatabase.DatabaseFolder is now read/write. Set this property if you want to use a specific path for the internal database files, If you don't set a path it will use the default folder (%localappadata%\FSUIPCClientDLL). Paul
  22. Hi Ruediger, I'm almost certain there won't be any problem with this. Except for the Rebuild(), all the airports database functions open the files as read-only with shared access. However, at the moment the path to the internal database files is fixed and can't be changed (you'll find the DatabaseFolder property is read-only). You'll need this to be writable so you can set it to the folder on your network. I'll make this change and upload a new version in the next few days. Paul
  23. New websocket server is now available (Version 1,1,1): http://fsuipcwebsockets.paulhenty.com/ Uses new WAPI version 1.0.0 beta. vars.calc now has 'interval' property to request repeated execution of calculator code. Time in milliseconds. Stop the repeats with vars.stop command. (Use the same command name). Multiple code requests can be repeated by using unique command names. Paul
  24. Okay - I'll make the changes. I expect to have a new version out sometime next week. I'll also update to the new WAPI library that John is releasing. Paul
  25. Hi Joe, If your calculator code is updating the LVar then it must be run at regular intervals. The only question is *where' it's being run at regular intervals. It seems like you don't want to do it in your code as it will result in a lot of network traffic. Would it help if I enabled the 'interval' property for the 'vars.calc' command? The websocket server would then run the calc for you every x milliseconds. If you monitor the destination LVar with changesonly then you'll just get a message when the destination lvar changes. Let me know if that sounds like a useable solution. But before I do the work, please check that you can indeed write to a new LVar from the calc code and read the resulting value back. 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.