Skip to content

Commit

Permalink
Added GUI error message when analysis base directory (MSES) is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
mlau154 committed Aug 7, 2024
1 parent 849f5af commit eafe41f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pymead/analysis/calc_aero_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,16 @@ def send_over_pipe(data: object):

# Make the analysis directory if not already created
base_dir = os.path.join(airfoil_coord_dir, airfoil_name)
if not os.path.exists(base_dir):
os.mkdir(base_dir)
try:
if not os.path.exists(base_dir):
os.mkdir(base_dir)
except FileNotFoundError as e:
if conn is not None:
send_over_pipe(("disp_message_box",
f"Could not find analysis base directory {mset_settings['airfoil_analysis_dir']}"))
return
else:
raise FileNotFoundError(f"Could not find analysis base directory {mset_settings['airfoil_analysis_dir']}")

if tool == 'XFOIL':
if xfoil_settings is None:
Expand Down
2 changes: 2 additions & 0 deletions pymead/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1843,6 +1843,8 @@ def progress_update(self, status: str, data: object):
self.output_area_text(data, line_break=True)
elif status == "message" and isinstance(data, str):
self.message_callback_fn(data)
elif status == "disp_message_box" and isinstance(data, str):
self.disp_message_box(data)
elif status == "opt_progress" and isinstance(data, dict):
callback = TextCallback(parent=self, text_list=data["text"], completed=data["completed"],
warm_start_gen=data["warm_start_gen"])
Expand Down

0 comments on commit eafe41f

Please sign in to comment.