navigate.controller.sub_controllers.menus.MenuController
- class navigate.controller.sub_controllers.menus.MenuController(view, parent_controller=None)
Bases:
GUIController
Menu controller class.
- __init__(view, parent_controller=None)
Initialize MenuController
- Parameters:
view (class) – The view class.
parent_controller – The parent controller.
Methods
__init__
(view[, parent_controller])Initialize MenuController
acquire_data
(*args)Acquire data/Stop acquiring data.
add_feature_list
(feature_list_name, ...)Add feature list to the software and system yaml files
Delete a selected customized feature list from the software and system yaml file
execute
(command, *args)This function is called when a command is passed from a child process.
This function is called when the controller is initialized
Initialize menus This function defines all the menus in the menubar
install_plugin
(*args)Install a plugin
load_experiment
(*args)Load an experiment file.
Load feature lists from a python file
Load images from a file.
Load a waveform constants file
new_experiment
(*args)Create a new experiment file.
not_implemented
(*args)Not implemented.
Open configuration files folder.
open_folder
(path)Open folder in file explorer.
Open log files folder.
Pop out camera display.
Pop out camera display.
Pop out camera display.
Pop out MIP display.
Pop out camera display.
Pop out camera display.
Pop out waveform display.
populate_menu
(menu_dict)Populate the menus from a dictionary.
Pop up the Adaptive Optics setting window.
popup_autofocus_setting
(*args)Pop up the Autofocus setting window.
Pop up the Camera Map setting window.
popup_camera_setting
(microscope_name)Pop up the Camera setting window.
Show feature advanced setting window
Show feature list popup window
Open a web browser to the Navigate documentation.
Pop up the Ilastik setting window.
Pop up the microscope setting window.
popup_uninstall_plugin
(*args)Uninstall plugin
Pop up the Waveform setting window.
register_event_listener
(event_name, ...)Register event listener in the parent_controller
save_experiment
(*args)Save an experiment file.
Save a waveform constants file
Sets values of widgets based on experiment setting
show_verbose_info
(*info)Prints verbose information to the console
stage_movement
(char)Stage movement.
switch_tabs
(window, tab)Switch tabs.
Enable or disable histogram display.
Enable or disable MIP display.
toggle_save
(*args)Toggle save button
toggle_stage_limits
(*args)Toggle stage limits.
Collects all the values of widgets
Attributes
Custom events for the controller
The parent controller.
The view class.
Resolution value.
Feature id value.
Disable stage limits.
Fake event.
List of feature list names.
System feature list count.
Feature list count.
Feature list file name.
- acquire_data(*args) → None
Acquire data/Stop acquiring data.
- add_feature_list(feature_list_name: str, feature_list_str: str) → bool
Add feature list to the software and system yaml files
- Parameters:
feature_list_name (str) – feature list name
feature_list_str (str) – string of a feature list
- Returns:
result – True: add feature list successfully False: failed
- Return type:
bool
- delete_feature_list() → None
Delete a selected customized feature list from the software and system yaml file
- execute(command, *args)
This function is called when a command is passed from a child process.
- Parameters:
command (str) – command name
args (tuple) – command arguments
- initialize()
This function is called when the controller is initialized
This function initializes GUI based on configuration setting parameter: configuration_controller set range value for entry or spinbox widgets; add values to combobox get other necessary information for configuration.yml
- initialize_menus()
Initialize menus This function defines all the menus in the menubar
Each menu item is initialized as a dictionary entry that is associated with a list that provides the following parameters:
Menu item name: name of the menu item. If the name is specified as add_separator, then a separator is added to the menu.
- List of parameters:
Type of entry: standard, checkbutton, radiobutton, cascade Function: function to be called when menu item is selected Accelerator: keyboard shortcut Bindings: keyboard shortcut bindings for Windows Bindings: keyboard shortcut bindings for Mac
Example
- “Acquire Data”: [
“standard”, self.acquire_data, “Ctrl+Enter”, “<Control-Return>”, “<Control_L-Return>”,
]
- Returns:
configuration_controller – Camera view sub-controller.
- Return type:
class
- install_plugin(*args) → None
Install a plugin
- load_experiment(*args) → None
Load an experiment file.
- load_feature_list() → None
Load feature lists from a python file
- load_images() → None
Load images from a file.
- load_waveform_constants() → None
Load a waveform constants file
- new_experiment(*args) → None
Create a new experiment file.
- not_implemented(*args) → None
Not implemented.
- open_configuration_files() → None
Open configuration files folder.
- open_folder(path: str) → None
Open folder in file explorer.
- Parameters:
path (str) – Path to folder.
- open_log_files() → None
Open log files folder.
- popout_camera_display() → None
Pop out camera display.
- popout_camera_settings() → None
Pop out camera display.
- popout_channel_settings() → None
Pop out camera display.
- popout_mip_display() → None
Pop out MIP display.
- popout_multiposition_settings() → None
Pop out camera display.
- popout_stage_settings() → None
Pop out camera display.
- popout_waveform_display() → None
Pop out waveform display.
- populate_menu(menu_dict: dict) → None
Populate the menus from a dictionary.
- Parameters:
menu_dict (dict) –
- menu_dict = {
- Menu object: {
- “Menu String Entry”: [
entry_type (standard, radio), Command, Accelerator, Windows Keystroke, Apple Keystroke”,
- popup_adaptiveoptics() → None
Pop up the Adaptive Optics setting window.
- popup_autofocus_setting(*args) → None
Pop up the Autofocus setting window.
- popup_camera_map_setting() → None
Pop up the Camera Map setting window.
- popup_camera_setting(microscope_name: str) → Callable
Pop up the Camera setting window.
If the window is already open, show it. Otherwise, create a new one.
- Parameters:
microscope_name (str) – Name of the microscope.
- Returns:
Function to be called when the menu item is selected.
- Return type:
Callable
- popup_feature_advanced_setting() → None
Show feature advanced setting window
- popup_feature_list_setting() → None
Show feature list popup window
- popup_help() → None
Open a web browser to the Navigate documentation.
- popup_ilastik_setting() → None
Pop up the Ilastik setting window.
- popup_microscope_setting() → None
Pop up the microscope setting window.
- popup_uninstall_plugin(*args) → None
Uninstall plugin
- popup_waveform_setting() → None
Pop up the Waveform setting window.
If the window is already open, show it. Otherwise, create a new one.
- register_event_listener(event_name, event_handler)
Register event listener in the parent_controller
- Parameters:
event_name (str) – event name
event_handler (function) – event handler
- save_experiment(*args) → None
Save an experiment file.
Updates model.experiment and saves it to file.
- save_waveform_constants() → None
Save a waveform constants file
Updates model.waveform_constants and saves it to file
- set_experiment_values()
Sets values of widgets based on experiment setting
setting_dict is a dictionary
- show_verbose_info(*info)
Prints verbose information to the console
- Parameters:
info (tuple) – information to be printed
- stage_movement(char: str) → None
Stage movement.
Should not be run if we are in a validated combobox, or a validate entry.
- Parameters:
char (str) – The character that was pressed.
- switch_tabs(window: str, tab: int) → None
Switch tabs.
- Parameters:
window (str) – “left” or “right”
tab (int) – Tab index to switch to.
- toggle_histogram() → None
Enable or disable histogram display.
Gets the current value from the menu, updates the configuration, and communicates the changes to the histogram sub-controller.
- toggle_mip() → None
Enable or disable MIP display.
- toggle_save(*args) → None
Toggle save button
- Parameters:
args – could be tkinter event(Key press event)
- toggle_stage_limits(*args) → None
Toggle stage limits.
- update_experiment_values()
Collects all the values of widgets
setting_dict is a reference of experiment dictionary update the dictionary directly
- property custom_events
Custom events for the controller
- disable_stage_limits
Disable stage limits.
- Type:
tkinter.IntVar
- feature_id_val
Feature id value.
- Type:
tkinter.IntVar
- feature_list_count
Feature list count.
- Type:
int
- feature_list_file_name
Feature list file name.
- Type:
str
- feature_list_names
List of feature list names.
- Type:
list
- parent_controller
The parent controller.
- Type:
- resolution_value
Resolution value.
- Type:
tkinter.StringVar
- system_feature_list_count
System feature list count.
- Type:
int
- view
The view class.
- Type:
tk.canvas