diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index cb9d8b7e5fd300baebb7095603cc6d7a8ce359c5..58a2a031c0d2e9fbf0ccb6b217c41408635a2950 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -44,18 +44,18 @@ from View.Configure.Window import ConfigureWindow from View.Study.Window import NewStudyWindow from View.About.Window import AboutWindow from View.Network.Window import NetworkWindow -from View.Geometry.Window import GeometryWindow -from View.BoundaryCondition.Window import BoundaryConditionWindow -from View.LateralContribution.Window import LateralContributionWindow -from View.InitialConditions.Window import InitialConditionsWindow -from View.Stricklers.Window import StricklersWindow -from View.Frictions.Window import FrictionsWindow -from View.SedimentLayers.Window import SedimentLayersWindow -from View.SedimentLayers.Reach.Window import ReachSedimentLayersWindow -from View.SolverParameters.Window import SolverParametersWindow -from View.RunSolver.Window import SelectSolverWindow, SolverLogWindow -from View.CheckList.Window import CheckListWindow -from View.Results.Window import ResultsWindow +# from View.Geometry.Window import GeometryWindow +# from View.BoundaryCondition.Window import BoundaryConditionWindow +# from View.LateralContribution.Window import LateralContributionWindow +# from View.InitialConditions.Window import InitialConditionsWindow +# from View.Stricklers.Window import StricklersWindow +# from View.Frictions.Window import FrictionsWindow +# from View.SedimentLayers.Window import SedimentLayersWindow +# from View.SedimentLayers.Reach.Window import ReachSedimentLayersWindow +# from View.SolverParameters.Window import SolverParametersWindow +# from View.RunSolver.Window import SelectSolverWindow, SolverLogWindow +# from View.CheckList.Window import CheckListWindow +# from View.Results.Window import ResultsWindow from View.Debug.Window import ReplWindow from Model.Study import Study diff --git a/src/View/Tools/PamhyrPlot.py b/src/View/Tools/PamhyrPlot.py new file mode 100644 index 0000000000000000000000000000000000000000..b06ec2c24209d1c12bfc5f1818813a51fbc8d2a5 --- /dev/null +++ b/src/View/Tools/PamhyrPlot.py @@ -0,0 +1,43 @@ +# PamhyrPlot.py -- Pamhyr +# Copyright (C) 2023 INRAE +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +# -*- coding: utf-8 -*- + +from View.Tools.Plot.APlot import APlot +from View.Tools.Plot.PamhyrCanvas import MplCanvas +from View.Tools.Plot.PamhyrToolbar import PamhyrPlotToolbar + +class PamhyrPlot(APlot): + def __init__(self, data=None, trad=None, + canvas=None, toolbar=None, + parent=None): + if canvas is None: + canvas = MplCanvas() + + self._trad = trad + self._canvas = canvas + self._toolbar = toolbar + self._parent = parent + + super(PamhyrPlot, self).__init__(data = data) + + @property + def canvas(self): + return self._canvas + + @property + def toolbar(self): + return self._toolbar diff --git a/src/View/Plot/APlot.py b/src/View/Tools/Plot/APlot.py similarity index 84% rename from src/View/Plot/APlot.py rename to src/View/Tools/Plot/APlot.py index a863f1e605967deed6db64948367012e1125a964..7d8de3070421bd7214aac4a05fc5fc8a3cb2c1dc 100644 --- a/src/View/Plot/APlot.py +++ b/src/View/Tools/Plot/APlot.py @@ -19,26 +19,16 @@ from Model.Except import NotImplementedMethodeError class APlot(object): - def __init__(self, canvas=None, data=None, toolbar=None): + def __init__(self, data=None): super(APlot, self).__init__() self._init = False - - self._canvas = canvas self._data = data - self._toolbar = toolbar - - @property - def canvas(self): - return self._canvas @property def data(self): return self._data - @property - def toolbar(self): - return self._toolbar def draw(self): """Draw plot diff --git a/src/View/Plot/mpl_canvas_onpick_event.py b/src/View/Tools/Plot/OnPickEvent.py similarity index 100% rename from src/View/Plot/mpl_canvas_onpick_event.py rename to src/View/Tools/Plot/OnPickEvent.py diff --git a/src/View/Plot/MplCanvas.py b/src/View/Tools/Plot/PamhyrCanvas.py similarity index 99% rename from src/View/Plot/MplCanvas.py rename to src/View/Tools/Plot/PamhyrCanvas.py index ee1f5373544bb9096839da3e6b7ef964679035b4..c4bbf4d33d66b408f75a8c6a9134555eb56a03ea 100644 --- a/src/View/Plot/MplCanvas.py +++ b/src/View/Tools/Plot/PamhyrCanvas.py @@ -17,7 +17,6 @@ from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg from matplotlib.figure import Figure - class MplCanvas(FigureCanvasQTAgg): def __init__(self, width=5, height=4, dpi=100): fig = Figure( diff --git a/src/View/Plot/PamhyrToolbar.py b/src/View/Tools/Plot/PamhyrToolbar.py similarity index 100% rename from src/View/Plot/PamhyrToolbar.py rename to src/View/Tools/Plot/PamhyrToolbar.py