From fc7e91c5b264b7a1ee157a11de2fa1e45dcc0144 Mon Sep 17 00:00:00 2001 From: JeanBilheux Date: Thu, 17 Aug 2023 16:37:08 -0400 Subject: [PATCH] about to look at the status of the reconstructions. this refs #76 --- .../event_handler.py | 32 +++++++--------- src/hyperctui/hyperctui.py | 4 +- .../initialization/gui_initialization.py | 8 +++- src/hyperctui/ui/main_application.ui | 37 +++++++++++++++---- 4 files changed, 52 insertions(+), 29 deletions(-) diff --git a/src/hyperctui/autonomous_reconstruction/event_handler.py b/src/hyperctui/autonomous_reconstruction/event_handler.py index 160e2f0..6cbe9e9 100644 --- a/src/hyperctui/autonomous_reconstruction/event_handler.py +++ b/src/hyperctui/autonomous_reconstruction/event_handler.py @@ -138,7 +138,7 @@ def start_acquisition(self): # enable self.parent.ui.autonomous_refresh_pushButton.setEnabled(True) - self.parent.ui.autonomous_monitor_groupBox.setVisible(True) + self.parent.ui.autonomous_reconstruction_tabWidget.setVisible(True) self.parent.ui.autonomous_refresh_pushButton.setStyleSheet(interact_me_style) number_angles = self.parent.ui.evaluation_frequency_spinBox.value() @@ -217,7 +217,7 @@ def init_autonomous_table(self): logging.info(f"- {list_tof_region_index =}") logging.info(f"- {list_tof_region_collected =}") - o_table = TableHandler(table_ui=self.parent.ui.autonomous_reconstruction_tableWidget) + o_table = TableHandler(table_ui=self.parent.ui.autonomous_projections_tableWidget) o_table.remove_all_rows() for _row in np.arange(nbr_angles): @@ -271,7 +271,7 @@ def preview_data(self, row=-1): file_name=file_name) preview_image.show() - def refresh_table_clicked(self): + def refresh_projections_table_clicked(self): """refresh button next to the table has been clicked""" logging.info("User refreshing the autonomous reconstruction step1 table!") @@ -321,9 +321,9 @@ def refresh_table_clicked(self): self.fill_table_with_list_folders(list_folders=list_new_folders, starting_row_index=starting_row_index) - self.checking_state_of_widgets_post_reconstruction() + self.checking_state_of_projections_table() - def checking_state_of_widgets_post_reconstruction(self): + def checking_state_of_projections_table(self): """This is looking for all the projections angles requested. If they are all there, then it will change the state of the widgets.""" @@ -345,13 +345,8 @@ def checking_state_of_widgets_post_reconstruction(self): self.parent.ui.autonomous_reconstruction_tabWidget.setCurrentIndex(1) # fill table with as many as TOF regions reconstruction requested - o_get = AutonomousGet(parent=self.parent) - nbr_tof_regions = o_get.get_nbr_tof_regions() - tof_regions_dict = self.parent.session_dict[SessionKeys.tof_regions] - o_table = TableHandler(table_ui=self.parent.ui.autonomous_reconstructions_tableWidget) - o_table.insert_empty_row(row=nbr_tof_regions) row_index = 0 for _key in tof_regions_dict.keys(): @@ -377,14 +372,15 @@ def checking_state_of_widgets_post_reconstruction(self): o_table.set_background_color(row=row_index, column=ReconstructionTableColumnIndex.status, qcolor=background_color) + row_index += 1 + + def refrech_reconstruction_table_clicked(self): + """this is where we will check the json file in {{location TBD}} and look for tag that + list the reconstruction done!""" + pass + - # checking if any reconstruction showed up - if self.is_reconstruction_done(): - self.parent.ui.autonomous_reconstructed_status_label.setText(DataStatus.ready) - else: - # if not - pass def fill_table_with_list_folders(self, list_folders=None, starting_row_index=0): @@ -392,7 +388,7 @@ def fill_table_with_list_folders(self, list_folders=None, starting_row_index=0): return o_get = GetMonitor(grand_parent=self.parent) - o_table = TableHandler(table_ui=self.parent.ui.autonomous_reconstruction_tableWidget) + o_table = TableHandler(table_ui=self.parent.ui.autonomous_projections_tableWidget) for _offset_row_index in np.arange(len(list_folders)): @@ -552,4 +548,4 @@ def update_autonomous_reconstruction_widgets(self): list_folders_acquired = self.parent.session_dict[SessionKeys.list_projections_folders_acquired_so_far] self.fill_table_with_list_folders(list_folders=list_folders_acquired, starting_row_index=0) - self.checking_state_of_widgets_post_reconstruction() + self.checking_state_of_projections_table() diff --git a/src/hyperctui/hyperctui.py b/src/hyperctui/hyperctui.py index e77cd37..d6fe98c 100644 --- a/src/hyperctui/hyperctui.py +++ b/src/hyperctui/hyperctui.py @@ -474,11 +474,11 @@ def autonomous_reconstruction_stop_process_button_clicked(self): def autonomous_refresh_table_clicked(self): o_event = AutonomousReconstructionHandler(parent=self) - o_event.refresh_table_clicked() + o_event.refresh_projections_table_clicked() def autonomous_checking_reconstruction_clicked(self): o_event = AutonomousReconstructionHandler(parent=self) - o_event.checking_reconstruction_clicked() + o_event.refrech_reconstruction_table_clicked() # leaving ui def closeEvent(self, c): diff --git a/src/hyperctui/initialization/gui_initialization.py b/src/hyperctui/initialization/gui_initialization.py index 9877daa..872e17c 100644 --- a/src/hyperctui/initialization/gui_initialization.py +++ b/src/hyperctui/initialization/gui_initialization.py @@ -53,8 +53,12 @@ def tables(self): column_sizes = [600, 50] o_table.set_column_sizes(column_sizes=column_sizes) - table_columns = [540, 80, 80, 80, 100] - o_table = TableHandler(table_ui=self.parent.ui.autonomous_reconstruction_tableWidget) + table_columns = [540, 80, 80, 80, 80, 100] + o_table = TableHandler(table_ui=self.parent.ui.autonomous_projections_tableWidget) + o_table.set_column_sizes(column_sizes=table_columns) + + recon_table_columns = [740, 80, 100] + o_table = TableHandler(table_ui=self.parent.ui.autonomous_reconstructions_tableWidget) o_table.set_column_sizes(column_sizes=table_columns) def full_reset(self): diff --git a/src/hyperctui/ui/main_application.ui b/src/hyperctui/ui/main_application.ui index f937566..3326019 100644 --- a/src/hyperctui/ui/main_application.ui +++ b/src/hyperctui/ui/main_application.ui @@ -1429,7 +1429,7 @@ - + true @@ -1532,7 +1532,29 @@ - + + + true + + + false + + + + Folder name + + + + + Preview + + + + + Status + + + @@ -2416,7 +2438,7 @@ 481 - 456 + 530 1132 @@ -2447,8 +2469,8 @@ autonomous_refresh_table_clicked() - 1070 - 525 + 1062 + 613 1132 @@ -2575,8 +2597,8 @@ autonomous_checking_reconstruction_clicked() - 1029 - 672 + 1021 + 595 1089 @@ -2633,5 +2655,6 @@ action_settings_clicked() refresh_list_of_obs_button_clicked() autonomous_checking_reconstruction_clicked() + autonomous_checking_projections_clicked()