Skip to content

Commit

Permalink
Automatically apply Physics Package after LLNL import is complete
Browse files Browse the repository at this point in the history
Signed-off-by: Brianna Major <[email protected]>
  • Loading branch information
Brianna Major committed Jan 9, 2025
1 parent 93ab812 commit 9b6226e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 1 addition & 4 deletions hexrdgui/llnl_import_tool_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LLNLImportToolDialog(QObject):

cancel_workflow = Signal()

def __init__(self, cmap=None, physics_package_manager=None, parent=None):
def __init__(self, cmap=None, parent=None):
super().__init__(parent)

loader = UiLoader()
Expand All @@ -59,7 +59,6 @@ def __init__(self, cmap=None, physics_package_manager=None, parent=None):
self.import_in_progress = False
self.loaded_images = []
self.canvas = parent.image_tab_widget.active_canvas
self.physics_package_manager = physics_package_manager

# Disable these by default.
# If we disable these in Qt Designer, there are some weird bugs
Expand Down Expand Up @@ -620,8 +619,6 @@ def completed(self):
self.ui.instrument.setDisabled(False)
HexrdConfig().enable_canvas_toolbar.emit(True)
self.cmap.block_updates(False)
HexrdConfig().use_physics_package = True
self.physics_package_manager.show()

def show(self):
self.ui.show()
Expand Down
8 changes: 6 additions & 2 deletions hexrdgui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ def __init__(self, parent=None, image_files=None):
self.simple_image_series_dialog = SimpleImageSeriesDialog(self.ui)
self.llnl_import_tool_dialog = LLNLImportToolDialog(
self.color_map_editor,
self.physics_package_manager_dialog,
self.ui)
self.image_stack_dialog = ImageStackDialog(
self.ui, self.simple_image_series_dialog)
Expand Down Expand Up @@ -1546,7 +1545,12 @@ def on_action_hedm_import_tool_triggered(self):
self.simple_image_series_dialog.show()

def on_action_llnl_import_tool_triggered(self):
self.llnl_import_tool_dialog.show()
dialog = self.llnl_import_tool_dialog
dialog.show()
# Always assume Physics Package is needed for LLNL import
dialog.ui.complete.clicked.connect(
lambda: self.on_action_apply_physics_package_toggled(True)
)

def on_action_image_stack_triggered(self):
self.image_stack_dialog.show()
Expand Down

0 comments on commit 9b6226e

Please sign in to comment.