navigate.controller.configurator.Configurator
- class navigate.controller.configurator.Configurator(root: Tk, splash_screen)
Bases:
objectCoordinate configurator state, events, and dynamic widgets.
- __init__(root: Tk, splash_screen) → None
Methods
__init__(root, splash_screen)Return whether the visible settings belong to a stage device.
add_collection_row(name, spec, parent)Append a row of editable collection values.
add_device_to_microscope(microscope, ...)Add one serialized device using its category's YAML structure.
add_microscope(name)Create and display one microscope selection button.
Add and select the next default-named microscope.
Build a configuration.yaml-compatible dictionary from added devices.
category_base_class_name(category)Return a category's base class name, including acronym exceptions.
category_is_already_configured(category)Return whether adding or changing would duplicate a singleton category.
class_inherits(category, manufacturer, ...)Check inheritance without importing device hardware APIs.
Clear configuration widgets and controller state before loading a file.
clear_tree(tree)Delete all rows from a Treeview.
configuration_path_value(configuration, path)Return a nested configuration value, or
Nonewhen it is absent.Add or update a device from the selections in the active dialog.
confirm_microscope_rename([_event])Apply the pending rename if it is unique and non-empty.
create_setting_widget(parent, row, spec, ...)Render the editor appropriate for a setting schema definition.
create_value_variable(spec[, value])Create a Tk value variable matching the schema's declared type.
delete_collection_row(name, spec, parent, index)Remove one collection row and redraw its table.
Delete the microscope targeted by the context menu.
Confirm and delete the device selected in the device list.
device_configuration(category, manufacturer, ...)Convert one configured device into its configuration.yaml section.
device_directory()Return duplicate wheel numbers for matching filter-wheel types.
Return duplicate laser wavelengths grouped by microscope.
format_category_name(name)format_manufacturer_name(name)format_model_name(name, category)get_class_configuration_schema(category, ...)Read class-level schemas without importing device hardware APIs.
get_configuration_schema(category, ...)Resolve the currently available configuration schema for a device.
get_connect_params(category, manufacturer, ...)Read literal
get_connect_paramsvalues from a class or local ancestor.Return device category package names, excluding APIs and caches.
get_device_manufacturers(category)Return Python manufacturer modules for a category.
get_device_models(category, manufacturer)Return non-base device classes inheriting from the category base class.
initial_device_settings(category, model)Return initial values that depend on the selected device model.
Return partially entered Zoom stage-position calibration rows.
Return Zoom value rows whose pixel size is not a positive float.
is_synthetic_laser_type(device_type)Return whether a simple or qualified laser type is synthetic.
laser_control_hardware_path(configuration)Return the laser control branch selected by its hardware-type rule.
laser_device_type(configuration)Resolve a laser type from its on/off and power hardware types.
Choose a YAML file and populate the configurator from its devices.
Insert one YAML device and retain its matching schema values.
load_microscope_devices(microscope_name, ...)Add every recognizable device from one microscope configuration.
module_classes(category, manufacturer)Return class names mapped to directly declared base-class names.
Confirm and reset the configurator to a clean configuration.
Close the configurator application.
open_device_dialog(title, action_text[, initial])Build a device dialog and populate its controller-owned lists.
parse_coupled_axes(value)Convert comma-separated
leader:followerpairs into a mapping.parse_stage_axes(value)Convert an axes entry into a YAML list, even for one axis.
populate_manufacturers([_event])Fill manufacturers for the selected category.
populate_models([_event])Fill models for the selected category and manufacturer.
refresh_collection_rows(name, spec, parent)Rebuild only the dynamic rows of a collection table.
Open a controller-driven rename dialog for the context microscope.
render_collection_setting(parent, row, name, ...)Render a repeatable configuration collection as an editable table.
render_device_info(schema[, values])Create Property/Value widgets inside the passive Device Info panel.
Return user-facing descriptions of required settings without values.
resize_settings_form(event)Expand settings values with the panel while retaining a minimum width.
resolve_device_type(category, device_type)Match a YAML type to an optional manufacturer and required model name.
Ask for a YAML path and write the configurator's device configuration.
saved_device_type(category, manufacturer, model)Return a YAML device type as
manufacturer.Model.saved_laser_control_type(device_type)Return a laser control type in the YAML
manufacturer.Modelform.Return the selected device item and its controller-owned data.
set_configuration_value(configuration, path, ...)Set a slash-separated configuration path in a nested dictionary.
setting_value_is_present(value)Return whether a value satisfies a required configuration setting.
settings_from_configuration(category, ...)Extract known schema values from one YAML device configuration.
Open the Add Device selection dialog.
show_device_info([_event])Render editable settings for the selected device.
Open the selected device in an Edit Device dialog.
show_microscope_menu(event)Show the Rename/Delete menu for the microscope button clicked.
Display only the devices belonging to the selected microscope.
Copy the currently visible editors into controller-owned device data.
Persist the current device panel before changing microscopes.
update_scrollregion(_event)Update horizontal scrolling for dynamically created setting widgets.
update_stage_axis_range_fields(*_args)Show editable limits and flip flags for the entered stage axes.
Attributes
singleton_device_categories- active_device_is_stage() → bool
Return whether the visible settings belong to a stage device.
- add_collection_row(name: str, spec: CollectionSpec, parent: Labelframe) → None
Append a row of editable collection values.
- static add_device_to_microscope(microscope: dict, category: str, device: dict) → None
Add one serialized device using its category’s YAML structure.
- add_microscope(name: str) → None
Create and display one microscope selection button.
- add_next_microscope() → None
Add and select the next default-named microscope.
- build_configuration() → dict
Build a configuration.yaml-compatible dictionary from added devices.
- static category_base_class_name(category: str) → str
Return a category’s base class name, including acronym exceptions.
- category_is_already_configured(category: str) → bool
Return whether adding or changing would duplicate a singleton category.
- classmethod class_inherits(category: str, manufacturer: str, class_name: str, parent: str) → bool
Check inheritance without importing device hardware APIs.
In addition to classes in the selected module, follow imports from other modules in the same device category. This keeps model discovery safe when a device implementation inherits from a category-specific class defined by another manufacturer module.
- clear_loaded_configuration() → None
Clear configuration widgets and controller state before loading a file.
- static clear_tree(tree: Treeview) → None
Delete all rows from a Treeview.
- static configuration_path_value(configuration: dict, path: str) → object
Return a nested configuration value, or
Nonewhen it is absent.
- confirm_device_dialog() → None
Add or update a device from the selections in the active dialog.
- confirm_microscope_rename(_event: Optional[Event] = None) → None
Apply the pending rename if it is unique and non-empty.
- create_setting_widget(parent: Frame, row: int, spec: SettingSpec, variable: Variable, column: int = 1) → None
Render the editor appropriate for a setting schema definition.
- create_value_variable(spec: SettingSpec, value: Optional[object] = None) → Variable
Create a Tk value variable matching the schema’s declared type.
- delete_collection_row(name: str, spec: CollectionSpec, parent: Labelframe, index: int) → None
Remove one collection row and redraw its table.
- delete_microscope() → None
Delete the microscope targeted by the context menu.
- delete_selected_device() → None
Confirm and delete the device selected in the device list.
- device_configuration(category: str, manufacturer: str, model: str, settings: dict[str, object]) → dict
Convert one configured device into its configuration.yaml section.
- duplicate_filter_wheel_numbers() → list[str]
Return duplicate wheel numbers for matching filter-wheel types.
- duplicate_laser_wavelengths() → list[str]
Return duplicate laser wavelengths grouped by microscope.
- classmethod get_class_configuration_schema(category: str, manufacturer: str, class_name: str) → dict[str, navigate.model.devices.configuration_schema.SettingSpec]
Read class-level schemas without importing device hardware APIs.
Device modules can import vendor SDKs that are unavailable to the configurator. The schema is intentionally declarative, so AST parsing provides the required metadata safely. Local parent schemas are merged before their child schemas.
- get_configuration_schema(category: str, manufacturer: str, model: str) → dict[str, object]
Resolve the currently available configuration schema for a device.
Base-class schemas are authoritative.
get_connect_paramsremains a compatibility fallback until concrete device classes declare their ownconfiguration_schemavalues.
- classmethod get_connect_params(category: str, manufacturer: str, class_name: str) → list[str]
Read literal
get_connect_paramsvalues from a class or local ancestor.
- classmethod get_device_categories() → list[str]
Return device category package names, excluding APIs and caches.
- classmethod get_device_manufacturers(category: str) → list[str]
Return Python manufacturer modules for a category.
- classmethod get_device_models(category: str, manufacturer: str) → list[str]
Return non-base device classes inheriting from the category base class.
- static initial_device_settings(category: str, model: str) → dict[str, object]
Return initial values that depend on the selected device model.
- invalid_stage_position_calibrations() → list[str]
Return partially entered Zoom stage-position calibration rows.
stage_positionsis stored as a nested mapping, so every row needs a solvent, axis, zoom, and position before it can be represented in YAML. Empty rows are ignored and may be completed later.
- invalid_zoom_pixel_sizes() → list[str]
Return Zoom value rows whose pixel size is not a positive float.
- static is_synthetic_laser_type(device_type: object) → bool
Return whether a simple or qualified laser type is synthetic.
- static laser_control_hardware_path(configuration: dict) → Optional[str]
Return the laser control branch selected by its hardware-type rule.
- static laser_device_type(configuration: dict) → str
Resolve a laser type from its on/off and power hardware types.
- load_configuration() → None
Choose a YAML file and populate the configurator from its devices.
- load_device_from_configuration(microscope_name: str, category: str, configuration: dict) → None
Insert one YAML device and retain its matching schema values.
- load_microscope_devices(microscope_name: str, configuration: dict) → None
Add every recognizable device from one microscope configuration.
- classmethod module_classes(category: str, manufacturer: str) → dict[str, list[str]]
Return class names mapped to directly declared base-class names.
- new_configuration() → None
Confirm and reset the configurator to a clean configuration.
- on_cancel() → None
Close the configurator application.
- open_device_dialog(title: str, action_text: str, initial: Optional[tuple[str, str, str]] = None) → None
Build a device dialog and populate its controller-owned lists.
- static parse_coupled_axes(value: str) → dict[str, str]
Convert comma-separated
leader:followerpairs into a mapping.
- static parse_stage_axes(value: str) → list[str]
Convert an axes entry into a YAML list, even for one axis.
- populate_manufacturers(_event: Optional[Event] = None) → None
Fill manufacturers for the selected category.
- populate_models(_event: Optional[Event] = None) → None
Fill models for the selected category and manufacturer.
- refresh_collection_rows(name: str, spec: CollectionSpec, parent: Labelframe) → None
Rebuild only the dynamic rows of a collection table.
- rename_microscope() → None
Open a controller-driven rename dialog for the context microscope.
- render_collection_setting(parent: Frame, row: int, name: str, spec: CollectionSpec, values: Optional[object] = None) → None
Render a repeatable configuration collection as an editable table.
- render_device_info(schema: dict[str, object], values: Optional[dict[str, object]] = None) → None
Create Property/Value widgets inside the passive Device Info panel.
- required_settings_missing_values() → list[str]
Return user-facing descriptions of required settings without values.
- resize_settings_form(event: Event) → None
Expand settings values with the panel while retaining a minimum width.
- classmethod resolve_device_type(category: str, device_type: str) → Optional[tuple[str, str]]
Match a YAML type to an optional manufacturer and required model name.
YAML may name a model directly (
NI), use its full class-style name (NIDAQ), or qualify either form withmanufacturer..
- save_configuration() → None
Ask for a YAML path and write the configurator’s device configuration.
- classmethod saved_device_type(category: str, manufacturer: str, model: str) → str
Return a YAML device type as
manufacturer.Model.
- classmethod saved_laser_control_type(device_type: object) → object
Return a laser control type in the YAML
manufacturer.Modelform.
- selected_device() → Optional[tuple[str, tuple[str, str, str]]]
Return the selected device item and its controller-owned data.
- static set_configuration_value(configuration: dict, path: str, value: object) → None
Set a slash-separated configuration path in a nested dictionary.
- static setting_value_is_present(value: object) → bool
Return whether a value satisfies a required configuration setting.
- settings_from_configuration(category: str, manufacturer: str, model: str, configuration: dict) → dict[str, object]
Extract known schema values from one YAML device configuration.
- show_add_device_dialog() → None
Open the Add Device selection dialog.
- show_device_info(_event: Optional[Event] = None) → None
Render editable settings for the selected device.
- show_edit_device_dialog() → None
Open the selected device in an Edit Device dialog.
- show_microscope_menu(event: Event) → str
Show the Rename/Delete menu for the microscope button clicked.
- show_selected_microscope_devices() → None
Display only the devices belonging to the selected microscope.
- store_active_device_settings() → None
Copy the currently visible editors into controller-owned device data.
- store_visible_microscope_devices() → None
Persist the current device panel before changing microscopes.
- update_scrollregion(_event: Event) → None
Update horizontal scrolling for dynamically created setting widgets.
- update_stage_axis_range_fields(*_args) → None
Show editable limits and flip flags for the entered stage axes.