Geometry: Remove some warning when profile not fully defined.

This commit is contained in:
Pierre-Antoine Rouby committed 2024-01-16 09:05:27 +01:00
1 parent 0ace259d2d
commit cf53985fed
3 files changed
+25 -8

No files matched your search

+8 -2
View File
@@ -63,13 +63,19 @@ class PlotAC(PamhyrPlot):
if self.data.number_profiles == 0:
return
np = len(self.data.profiles)
if np < 2:
return
selected_profile = 0
station = self.data.profile(selected_profile).get_station()
station_plus_1 = self.data.profile(selected_profile + 1).get_station()
elevation = self.data.profile(selected_profile).z()
elevation_i_plus_1 = self.data.profile(selected_profile + 1).z()
gl = self.data.profile(selected_profile).names()
station_plus_1 = self.data.profile(selected_profile + 1).get_station()
elevation_i_plus_1 = self.data.profile(selected_profile + 1).z()
self.canvas.axes.set_xlabel(
_translate("MainWindow_reach", "Transverse abscissa (m)"),
color='black', fontsize=10
+14 -3
View File
@@ -62,6 +62,17 @@ class PlotKPZ(PamhyrPlot):
if self.data.number_profiles == 0:
return
profiles_defined = any(
filter(
lambda profile: len(profile.x()) > 0,
self.data.profiles
)
)
if not profiles_defined:
self._init = False
return
self.canvas.axes.set_xlabel(
_translate("MainWindow_reach", "Kp (m)"),
color='black', fontsize=10
@@ -75,9 +86,9 @@ class PlotKPZ(PamhyrPlot):
z_min = self.data.get_z_min()
z_max = self.data.get_z_max()
self.canvas.axes.set_xlim(
left=min(kp), right=max(kp)
)
# self.canvas.axes.set_xlim(
# left=min(kp), right=max(kp)
# )
self.line_kp_zmin_zmax = self.canvas.axes.vlines(
x=kp,
+3 -3
View File
@@ -74,9 +74,9 @@ class PlotXY(PamhyrPlot):
self.canvas.axes.axis("equal")
kp = self.data.get_kp()
self.canvas.axes.set_xlim(
left=min(kp), right=max(kp)
)
# self.canvas.axes.set_xlim(
# left=min(kp), right=max(kp)
# )
# Draw line for each profile
self.line_xy = [