I did it!!!

Keep up to date with EG related information here.
User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

I did it!!!

Post by kgschlosser » Fri Jul 14, 2017 4:39 am

Holy cow. I finally did it. and it works properly. still have some GUI tinkering to do. But I got every event to run in it's own thread without error and also without breaking a single bit of the EG API. everything functions like it should it works with plugins just as they are.

WAHOO!!!!!

This is some really cool stuff.

There was some serious modifications to the log because if multiple events are running at the same time one single log was going to get awfully messy because nothing would be in order. so what i did was I made it so that only stuff that runs in the main thread will get printed out in the main log. any debugging message relating to the core of EG as well as events that get triggered. so if you double click on the event it will expand it to show all of the log message that are for that event. and it moves with the log window if you scroll it. but it's a wee bit out of alignment and it also doesn't shuffle the events out of the way it covers over them. so these things I have to fix. I will probably end up writing a whole custom widget for this because it's going to get complicated to make it work properly.

But i cannot believe i finally got it to work properly with keeping the API 100% in tact. I am so stoked!
If you like the work I have been doing then feel free to Image

Diz
Experienced User
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: I did it!!!

Post by Diz » Fri Jul 14, 2017 4:47 am

congrats! sounds good :)

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: I did it!!!

Post by kgschlosser » Fri Jul 14, 2017 7:49 am

I have the alignment correct now in the log. but dumbass wx had to go and use a native windows control for the list control (that is the control that is used for the log) and because it is a native list control it doesn't give events when you scroll it. Now i got past the mouse wheel. but I am going to have to do some hocus pocus to get everything to work with the scroll bar. because it doesn't even give mouse events if the mouse is over the bar either. that is something I may have to use pyHook for set a binder for the left mouse click grab the position the mouse is at when the click takes place. do some calculations to provide a location of the scroll bar and if the position is over the bar then to "capture" the mouse movements and update the log and when the left button is released then to "un capture" the mouse movements and do one final update to the log. just another step that I will have to take. and there is one other glitch i have to iron out just trying to figure out how I am going to go about it.

But if there is anyone that wants to check it out I can do a build and they can give it a try as it is now and let me know if they come across any issues.. That would be a huge help. then I am going to have to try and remember what I changed and move everything over to a newer version of EG LOL
If you like the work I have been doing then feel free to Image

Diz
Experienced User
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: I did it!!!

Post by Diz » Fri Jul 14, 2017 1:31 pm

i can certainly give it try :wink:

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: I did it!!!

Post by kgschlosser » Fri Jul 14, 2017 2:31 pm

it's gonna be glitchy I am sure. but give me a few hours to tidy it up some more and get a build for it (i don't even know if it will build properly :shock: )
If you like the work I have been doing then feel free to Image

User avatar
Sem;colon
Plugin Developer
Posts: 731
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: I did it!!!

Post by Sem;colon » Fri Jul 14, 2017 2:40 pm

WOW, respect mate, I'm impressed!

I need to check it out! ;-)
If you like my work, Image me a drink :wink:

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: I did it!!!

Post by kgschlosser » Fri Jul 14, 2017 8:06 pm

Please make sure before using this you make a backup of your existing Eventghost and Config and save file also user plugins. I do not want to hear someone bitch that it screwed their EG up. this is pre Alpha test run. There are going to be problems with it.

ok so here goes..

I know of 2 glitches in the log. the first is if the event is at the bottom it won't open properly.. I know it. and also the scroll bar on the right will not move an event log properly. but the mouse scroll wheel works just fine

so here is the low down on the log changes..


You will no longer see anything other then events/plugins/Autostart in the main log. unless whatever it is that is being printed out is being done so from the main thread. so if you have debugging turned on you will see debugging messages in there that were printed from the main thread. any debugging message that get printed while an event is running will get printed to that events log. any macros/actions that are run will be printed to the events log.

this is an old version of EG so there are going to be some bugs or things that might not have been added in this version compared to rc3. this is for pure testing and running of the multi threaded events.

If you happen to come across an error. please me kind and post as much information as possible. Oh and one thing there is going to be a bunch of numbers that print off into the debugging log. do not mind this i simply forgot to remove them. I was trying to figure out what was causing EG to hang and not print out anything in the log LOL..

It did compile and pass appveyor build tests which is a good thing so here is the setup file.
https://ci.appveyor.com/api/buildjobs/f ... _Setup.exe
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: I did it!!!

Post by kgschlosser » Sat Jul 15, 2017 8:13 am

OK I have gotten the EG version up to the minute.

