Nantes Université
Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
I
infem-tp-bac
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de conteneurs
Registre de modèles
Opération
Environnements
Surveillance
Incidents
Service d'assistance
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Mikaël BRIDAY
infem-tp-bac
Validations
5a823147
Valider
5a823147
rédigé
4 years ago
par
Mikaël BRIDAY
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
debug event list refactoring
parent
a03a483d
Branches
Branches contenant la validation
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
5
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
5 fichiers modifiés
bac/bac.ui
+1
-1
1 ajout, 1 suppression
bac/bac.ui
bac/bacGUI.py
+1
-0
1 ajout, 0 suppression
bac/bacGUI.py
bac/baseThreads.py
+4
-2
4 ajouts, 2 suppressions
bac/baseThreads.py
bac/debugEvents.py
+13
-2
13 ajouts, 2 suppressions
bac/debugEvents.py
bac/mainwindow.py
+4
-3
4 ajouts, 3 suppressions
bac/mainwindow.py
avec
23 ajouts
et
8 suppressions
bac/bac.ui
+
1
−
1
Voir le fichier @
5a823147
...
...
@@ -11,7 +11,7 @@
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
mainwindow
</string>
<string>
INFEM - TP Bac
</string>
</property>
<widget
class=
"QWidget"
name=
"centralwidget"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_2"
>
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
bac/bacGUI.py
+
1
−
0
Voir le fichier @
5a823147
...
...
@@ -34,6 +34,7 @@ class MainWindow(QMainWindow, Ui_mainwindow):
#event list view
self
.
debugEventModel
=
debugEventModel
()
self
.
eventListView
.
setModel
(
self
.
debugEventModel
)
self
.
debugEventModel
.
signalScroll
.
connect
(
self
.
eventListView
.
scrollToBottom
)
#threads
appli
=
mainThread
(
self
.
labTerm
,
self
.
drawingWidget
,
self
.
debugEventModel
)
appli
.
start
()
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
bac/baseThreads.py
+
4
−
2
Voir le fichier @
5a823147
...
...
@@ -35,7 +35,8 @@ class ferry(threading.Thread):
])
def
check
(
self
,
cond
,
info
,
msgIfOk
=
True
):
"""
basic verification (assert(cond)). If the condition is not ok, report the pb and ends the thread.
"""
basic verification (assert(cond)).
If the condition is not ok, report the pb and ends the thread.
info is an extra information (char string)
"""
if
not
cond
:
...
...
@@ -97,7 +98,8 @@ class car(threading.Thread):
])
def
check
(
self
,
cond
,
info
,
msgIfOk
=
True
):
"""
basic verification (assert(cond)). If the condition is not ok, report the pb and ends the thread.
"""
basic verification (assert(cond)).
If the condition is not ok, report the pb and ends the thread.
info is an extra information (char string)
"""
if
not
cond
:
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
bac/debugEvents.py
+
13
−
2
Voir le fichier @
5a823147
#! /usr/bin/env python3
# -*- coding: UTF-8 -*-
import
threading
from
PyQt5.QtWidgets
import
*
from
PyQt5.QtCore
import
*
from
PyQt5.QtGui
import
*
...
...
@@ -8,9 +9,13 @@ from PyQt5.QtGui import *
pb
=
QImage
(
'
bac/cross.png
'
).
scaled
(
16
,
16
,
Qt
.
KeepAspectRatio
)
class
debugEventModel
(
QAbstractListModel
):
signalAddEv
=
pyqtSignal
(
bool
,
str
)
signalScroll
=
pyqtSignal
()
def
__init__
(
self
,
*
args
,
debugEvent
=
None
,
**
kwargs
):
super
(
debugEventModel
,
self
).
__init__
(
*
args
,
**
kwargs
)
self
.
debugEvent
=
debugEvent
or
[]
self
.
signalAddEv
.
connect
(
self
.
addEvGUIThread
)
def
data
(
self
,
index
,
role
):
#index: row,column
status
,
text
=
self
.
debugEvent
[
index
.
row
()]
...
...
@@ -26,8 +31,14 @@ class debugEventModel(QAbstractListModel):
return
len
(
self
.
debugEvent
)
def
addEv
(
self
,
error
,
text
):
self
.
signalAddEv
.
emit
(
error
,
text
)
@pyqtSlot
(
bool
,
str
)
def
addEvGUIThread
(
self
,
error
,
text
):
assert
threading
.
current_thread
()
is
threading
.
main_thread
()
index
=
QModelIndex
()
n
=
self
.
rowCount
(
index
)
self
.
beginInsertRows
(
index
,
0
,
1
)
self
.
debugEvent
.
insert
(
0
,
(
error
,
text
))
self
.
beginInsertRows
(
index
,
n
,
n
)
self
.
debugEvent
.
append
(
(
error
,
text
))
self
.
endInsertRows
()
self
.
signalScroll
.
emit
()
Ce diff est replié.
Cliquez pour l'agrandir.
bac/mainwindow.py
+
4
−
3
Voir le fichier @
5a823147
...
...
@@ -2,9 +2,10 @@
# Form implementation generated from reading ui file 'bac.ui'
#
# Created by: PyQt5 UI code generator 5.1
4.0
# Created by: PyQt5 UI code generator 5.1
5.4
#
# WARNING! All changes made in this file will be lost!
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from
PyQt5
import
QtCore
,
QtGui
,
QtWidgets
...
...
@@ -85,7 +86,7 @@ class Ui_mainwindow(object):
def
retranslateUi
(
self
,
mainwindow
):
_translate
=
QtCore
.
QCoreApplication
.
translate
mainwindow
.
setWindowTitle
(
_translate
(
"
mainwindow
"
,
"
mainwindow
"
))
mainwindow
.
setWindowTitle
(
_translate
(
"
mainwindow
"
,
"
INFEM - TP Bac
"
))
self
.
pbTerm
.
setText
(
_translate
(
"
mainwindow
"
,
"
demander la terminaison propre
"
))
self
.
label
.
setText
(
_translate
(
"
mainwindow
"
,
"
État des sémaphores
"
))
from
QDrawing
import
QDrawing
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter