Index

Signal

The name of a registered signal.

Input Format:
A case-insensitive word starting with a letter. After the first character, letters, numeric digits and underscore characters are allowed.
Built-in signals:
source_set
This signal is sent whenever a source sets below the lower elevation limit, or if one sends a command (such as an offset) that results in the source being unreachable below the telescope elevation limit. The signal is cleared whenever a new telescope positioning control command is executed, but will be resent if the modified target position is still below the elevation limit.
suspended
This signal is sent to the currently running schedule whenever it is suspended. It can then be caught by the schedule when the schedule is resumed. The rationale for this signal is that the usual reason for suspending a schedule is to do maintenance work. This could leave the receiver in a state that is incompatible with what the schedule was doing when it was suspended. So this signal is provided to let the schedule know that it should reset the receiver before continuing. The following is an example of how to use this signal.
  Boolean finished = false         # We will make this true when the observation ends.
  while(!$finished) {              # Repeat the following if the observation is interrupted.
    signal/init suspended          # Forget about previously signaled schedule suspensions.
    setup_rx                       # Reset the receiver configuration.
    catch($signaled(suspended)) {  # Stop observing if the schedule is suspended.
      track jupiter                # Start a track on Jupiter
      until $acquired(source)      # Wait until Jupiter is acquired.
      until $elapsed > 0:10:0      # Observe Jupiter for 10 minutes.
      finished = true              # Mark the observation as having completed.
    }
  }
The example first discards any previous occurrences of the "suspended" signal, using the signal/init command, before configuring the receiver. If the schedule is subsequently suspended, either while configuring the receiver, then this will be caught by the following catch statement. It will also be caught if the schedule is suspended while performing the observation on Jupiter. This will abort the observation, and cause the while loop to redo the commands that reset the receiver and observe jupiter.

Note the need to initialize the signal before doing anything that might need to be repeated after a schedule suspension. If the signal were instead initialized after setting up the receiver, then if the schedule was suspended while setting up the receiver, the schedule would never notice this, and the receiver might be left in an unexpected state.

A general example:
If the observer typed the following in the telviewer command window, then the currently running schedule would be sent a "suspended" signal, just as though the schedule had been suspended and later resumed.
 signal suspended
Adding additional signals:
In addition to the built-in signals listed above, additional signals can be defined using the add_signals command, which should be run from the telcontrol initialization script, for use by subsequent schedules.

Martin Shepherd (18-Oct-2010)