[FEM] fix Z88 binary handling
- when the binary was not found, the function called the non-existing binary - also push error message for Elmer and Z88 to the status info so that user gets feedback also when report view console is not shown - uniform wording to 'binary' - avoid unnecessary console output
This commit is contained in:
@@ -159,7 +159,8 @@ class Solve(run.Solve):
|
||||
if not self.aborted:
|
||||
self._updateOutput(output)
|
||||
else:
|
||||
self.report.error("ElmerSolver executable not found.")
|
||||
self.report.error("ElmerSolver binary not found.")
|
||||
self.pushStatus("Error: ElmerSolver binary has not been found!")
|
||||
self.fail()
|
||||
|
||||
def _updateOutput(self, output):
|
||||
|
||||
@@ -87,14 +87,16 @@ def get_binary(name):
|
||||
Return the specific path set by the user in FreeCADs settings/parameter
|
||||
system if set or the default binary name if no specific path is set. If no
|
||||
path was found because the solver *name* is not supported ``None`` is
|
||||
returned. This method does not check whether the binary actually exists
|
||||
and is callable.
|
||||
returned.
|
||||
This method does not check whether the binary actually exists and is callable.
|
||||
That check is done in DlgSettingsFem_Solver_Imp.cpp
|
||||
|
||||
:param name: solver id as a ``str`` (see :mod:`femsolver.settings`)
|
||||
"""
|
||||
if name in _SOLVER_PARAM:
|
||||
binary = _SOLVER_PARAM[name].get_binary()
|
||||
FreeCAD.Console.PrintMessage('Solver binary path: {} \n'.format(binary))
|
||||
if binary is not None:
|
||||
FreeCAD.Console.PrintMessage('Solver binary path: {} \n'.format(binary))
|
||||
return binary
|
||||
else:
|
||||
FreeCAD.Console.PrintError(
|
||||
@@ -236,7 +238,8 @@ class _SolverDlg(object):
|
||||
"The binary has not been found. Full binary search path: {}\n"
|
||||
.format(binary)
|
||||
)
|
||||
FreeCAD.Console.PrintLog("Solver binary found path: {}\n".format(the_found_binary))
|
||||
else:
|
||||
FreeCAD.Console.PrintLog("Found solver binary path: {}\n".format(the_found_binary))
|
||||
return the_found_binary
|
||||
|
||||
def get_cores(self):
|
||||
|
||||
@@ -104,7 +104,9 @@ class Solve(run.Solve):
|
||||
self.pushStatus("Get solver binary...\n")
|
||||
binary = settings.get_binary("Z88")
|
||||
if binary is None:
|
||||
self.fail() # a print has been made in settings module
|
||||
self.pushStatus("Error: The z88r binary has not been found!")
|
||||
self.fail()
|
||||
return
|
||||
|
||||
prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Z88")
|
||||
solver = SOLVER_TYPES
|
||||
|
||||
Reference in New Issue
Block a user