Running a Queue of Tasks

Build a queue in the program

  1. Choose Tasks → Queue and pick a task. It is added to the end of the queue in the Tasks tab. Pick the tasks in the order that they should run.
  2. Click a task in the Tasks tab and set its parameters.
  3. Press Play.

Press Stop to end the run and go back to the first task. When all of the tasks are done the queue is ready to run again.

Choose the traps to move

The task Move moves the marked traps. Mark a trap or a group by holding Ctrl and clicking its marker; it turns violet. MoveTraps moves all of the traps, or only the marked ones if you check selected_only. A group moves as a whole.

Repeat a block of tasks

Put BeginRepeat before the tasks to repeat and Repeat after them. The parameter n of Repeat is how many times the block runs in all. Blocks can be inside blocks. For example, to move a trap 10 pixels to the right and take a picture, twenty times:

  BeginRepeat
  MoveTraps   dx = 10
  Snapshot
  Repeat      n = 20

Save a queue and use it again

File → Save Queue writes the tasks that are waiting to run to a file, and File → Open Queue adds the tasks in a file to the end of the queue. A queue that was not running waits for Play, so that you can look at the new tasks first. The file is plain text, so you can also write it in an editor. Each task is a [[tasks]] table; type is the name of the task, and the other lines are its parameters. A line that begins with # is a comment.

  # Put a tweezer on the optical axis and wait 60 frames.
  [[tasks]]
  type = "AddTweezer"

  [[tasks]]
  type = "Delay"
  frames = 60

Every task also takes delay, a number of frames to wait before it starts. If a queue file has a mistake, such as a task name that is spelled wrong or a parameter that does not exist, the status bar says what is wrong, and the file is not opened.

When a task fails

A task that cannot do its work turns red, and the queue does not run the tasks after it. For example, LoadTraps fails if it has no file name or the file cannot be read, and the recording tasks fail if the file exists (and you did not allow replacing it), cannot be written, or a video is playing. Fix the cause, press Stop to go back to the first task, and press Play.