-
Notifications
You must be signed in to change notification settings - Fork 8
GUI External Control
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.
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.
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.
You can find an example script in this folder of the source code.