Skip to content

Commit

Permalink
FEM: Fill default ccx binary location in Preferences
Browse files Browse the repository at this point in the history
ccx path is filled for linux and windows if it was empty.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
  • Loading branch information
PrzemoF authored and wwmayer committed Apr 14, 2015
1 parent bf179d9 commit b7bb434
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Mod/Fem/InitGui.py
Expand Up @@ -33,9 +33,20 @@
class FemWorkbench (Workbench):
"Fem workbench object"
def __init__(self):
import subprocess
from platform import system
self.__class__.Icon = FreeCAD.getResourceDir() + "Mod/Fem/Resources/icons/preferences-fem.svg"
self.__class__.MenuText = "FEM"
self.__class__.ToolTip = "FEM workbench"
ccx_path = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem").GetString("ccxBinaryPath")
if not ccx_path:
if system() == 'Linux':
p1 = subprocess.Popen(['which', 'ccx'], stdout=subprocess.PIPE)
if p1.wait() == 0:
ccx_path = p1.stdout.read().split('\n')[0]
elif system() == 'Windows':
ccx_path = FreeCAD.getHomePath() + 'bin/ccx.exe'
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem").SetString("ccxBinaryPath", ccx_path)

def Initialize(self):
# load the module
Expand Down

0 comments on commit b7bb434

Please sign in to comment.