diff --git a/pyAmakIHM/classes/controleur.py b/pyAmakIHM/classes/controleur.py index 23910146921666f701648f4e907dfd8837a88774..c47fcc86a80b5fc7be07d0b54bc9670d9be0634e 100644 --- a/pyAmakIHM/classes/controleur.py +++ b/pyAmakIHM/classes/controleur.py @@ -204,7 +204,7 @@ class Controleur: """ def updateAdd(self) -> None: print("Ajout d'un agent") - + """ Remove an agent from amas """ @@ -234,6 +234,12 @@ class Controleur: self.__is_run = True self.__scheduler.start() + """ + Save the current state + """ + def updateSave(self) -> None: + self.__scheduler.save() + def updateCycle(self) -> None: try: self.updateWindow() diff --git a/pyAmakIHM/classes/panelCommandes.py b/pyAmakIHM/classes/panelCommandes.py index b0c775f6521b75c337b549012a72fd8b367fa5d9..81a1a72cca24b79613f0acb839aeb7cc38993f3f 100644 --- a/pyAmakIHM/classes/panelCommandes.py +++ b/pyAmakIHM/classes/panelCommandes.py @@ -24,6 +24,9 @@ class PanelCommandes(LabelFrame): bouttonStartStop = Button(self, text='start/stop',height=2,command=self.notifyObserverAboutStartStop) bouttonStartStop.pack(side='top',fill='x') + bouttonSaveState = Button(self, text='save state',height=2,command=self.notifyObserverAboutSave) + bouttonSaveState.pack(side='top',fill='x') + frameBoutons = Frame(self) frameBoutons.pack(side='bottom',fill='x') @@ -55,6 +58,9 @@ class PanelCommandes(LabelFrame): def notifyObserverAboutStartStop(self) -> None: self.__observer.updateStartStop() + def notifyObserverAboutSave(self) -> None: + self.__observer.updateSave() + """ Notify the observer that the scale has change its value and give the current value """