User Tools

Site Tools


ideas:advanced_scripting

Advanced scripting

The current scripting model proved too difficult to maintain. Hence we are looking for new scripting part of RTS2. It shall be fully integrated. It should provide language specification, so we can easily extend language with new features.

The language must provides constructs for:

  • loops (for, while,..)
  • blocks which execution is based on some external factors (if acqusition is sucessfull, telescope error drop bellow some amount,..)
  • manipulation devices variables
  • executing and possibly queuing commands to devices
  • waiting for system to reach some state (exposure possible,..) with possible timeout
  • procedures and functions with parameters
  • functions to perform various system tasks (copy files, call external programs in background,..)
  • including of “libraries”
  • calls to generate exceptions, which will be catched by RTS2 and resulted in script premature end
  • logging calls to log script progress
  • comments inside scripting language

The idea is that the language will provide variables manipulation routines (including creating customs variables). The variables can be some “strange” astronomical quantities, e.g. error introduced either in degrees, arcminutes or arcseconds - distinguished by d, ', and “ suffix.

Input of the processor is string stream containing script. Its output is a binary sequence of commands, which will be executed by RTS2. There is an example of definition command to execute exposure:

int exposure (camera, length)
{
       waitforSystemState(EXPOSURE_POSSIBLE);  // will wait for system to reach state when exposure is possible
       camera.EXPOSURE = length;               // set camera variable EXPOSURE
       camera.executer("exposure");            // execute command on camera
       system.log ("exposure started on camera " + camera + " with length " + length);  // log command execution
}

and there is a call which include library, and call 10 seconds exposure:

include exposureLibrary;
exposure (C0, 10);
ideas/advanced_scripting.txt · Last modified: 2008/11/07 00:00 (external edit)