diff --git a/src/View/Results/PlotHAdisTS.py b/src/View/Results/PlotHAdisTS.py index 418acdf7..299d3bab 100644 --- a/src/View/Results/PlotHAdisTS.py +++ b/src/View/Results/PlotHAdisTS.py @@ -1,4 +1,4 @@ -# PlotH.py -- Pamhyr +# PlotHAdisTS.py -- Pamhyr # Copyright (C) 2023-2024 INRAE # # This program is free software: you can redistribute it and/or modify diff --git a/src/View/Results/TableAdisTS.py b/src/View/Results/TableAdisTS.py index 6b77d358..d798ddf2 100644 --- a/src/View/Results/TableAdisTS.py +++ b/src/View/Results/TableAdisTS.py @@ -1,4 +1,4 @@ -# Table.py -- Pamhyr +# TableAdisTS.py -- Pamhyr # Copyright (C) 2023-2024 INRAE # # This program is free software: you can redistribute it and/or modify diff --git a/src/View/Results/WindowAdisTS.py b/src/View/Results/WindowAdisTS.py index 540d554f..50bef3ef 100644 --- a/src/View/Results/WindowAdisTS.py +++ b/src/View/Results/WindowAdisTS.py @@ -1,4 +1,4 @@ -# Window.py -- Pamhyr +# WindowAdisTS.py -- Pamhyr # Copyright (C) 2023-2024 INRAE # # This program is free software: you can redistribute it and/or modify @@ -46,12 +46,7 @@ from PyQt5.QtWidgets import ( from View.Tools.Plot.PamhyrCanvas import MplCanvas from View.Tools.Plot.PamhyrToolbar import PamhyrPlotToolbar -from View.Results.PlotXY import PlotXY -from View.Results.PlotAC import PlotAC -from View.Results.PlotKPC import PlotKPC from View.Results.PlotHAdisTS import PlotH -from View.Results.PlotSedReach import PlotSedReach -from View.Results.PlotSedProfile import PlotSedProfile from View.Results.CustomPlot.Plot import CustomPlot from View.Results.CustomPlot.CustomPlotValuesSelectionDialog import ( @@ -60,7 +55,6 @@ from View.Results.CustomPlot.CustomPlotValuesSelectionDialog import ( from View.Results.TableAdisTS import TableModel from View.Results.translate import ResultsTranslate -from View.Stricklers.Window import StricklersWindow _translate = QCoreApplication.translate @@ -113,7 +107,7 @@ class ResultsWindowAdisTS(PamhyrWindow): self.setup_table() self.setup_plots() - #self.setup_slider() + self.setup_slider() #self.setup_statusbar() #self.setup_connections() except Exception as e: @@ -138,30 +132,6 @@ class ResultsWindowAdisTS(PamhyrWindow): ) def setup_slider(self): - self._slider_profile = self.find(QSlider, f"verticalSlider_profile") - default_reach = self._results.river.reach(0) - self._slider_profile.setMaximum(len(default_reach.profiles) - 1) - self._slider_profile.setValue(0) - - self._slider_time = self.find(QSlider, f"horizontalSlider_time") - self._slider_time.setMaximum(len(self._timestamps) - 1) - self._slider_time.setValue(len(self._timestamps) - 1) - - self._icon_start = QIcon() - self._icon_start.addPixmap( - QPixmap(self._path_file("media-playback-start.png")) - ) - - self._icon_pause = QIcon() - self._icon_pause.addPixmap( - QPixmap(self._path_file("media-playback-pause.png")) - ) - self._button_play = self.find(QPushButton, f"playButton") - self._button_play.setIcon(self._icon_start) - self._button_back = self.find(QPushButton, f"backButton") - self._button_next = self.find(QPushButton, f"nextButton") - self._button_first = self.find(QPushButton, f"firstButton") - self._button_last = self.find(QPushButton, f"lastButton") self._timer = QTimer(self) def setup_plots(self): @@ -267,15 +237,6 @@ class ResultsWindowAdisTS(PamhyrWindow): self._table[t].dataChanged.connect(fun[t]) - self._slider_profile.valueChanged.connect( - self._set_current_profile_slider) - self._slider_time.valueChanged.connect(self._set_current_timestamp) - self._button_play.setChecked(False) - self._button_play.clicked.connect(self._pause) - self._button_back.clicked.connect(self._back) - self._button_next.clicked.connect(self._next) - self._button_first.clicked.connect(self._first) - self._button_last.clicked.connect(self._last) self._timer.timeout.connect(self._update_slider) def update_table_selection_reach(self, ind): @@ -310,37 +271,19 @@ class ResultsWindowAdisTS(PamhyrWindow): def update(self, reach_id=None, profile_id=None, timestamp=None): if reach_id is not None: - self.plot_xy.set_reach(reach_id) - self.plot_ac.set_reach(reach_id) - self.plot_kpc.set_reach(reach_id) self.plot_h.set_reach(reach_id) - for plot in self._additional_plot: - self._additional_plot[plot].set_reach(reach_id) - self.update_table_selection_reach(reach_id) self.update_table_selection_profile(0) if profile_id is not None: - self.plot_xy.set_profile(profile_id) - self.plot_ac.set_profile(profile_id) - self.plot_kpc.set_profile(profile_id) self.plot_h.set_profile(profile_id) - for plot in self._additional_plot: - self._additional_plot[plot].set_profile(profile_id) - self.update_table_selection_profile(profile_id) if timestamp is not None: - self.plot_xy.set_timestamp(timestamp) - self.plot_ac.set_timestamp(timestamp) - self.plot_kpc.set_timestamp(timestamp) self.plot_h.set_timestamp(timestamp) - for plot in self._additional_plot: - self._additional_plot[plot].set_timestamp(timestamp) - self._table["raw_data"].timestamp = timestamp self.update_statusbar() @@ -403,14 +346,8 @@ class ResultsWindowAdisTS(PamhyrWindow): self.update(timestamp=timestamp) def _reload_plots(self): - self.plot_xy.results = self._results - self.plot_ac.results = self._results - self.plot_kpc.results = self._results self.plot_h.results = self._results - self.plot_xy.draw() - self.plot_ac.draw() - self.plot_kpc.draw() self.plot_h.draw() def _reload_slider(self): @@ -439,13 +376,6 @@ class ResultsWindowAdisTS(PamhyrWindow): tab_widget = self.find(QTabWidget, f"tabWidget") - # This plot already exists - if name in self._additional_plot: - tab_widget.setCurrentWidget( - tab_widget.findChild(QWidget, wname) - ) - return - widget = QWidget() grid = QGridLayout() diff --git a/src/View/ui/ResultsAdisTS.ui b/src/View/ui/ResultsAdisTS.ui index a18a9982..c499f085 100644 --- a/src/View/ui/ResultsAdisTS.ui +++ b/src/View/ui/ResultsAdisTS.ui @@ -39,19 +39,6 @@ - - - - Qt::Vertical - - - true - - - true - - - @@ -68,89 +55,7 @@ - - - - - - - - - ressources/media-skip-backward.pngressources/media-skip-backward.png - - - - - - - - - - - ressources/media-seek-backward.pngressources/media-seek-backward.png - - - - - - - true - - - true - - - Qt::DefaultContextMenu - - - true - - - - - - - ressources/media-playback-start.png - ressources/media-playback-pause.pngressources/media-playback-start.png - - - true - - - true - - - - - - - - - - - ressources/media-seek-forward.pngressources/media-seek-forward.png - - - - - - - - - - - ressources/media-skip-forward.pngressources/media-skip-forward.png - - - - - - - Qt::Horizontal - - - - +