Acoustic inversion: Clear plots at redraw.
parent
7d9726fbd6
commit
2dc6bb5f3f
|
|
@ -64,6 +64,7 @@ class AcousticInversionTab(QWidget):
|
|||
self.inv_hc = AcousticInversionMethodHighConcentration()
|
||||
|
||||
self._setup_icons()
|
||||
self._setup_attrs()
|
||||
self._setup_general_layout(widget_tab)
|
||||
self._setup_connections()
|
||||
|
||||
|
|
@ -444,6 +445,14 @@ class AcousticInversionTab(QWidget):
|
|||
self.pushbutton_plot_sand_sample_choice\
|
||||
.clicked.connect(self.plot_measured_vs_inverted_SSC_sand)
|
||||
|
||||
def _setup_attrs(self):
|
||||
self.figure_SSC_fine = None
|
||||
self.figure_SSC_sand = None
|
||||
self.figure_vertical_profile_SSC_fine = None
|
||||
self.figure_vertical_profile_SSC_sand = None
|
||||
self.figure_measured_vs_inverted_fine = None
|
||||
self.figure_measured_vs_inverted_sand = None
|
||||
|
||||
def full_update(self):
|
||||
logger.debug(f"{__name__}: Update")
|
||||
self.blockSignals(True)
|
||||
|
|
@ -584,6 +593,9 @@ class AcousticInversionTab(QWidget):
|
|||
self.verticalLayout_groupbox_plot_SSC_fine.removeWidget(self.toolbar_SSC_fine)
|
||||
self.verticalLayout_groupbox_plot_SSC_fine.removeWidget(self.canvas_SSC_fine)
|
||||
|
||||
if self.figure_SSC_fine is not None:
|
||||
self.figure_SSC_fine.clear()
|
||||
|
||||
self.figure_SSC_fine, self.axis_SSC_fine = plt.subplots(
|
||||
nrows=1, ncols=1, layout="constrained"
|
||||
)
|
||||
|
|
@ -709,6 +721,9 @@ class AcousticInversionTab(QWidget):
|
|||
self.verticalLayout_groupbox_plot_vertical_profile_fine\
|
||||
.removeWidget(self.canvas_profile_fine)
|
||||
|
||||
if self.figure_vertical_profile_SSC_fine is not None:
|
||||
self.figure_vertical_profile_SSC_fine.clear()
|
||||
|
||||
fig, ax = plt.subplots(nrows=1, ncols=1, layout="constrained")
|
||||
self.figure_vertical_profile_SSC_fine = fig
|
||||
self.axis_vertical_profile_SSC_fine = ax
|
||||
|
|
@ -989,6 +1004,9 @@ class AcousticInversionTab(QWidget):
|
|||
self.canvas_inverted_vs_measured_SSC_fine, self
|
||||
)
|
||||
else:
|
||||
if self.figure_measured_vs_inverted_fine is not None:
|
||||
self.figure_measured_vs_inverted_fine.clear()
|
||||
|
||||
fig, ax = plt.subplots(nrows=1, ncols=1, layout="constrained")
|
||||
|
||||
self.figure_measured_vs_inverted_fine = fig
|
||||
|
|
@ -1129,6 +1147,9 @@ class AcousticInversionTab(QWidget):
|
|||
self.canvas_SSC_sand = FigureCanvas()
|
||||
self.toolbar_SSC_sand = NavigationToolBar(self.canvas_SSC_sand, self)
|
||||
else:
|
||||
if self.figure_SSC_sand is not None:
|
||||
self.figure_SSC_sand.clear()
|
||||
|
||||
self.figure_SSC_sand, self.axis_SSC_sand = plt.subplots(
|
||||
nrows=1, ncols=1, layout="constrained"
|
||||
)
|
||||
|
|
@ -1253,8 +1274,14 @@ class AcousticInversionTab(QWidget):
|
|||
self.verticalLayout_groupbox_plot_vertical_profile_sand.removeWidget(self.toolbar_profile_sand)
|
||||
self.verticalLayout_groupbox_plot_vertical_profile_sand.removeWidget(self.canvas_profile_sand)
|
||||
|
||||
self.figure_vertical_profile_SSC_sand, self.axis_vertical_profile_SSC_sand = plt.subplots(
|
||||
nrows=1, ncols=1, layout="constrained")
|
||||
if self.figure_vertical_profile_SSC_sand is not None:
|
||||
self.figure_vertical_profile_SSC_sand.clear()
|
||||
|
||||
fig, ax = plt.subplots(
|
||||
nrows=1, ncols=1, layout="constrained"
|
||||
)
|
||||
self.figure_vertical_profile_SSC_sand = fig
|
||||
self.axis_vertical_profile_SSC_sand = ax
|
||||
|
||||
self.canvas_profile_sand = FigureCanvas(self.figure_vertical_profile_SSC_sand)
|
||||
self.toolbar_profile_sand = NavigationToolBar(self.canvas_profile_sand, self)
|
||||
|
|
@ -1619,8 +1646,13 @@ class AcousticInversionTab(QWidget):
|
|||
self.verticalLayout_groupbox_plot_measured_vs_inverted_SSC_sand.removeWidget(
|
||||
self.canvas_inverted_vs_measured_SSC_sand)
|
||||
|
||||
self.figure_measured_vs_inverted_sand, self.axis_measured_vs_inverted_sand = (
|
||||
plt.subplots(nrows=1, ncols=1, layout="constrained"))
|
||||
if self.figure_measured_vs_inverted_sand is not None:
|
||||
self.figure_measured_vs_inverted_sand.clear()
|
||||
|
||||
fig, ax = plt.subplots(nrows=1, ncols=1, layout="constrained")
|
||||
self.figure_measured_vs_inverted_sand = fig
|
||||
self.axis_measured_vs_inverted_sand = ax
|
||||
|
||||
|
||||
self.canvas_inverted_vs_measured_SSC_sand = FigureCanvas(self.figure_measured_vs_inverted_sand)
|
||||
self.toolbar_inverted_vs_measured_SSC_sand = NavigationToolBar(self.canvas_inverted_vs_measured_SSC_sand, self)
|
||||
|
|
|
|||
Loading…
Reference in New Issue