mirror of https://gitlab.com/pamhyr/pamhyr2
geometry: Working table display.
parent
d4ce6ce83d
commit
af4832a134
|
|
@ -34,7 +34,7 @@ class Reach:
|
|||
Returns:
|
||||
The profile at index i
|
||||
"""
|
||||
if i in self._profiles:
|
||||
if i < len(self._profiles):
|
||||
return self._profiles[i]
|
||||
|
||||
return None
|
||||
|
|
@ -62,19 +62,6 @@ class Reach:
|
|||
"""
|
||||
return self._profiles
|
||||
|
||||
def get_profile_i(self, i: int) -> Profile:
|
||||
"""
|
||||
Args:
|
||||
i: Index
|
||||
|
||||
Returns:
|
||||
The profile at index i.
|
||||
"""
|
||||
try:
|
||||
return self._profiles[i]
|
||||
except IndexError:
|
||||
raise IndexError(f"Invalid profile index: {i}")
|
||||
|
||||
def add_profile(self, index):
|
||||
"""Add a new profile at the end of profiles list
|
||||
|
||||
|
|
|
|||
|
|
@ -249,16 +249,16 @@ class GeometryWindow(QMainWindow, WindowToolKit):
|
|||
)
|
||||
|
||||
self.plot_selected_1, = self.ui.canvas_1.axes.plot(
|
||||
self._reach.get_profile_i(0).x(),
|
||||
self._reach.get_profile_i(0).y(),
|
||||
self._reach.profile(0).x(),
|
||||
self._reach.profile(0).y(),
|
||||
lw=1., markersize=3,
|
||||
marker='+', color="b"
|
||||
)
|
||||
|
||||
self.plot_selected_1.set_visible(False)
|
||||
self.before_plot_selected_1, = self.ui.canvas_1.axes.plot(
|
||||
self._reach.get_profile_i(0).x(),
|
||||
self._reach.get_profile_i(0).y(),
|
||||
self._reach.profile(0).x(),
|
||||
self._reach.profile(0).y(),
|
||||
lw=1., markersize=3,
|
||||
marker='+', color="k", linestyle="--"
|
||||
)
|
||||
|
|
@ -266,8 +266,8 @@ class GeometryWindow(QMainWindow, WindowToolKit):
|
|||
self.before_plot_selected_1.set_visible(False)
|
||||
|
||||
self.after_plot_selected_1, = self.ui.canvas_1.axes.plot(
|
||||
self._reach.get_profile_i(0).x(),
|
||||
self._reach.get_profile_i(0).y(),
|
||||
self._reach.profile(0).x(),
|
||||
self._reach.profile(0).y(),
|
||||
lw=1., markersize=3,
|
||||
marker='+', color="m", linestyle='--'
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue