mirror of https://gitlab.com/pamhyr/pamhyr2
MeshingTools: Fix mailleurTT path.
parent
3516986ff2
commit
672f81f216
|
|
@ -30,7 +30,7 @@ from ctypes import (
|
||||||
)
|
)
|
||||||
from PyQt5.QtCore import QProcess
|
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
|
from Meshing.AMeshingTool import AMeshingTool
|
||||||
|
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
|
|
@ -278,7 +278,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
||||||
return os.path.abspath(
|
return os.path.abspath(
|
||||||
os.path.join(
|
os.path.join(
|
||||||
os.path.dirname(__file__),
|
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)
|
st_file = self.export_reach_to_st(reach, tmp)
|
||||||
m_file = st_file.rsplit(".ST", 1)[0] + ".M"
|
m_file = st_file.rsplit(".ST", 1)[0] + ".M"
|
||||||
|
|
||||||
|
os.sync()
|
||||||
|
|
||||||
proc = QProcess()
|
proc = QProcess()
|
||||||
proc.setWorkingDirectory(tmp)
|
proc.setWorkingDirectory(tmp)
|
||||||
|
|
||||||
|
|
@ -312,7 +314,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
||||||
linear = 1 if linear else 0
|
linear = 1 if linear else 0
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
f"! mailleurTT {st_file} {m_file} " +
|
f"! {self._exe_path()} {st_file} {m_file} " +
|
||||||
f"{str(step)} " +
|
f"{str(step)} " +
|
||||||
f"{limites[0]} {limites[1]} " +
|
f"{limites[0]} {limites[1]} " +
|
||||||
f"{directrices[0]} {directrices[1]} " +
|
f"{directrices[0]} {directrices[1]} " +
|
||||||
|
|
@ -332,13 +334,22 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
||||||
)
|
)
|
||||||
proc.waitForFinished()
|
proc.waitForFinished()
|
||||||
|
|
||||||
|
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()
|
errors = proc.readAllStandardError()
|
||||||
if len(errors) != 0:
|
|
||||||
logger.error(
|
logger.error(
|
||||||
f"{logger_color_red()}{errors}{logger_color_reset()}"
|
f"{logger_color_red()}{errors}{logger_color_reset()}"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.import_m_file(reach, m_file)
|
self.import_m_file(reach, m_file)
|
||||||
|
|
||||||
return reach
|
return reach
|
||||||
|
|
||||||
def export_reach_to_st(self, reach, tmp):
|
def export_reach_to_st(self, reach, tmp):
|
||||||
|
|
@ -350,7 +361,9 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
||||||
return tmp_st
|
return tmp_st
|
||||||
|
|
||||||
def import_m_file(self, reach, m):
|
def import_m_file(self, reach, m):
|
||||||
|
if os.path.exists(m):
|
||||||
reach.purge()
|
reach.purge()
|
||||||
|
|
||||||
logger.debug(f"meshing: Import geometry from {m}")
|
logger.debug(f"meshing: Import geometry from {m}")
|
||||||
reach.import_geometry(m)
|
reach.import_geometry(m)
|
||||||
|
else:
|
||||||
|
logger.error(f"meshing: Meshed geometry file {m} do not exists")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue