WhiteMagic / JoystickGremlin

A tool for configuring and managing joystick devices.
http://whitemagic.github.io/JoystickGremlin/
GNU General Public License v3.0
316 stars 46 forks source link

Tempo container assumes first activation to occur with a "press" action which is not necessarily true #303

Open danw-eth opened 4 years ago

danw-eth commented 4 years ago

-Option is ON to "Automatically load profile based on current application" -Setup a tempo on X52 button 31 -Tested in input viewer, no problem -Opened DCS and assign the short press (X52 button 31: VJoy button 11) to a setting in DCS and the error happens. -Reboot and try again -Same error

-Switch to manual loading of the profile, without rebooting again and the problem suddenly stops. Everything works. -Switch back to automatic loading of the profile and error stops for a little while and then comes back

Screenshot, log, profile, and Gremlin folder: GremlinVJoyBug.zip

danw-eth commented 4 years ago

UPDATE: Manual loading of the profile is not a fix, now there is a different error that doesn't mention VJoy: 2020-06-30 09:58:14 ERROR Uncaught exception: Traceback (most recent call last): File "gremlin\event_handler.py", line 489, in process_event File "gremlin\execution_graph.py", line 76, in call File "gremlin\execution_graph.py", line 172, in process_event File "container_plugins\tempo__init__.py", line 257, in process_event self.timer.cancel() AttributeError: 'NoneType' object has no attribute 'cancel'

system.log

WhiteMagic commented 4 years ago

Is that button a switch or a button that can start out in the "pressed" position? There is an assumption in the code that the first time the tempo container is activated will be with a "press" event. In your case that doesn't seem to be the case and causes the whole thing to crash because an object that would normally exist doesn't yet.

This is a general issue but it seems you're the first that ran into it and reported it so I'll have to fix the container code itself to not make this assumption. Sadly there isn't really any workaround for this.

danw-eth commented 4 years ago

It's just a normal button, it's not pressed until I try to assign it in DCS settings. However there are other "virtual buttons" on various axis that may already be pressed depending on where the axis is, if that makes a difference (or it may be possible I've accidentally used a button twice).

Or are you referring to the setting in TEMPO container is for "pressed" or "released"?

WhiteMagic commented 4 years ago

Other conditions etc. should not impact anything as different actions are completely independent of each other. I actually quickly tried to produce an error by doing what I though was the cause, however, that didn't end up working out. Do you get the same issue to occurr when you create a completely fresh profile with just the tempo container? And if so does that happen independent of the input you use or is it specific to that particular input?

danw-eth commented 4 years ago

I created a fresh profile and tried it, and it doesn't cause the error. However it's not conclusive because if I use tempo with my original profile it doesn't cause the error now too. It happens only "sometimes" but I don't know why..

WhiteMagic commented 4 years ago

That's definitely odd, I played around a bit with what I thought would be the cause but that didn't trigger the issue. The code definitely could be changed to not bail when this situation arises but that just covers the root cause. I'll probably do that at a minimu m when reimplementing the thing. If you encouter the issue again and figure out a method to the madness let me know.

danw-eth commented 4 years ago

Thanks, will do. When I get around to setting up the A-10C it will probably come up, the A-10 has alot of tempo commands on its HOTAS

samche2000 commented 7 months ago

Hello,

I have exactly the same error popup when i use this configuration :

2024-03-24 17_37_21-VPC Joystick Tester Tool  v20230213

The config is :

This bug occurs immediately after pressing the button in input viewer or any software.