Skip to content

Commit

Permalink
FEM: pref, if ccx standard path and ccx path are not set, set ccx sta…
Browse files Browse the repository at this point in the history
…ndard to true
  • Loading branch information
berndhahnebach committed Oct 5, 2016
1 parent 469f22d commit 3cf036d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Mod/Fem/FemToolsCcx.py
Expand Up @@ -121,7 +121,7 @@ def setup_ccx(self, ccx_binary=None, ccx_binary_sig="CalculiX"):
if p1.wait() == 0:
ccx_path = p1.stdout.read().split('\n')[0]
elif p1.wait() == 1:
error_message = "FEM: CalculiX binary ccx not found in standard system binary path. Please install ccx or set path to binary in FEM preferences.\n"
error_message = "FEM: CalculiX binary ccx not found in standard system binary path. Please install ccx or set path to binary in FEM preferences tab CalculiX.\n"
if FreeCAD.GuiUp:
QtGui.QMessageBox.critical(None, error_title, error_message)
raise Exception(error_message)
Expand All @@ -130,6 +130,12 @@ def setup_ccx(self, ccx_binary=None, ccx_binary_sig="CalculiX"):
if not ccx_binary:
self.ccx_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx")
ccx_binary = self.ccx_prefs.GetString("ccxBinaryPath", "")
if not ccx_binary:
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx").SetBool("UseStandardCcxLocation", True)
error_message = "FEM: CalculiX binary ccx path not set at all. The use of standard path was activated in FEM preferences tab CalculiX. Please try again!\n"
if FreeCAD.GuiUp:
QtGui.QMessageBox.critical(None, error_title, error_message)
raise Exception(error_message)
self.ccx_binary = ccx_binary

import subprocess
Expand All @@ -153,7 +159,7 @@ def setup_ccx(self, ccx_binary=None, ccx_binary_sig="CalculiX"):
except OSError as e:
FreeCAD.Console.PrintError(e.message)
if e.errno == 2:
error_message = "FEM: CalculiX binary ccx \'{}\' not found. Please set the CalculiX binary ccx path in FEM preferences.\n".format(ccx_binary)
error_message = "FEM: CalculiX binary ccx \'{}\' not found. Please set the CalculiX binary ccx path in FEM preferences tab CalculiX.\n".format(ccx_binary)
if FreeCAD.GuiUp:
QtGui.QMessageBox.critical(None, error_title, error_message)
raise Exception(error_message)
Expand Down

0 comments on commit 3cf036d

Please sign in to comment.