Skip to content

GUI External Control

Pedro Almada edited this page Oct 7, 2018 · 18 revisions

Micro-Manager

The GUI has been designed to be controlled through scripts as well as through the GUI. Several of the internal classes are marked as public, allowing developers easy access to most relevant functions. However, the simplest way to control is through a few convenience functions present in the GUI class. This section will show you how to send a few basic commands through BeanShell to the GUI.

Importing the GUI

To get access to the GUI in a BeanShell script, you have to import the package and get a reference to the instance:

`import nanoj.pumpControl.java.sequentialProtocol.GUI;

seqProt = GUI.INSTANCE;`

Once this is done, you can access several functions. Most of these return some form of String value that can be used for debugging.

Available functions

seqProt.startSequence()

Starts the entire sequence

seqProt.startSequence(int startingStep, int endingStep)

Starts just a portion of the sequence, e.g. from steps 2 to 4.

seqProt.stopSequence()

Stops the sequence.

seqProt.sequenceRunning()

Get whether the sequence is running or not as a boolean.

seqProt.getCurrentStep()

Get what is the current step (-1 if not running)

seqProt.stopAllPumps()

Stops all currently connected pump.

seqProt.stopPump(int pumpIndex)

Stops a specific pump (value from 1 to N connected pump). The index matches the dropdown menus in the GUI.

Full example script

You can find an example script in this folder of the source code.