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.
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.