Skip to content

Commit

Permalink
FEM: remove working dir and ccx binary check from InitGui
Browse files Browse the repository at this point in the history
- they are duplicates of the methods in FemToolsCcx
- FEM could be used without solving too
- they only checked for ccx, but we have more solver already
  • Loading branch information
berndhahnebach authored and yorikvanhavre committed Sep 13, 2016
1 parent 3dd586b commit 0da41bb
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/Mod/Fem/InitGui.py
Expand Up @@ -60,39 +60,6 @@ def Initialize(self):
import _CommandSolverZ88
import _CommandConstraintSelfWeight

import subprocess
from platform import system
ccx_path = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx").GetString("ccxBinaryPath")
if not ccx_path:
try:
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'
if 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:
FreeCAD.Console.PrintError(e.message)

import os
working_dir = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/General").GetString("WorkingDir")
if not (os.path.isdir(working_dir)):
try:
os.makedirs(working_dir)
except:
print ("Dir \'{}\' from FEM preferences doesn't exist and cannot be created.".format(working_dir))
import tempfile
working_dir = tempfile.gettempdir()
print ("Dir \'{}\' will be used instead.".format(working_dir))
if working_dir:
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/General").SetString("WorkingDir", working_dir)
else:
FreeCAD.Console.PrintError("Setting working directory \'{}\' for ccx failed!\n")

def GetClassName(self):
return "FemGui::Workbench"

Expand Down

0 comments on commit 0da41bb

Please sign in to comment.