I have also sorted out all but the scroll bar with how the event log works.
remember by double clicking on an event that is what opens the log for that event.

The clear log works kinda cool. you can clear the log for a specific event, or clear the main log and leave the event logs in tact or you can clear all of the logs.

You will have to try it to see how the whole logging turned out. I think it's a good way to get it done with as minimal a UI change as possible.

TODO:
Finish up being able to delete an event from the tree
Finish the event registration from the plugins.
Add the caching for dynamically created events with option to delete if the plugin is removed.
Add fnmatch for wild carding the events.
Modify the add event dialog to use the new style of storing events
Get the bloody scroll bar to work right

I think that is really all that is left.

But here is the link to the new version

https://ci.appveyor.com/api/buildjobs/0 ... _Setup.exe
If you like the work I have been doing then feel free to Image

Diz
Experienced User
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: I did it!!!

Post by Diz » Sat Jul 15, 2017 3:26 pm

ok... so... bit weird! with the keyboard plugin running every time i press any key i get this error:

16:22:59 Traceback (most recent call last) (WIP-2017.07.15-08.04.28):
16:22:59 File "D:\Automation\EventGhost\plugins\Keyboard\__init__.py", line 97, in KeyboardCallback
16:22:59 return HasActiveHandler("Keyboard." + codes)
16:22:59 File "D:\Automation\EventGhost\eg\Core.py", line 173, in HasActiveHandler
16:22:59 for eventHandler in eg.eventTable.get(eventstring, []):
16:22:59 File "D:\Automation\EventGhost\eg\__init__.py", line 51, in __getattr__
16:22:59 mod = __import__("eg.Classes." + name, None, None, [name], 0)
16:22:59 ImportError: No module named eventTable

but the key events still work after the error!

Diz
Experienced User
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: I did it!!!

Post by Diz » Sat Jul 15, 2017 3:54 pm

so i think i fixed the issue in my last post by adding the following line in 'eg/core.py':

eg.eventTable = {}

thats the line taken from the rc3 version of the file where there was no problems.

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: I did it!!!

Post by kgschlosser » Sat Jul 15, 2017 4:20 pm

nope you didn't because the event table no longer exists.

I have to fix the issue in the call to HasActiveHandler in Core.py and remove the use of the eventTable and get the EventManager to do the job instead.

Or make it so that the eventTable is a pointer to an object that represents a dictionary and can properly format the data stored in the EventManager into the old style table I am not sure which one would be the best solution. it all depends on of there are any plugins that directly access the eventTable.

The API being 100% compatible is for a standard type of plugin that does not directly access any of the "not so public" attributes.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: I did it!!!

Post by kgschlosser » Sat Jul 15, 2017 4:24 pm

I made the necessary changes to the HasActiveHandler this should fix the issue.

replace your Core.py with the one that is attached
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: I did it!!!

Post by kgschlosser » Sat Jul 15, 2017 9:06 pm

well something had to rain on my parade.

That stupid scroll bar. even pyHook doesn't work. So I guess I am going to have to create a custom control. That should be fun. I am trying to decide if i should draw the whole thing or if i should use static text controls to do the work.


But as an update here is a link to a newer version that fixes the deleting of an event as well as an error with the keyboard plugin so here is the link

https://ci.appveyor.com/api/buildjobs/6 ... _Setup.exe
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: I did it!!!

Post by kgschlosser » Sun Jul 16, 2017 5:00 am

OK I finally got the scroll bar working. YAY!!!

I think that wraps up the logging. Now to focus my attention to the add event dialog.

but here is a link the the latest version.

https://ci.appveyor.com/api/buildjobs/l ... _Setup.exe
If you like the work I have been doing then feel free to Image

Diz
Experienced User
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: I did it!!!

Post by Diz » Sun Jul 16, 2017 2:51 pm

sometimes, seemingly random, i get a whole lotta errors the first time i run eg:

