this is going to be a really easy thing to use. this is basically what it would look like.
EG does all of the crazy mechanics to properly return the event you are asking for.
these are the attributes that are event specific so EG is able to do the back end magic to get the proper information return to you
eg.event
eg.eventString
eg.programReturnStack
eg.programCounter
eg.result
eg.indent
eg.stopExecutionFlag
eg.lastFoundWindows
eg.currentItem
these are new
eg.event.stop - tells you if you can keep on looping or not. and also allows you to stop a loop
eg.event.Wait - causes the event to wait inside of a loop. this is not a sleep it is a non blocking form of waiting
eg.event.colour - you can set either a wxColour or a tuple (Red, Green, Blue) with a number between 0-255 for each color
eg.event.start_time - the time the this event started
eg.event.stop_time - the time the this event stopped
eg.event.run_time - how long this event ran for in milliseconds
any of the events can be accessed at any given point by doing
Code: Select all
event = eg.EventManager['Prefix.Suffix']
so as an example, if you wanted to stop a specific event that is running in a loop from another event that is running
Code: Select all
event = eg.EventManager['Prefix.Suffix']
event.stop = True
or if you wanted to have an event wait until a specific event has finished
Code: Select all
event = eg.EventManager['Prefix.Suffix']
event.Wait()
and this is what a a loop would look like
Code: Select all
# do opening code
while not eg.event.stop:
# do your looping code here
# if you need to wait
eg.event.Wait(1.0)
data = 'some data'
if data:
# do code that deal with data
some_function(data)
# to stop the loop this also gets set when EG closes
eg.event.stop = True
# do your closing code here
I have also changed the Wait action to use these mechanics so they are non blocking waits as well.
There is still a lot I have to finish up but it is coming together really really nice. it's going to really expand what EG can do. and the only thing I have found thus far that is not on the plus side of things is the ram use. it's 5 meg higher LOL. But I think it's worth it.
some of the above may change. but the really cool thing is that almost all existing plugins should work right out of the box (unless i missed something or they have some kind of an override in it that uses pieces of EG that are more along the lines of a private thing.). But think of all of the really cool threading actions we will be able to put into place. No more of blocking Enduring events to repeat a macro.. or EG not responding because something is taking a long time to process. I had 1000 events running at the same time. and it didn't crash. But the limit on the number of threads would be the amount of available memory. when running a 32 bit app on a 64 bit OS there is 1 meg set aside for the thread on the 32 bit side of things and 256k on the 64 bit side. so technically speaking the limit I think would be in the amount of physical free memory available. I may have to put into place something that checks this to make sure EG doesn't cause a not enough system resources message.