Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lot's of None values received #59

Closed
viboux opened this issue Oct 24, 2020 · 3 comments
Closed

Lot's of None values received #59

viboux opened this issue Oct 24, 2020 · 3 comments

Comments

@viboux
Copy link

viboux commented Oct 24, 2020

Very nice package, the glass cockpit demo is great, however I cannot get it to work with both the local_exemple.py and glass_server. I am getting a lot of None values returned from aq.get. I am using MSFS 2020 version 1.9.5.0 and SimConnect 0.6.1 DLL (as present in the branch).

Have you experienced any of this?

  File "C:\Dev\python\simconnect\Python-SimConnect-master\glass_server.py", line 307, in output_ui_variables
    fuel_percentage = (aq.get("FUEL_TOTAL_QUANTITY") / aq.get("FUEL_TOTAL_CAPACITY")) * 100
TypeError: unsupported operand type(s) for /: 'NoneType' and 'NoneType'

Or in some local_example.py fiddling.

Throttle = aq.find('GENERAL_ENG_THROTTLE_LEVER_POSITION:1')
altitude_f = aq.find("PLANE_ALTITUDE")
altitude_f.time = 200
while not sm.quit:
	print("Throttle:", Throttle.value)
	#altitude = aq.get("PLANE_ALTITUDE")
	
	#print ("Altitude:", altitude)
	print("Altitude_f:", altitude_f.value)
	sleep(2)

Altitude_f: 1175.8360727116944
Throttle: 0.0
Altitude_f: None
Throttle: 0.0
Altitude_f: None
Throttle: 0.0
Altitude_f: 1175.8360727116944
Throttle: 0.0
Altitude_f: None
Throttle: 0.0
Altitude_f: 1175.8360727116944
Throttle: 0.0
Altitude_f: None
Throttle: 0.0
Altitude_f: None
Throttle: 0.0
Altitude_f: 1175.8360727116944
@odwdinc
Copy link
Owner

odwdinc commented Oct 24, 2020

yah its a problem with performance,
I have set the defaults to use 10 _attemps in 0.4.19
this should fix.
you can play more with the _attemps in

def __init__(self, _sm, _time=10, _attemps=10):

aq = AircraftRequests(sm, _time=10, _attemps=10)

@viboux
Copy link
Author

viboux commented Oct 24, 2020

Thanks! Works lot better, both for local_example and glass_server. SimConnect seems to be very fiddly from what I see from many 3rd party addons sites.

I will let you know about any strange behaviour I encouter.

Thanks again!

@odwdinc
Copy link
Owner

odwdinc commented Oct 24, 2020

Yep the SDK is "working" at best, not a lot of support on the SimConnect.

I'm working on asyncio, should help with performance as well, #60

@odwdinc odwdinc closed this as completed Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants