DC-3 Dreams

Special Scripts and Tools

Several aspects of Scheduler's operation are accomplished through the use of scripts written in Javascript or VBScript. The scripts used for starting things up in the evening (StartupObs) and shutting down in the morning (ShutdownObs) are separately described in Startup and Shutdown. The system (and the ACP script ACP-Weather) that is used to respond to weather-unsafe events are separately described in Weather Handling. This page describes a special script and tool, each of which provides Scheduler with much more flexibility than a standard set of logic.

TipAll of the special scripts must be located in Public Documents\ACP Config\Scheduler (as of ACP Expert 8), in keeping with the Windows security model for Windows 7 and later. If any special script is found in the old Program Files\ACP Scheduler location, it will be automatically moved to the new location.

Special Needs Rolloff Roofs

Screen/Panel flats, as well as calibration frames (darks/biases) should be done with the dome/roof closed. In addition, Scheduler has the ability to close the dome or roof if it appears that there will be no work to do for some period of time (see Close-If-Idle). Some observatories have low-hanging roll-off roofs or other structures which require that the telescope be put into a specific position (parked, etc.) before the roof or shutter can be safely closed. While we always recommend that this problem be solved architecturally, this isn't always possible. Therefore we provide a software "hook" to handle the problem of getting the enclosure and equipment closed up and protected from inclement weather or sunlight. This same task usually needs to be performed in the Shutdown script and also the ACP-Weather script, but these other scripts can have additional things to do, so we provided a separate script call just for getting the roof safely closed. Here is a sample CloseSpecialRoof.js script. This is essentially the same script as the ACP-Weather script for common configurations.

//
// Template script for handling special-needs buildings like roll off
// roofs which hang low and can damage the telescope/mount. This script
// comes into play from Scheduler during Dawn Cal Frames, and oinly if 
// ACP's dome control option "Safe to slew anywhere with dome closed"
// is OFF (in other words, UNSAFE). Then it is this script's responsibility
// to get the roof or whatever closed safely.
//
// Bob Denny	27-Jul-2014
//
function main()
{
    Console.PrintLine("Park the scope then close the special roof...");
    // Depends on Dome setting "Close and park/home AFTER scope is parked
    // in ACP Preferences, Dome control, being ON (checked).
    Telescope.Park();                    // Park the scope, triggering the roof closure afterward
    Console.PrintLine("... completed.");
}

Operator Intervention Tool

When Scheduler encounters an error from which it cannot recover, it will place itself into "operator intervention required" state. If configured, Scheduler will send an email message with details about the problem. For some installations this is not enough. In this case, Scheduler provides for running a configurable Windows (console) executable and passing it a command line, also configurable. Normally you need to provide the full path and name of the executable to run.

The command line executable that is run will have the Scheduler error message(s) piped into its standard input (STDIN), so the program can display it, log it etc. In addition, if the program writes anything to its standard output (STDOUT) or standard error (STDERR), the Scheduler will handle that. If the program exits with error status, the exit code and message on standard error will be logged as an error. Text written to standard output will be logged as a normal advisory message.

Note that the Windows executable can be "cscript.exe" and the command line can be a JScript or VBScript script, so it is possible to have a script run at "operator intervention" time. If you don't put a complete path for the executable into the configuration, it will be assumed to be in Windows\System32 (\Windows\SysWOW64 on 64-bit systems). Thus "cscript.exe" is enough. If Scheduler detects "cscript" as the program name, it will add the option //NoLogo to prevent Microsoft banner text from being written to the script's output. Thus the Script can call WScript.Echo() and that text will appear in Scheduler's log.