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.
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)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
(tab)Switch tabs.
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)
Acquire data/Stop acquiring data.
- add_feature_list(feature_list_name, feature_list_str)
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()
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)
Install a plugin
- load_experiment(*args)
Load an experiment file.
- load_feature_list()
Load feature lists from a python file
- load_images()
Load images from a file.
- load_waveform_constants()
Load a waveform constants file
- new_experiment(*args)
Create a new experiment file.
- not_implemented(*args)
Not implemented.
- open_configuration_files()
Open configuration files folder.
- open_folder(path)
Open folder in file explorer.
- Parameters:
path (str) – Path to folder.
- open_log_files()
Open log files folder.
- popout_camera_display()
Pop out camera display.
- populate_menu(menu_dict)
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()
Pop up the Adaptive Optics setting window.
- popup_autofocus_setting(*args)
Pop up the Autofocus setting window.
- popup_camera_map_setting()
Pop up the Camera Map setting window.
- popup_feature_advanced_setting()
Show feature advanced setting window
- popup_feature_list_setting()
Show feature list popup window
- popup_help()
Open a web browser to the Navigate documentation.
- popup_ilastik_setting()
Pop up the Ilastik setting window.
- popup_microscope_setting()
Pop up the microscope setting window.
- popup_uninstall_plugin(*args)
Uninstall plugin
- popup_waveform_setting()
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)
Save an experiment file.
Updates model.experiment and saves it to file.
- save_waveform_constants()
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)
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(tab)
Switch tabs.
- toggle_save(*args)
Toggle save button
- Parameters:
args – could be tkinter event(Key press event)
- toggle_stage_limits(*args)
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