Skip to content

Commit

Permalink
new UI. this refs #76
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed Aug 17, 2023
1 parent b22c035 commit 7498126
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 28 deletions.
32 changes: 10 additions & 22 deletions src/hyperctui/autonomous_reconstruction/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ def start_acquisition(self):
# retrieve list of folders in the reconstruction folder
self.update_list_recon_folders_initially_there(folder_path=folder_path)

self.parent.ui.autonomous_projection_location_label.setText(folder_path.mcp)

self.init_autonomous_table()

def stop_acquisition(self):
Expand Down Expand Up @@ -211,27 +213,9 @@ def init_autonomous_table(self):
logging.info(f"- {list_tof_region_index =}")
logging.info(f"- {list_tof_region_collected =}")

# print(f"{formatted2_list_golden_ratio =}")
# print(f"{ list_tof_region_collected =}")
# print(f"{list_tof_region_index =}")

o_table = TableHandler(table_ui=self.parent.ui.autonomous_reconstruction_tableWidget)
o_table.remove_all_rows()

# # retrieve the list of folders in the output folder (any new one will be the one we are looking for)
# self.update_list_projections_folders_initially_there(folder_path=folder_path)
# list_folders_there = self.parent.session_dict[SessionKeys.list_projections_folders_initially_there]
# list_folders_there.sort()
# formatted_list_folders_there = "\n".join(list_folders_there)
# logging.info(f"- list folders initially there:\n"
# f"{formatted_list_folders_there}")
#
# # no projections yet as we just started
# self.parent.session_dict[SessionKeys.list_projections_folders_acquired_so_far] = None
#
# # retrieve list of folders in the reconstruction folder
# self.update_list_recon_folders_initially_there(folder_path=folder_path)

for _row in np.arange(nbr_angles):
o_table.insert_empty_row(row=_row)

Expand All @@ -255,8 +239,8 @@ def init_autonomous_table(self):
qcolor=background_color)

self.parent.ui.autonomous_reconstructed_location_label.setText(folder_path.recon)
self.parent.ui.autonomous_reconstructed_status_label.setText(DataStatus.in_queue)
self.parent.ui.autonomous_reconstructed_status_label.setStyleSheet(label_in_focus_style)
# self.parent.ui.autonomous_reconstructed_status_label.setStyleSheet(label_in_focus_style)
self.parent.ui.autonomous_reconstruction_tabWidget.setTabEnabled(1, False)

def preview_log(self, state=0, row=-1, data_type='ob'):
log_file = self.parent.dict_projection_log_err_metadata[row]['log_file']
Expand Down Expand Up @@ -346,14 +330,16 @@ def checking_state_of_widgets_post_reconstruction(self):
self.parent.ui.autonomous_refresh_pushButton.setStyleSheet(normal_style)
self.parent.ui.autonomous_checking_reconstruction_pushButton.setEnabled(True)
self.parent.ui.autonomous_checking_reconstruction_pushButton.setStyleSheet(interact_me_style)
self.parent.ui.autonomous_reconstruction_tabWidget.setTabEnabled(1, True)
self.parent.ui.autonomous_reconstruction_tabWidget.setCurrentIndex(1)

# checking if any reconstruction showed up
if self.is_reconstruction_done():
self.parent.ui.autonomous_reconstructed_status_label.setText(DataStatus.ready)

else:
# if not
self.parent.ui.autonomous_reconstructed_status_label.setText(DataStatus.in_progress)
pass

def fill_table_with_list_folders(self, list_folders=None, starting_row_index=0):

Expand Down Expand Up @@ -501,8 +487,10 @@ def update_autonomous_reconstruction_widgets(self):
self.parent.ui.start_first_reconstruction_pushButton.setStyleSheet(normal_style)
self.parent.ui.autonomous_refresh_pushButton.setEnabled(True)

self.parent.ui.autonomous_projection_location_label.setText(self.parent.folder_path.mcp)

# enable table
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)

# populate first projections table
Expand Down
2 changes: 1 addition & 1 deletion src/hyperctui/initialization/gui_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def widgets(self):
self.parent.ui.logo.setPixmap(logo_icon)
# self.parent.ui.tab.setStyleSheet("background-image: url('" + background_file + "'); background-repeat: no-repeat")

self.parent.ui.autonomous_monitor_groupBox.setVisible(False)
self.parent.ui.autonomous_reconstruction_tabWidget.setVisible(False)

def statusbar(self):
self.parent.eventProgress = QProgressBar(self.parent.ui.statusbar)
Expand Down
20 changes: 17 additions & 3 deletions src/hyperctui/ui/main_application.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@
</widget>
</item>
<item>
<widget class="QTabWidget" name="tabWidget_2">
<widget class="QTabWidget" name="autonomous_reconstruction_tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
Expand All @@ -1389,6 +1389,20 @@
<layout class="QVBoxLayout" name="verticalLayout_23">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_19">
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>Location:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="autonomous_projection_location_label">
<property name="text">
<string>N/A</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_16">
<property name="orientation">
Expand Down Expand Up @@ -1526,8 +1540,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>30</height>
<width>1082</width>
<height>645</height>
</rect>
</property>
<attribute name="label">
Expand Down
4 changes: 2 additions & 2 deletions src/hyperctui/utilities/folder_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def update(self):
self.root = homepath
ipts = self.parent.session_dict[SessionKeys.ipts_selected]
instrument = self.parent.session_dict[SessionKeys.instrument]
title = self.parent.ui.run_title_formatted_label.text()
title = self.parent.session_dict[SessionKeys.run_title]

if (instrument is None) | (ipts is None):
return
Expand Down Expand Up @@ -68,7 +68,7 @@ def mcp(self):
self.mcp = os.sep.join([self.autoreduce, "mcp"])

def recon(self, title=None):
self.recon = os.sep.join([self.shared, "insitu_recon", "recon", title])
self.recon = os.sep.join([self.shared, "insitu_recon", title, "recon"])

def create_mcp_raw(self):
self.mcp_raw = os.sep.join([self.ipts_full_path,
Expand Down

0 comments on commit 7498126

Please sign in to comment.