Commit ef672798 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

refactoring: Start refactoring plot.

Showing with 56 additions and 24 deletions
+56 -24
......@@ -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
......
# 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
......@@ -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
......
......@@ -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(
......
File moved
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment