Skip to content
Snippets Groups Projects
Commit 8d9b44c8 authored by Jdrezen's avatar Jdrezen
Browse files

Ajout d'une classe PanelLimitedPlotChart

parent 54bb5658
No related branches found
No related tags found
No related merge requests found
...@@ -124,6 +124,9 @@ class Controleur: ...@@ -124,6 +124,9 @@ class Controleur:
def addPlotChart(self, name : str) -> int: def addPlotChart(self, name : str) -> int:
return self.__fenetre.addPlotChart(name) return self.__fenetre.addPlotChart(name)
def addLimitedPlotChart(self, name : str, limit) -> int:
return self.__fenetre.addLimitedPlotChart(name, limit)
""" """
Set the drawing policy to the curve of the plot chart identified by idCurve and id Set the drawing policy to the curve of the plot chart identified by idCurve and id
""" """
......
...@@ -11,6 +11,7 @@ from pyAmakIHM.classes.panelCommandes import PanelCommandes ...@@ -11,6 +11,7 @@ from pyAmakIHM.classes.panelCommandes import PanelCommandes
from pyAmakIHM.classes.panelVue import PanelVue from pyAmakIHM.classes.panelVue import PanelVue
from pyAmakIHM.classes.panelBarChart import PanelBarChart from pyAmakIHM.classes.panelBarChart import PanelBarChart
from pyAmakIHM.classes.panelPlotChart import PanelPlotChart from pyAmakIHM.classes.panelPlotChart import PanelPlotChart
from pyAmakIHM.classes.panelLimitedPlotChart import PanelLimitedPlotChart
from tkinter import ttk, Tk from tkinter import ttk, Tk
...@@ -163,6 +164,15 @@ class Fenetre : ...@@ -163,6 +164,15 @@ class Fenetre :
self.__onglet.add(self.__panelGraphiques[length],text = name) self.__onglet.add(self.__panelGraphiques[length],text = name)
return (length) return (length)
def addLimitedPlotChart(self, name : str, limit) -> int:
length = len(self.__panelGraphiques)
self.__panelGraphiques.append(PanelLimitedPlotChart(self.__onglet,length, limit))
self.__panelGraphiques[length].attach(self)
self.__onglet.add(self.__panelGraphiques[length],text = name)
return (length)
""" """
Set the drawing policy to the curve of the plot chart identified by idCurve and id Set the drawing policy to the curve of the plot chart identified by idCurve and id
""" """
......
"""
Class PanelLimitedPlotChart
"""
from pyAmakIHM.classes.panelPlotChart import PanelPlotChart
class PanelLimitedPlotChart(PanelPlotChart):
"""
Class PanelLimitedPlotChart
"""
def __init__(
self,
root,
id,
limit
) :
super().__init__(root, id)
self.__limit = limit
self.__limited = False
def addPoint(self, id : int, x : int, y : int):
self.__axis.clear()
self.__xAxis[id].append(x)
self.__yAxis[id].append(y)
if(self.__limited):
del self.__xAxis[0]
del self.__yAxis[0]
else:
self.__limited = self.isLimited()
self.__rebuild()
def isLimited(self):
return len(self.__xAxis) > self.__limit
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment