Git Product home page Git Product logo

Comments (7)

Koseng avatar Koseng commented on August 11, 2024

Hi,
you're right it always returns 0 at first, which makes it quite useless for a single read.
I made changes to fix it, but it is tricky because the Mobiflight WASM also returns 0 in its first callback.
Try the new main and please give feedback whether that works well for you:
https://github.com/Koseng/MSFSPythonSimConnectMobiFlightExtension/blob/main/src/mobiflight_variable_requests.py

And thanks for your work on FlyByWire!

from msfspythonsimconnectmobiflightextension.

Koseng avatar Koseng commented on August 11, 2024

Wait with testing, at the moment it will work only starting with second run of the python client application. The callbacks behave differently whether the simconnect shared memory was in its initial state or whether it already was used in the past. I need to think whether there is a solution.

from msfspythonsimconnectmobiflightextension.

Taz5150 avatar Taz5150 commented on August 11, 2024

Wait with testing, at the moment it will work only starting with second run of the python client application. The callbacks behave differently whether the simconnect shared memory was in its initial state or whether it already was used in the past. I need to think whether there is a solution.

Thank you! I'll wait then for a potential solution.

And by the way, thank you for the alternative of working with LVars through Python. :)

from msfspythonsimconnectmobiflightextension.

Koseng avatar Koseng commented on August 11, 2024

Should work now. Please try and give feedback.
https://github.com/Koseng/MSFSPythonSimConnectMobiFlightExtension/blob/main/src/mobiflight_variable_requests.py

from msfspythonsimconnectmobiflightextension.

Taz5150 avatar Taz5150 commented on August 11, 2024

Should work now. Please try and give feedback. https://github.com/Koseng/MSFSPythonSimConnectMobiFlightExtension/blob/main/src/mobiflight_variable_requests.py

Hey! It works great now! I tried with continuously updated variables, such as EGT or N1 and works like a charm. The only thing I need to check is why I get the following exception:

WARNING:SimConnect.SimConnect:SIMCONNECT_EXCEPTION_ALREADY_CREATED

My guess is because during test, I am calling SimConnectMobiFlight once and again ... but will check and let you know. No biggy!

Thank you!

from msfspythonsimconnectmobiflightextension.

Koseng avatar Koseng commented on August 11, 2024

Hi,
that warning can be ignored, it is all fine.

Details:
Creation of the shared memory areas between the WASM-Simconnect-Client and the Python-Simconnect-Client is done on both sides, to be sure whoever is first, not tries to access a non existing shared memory.

Usually the WASM-Simconnect-Client is first, therefore the ALREADY_CREATED warning on the Python side. Probably WASM is always first and it can be safely removed on the Python side. Initially I just did it the same way as the mobiflight client.

So if you want to get rid of the warning, just remove the 3 CreateClientData code lines similar to.
self.sm.dll.CreateClientData(self.sm.hSimConnect, self.CLIENT_DATA_AREA_LVARS, 4096, self.FLAG_DEFAULT)

from msfspythonsimconnectmobiflightextension.

Taz5150 avatar Taz5150 commented on August 11, 2024

Hi, that warning can be ignored, it is all fine.

Details: Creation of the shared memory areas between the WASM-Simconnect-Client and the Python-Simconnect-Client is done on both sides, to be sure whoever is first, not tries to access a non existing shared memory.

Usually the WASM-Simconnect-Client is first, therefore the ALREADY_CREATED warning on the Python side. Probably WASM is always first and it can be safely removed on the Python side. Initially I just did it the same way as the mobiflight client.

So if you want to get rid of the warning, just remove the 3 CreateClientData code lines similar to. self.sm.dll.CreateClientData(self.sm.hSimConnect, self.CLIENT_DATA_AREA_LVARS, 4096, self.FLAG_DEFAULT)

Understood, thank you so much.

from msfspythonsimconnectmobiflightextension.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.