PDA

View Full Version : Updated Scheduler UI - Beta



JohnHind
October 23rd, 2007, 09:43 AM
This is a beta version of updated Scheduler UI focused on new features. There should be no breaking changes against the current version. If you want to give it a try, download the attached zip file and uncompress it in your Girder 5 program directory (usually C:\Program Files\Promixis\Girder5\). Then either restart Girder or do a Scripting Engine Reset.

New Features (For Everyone)

1. You can now add a "Randomize" constraint to most task types. Highlight a task in the upper list box, select "++ Randomize" in the selector top left of the lower box, set the offset to a non-zero positive or negative number of minutes, finally press the change button. This causes a random number of minutes between zero and the offset to be added each time the set time is calculated. This is intended for security light and similar systems.

2. New Weekday and Weekend task types. Select one of these and press the change button to add five or two per week tasks for the relevant days.

3. Version migration. First time the script is run, any schedulers in a remaining Girder 4 installation are copied over. You can delete or edit these if you do not want them.

4. Removal of the requirement to set Latitude and Longitude for sunset and sunrise tasks. These now always apply to the current location set on the Settings Location tab. If you change location, you can reevaluate sunset and sunrise scheduler tasks by doing a script reset.

5. Usability improvements including automatic persistence without the need for a "apply" button.

Enhanced features (for scripting)

[uuid] = scheduler.SaveToXML(sh, [file], [nolatlong])

sh is scheduler object OR scheduler ID (number) OR scheduler uuid (string).
[file] specifies an optional file and path to use. If [file] is omitted the file is stored to the persistence store used by the UI and will be automatically reloaded on restart/ lua reset.
[nolatlong] is optional boolean, if present and true, latitude and longitude values for sunset and sunrise tasks are NOT persisted. In this case, these are filled in on load from Girder settings which allows Girder to be reloacated or schedulers to be moved to other Girder instances. However if it is desired to persist a scheduler with sunset or sunrise tasks for other than the current Girder location, this parameter should be omitted or set false.
The uuid is a string that uniquely identifies the scheduler both on disk and in memory. Normally it may be ignored.

[idtable], [error] = scheduler.LoadFromXML(xml)

xml is file path & name OR uuid OR string containing xml in persistence format. If a uuid, it is used to find the scheduler in the persistence store.
[idtable] receives a numericaly indexed table of the ID numbers of the schedulers created or nil. Often this table will contain just one entry, but the XML format allows multiple schedulers in the same file.
[error] receives an error message if idtable is nil.

scheduler.Delete(sh)

sh is scheduler object OR scheduler ID (number) OR uuid (string). This safely deletes a scheduler from memory and persistence store, if present in either or both.

Import Scripts

On startup, the system runs any lua files found in the \luascript\Scheduler\ directory BEFORE loading XML persisted schedulers. This directory ships with the migration script, but you can add more scripts in this directory. The intention is to place scripts which create schedulers based on external data such as diaries or TV schedules. These can either create schedulers using the Lua scheduler library, or you can generate XML files in the persistance store which will subsequently be imported.

jackisidore
October 24th, 2007, 11:55 PM
Thanks,

The randomize function is very handy.
I get the following errors in Lua Console after installing the files:



Aux lib Open: ...iles\Promixis\Girder5\luascript\ComponentManage r.lua:558: attempt to call method `GetID' (a nil value)
stack traceback:
...iles\Promixis\Girder5\luascript\ComponentManage r.lua:558: in function `ReadComponentFile'
...iles\Promixis\Girder5\luascript\ComponentManage r.lua:490: in function `LoadComponents'
...iles\Promixis\Girder5\luascript\ComponentManage r.lua:221: in function `Initialize'
...iles\Promixis\Girder5\luascript\ComponentManage r.lua:810: in function `init'
...ram Files\Promixis\Girder5\\luascript\compat-5.1.lua:195: in function `require'
...gram Files\Promixis\Girder5\\luascript\Additions.lua:63 0: in main chunk


In component manager all enabled components are gone. CallerID modem and AmbientLight are displayed as installed. Enabling is not possible. This throws more errors in luaconsole.

jackisidore
October 25th, 2007, 11:23 PM
The errors in lua console are not related to the new schedulers (I think). Reinstalled the old scheduler files and the errors remain.

The new schedulers work nicely. It's exactly what I need to control lighting when I'm gone!

Rob H
October 26th, 2007, 02:23 AM
Jack, can you ensure that File|Setup|General|File Logging is enabled then check the ComponentManager xxx.log files for "Reading component" and find the last of those entries - that should tell us which component is not implementing the GetID() method.

jackisidore
October 26th, 2007, 06:02 AM
That would be customweather.lua. I replaced that one with the new version from this thread http://www.promixis.com/forums/showthread.php?t=17464&page=3. I use it for fun but the old one was eating my memory. I moved the file and now girder is running normal.




10/26/07 15:52:20 INFO Reading component C:\Program Files\Promixis\Girder5\luascript\components\Caller IDModem.lua
10/26/07 15:52:20 INFO Loading component 10046
10/26/07 15:52:20 INFO Component Manager Event: Add 10046 CallerIDModem
10/26/07 15:52:20 INFO Reading component C:\Program Files\Promixis\Girder5\luascript\components\Custom Weather.lua

jackisidore
May 31st, 2008, 11:12 PM
This new scheduler isn't included in the last beta (524). Quickly fixed on my setup. Do I need an update?
I would suggest implementing this in standard girder. The updated functions are very usefull.