mirror of https://gitlab.com/pamhyr/pamhyr2
Meshing: Fix meshing M file import.
parent
f9a8512477
commit
e0cee0fbef
|
|
@ -343,7 +343,9 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
logger.info("Waiting ...")
|
||||||
proc.waitForFinished()
|
proc.waitForFinished()
|
||||||
|
logger.info(f"Waiting ... Done (status : {proc.exitCode()})")
|
||||||
|
|
||||||
if proc.exitCode() != 0:
|
if proc.exitCode() != 0:
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|
@ -352,7 +354,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
||||||
f"{logger_color_reset()}"
|
f"{logger_color_reset()}"
|
||||||
)
|
)
|
||||||
outputs = proc.readAllStandardOutput()
|
outputs = proc.readAllStandardOutput()
|
||||||
logger.debug(outputs)
|
logger.warning(outputs)
|
||||||
|
|
||||||
errors = proc.readAllStandardError()
|
errors = proc.readAllStandardError()
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|
@ -418,7 +420,9 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
logger.debug("Waiting ...")
|
||||||
proc.waitForFinished()
|
proc.waitForFinished()
|
||||||
|
logger.debug(f"Waiting ... Done (status : {proc.exitCode()})")
|
||||||
|
|
||||||
if proc.exitCode() != 0:
|
if proc.exitCode() != 0:
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|
@ -427,7 +431,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
||||||
f"{logger_color_reset()}"
|
f"{logger_color_reset()}"
|
||||||
)
|
)
|
||||||
outputs = proc.readAllStandardOutput()
|
outputs = proc.readAllStandardOutput()
|
||||||
logger.debug(outputs)
|
logger.warning(outputs)
|
||||||
|
|
||||||
errors = proc.readAllStandardError()
|
errors = proc.readAllStandardError()
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|
|
||||||
|
|
@ -442,12 +442,17 @@ class ProfileXYZ(Profile, SQLSubModel):
|
||||||
Nothing.
|
Nothing.
|
||||||
"""
|
"""
|
||||||
for point in list_points:
|
for point in list_points:
|
||||||
pt = PointXYZ(*point, profile=self, status=self._status)
|
named_args = {
|
||||||
self.points.append(pt)
|
"x": point[0],
|
||||||
|
"y": point[1],
|
||||||
|
"z": point[2],
|
||||||
|
"name": point[3],
|
||||||
|
}
|
||||||
|
|
||||||
|
pt = PointXYZ(id=-1, **named_args, profile=self, status=self._status)
|
||||||
|
self._points.append(pt)
|
||||||
|
|
||||||
self.modified()
|
self.modified()
|
||||||
self.tab_up_to_date = False
|
|
||||||
self.station_up_to_date = False
|
|
||||||
|
|
||||||
def get_point_i(self, index: int) -> PointXYZ:
|
def get_point_i(self, index: int) -> PointXYZ:
|
||||||
"""Get point at index.
|
"""Get point at index.
|
||||||
|
|
@ -510,8 +515,6 @@ class ProfileXYZ(Profile, SQLSubModel):
|
||||||
self.points.append(point_xyz)
|
self.points.append(point_xyz)
|
||||||
|
|
||||||
self.modified()
|
self.modified()
|
||||||
self.tab_up_to_date = False
|
|
||||||
self.station_up_to_date = False
|
|
||||||
|
|
||||||
def insert(self, index: int):
|
def insert(self, index: int):
|
||||||
"""Insert a new point at index.
|
"""Insert a new point at index.
|
||||||
|
|
@ -531,8 +534,6 @@ class ProfileXYZ(Profile, SQLSubModel):
|
||||||
self._points.insert(index, point)
|
self._points.insert(index, point)
|
||||||
|
|
||||||
self.modified()
|
self.modified()
|
||||||
self.tab_up_to_date = False
|
|
||||||
self.station_up_to_date = False
|
|
||||||
|
|
||||||
return point
|
return point
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -617,6 +617,8 @@ class Reach(SQLSubModel):
|
||||||
"""
|
"""
|
||||||
imported_profiles = []
|
imported_profiles = []
|
||||||
|
|
||||||
|
logger.info(f"import reach from {file_path_name}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
list_profile, list_header = self.read_file_st(str(file_path_name))
|
list_profile, list_header = self.read_file_st(str(file_path_name))
|
||||||
profile_header = ["num", "code1", "code2",
|
profile_header = ["num", "code1", "code2",
|
||||||
|
|
@ -629,7 +631,10 @@ class Reach(SQLSubModel):
|
||||||
d[profile_header[i]] = data
|
d[profile_header[i]] = data
|
||||||
|
|
||||||
prof = ProfileXYZ(
|
prof = ProfileXYZ(
|
||||||
**d, reach=self, status=self._status
|
id=-1,
|
||||||
|
**d,
|
||||||
|
reach=self,
|
||||||
|
status=self._status
|
||||||
)
|
)
|
||||||
prof.import_points(profile)
|
prof.import_points(profile)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue