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