Skip to content

Commit

Permalink
Application starts and path to files is correct now. this refs #84
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed Aug 14, 2024
1 parent 7c431ad commit 1215b45
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/hyperctui/hyperctui.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from hyperctui.session import DefaultValues

# warnings.filterwarnings('ignore')
DEBUG = True
DEBUG = False

if DEBUG:
HOME_FOLDER = "/Volumes/JeanHardDrive/" # mac at home
Expand Down Expand Up @@ -501,6 +501,7 @@ def set_window_title(self):
self.ui.setWindowTitle(title)

def inform_of_output_location(self):
facility = self.session_dict.get(SessionKeys.facility, 'SNS')
instrument = self.session_dict[SessionKeys.instrument]
ipts = self.session_dict[SessionKeys.ipts_selected]
title = self.ui.run_title_formatted_label.text()
Expand All @@ -519,21 +520,21 @@ def inform_of_output_location(self):
if title == "N/A":
title = "'title'"

output_location = os.sep.join([self.homepath,
output_location = os.sep.join([facility,
instrument,
ipts,
"shared",
"autoreduce",
"mcp",
])
ob_output_location = os.sep.join([self.homepath,
ob_output_location = os.sep.join([facility,
instrument,
ipts,
"shared",
"autoreduce",
"mcp",
])
final_ob_output_location = os.sep.join([self.homepath,
final_ob_output_location = os.sep.join([facility,
instrument,
ipts,
"shared",
Expand Down
1 change: 1 addition & 0 deletions src/hyperctui/session/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class SessionKeys:

config_version = 'config version'

facility = 'facility'
instrument = 'instrument'
ipts_selected = 'ipts selected'
ipts_index_selected = 'ipts index selected'
Expand Down
1 change: 1 addition & 0 deletions src/hyperctui/session/new_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def accept(self):
ipts = self.ui.ipts_comboBox.currentText()
ipts_index = self.ui.ipts_comboBox.currentIndex()

self.parent.session_dict[SessionKeys.facility] = 'SNS' if instrument in ['SNAP', 'VENUS'] else 'HFIR'
self.parent.session_dict[SessionKeys.instrument] = instrument
self.parent.session_dict[SessionKeys.ipts_selected] = ipts
self.parent.session_dict[SessionKeys.ipts_index_selected] = ipts_index
Expand Down
2 changes: 2 additions & 0 deletions src/hyperctui/session/session_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def save_from_ui(self):
session_dict[SessionKeys.window_height] = height

instrument = session_dict[SessionKeys.instrument]
instrument = session_dict.get(SessionKeys.facility, 'SNS')
ipts_selected = session_dict[SessionKeys.ipts_selected]
ipts_index_selected = session_dict[SessionKeys.ipts_index_selected]

Expand All @@ -57,6 +58,7 @@ def save_from_ui(self):
output_projection_folder = o_get_step1.projection_folder()
output_ob_folder = o_get_step1.ob_folder()

session_dict[SessionKeys.facility] = facility
session_dict[SessionKeys.instrument] = instrument
session_dict[SessionKeys.ipts_selected] = ipts_selected
session_dict[SessionKeys.ipts_index_selected] = ipts_index_selected
Expand Down

0 comments on commit 1215b45

Please sign in to comment.