4 etatsMain, a module for pymecavideo:
5 a program to track moving points
in a video frameset
7 Copyright (C) 2023 Georges Khaznadar <georgesk
@debian.org>
9 This program
is free software: you can redistribute it
and/
or modify
10 it under the terms of the GNU General Public License
as published by
11 the Free Software Foundation, either version 3 of the License,
or
12 (at your option) any later version.
14 This program
is distributed
in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License
for more details.
19 You should have received a copy of the GNU General Public License
20 along
with this program. If
not, see <http://www.gnu.org/licenses/>.
23from PyQt6.QtCore import Qt, QObject, pyqtSignal
24from PyQt6.QtWidgets import QMessageBox
28from vecteur import vecteur
29from etats import Etats_Base
31class Etats(Etats_Base):
33 Une classe qui permet de définir les états pour le pointageWidget
34 debut, A, AB, B, C, D, E : voir le fichier etats_pymecavideo.html
38 Etats_Base.__init__(self)
43 changement d'état : fait ce qu'il faut faire au niveau de la fenêtre
44 principale puis renvoie aux autres widgets actifs
49 self.dbg.p(1, f
"========> État précédent = {self.etat_ancien}. État suivant = {self.etat}")
52 f
"L'état doit être {', '.join(self.etats)}, or il est « {repr(self.etat)} »")
54 for obj
in self.actionDefaire, self.actionRefaire, \
55 self.actionCopier_dans_le_presse_papier, \
56 self.menuE_xporter_vers, \
60 self.actionExemples.setEnabled(
True)
61 self.tabWidget.setEnabled(
True)
63 self.tabWidget.setCurrentIndex(0)
65 self.tabWidget.setTabEnabled(i,
False)
68 self.OKRedimensionnement.emit()
71 if self.pointage.filename
is None:
return
72 self.setWindowTitle(self.tr(
"Pymecavideo : {filename}").format(
73 filename = os.path.basename(self.pointage.filename)))
74 if not self.pointage.echelle_image:
76 self.OKRedimensionnement.emit()
77 for obj
in self.menuE_xporter_vers, self.actionSaveData, \
78 self.actionCopier_dans_le_presse_papier:
81 self.tabWidget.setTabEnabled(i,
False)
83 self.affiche_statut.emit(
84 self.tr(
"Veuillez choisir une image (et définir l'échelle)"))
86 self.egalise_origine()
87 self.init_variables(self.pointage.filename)
90 for obj
in self.actionCopier_dans_le_presse_papier, \
91 self.menuE_xporter_vers, self.actionSaveData :
93 self.affiche_statut.emit(self.tr(
"Pointage Automatique"))
94 QMessageBox.information(
95 None,
"Capture Automatique",
97Veuillez sélectionner un cadre autour du ou des objets que vous voulez suivre ;
98Vous pouvez arrêter à tout moment la capture en appuyant sur le bouton STOP""",
105 for obj
in self.actionCopier_dans_le_presse_papier, \
106 self.menuE_xporter_vers, self.actionSaveData:
107 obj.setEnabled(
False)
113 self.tabWidget.setTabEnabled(i,
True)
115 self.actionSaveData.setEnabled(
True)
116 self.actionCopier_dans_le_presse_papier.setEnabled(
True)
120 self.tabWidget.setTabEnabled(i,
False)
122 self.affiche_statut.emit(
"")
123 for widget
in self.pointage, self.trajectoire, self.coord, self.graph:
124 widget.changeEtat(etat)
Une classe qui permet de définir les états pour le pointageWidget debut, A, AB, B,...
def changeEtat(self, etat)
changement d'état : fait ce qu'il faut faire au niveau de la fenêtre principale puis renvoie aux autr...
Une classe qui permet de définir les états pour le pointageWidget debut, A, AB, B,...