Author Topic: delay secenario or ruby-code more than 20sec  (Read 2571 times)

toko

  • Regular Poster
  • **
  • Posts: 30
    • View Profile
delay secenario or ruby-code more than 20sec
« on: February 23, 2008, 05:05:27 pm »
what I want to get as result:
put GO status for channel 1 via GSD -> wait 60sec -> remove the GO status from channel 1

I control blinds via GSD and ruby-codes. When I click DOWN ("go" status is set) function it starts moving downl the blinds but this task needs about 1min. time. So what I want is to give the command DOWN, wait 60sec and then call STOP ("go" status is set to off) function.

problem:
I can use ruby function "sleep 60" but from linuxmce there's timeout of 20sec and then I get in my logs something like
Quote
Ruby was unable to handle the command in reasonable amount of time

how can I handle that - is there any function in scenario-edit I could use (I put it under lightning-scenario)?
can I increase the ruby timeout to 2 min. maybe manually... where?

Thank You!
thomas

bulek

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 909
  • Living with LMCE
    • View Profile
Re: delay secenario or ruby-code more than 20sec
« Reply #1 on: February 23, 2008, 08:10:36 pm »
Hi,

you can also register and run Ruby program outside GSD mechanism. You can register with DCERouter through 2 tcp ports and then it's all up to you what to do and when to do ....

http://wiki.linuxmce.org/index.php/Message_Interceptors
http://wiki.linuxmce.org/index.php/Plain_Text_DCE_Messages

HTH,

regards,

Bulek.
Thanks in advance,

regards,

Bulek.

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: delay secenario or ruby-code more than 20sec
« Reply #2 on: February 23, 2008, 09:14:04 pm »
Toko,
create yourself a Global variable to hold the time.  Don't sleep, as you need to return control back to linuxmce.

Then , in Process IDLE, you can compare that global time variable with the current time...
and stop it when it gets close to 60 seconds..

The Process IDLE command is fired at your code about every 3-4 seconds.  I use that to check for timeouts.

HTH, and good luck!

Dan
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.