Signal
The name of a registered signal.
source_set
suspended
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.
signal suspended