15:44:29 Unhandled exception in WorkerThread <ActionThread>:
15:44:29 Callers stack:
15:44:29 File "threading.pyc", line 774, in __bootstrap
15:44:29 File "threading.pyc", line 801, in __bootstrap_inner
15:44:29 File "threading.pyc", line 754, in run
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 280, in __MainLoop
15:44:29 self.__DoOneEvent()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 269, in __DoOneEvent
15:44:29 eg.PrintTraceback()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 140, in HandleAction
15:44:29 action()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\Event\EventThread.py", line 116, in Transfer
15:44:29 event.SetShouldEnd()
15:44:29 Traceback (most recent call last) (WIP-2017.07.16-04.58.18):
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 253, in __DoOneEvent
15:44:29 self.HandleAction(action)
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ActionThread.py", line 41, in HandleAction
15:44:29 action()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 324, in __call__
15:44:29 self.returnValue = self.func(*self.args, **self.kwargs)
15:44:29 File "D:\Automation\EventGhost\eg\Classes\Event\EventGhostEvent.py", line 38, in Execute
15:44:29 event.Execute(payload)
15:44:29 TypeError: Execute() takes no arguments (1 given)
15:44:29 Process.Created.devcon
15:44:29 Unhandled exception in WorkerThread <ActionThread>:
15:44:29 Callers stack:
15:44:29 File "threading.pyc", line 774, in __bootstrap
15:44:29 File "threading.pyc", line 801, in __bootstrap_inner
15:44:29 File "threading.pyc", line 754, in run
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 280, in __MainLoop
15:44:29 self.__DoOneEvent()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 269, in __DoOneEvent
15:44:29 eg.PrintTraceback()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 140, in HandleAction
15:44:29 action()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\Event\EventThread.py", line 116, in Transfer
15:44:29 event.SetShouldEnd()
15:44:29 Traceback (most recent call last) (WIP-2017.07.16-04.58.18):
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 253, in __DoOneEvent
15:44:29 self.HandleAction(action)
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ActionThread.py", line 41, in HandleAction
15:44:29 action()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 324, in __call__
15:44:29 self.returnValue = self.func(*self.args, **self.kwargs)
15:44:29 File "D:\Automation\EventGhost\eg\Classes\Event\EventGhostEvent.py", line 38, in Execute
15:44:29 event.Execute(payload)
15:44:29 TypeError: Execute() takes no arguments (1 given)
15:44:29 Unhandled exception in WorkerThread <ActionThread>:
15:44:29 Callers stack:
15:44:29 File "threading.pyc", line 774, in __bootstrap
15:44:29 File "threading.pyc", line 801, in __bootstrap_inner
15:44:29 File "threading.pyc", line 754, in run
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 280, in __MainLoop
15:44:29 self.__DoOneEvent()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 269, in __DoOneEvent
15:44:29 eg.PrintTraceback()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 140, in HandleAction
15:44:29 action()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\Event\EventThread.py", line 116, in Transfer
15:44:29 event.SetShouldEnd()
15:44:29 Traceback (most recent call last) (WIP-2017.07.16-04.58.18):
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 253, in __DoOneEvent
15:44:29 self.HandleAction(action)
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ActionThread.py", line 41, in HandleAction
15:44:29 action()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 324, in __call__
15:44:29 self.returnValue = self.func(*self.args, **self.kwargs)
15:44:29 File "D:\Automation\EventGhost\eg\Classes\Event\EventGhostEvent.py", line 38, in Execute
15:44:29 event.Execute(payload)
15:44:29 TypeError: Execute() takes no arguments (1 given)
15:44:29 Process.Destroyed.devcon
15:44:29 Unhandled exception in WorkerThread <ActionThread>:
15:44:29 Callers stack:
15:44:29 File "threading.pyc", line 774, in __bootstrap
15:44:29 File "threading.pyc", line 801, in __bootstrap_inner
15:44:29 File "threading.pyc", line 754, in run
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 280, in __MainLoop
15:44:29 self.__DoOneEvent()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 269, in __DoOneEvent
15:44:29 eg.PrintTraceback()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 140, in HandleAction
15:44:29 action()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\Event\EventThread.py", line 116, in Transfer
15:44:29 event.SetShouldEnd()
15:44:29 Traceback (most recent call last) (WIP-2017.07.16-04.58.18):
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 253, in __DoOneEvent
15:44:29 self.HandleAction(action)
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ActionThread.py", line 41, in HandleAction
15:44:29 action()
15:44:29 File "D:\Automation\EventGhost\eg\Classes\ThreadWorker.py", line 324, in __call__
15:44:29 self.returnValue = self.func(*self.args, **self.kwargs)
15:44:29 File "D:\Automation\EventGhost\eg\Classes\Event\EventGhostEvent.py", line 38, in Execute
15:44:29 event.Execute(payload)
15:44:29 TypeError: Execute() takes no arguments (1 given)

when it does do this ive just being clicking restart from the menu and then it seems to work normaly.

also, probably unrelated to the above issue because it happens on rc3 too, the file 'plugins\task\taskhook.dll' is always locked when i try to delete/overwrite it and i have to use a file unlocker on it.

Post Reply