-
Notifications
You must be signed in to change notification settings - Fork 6
Using Command Center
A shorter intro of this can be found in the repo's readme.
-
Load Image in CC: This will take a file that has been saved by either
Databases.AutoSave,Databases.Manual, or an equivalent module that saves data to the filesystem without modification and load the raw data back into CommandCenter's image panel. - Open Image in New Window: Identical to the previous option, however instead of loading in CommandCenter's image panel, it will open a new Smart Image window.
- Camera Calibration: If there is an active imaging module loaded, this will be enabled. It will go through a process of taking images and asking the user to draw lines between features and specifying their size. Using these lines, a calibration value will be generated. Special action is taken when the imaging device is the same as the stage (e.g. the case of galvos). See Imaging modules for more details.
- Color Map: Control the colormap of captured images.
- Axes Layout: Control the orientation of the imaging and experiment panels. Note, their sizes can be adjusted by dragging the divider between them (when both displayed).
- Manager Settings: Access the editor for manager settings.
- Logger Visible: Reveal the logger window. If it is minimized, this won't expand it. It will only display it if it was closed.
- Reset: Close CommandCenter, unlock any locked file, then relaunch CommandCenter.
-
Git Pull: Similar to reset, but also will remove CommandCenter from the MATLAB path (and all subdirectories) then perform a
git pullbefore relaunching. Currently only supports pulling themasterbranch. If you were originally on the root path of the repo, you will be moved into a safe folder within the repo during all of this, then returned after finished. - Send Logs: Immediately send new log entries to the logging server. This is done by default when the inactivity monitor triggers or CommandCenter is closed.
(Experiments, Stages**, Imaging, Sources, Saving)
See module selection for a few examples.
These menus are populated dynamically from the corresponding package in Modules/+*. Any nested package is represented as a submenu for further organization. Clicking on any module will result in loading (making a new instance if necessary) for use in the left panel. A check mark will appear next to any loaded modules. Clicking on a module that is loaded (check marked) will result in unloading it and deleting the instance (even if the instance wasn't created when loading).
- The "Experiments" menu has an additional "New Module" option at the end which will use a template to construct necessary files with the correct contents.
** The "Stages" menu will only list actively loaded modules in a disabled fashion. The "Edit" option at the end opens up a UI to modify the loaded stages. This is because the ordering of the stages matters (more info).
The first set of options will be the set of configured paths that have already been created. Clicking on them will execute the instructions to transition the setup to that path.
Assuming paths exist, the other available options are (some might not exist if there are no defined paths yet):
New Path: Open a UI to create a new path and associated set of instructions. See the path manager for details.
Step 1: You will first need to enter a name for the path; any ASCII string will do.
![]()
Next, you will be presented with many menu options. The first set of these mirror the menus in CommandCenter and are intended to behave in a similar way. Once discussing how the module menus work, we will look at the last option "Function (no module)".
![]()
Once you select a module, if input is required in the constructor, you will be presented with a dialog to fill these values. Remember, CommandCenter modules are singleton, so if this module is already loaded, you are simply grabbing that instance in this process, not generating a new one. IMPORTANT note: the values are as if you were typing in the console! This means that a char array must be enclosed in single quotes (as you can see below).
![]()
Once you have supplied the required inputs and the module can be instantiated/retrieved, you will be provided with a list of public methods provided by that module. Select the one you want to call and press "OK".
![]()
Similar to module instantiation, if input is necessary, you will be provided with the option to input it. IMPORTANT note: as with module instantiation, these values are interpreted as if you typed in the MATLAB console (hence the single quotes required for char arrays).
![]()
Now, you are asked if you would like to add another instruction. Pressing "No" will close all dialogs and save the path with the existing instructions. If you cancelled instruction entry or it errored and it resulted in no instructions, pressing "No" will cancel the whole process. Pressing "Yes" will always take you back to step 1.
![]()
The other option from step 1 is to selection "Function (no module)". This will result in a dialog opening to enter a MATLAB expression. As previously pointed out, this is just as if you were entering it on the MATLAB console.
![]()
Two very handy function calls:
The following call is useful when nothing needs to be done to switch paths. Perhaps there is a beam splitter that sends your signal to this detector as well. In that scenario, simply calling the following will result in doing "nothing".
drawnow()The following call is useful when the action required is all manual and the operator needs to perform a physical action on the setup. This is quite common, for example if you need to rotate a polarizer or flip a flippable mirror. In that scenario, pausing code evaluation is necessary until the action can be confirmed as complete:
questdlg('Flip the spectrometer mirror!','Action Required!','Done','Done')
questdlgcallsuiwaitto pause code evaluation, and uses amodalfigure which doesn't allow interaction with anything but thequestdlgwindow. Pressing "Done" (or closing with the "X") in the window will close it and resume operation.
New Alias: Create a new alias for an existing path.
The new alias setup is much simpler. Enter the name you would like for the alias (again, any valid ASCII char array) and select an existing target path/alias.
![]()
Remove Path/Alias: Remove an existing path or alias permanently. Note that aliases will not be cleaned up even if their target path gets removed!
View All: Open a viewer to inspect each path/alias and their associated set of instructions.
The new alias setup is much simpler. Two examples below show a path highlighted which lists the actions taken on the right and an alias highlighted that indicate it is an alias and show the name of the path it is an alias for.
![]()
Long story short, managers are responsible for linking the left panel UI controls to the loaded module methods. The managers also take care of dynamically populating the top menu items.
Managers have their own (limited) set of preferences that can be accessed through the file menu:
As with modules, these settings are persistent between sessions. For example, the imaging manager's settings panel looks like this:
Values changed are saved when the window is closed. To understand what each property does, see the managers page.
This is quite straight forward. Simply open the appropriate menu at the top of the application and navigate to the appropriate module. The description of the module menus) describes this process.
Note, from a MATLAB perspective, nested packages will create submenus.
From a filesystem perspective, nested folders that begin with a "+" sign are MATLAB packages, thus creating submenus.
For example to load the package
Sources.msquared.SolsTiS, located at Modules/+Sources/+msquared/SolsTiS.m you would follow the menus as such and click on the "SolsTiS" option:![]()
Stages are slightly different because it is possible for their motion to be coupled. This may be changed due to issue 70, specifically this comment.
Regardless, the UI to select stages is fairly straightforward. You can add modules by selecting the stage of interest on the left and pressing the right arrow. Removing modules is similar; select the stage on the right and press the left arrow. The "used" stage modules can be re-ordered with the up and down arrows at the bottom of the right panel. Hitting continue will unload any loaded stage and load all selected stages (even if this requires unloading and reloading). Pressing the "X" at the top right of the window cancels the operation.
![]()
This section explains the various controls on the side panel.
- Each manager (except the "Path" manager) gets their own section.
- Every manager except the "Experiment" manager is capable of having multiple modules loaded simultaneously.
- Every manager acts as the "go-between" for the GUI and the active module. The link will be described below in their specific sections.
- The "active module" refers to the module whose name appears in the dropdown menu that is highlighted in red below.
- The control panel can be "minimized" by clicking towards the top as indicated by the blue region below.
- The length of the panel can be adjusted by dragging the bottom of the panel as indicated by the gold region below.
- Under the ROI setting (above the binning field) there is a faint white line the delineates the end of the common controls for that type of module and the custom settings/preferences defined for the particular active module.
- Typically the settings are the module's prefs.
- A module's prefs are saved when the module is destroyed. This occurs when you unselect a module that is loaded via the menus or close CommandCenter entirely.
References StageManager frequently.
-
Visualize Button ->
StageManager.show(...). This opens up a figure with a 3D axis that represents the active stages and the current location of each of them. It draws them in the order of their stacked order (keep an eye on issue 70). - 3-axis position setting: The value displayed to the left of the edit boxes is the stage's "local" position (e.g. not considering any other stages). The editable values to the right correspond to where you want to move when clicking the Move button. If the Relative checkbox is selected, this motion is relative to the stage's current position. If not, the position is interpreted as the absolute position you want to set the stage.
-
Relative checkbox ->
StageManager.stage_rel(...). If selected, it will disable the directional arrows on the right portion of the panel (since those are meant to be relative motion). It also controls how the Move button interprets the values in the 3-axis position inputs. -
Move/Abort/ABORT Button: This button takes on multiple roles which are set in
StageManager.active_stage_moving_update().-
Move ->
StageManager.moveCallback->StageManager.jog([dx,dy,dz])|move([x,y,z])->Modules.Stage.move(x,y,z): Move either relative or absolute to location specified. Yes, there is a conditional jog/move call, but both do the appropriate calculation to call the module'smovemethod. -
Abort ->
StageManager.abort(immediate=false)->Modules.Stage.abort(false) -
ABORT ->
StageManager.abort(immediate=true)->Modules.Stage.abort(true): Depending on the stage module, this may not be different than Abort.
-
Move ->
Coming Soon
Coming Soon
Coming Soon
Coming Soon
The only additional information that I will supply here is how you can interact with CommandCenter from the console. While this shouldn't be necessary for most users, it can be handy.
After CommandCenter has been launched, a variable called managers is automatically added to your base workspace in MATLAB.
This is the container for all-things CommandCenter.
Every manager (many more details in the managers page) has two property that are very useful for interacting with their loaded modules.
obj.active_moduleobj.modules
Note the mapping of properties in managers to manager objects (and their associated menu):
- Path -> PathManager (Path Menu)
- DB -> DBManager (Saving Menu)
- Experiment -> ExperimentManager (Experiments Menu)
- Sources -> SourceManager (Sources Menu)
- Stages -> StageManager (Stages Menu)
- Imaging -> ImagingManager (Imaging Menu)
So, for example to get active module for the "Sources" manager, you would execute:
my_active_source = managers.Sources.active_module;The other properties are covered in the managers page.