Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Timer

Questions and comments specific to a particular plugin should go here.
manjh
Posts: 41
Joined: Thu Mar 12, 2009 11:14 am

Re: Timer

Post by manjh »

krambriw wrote:Search for "Scheduler"....or "SunTracker" in this forum if you would like to involve the sun status as condition

BestR Walter
I've got Suntracker, but it is not what I'm looking for. The sun is not really a variable in my switching, the day of week is... I know Suntracker can do that as well, but it gets complicated to use Suntracker without making use of sunsets.
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Timer

Post by Bartman »

I changed the Timer plugin to use EventGhost's internal scheduler.
Nothing has changed to the user but there should be less use of resources use and less potential for threading errors.
The old version also was imprecise as the processing time was taken account for the next interval (also this should be only milliseconds).

I would appreciate if some users could test the new version
http://www.eventghost.org/svn/trunk/plu ... _init__.py
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Timer

Post by krambriw »

Hi Bartman,
I just renamed your new plugin to Timer2 to allow to have the old one as well

However, you have missed to insert revision information, therefore this crash

Code: Select all

16:41:29   Error while loading plugin-file Timer2.
16:41:29   Traceback (most recent call last) (1016):
16:41:29     File "C:\Program Files\EventGhost\eg\Classes\PluginManager.py", line 178, in LoadPluginInfo
16:41:29     File "C:\Program Files\EventGhost\eg\Classes\PluginInfo.py", line 116, in ImportPlugin
16:41:29     File "C:\Program Files\EventGhost\plugins\Timer2\__init__.py", line 5, in <module>
16:41:29   IndexError: list index out of range

If you change line 5 to something similar like below it loads/compiles correctly

Code: Select all

    version = "1.0." + "$LastChangedRevision 000 $".split()[1],
Next step will be some testing...

Best regards, Walter
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Timer

Post by Bartman »

Thanks for testing.
I guess the automatic replacement only works when doing a checkout with a SVN client but when viewing via web server.
Do you use the Timer plugin intensivly?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Timer

Post by krambriw »

My current test has been running flawless over night since yesterday

Both timer types (your new (t1) and your old (t2)) triggering every 5th second

No problem detected. Stable memory usage. CPU load 0%

Best regards, Walter

Code: Select all

07:33:57   Timer.t110650 (10650, '2009-08-11 07:33:57')
07:34:00   Timer.t210633 (10633, '2009-08-11 07:34:00')
07:34:02   Timer.t110651 (10651, '2009-08-11 07:34:02')
07:34:05   Timer.t210634 (10634, '2009-08-11 07:34:05')
07:34:07   Timer.t110652 (10652, '2009-08-11 07:34:07')
07:34:10   Timer.t210635 (10635, '2009-08-11 07:34:10')
07:34:12   Timer.t110653 (10653, '2009-08-11 07:34:12')
07:34:15   Timer.t210636 (10636, '2009-08-11 07:34:15')
07:34:17   Timer.t110654 (10654, '2009-08-11 07:34:17')
07:34:20   Timer.t210637 (10637, '2009-08-11 07:34:20')
07:34:22   Timer.t110655 (10655, '2009-08-11 07:34:22')
07:34:25   Timer.t210638 (10638, '2009-08-11 07:34:25')
07:34:27   Timer.t110656 (10656, '2009-08-11 07:34:27')
07:34:30   Timer.t210639 (10639, '2009-08-11 07:34:30')
07:34:32   Timer.t110657 (10657, '2009-08-11 07:34:32')
07:34:35   Timer.t210640 (10640, '2009-08-11 07:34:35')
07:34:37   Timer.t110658 (10658, '2009-08-11 07:34:37')
07:34:40   Timer.t210641 (10641, '2009-08-11 07:34:40')
07:34:42   Timer.t110659 (10659, '2009-08-11 07:34:42')
07:34:45   Timer.t210642 (10642, '2009-08-11 07:34:45')
07:34:47   Timer.t110660 (10660, '2009-08-11 07:34:47')
07:34:50   Timer.t210643 (10643, '2009-08-11 07:34:50')
07:34:52   Timer.t110661 (10661, '2009-08-11 07:34:52')
07:34:55   Timer.t210644 (10644, '2009-08-11 07:34:55')
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Timer

Post by krambriw »

Still working without problem
vicx
Posts: 13
Joined: Sun Sep 06, 2009 11:34 am

Re: Timer

Post by vicx »

I just used this plugin instead of the original timer plug.

I prefer this one.
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Timer

Post by Bartman »

vicx wrote:I just used this plugin instead of the original timer plug.
I prefer this one.
This is the original timer plugin. It is already included in the current betas .
LanceDrolet
Posts: 10
Joined: Mon Apr 02, 2007 7:58 pm

Re: Timer

Post by LanceDrolet »

Is there a way to pass variables to the payload of the triggered event?

I'm trying to run a "convert-to-mpg" program when Vista Media Center records a show, but I have to wait until the show is done recording before converting it. So, I'm using directory watcher to see when a 'dvr-ms' file is created. I then want to wait a safe time and trigger an event that starts the converter. So, I have to pass the file location and destination to the event-handler (script) that runs the converter.

Is this possible?


Thanks!
manjh
Posts: 41
Joined: Thu Mar 12, 2009 11:14 am

Re: Timer

Post by manjh »

LanceDrolet wrote:Is there a way to pass variables to the payload of the triggered event?

I'm trying to run a "convert-to-mpg" program when Vista Media Center records a show, but I have to wait until the show is done recording before converting it. So, I'm using directory watcher to see when a 'dvr-ms' file is created. I then want to wait a safe time and trigger an event that starts the converter. So, I have to pass the file location and destination to the event-handler (script) that runs the converter.

Is this possible?


Thanks!
I assume there will only be one file to convert at any given time. Could you store the file location into a fixed named/location file? The conversion program can then be triggered without any parameter, since it will always look in that file to find the information about the file to be converted.
LanceDrolet
Posts: 10
Joined: Mon Apr 02, 2007 7:58 pm

Re: Timer

Post by LanceDrolet »

manjh wrote: I assume there will only be one file to convert at any given time. Could you store the file location into a fixed named/location file? The conversion program can then be triggered without any parameter, since it will always look in that file to find the information about the file to be converted.
No, there are many times when we record two or more TV shows at once (often with overlapping start/stop times). Otherwise, I'd just store the locations as eg.global variables.
LanceDrolet
Posts: 10
Joined: Mon Apr 02, 2007 7:58 pm

Re: Timer

Post by LanceDrolet »

Ok, I figured out a work-around. I can embed the variables in event name.

in my case, it will be something like

Timer.inputFile;outputDest.convert

Then I just trigger the conversion with any "convert" event... then in the event-handler, parse the event.suffix to get at what I need. Quick and dirty, but it'll get the job done.
LanceDrolet
Posts: 10
Joined: Mon Apr 02, 2007 7:58 pm

Re: Timer

Post by LanceDrolet »

Ok then... apparently, you can only use one timer at a time... Oh well, I guess I can just save the file info to a list in eg.globals and set a timer to run through the whole list in the middle of the night.
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Timer

Post by Bartman »

You can use as many timers as you like.
LanceDrolet
Posts: 10
Joined: Mon Apr 02, 2007 7:58 pm

Re: Timer

Post by LanceDrolet »

Bartman wrote:You can use as many timers as you like.
Guess I misspoke... you are only allowed to use one instance of the each timer... as it says in the GUI..."Currently running timer with the same name will be aborted"...

No worries, though... I found a solution to my problem.

Thanks.
Post Reply