daheise / simrate_control

A 'set it and forget it' utility to increase and decrease sim rate while following a flight plan. Provides time compression while in stable flight.
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Feature request: listen for program exit #21

Closed ghost closed 3 years ago

ghost commented 3 years ago

Would it be possible to make the program exit (and reset to normal acceleration) on a simple keypress (maybe q), instead of having to terminate it with CTRL-C ? Granted it's very rare, but I encountered on two occasions that the sim rate did not get reset to 1 after terminating the process that way. I'd think that if it would explicitly listen for an exit command the sim rate reset could be guaranteed...

daheise commented 3 years ago

Did you have this issue with version 0.7? It’s supposed to be doing exactly this.

ghost commented 3 years ago

Ah apologies, I didn't know there was already a new release out (I only saw the commit for the nav_mode_guarded which hasn't been merged yet). Cool, so that's exactly what I was asking for, thanks!

On another note, I wanted to build the curses branch to try it out but I get

Unable to find "env\Lib\site-packages\SimConnect\SimConnect.dll" when adding binary and data files.

Is there a new build step that needs to be done? The old v0.6 always built fine for me...

daheise commented 3 years ago

I think the problem is in simrate_control.spec. I'm using a virtual environment locally and I think I made an undocumented assumption about where SimConnect.dll can be found. I'll look into making that more robust. Change the first element in the tuple below to point to your SimConnect.dll inside of the SimConnect python package.

binaries=[(SPECPATH + "/env/Lib/site-packages/SimConnect/SimConnect.dll", './SimConnect/')],

ghost commented 3 years ago

Replaced it with c:\Python38\Lib\site-packages\SimConnect\SimConnect.dll, and the build went through.

And it's working fine with the DC-6 when nav_mode_guarded is disabled! Love the new output screen as well. Awesome, thanks for picking this up again! Hope you can eventually find someone who builds a UI for it, I'd love to but I'm just a backend guy ;)

daheise commented 3 years ago

Glad it's working well for you!

I think I've resolved the SimConnect.dll search issue, so I'm going to go ahead and close this issue.