[FEM] fix solver console bugs
- for Elmer and Z88 on Windows several windows pop up (console windows). This is maybe annoying and the user is wondering what is going on, but the main problem is that when you close them, you break the solving process. Therefore, on Windows only, hide the empty popup windows.
This commit is contained in:
@@ -121,10 +121,18 @@ class Solve(run.Solve):
|
||||
if os.path.isdir(solvpath):
|
||||
os.environ["ELMER_HOME"] = solvpath
|
||||
os.environ["LD_LIBRARY_PATH"] = "$LD_LIBRARY_PATH:{}/modules".format(solvpath)
|
||||
self._process = subprocess.Popen(
|
||||
# hide the popups on Windows
|
||||
if system() == "Windows":
|
||||
self._process = subprocess.Popen(
|
||||
[binary], cwd=self.directory,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
stderr=subprocess.PIPE,
|
||||
startupinfo=femutils.startProgramInfo("hide"))
|
||||
else:
|
||||
self._process = subprocess.Popen(
|
||||
[binary], cwd=self.directory,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
self.signalAbort.add(self._process.terminate)
|
||||
output = self._observeSolver(self._process)
|
||||
self._process.communicate()
|
||||
|
||||
@@ -33,6 +33,7 @@ import os
|
||||
import os.path
|
||||
import subprocess
|
||||
import tempfile
|
||||
from platform import system
|
||||
|
||||
from FreeCAD import Console
|
||||
from FreeCAD import Units
|
||||
@@ -223,7 +224,12 @@ class Writer(object):
|
||||
unvPath,
|
||||
"-scale", "0.001", "0.001", "0.001",
|
||||
"-out", self.directory]
|
||||
subprocess.call(args, stdout=subprocess.DEVNULL)
|
||||
# hide the popups on Windows
|
||||
if system() == "Windows":
|
||||
subprocess.call(args, stdout=subprocess.DEVNULL,
|
||||
startupinfo=femutils.startProgramInfo("hide"))
|
||||
else:
|
||||
subprocess.call(args, stdout=subprocess.DEVNULL)
|
||||
|
||||
def _writeStartinfo(self):
|
||||
path = os.path.join(self.directory, _STARTINFO_NAME)
|
||||
|
||||
Reference in New Issue
Block a user