Commit 672f81f2 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

MeshingTools: Fix mailleurTT path.

No related merge requests found
Pipeline #54925 passed with stages
in 3 minutes and 40 seconds
Showing with 22 additions and 9 deletions
+22 -9
......@@ -30,7 +30,7 @@ from ctypes import (
)
from PyQt5.QtCore import QProcess
from tools import logger_color_red, logger_color_reset
from tools import logger_color_red, logger_color_reset, logger_exception
from Meshing.AMeshingTool import AMeshingTool
logger = logging.getLogger()
......@@ -278,7 +278,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
return os.path.abspath(
os.path.join(
os.path.dirname(__file__),
"..", "..", "..", "mage", f"mailleurTT{ext}"
"..", "..", "mage8", f"mailleurTT{ext}"
)
)
......@@ -305,6 +305,8 @@ class MeshingWithMageMailleurTT(AMeshingTool):
st_file = self.export_reach_to_st(reach, tmp)
m_file = st_file.rsplit(".ST", 1)[0] + ".M"
os.sync()
proc = QProcess()
proc.setWorkingDirectory(tmp)
......@@ -312,7 +314,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
linear = 1 if linear else 0
logger.info(
f"! mailleurTT {st_file} {m_file} " +
f"! {self._exe_path()} {st_file} {m_file} " +
f"{str(step)} " +
f"{limites[0]} {limites[1]} " +
f"{directrices[0]} {directrices[1]} " +
......@@ -332,13 +334,22 @@ class MeshingWithMageMailleurTT(AMeshingTool):
)
proc.waitForFinished()
errors = proc.readAllStandardError()
if len(errors) != 0:
if proc.exitCode() != 0:
logger.error(
f"{logger_color_red()}" +
f"MailleurTT error: {proc.exitCode()}" +
f"{logger_color_reset()}"
)
outputs = proc.readAllStandardOutput()
logger.debug(outputs)
errors = proc.readAllStandardError()
logger.error(
f"{logger_color_red()}{errors}{logger_color_reset()}"
)
else:
self.import_m_file(reach, m_file)
return reach
def export_reach_to_st(self, reach, tmp):
......@@ -350,7 +361,9 @@ class MeshingWithMageMailleurTT(AMeshingTool):
return tmp_st
def import_m_file(self, reach, m):
reach.purge()
logger.debug(f"meshing: Import geometry from {m}")
reach.import_geometry(m)
if os.path.exists(m):
reach.purge()
logger.debug(f"meshing: Import geometry from {m}")
reach.import_geometry(m)
else:
logger.error(f"meshing: Meshed geometry file {m} do not exists")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment