Skip to content

Commit

Permalink
FEM: fix prefs
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach authored and wwmayer committed Aug 15, 2016
1 parent fe47ef7 commit 892271c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Mod/Fem/InitGui.py
Expand Up @@ -62,7 +62,7 @@ def Initialize(self):

import subprocess
from platform import system
ccx_path = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem").GetString("ccxBinaryPath")
ccx_path = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx").GetString("ccxBinaryPath")
if not ccx_path:
try:
if system() == 'Linux':
Expand All @@ -72,7 +72,7 @@ def Initialize(self):
elif system() == 'Windows':
ccx_path = FreeCAD.getHomePath() + 'bin/ccx.exe'
if ccx_path:
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem").SetString("ccxBinaryPath", ccx_path)
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx").SetString("ccxBinaryPath", ccx_path)
else:
FreeCAD.Console.PrintError("CalculiX ccx binary not found! Please set it manually in FEM preferences.\n")
except Exception as e:
Expand Down
9 changes: 4 additions & 5 deletions src/Mod/Fem/_TaskPanelFemSolverCalculix.py
Expand Up @@ -40,8 +40,8 @@
class _TaskPanelFemSolverCalculix:
def __init__(self, solver_object):
self.form = FreeCADGui.PySideUic.loadUi(FreeCAD.getHomePath() + "Mod/Fem/TaskPanelFemSolverCalculix.ui")
self.fem_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem")
ccx_binary = self.fem_prefs.GetString("ccxBinaryPath", "")
self.ccx_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx")
ccx_binary = self.ccx_prefs.GetString("ccxBinaryPath", "")
if ccx_binary:
self.CalculixBinary = ccx_binary
print ("Using CalculiX binary path from FEM preferences: {}".format(ccx_binary))
Expand All @@ -53,7 +53,6 @@ def __init__(self, solver_object):
self.CalculixBinary = FreeCAD.getHomePath() + 'bin/ccx.exe'
else:
self.CalculixBinary = 'ccx'
self.fem_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem")

self.solver_object = solver_object

Expand Down Expand Up @@ -222,10 +221,10 @@ def start_ext_editor(self, ext_editor_path, filename):

def editCalculixInputFile(self):
print ('editCalculixInputFile {}'.format(self.inp_file_name))
if self.fem_prefs.GetBool("UseInternalEditor", True):
if self.ccx_prefs.GetBool("UseInternalEditor", True):
FemGui.open(self.inp_file_name)
else:
ext_editor_path = self.fem_prefs.GetString("ExternalEditorPath", "")
ext_editor_path = self.ccx_prefs.GetString("ExternalEditorPath", "")
if ext_editor_path:
self.start_ext_editor(ext_editor_path, self.inp_file_name)
else:
Expand Down

0 comments on commit 892271c

Please sign in to comment.