Skip to content
Snippets Groups Projects
Commit 44b07a93 authored by Jdrezen's avatar Jdrezen
Browse files

Ajout de commentaires et de typage

parent 6023079f
Branches
No related tags found
No related merge requests found
...@@ -12,16 +12,19 @@ class PanelLimitedPlotChart(PanelPlotChart): ...@@ -12,16 +12,19 @@ class PanelLimitedPlotChart(PanelPlotChart):
def __init__( def __init__(
self, self,
root, root : 'Tk',
id, id : int,
limit limit : int
) : ) -> None :
super().__init__(root, id) super().__init__(root, id)
self.__limit = limit self.__limit = limit
self.__limited = False self.__limited = False
def addPoint(self, id : int, x : int, y : int): """
Add a point to the id curve with x,y coords
"""
def addPoint(self, id : int, x : int, y : int) -> None:
self._axis.clear() self._axis.clear()
self._xAxis[id].append(x) self._xAxis[id].append(x)
self._yAxis[id].append(y) self._yAxis[id].append(y)
...@@ -35,10 +38,16 @@ class PanelLimitedPlotChart(PanelPlotChart): ...@@ -35,10 +38,16 @@ class PanelLimitedPlotChart(PanelPlotChart):
self._rebuild() self._rebuild()
def isLimited(self,id): """
Return true if number of points is over the limit
"""
def isLimited(self,id : int) -> bool:
return len(self._xAxis[id]) > self.__limit return len(self._xAxis[id]) > self.__limit
def createCopy(self, name : str, id : int) -> 'PanelPlotChart': """
Return a copy of the object
"""
def createCopy(self, name : str, id : int) -> 'PanelLimitedPlotChart':
window = Toplevel() window = Toplevel()
window.title(name) window.title(name)
...@@ -57,7 +66,10 @@ class PanelLimitedPlotChart(PanelPlotChart): ...@@ -57,7 +66,10 @@ class PanelLimitedPlotChart(PanelPlotChart):
return self._copy return self._copy
def _copyWidget(self): """
Copy the object
"""
def _copyWidget(self) -> None:
super()._copyWidget() super()._copyWidget()
self._copy.__limit = self.__limit self._copy.__limit = self.__limit
self._copy.__limited = self.__limited self._copy.__limited = self.__limited
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment