single-threaded execution / wait to finish (?)

Got an idea, post it here

single-threaded execution / wait to finish (?)

Postby dalanik on Mon Nov 15, 2004 11:56 am

One thing that's bothering me... I need to run a script, and when it finishes, I need to return control to XLobby to open overlay, etc.

The problem is that XLobby is multithreaded and opens overlay before the script finishes... Now, I know this can be solved by sending the event to XLobby when the script finishes, but events don't work too well for me (I posted this problem in another theread), and also (more important) I can't use SEND_MESSAGE from VB Script...

Would it be possible to make a parameter in "execute" to wait for executed process to finish before continuing executing next command?

Thanx,

Dalibor
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby dalanik on Mon Nov 15, 2004 1:53 pm

I must be blind... Just found the "single thread" checkbox... disregard previous post...

:-)
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby dgemily on Mon Nov 15, 2004 2:48 pm

D.,
can you explain me how do you do ? where is the "single thread" checkbox, and how use it ?

For example: for the script to import pictures from your digital camera, if I would like to add an event "refresh database" this one will be executed when the script will finished to import my new pictures, so can you explain how to do it ?

Thanks,

Dge
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby dalanik on Mon Nov 15, 2004 3:18 pm

* Press F2
* Goto Event Manager
* in the left hand side list select items until you go to the command level, ie. in my skin (visual)

SKIN->autoplay->eject

you will see checkbox in the upper right hand corner "multithreaded" just uncheck :-)

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby dgemily on Mon Nov 15, 2004 3:42 pm

thanks, I didn't see it, I must be blind too 8) :lol:

I will try this feature... :wink:
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby dalanik on Tue Nov 16, 2004 8:48 am

I managed to make it work... Now I can get rid of another program I was using (for subtitles select)... I just use VBScript.

As far as download of pictures is concerned, the only thing I couldn't make work is status of operation (i.e. copied OK or error)... I see no way to pass that info to XLobby from vbscript (or to BRANCH in Xlobby, for that matter, even If I had the info). Similar problem for subtitles - what do I do if there are NO subtitles on the CD? There's no way I can tell XLobby from VBScript this and/or make it branch...

I had some problems with the category update as well (for my subtitle script). I create subs.xml database on the fly and want to display it in an overlay, but I keep getting old database (previous one).

I had to do something like this in order to update the category:

* copen overlay subselect
* category refresh
* wait 500
* close overlay
* open overlay subselect
* category refresh

...

simply using "refresh" wasn't enough...

I'll work a bit more on this and include it in my visual skin v050 in a couple of days...

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby dgemily on Tue Nov 16, 2004 10:42 pm

the only thing I couldn't make work is status of operation (i.e. copied OK or error)... I see no way to pass that info to XLobby from vbscript (or to BRANCH in Xlobby, for that matter, even If I had the info). Similar problem for subtitles - what do I do if there are NO subtitles on the CD? There's no way I can tell XLobby from VBScript this and/or make it branch...



I have an idea,
Ptrinchi wrote a plugin Xevent:

just, to inform you, Ptrinchi is writing a plugin "Xevent" to launch an event with a specific date and time, you can also specify a variable everyday or everymonth...
there is also a command for this plugin, to create a trigger via xlobby with a specify date and time and an other command to launch the event in xxx min.
the plugin gives the possibility to receive imformation via a script or something else to launch an event: example if your hard disk is full, your script or codes should send information to the plugin to launch an overlay alert... but for the moment there is a bug that it prevent to use it correctly : look at this theard : http://www.xlobby.com/forum/viewtopic.php?t=2368

Later,



The parameters of this plugin are stocked in the file "XAlarmClock.ini" the structure is like this:
"2004 11 01|08:36|goto:overlay_alerte".
So if you had some lines in your vbs to write these parameter in the file XAlarmClock.ini, you will have the possibility to display an overlay and execute all events that you want. example if it’s an error the vbs will write "2004 11 01|08:36|goto:overlay_error" and you will see the overlay “overlay_error” and if it’s copied OK the vbs will write "2004 11 01|08:36|goto:overlay_ copiedOK " and you will see the overlay “overlay_ copiedOK”.

Steven just answered to the request of Ptrinchi, so a new version should be work with all events and maybe with more functions. :wink:

but if you want to try the first version of this plugin it's here : http://france.xlobby.com/forum/dgemily/temp/XEvent.zip

Later
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby dalanik on Thu Nov 18, 2004 8:37 am

I guess that would work... can't wait to try it out!

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby dgemily on Thu Nov 18, 2004 9:12 am

Ptrinchi will add some more variables:

- every-week,
- now
- every-monday, every-tuesday...
- every-day-except-WeekEnd
- every-day-only-WeekEnd

if you have an other request about this plugin, tell it to me, and I will ask to him.

Dge.
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby dalanik on Thu Nov 18, 2004 11:43 am

One problem is that if I enter current time in the XAlarmClock.ini file, it never opens (or almost never).

If I enter current time + 1 minute, I have to wait up to 59 seconds :-)

Would it be possible to have another command line "NOW" - ie.

"2004 11 18|now|goto:goto menu"

so it's executed as soon as it's "spoted" by the plugin?

This would help greatly!

Thanx,

Dalibor
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby dgemily on Thu Nov 18, 2004 12:35 pm

I did already ask for command "NOW"and Ptrinchi will add it :wink:
look at my previous thread:
- every-week,
- now
- every-monday, every-tuesday...
- every-day-except-WeekEnd
- every-day-only-WeekEnd


the plugin ask XAlarmClock.ini every 30 seconds (to not take to much cpu) , so you will wait (maximum 30 seconds)
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby dalanik on Thu Nov 18, 2004 1:32 pm

dgemily wrote:I did already ask for command "NOW"and Ptrinchi will add it :wink:
look at my previous thread:


Well, I just proved twice in the same thread that I'm blind!! :-)

Great! Thanx!

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby dalanik on Thu Nov 18, 2004 1:43 pm

Anyone wants to use this from VBscript... here's a small function just for the purpose.

usage from vbscript:

WriteEvent("overlays:show pictures copy-err-setup")

(in parameter, include the whole name of the event)


' ------------------------------------------------------------------------------------
' main
' ------------------------------------------------------------------------------------

Option Explicit

Dim fso, WshShellWav
Dim FileSystemObject
Dim wsh, tf

Set fso = CreateObject("Scripting.FileSystemObject")
Set wsh = WScript.CreateObject("WScript.Shell")

WriteEvent("overlays:show pictures copy-err-setup")

Wscript.quit

' ------------------------------------------------------------------------------------
' functions
' ------------------------------------------------------------------------------------

Function WriteEvent(str)
Dim date, time, yyyy, mm, dd, hh, mn

Set tf = fso.OpenTextFile("c:\Program Files\XLobby\plugins\XEvent\XAlarmClock.ini", 8, True)

yyyy = Year(Now)
mm = Month(Now)
dd = Day(Now)

If( mm < 10 ) Then
mm = "0" & mm
End if
If( dd < 10 ) Then
dd = "0" & dd
End if

date = yyyy & " " & mm & " " & dd

hh = Hour(Now)
mn = Minute(Now)

If( hh < 10 ) Then
hh = "0" & hh
End if
If( mn < 10 ) Then
mn = "0" & mn
End if

time = hh & ":" & mn

tf.WriteLine( date & "|" & time & "|" & str )

tf.Close
End Function

' ------------------------------------------------------------------------------------
' end
' ------------------------------------------------------------------------------------
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby dgemily on Thu Nov 18, 2004 5:30 pm

thx :wink: Image
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby dgemily on Thu Nov 18, 2004 6:48 pm

nothing to do with this topic , but Dalanik I know that you use Mame and some VBscripts. so I have a sugestion for you :wink: you should use Rom_to_Xml, it's really nice :)

look at this thread: http://www.xlobby.com/forum/viewtopic.php?p=13598#13598
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France