Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pedro Henrique Kopper
SADAPMAP
Commits
28d55da4
Commit
28d55da4
authored
Nov 29, 2017
by
Alisson Claudino
Browse files
Padronização das interfaces e gráficos genéricos com n eixos
parent
b4282bcb
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Interface/CalibracaoP.py
View file @
28d55da4
This diff is collapsed.
Click to expand it.
Interface/CalibracaoT.py
View file @
28d55da4
...
...
@@ -2,19 +2,17 @@
# Form implementation generated from reading ui file 'Resources/CalibracaoT.ui'
#
# Created:
Fri
Nov 2
4
1
9:35:13
2017
# Created:
Wed
Nov 2
9
1
7:01:02
2017
# by: PyQt5 UI code generator 5.2.1
#
# WARNING! All changes made in this file will be lost!
from
PyQt5
import
QtCore
,
QtGui
,
QtWidgets
from
datetime
import
datetime
import
time
from
InterfaceTimer
import
InterfaceTimer
class
Ui_MainWindow
(
InterfaceTimer
):
def
setupUi
(
self
,
MainWindow
):
self
.
MainWindow
=
MainWindow
self
.
MainWindow
=
MainWindow
MainWindow
.
setObjectName
(
"MainWindow"
)
MainWindow
.
resize
(
1366
,
695
)
MainWindow
.
setMinimumSize
(
QtCore
.
QSize
(
817
,
0
))
...
...
@@ -30,12 +28,7 @@ class Ui_MainWindow(InterfaceTimer):
sizePolicy
.
setVerticalStretch
(
0
)
sizePolicy
.
setHeightForWidth
(
self
.
CentralGraph
.
sizePolicy
().
hasHeightForWidth
())
self
.
CentralGraph
.
setSizePolicy
(
sizePolicy
)
self
.
CentralGraph
.
setVerticalScrollBarPolicy
(
QtCore
.
Qt
.
ScrollBarAlwaysOff
)
self
.
CentralGraph
.
setHorizontalScrollBarPolicy
(
QtCore
.
Qt
.
ScrollBarAlwaysOff
)
self
.
CentralGraph
.
setSizeAdjustPolicy
(
QtWidgets
.
QAbstractScrollArea
.
AdjustToContents
)
self
.
CentralGraph
.
setAlignment
(
QtCore
.
Qt
.
AlignJustify
)
self
.
CentralGraph
.
setObjectName
(
"CentralGraph"
)
self
.
scaleBox
=
QtWidgets
.
QGroupBox
(
self
.
centralWidget
)
self
.
scaleBox
.
setGeometry
(
QtCore
.
QRect
(
10
,
10
,
401
,
231
))
self
.
scaleBox
.
setToolTip
(
""
)
...
...
@@ -154,13 +147,8 @@ class Ui_MainWindow(InterfaceTimer):
self
.
cronometroBox
.
setStyleSheet
(
"background-color: rgb(86, 86, 86);
\n
"
"border:1px solid rgb(123, 0, 129);"
)
self
.
cronometroBox
.
setObjectName
(
"cronometroBox"
)
self
.
startTimerButton
=
QtWidgets
.
QPushButton
(
self
.
cronometroBox
)
self
.
startTimerButton
.
setGeometry
(
QtCore
.
QRect
(
170
,
30
,
51
,
31
))
self
.
startTimerButton
.
setStyleSheet
(
"background-color:rgb(53, 53, 53);
\n
"
"border: 1px solid rgb(44, 0, 47);"
)
self
.
startTimerButton
.
setObjectName
(
"startTimerButton"
)
self
.
timerGBox
=
QtWidgets
.
QGroupBox
(
self
.
cronometroBox
)
self
.
timerGBox
.
setGeometry
(
QtCore
.
QRect
(
10
,
30
,
1
4
1
,
71
))
self
.
timerGBox
.
setGeometry
(
QtCore
.
QRect
(
10
,
30
,
2
11
,
71
))
self
.
timerGBox
.
setStyleSheet
(
"background-color:rgb(53, 53, 53)"
)
self
.
timerGBox
.
setObjectName
(
"timerGBox"
)
self
.
timerLabel
=
QtWidgets
.
QLabel
(
self
.
timerGBox
)
...
...
@@ -170,8 +158,28 @@ class Ui_MainWindow(InterfaceTimer):
"border: 1px solid rgb(44, 0, 47);
\n
"
"font: 75 12pt
\"
Noto Serif
\"
;"
)
self
.
timerLabel
.
setObjectName
(
"timerLabel"
)
self
.
startTimerButton
=
QtWidgets
.
QPushButton
(
self
.
timerGBox
)
self
.
startTimerButton
.
setGeometry
(
QtCore
.
QRect
(
130
,
10
,
51
,
21
))
self
.
startTimerButton
.
setStyleSheet
(
"background-color:rgb(53, 53, 53);
\n
"
"border: 1px solid rgb(44, 0, 47);"
)
self
.
startTimerButton
.
setObjectName
(
"startTimerButton"
)
self
.
stopTimerButton
=
QtWidgets
.
QPushButton
(
self
.
timerGBox
)
self
.
stopTimerButton
.
setGeometry
(
QtCore
.
QRect
(
130
,
40
,
51
,
21
))
self
.
stopTimerButton
.
setStyleSheet
(
"background-color:rgb(53, 53, 53);
\n
"
"border: 1px solid rgb(44, 0, 47);"
)
self
.
stopTimerButton
.
setObjectName
(
"stopTimerButton"
)
self
.
startTimeGBox
=
QtWidgets
.
QGroupBox
(
self
.
cronometroBox
)
self
.
startTimeGBox
.
setGeometry
(
QtCore
.
QRect
(
240
,
30
,
151
,
71
))
self
.
startTimeGBox
.
setStyleSheet
(
"background-color:rgb(53, 53, 53)"
)
self
.
startTimeGBox
.
setObjectName
(
"startTimeGBox"
)
self
.
startTimeLabel
=
QtWidgets
.
QLabel
(
self
.
startTimeGBox
)
self
.
startTimeLabel
.
setGeometry
(
QtCore
.
QRect
(
30
,
30
,
91
,
31
))
self
.
startTimeLabel
.
setStyleSheet
(
"background-color:rgb(80, 80,80);
\n
"
"color:rgb(255,255,255);
\n
"
"font: 14pt
\"
Noto Serif
\"
;"
)
self
.
startTimeLabel
.
setObjectName
(
"startTimeLabel"
)
self
.
currentTimeGBox
=
QtWidgets
.
QGroupBox
(
self
.
cronometroBox
)
self
.
currentTimeGBox
.
setGeometry
(
QtCore
.
QRect
(
240
,
3
0
,
151
,
71
))
self
.
currentTimeGBox
.
setGeometry
(
QtCore
.
QRect
(
240
,
12
0
,
151
,
71
))
self
.
currentTimeGBox
.
setStyleSheet
(
"background-color:rgb(53, 53, 53)"
)
self
.
currentTimeGBox
.
setObjectName
(
"currentTimeGBox"
)
self
.
currentTimeLabel
=
QtWidgets
.
QLabel
(
self
.
currentTimeGBox
)
...
...
@@ -180,39 +188,24 @@ class Ui_MainWindow(InterfaceTimer):
"color:rgb(255,255,255);
\n
"
"font: 14pt
\"
Noto Serif
\"
;"
)
self
.
currentTimeLabel
.
setObjectName
(
"currentTimeLabel"
)
self
.
horaAtualGBox
=
QtWidgets
.
QGroupBox
(
self
.
cronometroBox
)
self
.
horaAtualGBox
.
setGeometry
(
QtCore
.
QRect
(
240
,
120
,
151
,
71
))
self
.
horaAtualGBox
.
setStyleSheet
(
"background-color:rgb(53, 53, 53)"
)
self
.
horaAtualGBox
.
setObjectName
(
"horaAtualGBox"
)
self
.
horaAtualLabel
=
QtWidgets
.
QLabel
(
self
.
horaAtualGBox
)
self
.
horaAtualLabel
.
setGeometry
(
QtCore
.
QRect
(
30
,
30
,
91
,
31
))
self
.
horaAtualLabel
.
setStyleSheet
(
"background-color:rgb(80, 80,80);
\n
"
"color:rgb(255,255,255);
\n
"
"font: 14pt
\"
Noto Serif
\"
;"
)
self
.
horaAtualLabel
.
setObjectName
(
"horaAtualLabel"
)
self
.
stopTimerButton
=
QtWidgets
.
QPushButton
(
self
.
cronometroBox
)
self
.
stopTimerButton
.
setGeometry
(
QtCore
.
QRect
(
170
,
70
,
51
,
31
))
self
.
stopTimerButton
.
setStyleSheet
(
"background-color:rgb(53, 53, 53);
\n
"
"border: 1px solid rgb(44, 0, 47);"
)
self
.
stopTimerButton
.
setObjectName
(
"stopTimerButton"
)
self
.
regTimerGBox
=
QtWidgets
.
QGroupBox
(
self
.
cronometroBox
)
self
.
regTimerGBox
.
setGeometry
(
QtCore
.
QRect
(
10
,
120
,
1
4
1
,
71
))
self
.
regTimerGBox
.
setGeometry
(
QtCore
.
QRect
(
10
,
120
,
2
11
,
71
))
self
.
regTimerGBox
.
setStyleSheet
(
"background-color:rgb(53, 53, 53)"
)
self
.
regTimerGBox
.
setObjectName
(
"regTimerGBox"
)
self
.
regTimerLabel
=
QtWidgets
.
QL
abel
(
self
.
regTimerGBox
)
self
.
regTimerLabel
=
QtWidgets
.
QL
ineEdit
(
self
.
regTimerGBox
)
self
.
regTimerLabel
.
setGeometry
(
QtCore
.
QRect
(
20
,
30
,
81
,
31
))
self
.
regTimerLabel
.
setStyleSheet
(
"background-color: rgb(80,80,80);
\n
"
"border: 1px solid rgb(255,255,255);
\n
"
"color:rgb(255,255,255);
\n
"
"font: 75 12pt
\"
Noto Serif
\"
;"
)
self
.
regTimerLabel
.
setObjectName
(
"regTimerLabel"
)
self
.
startRegTimerButton
=
QtWidgets
.
QPushButton
(
self
.
cronometro
Box
)
self
.
startRegTimerButton
.
setGeometry
(
QtCore
.
QRect
(
1
7
0
,
1
2
0
,
51
,
3
1
))
self
.
startRegTimerButton
=
QtWidgets
.
QPushButton
(
self
.
regTimerG
Box
)
self
.
startRegTimerButton
.
setGeometry
(
QtCore
.
QRect
(
1
3
0
,
10
,
51
,
2
1
))
self
.
startRegTimerButton
.
setStyleSheet
(
"border: 1px solid rgb(255,255,255);
\n
"
"background-color:rgb(53, 53, 53)"
)
self
.
startRegTimerButton
.
setObjectName
(
"startRegTimerButton"
)
self
.
stopRegTimerButton
=
QtWidgets
.
QPushButton
(
self
.
cronometroBox
)
self
.
stopRegTimerButton
.
setGeometry
(
QtCore
.
QRect
(
1
7
0
,
160
,
51
,
3
1
))
self
.
stopRegTimerButton
.
setGeometry
(
QtCore
.
QRect
(
1
4
0
,
160
,
51
,
2
1
))
self
.
stopRegTimerButton
.
setStyleSheet
(
"background-color:rgb(53, 53, 53);
\n
"
"border: 1px solid rgb(255,255,255);"
)
self
.
stopRegTimerButton
.
setObjectName
(
"stopRegTimerButton"
)
...
...
@@ -288,18 +281,18 @@ class Ui_MainWindow(InterfaceTimer):
self
.
menuBar
=
QtWidgets
.
QMenuBar
(
MainWindow
)
self
.
menuBar
.
setGeometry
(
QtCore
.
QRect
(
0
,
0
,
1366
,
23
))
self
.
menuBar
.
setObjectName
(
"menuBar"
)
self
.
menuArquivo
=
QtWidgets
.
QMenu
(
self
.
menuBar
)
self
.
menuArquivo
.
setObjectName
(
"
menuArquivo
"
)
self
.
menuEtapa
=
QtWidgets
.
QMenu
(
self
.
menuBar
)
self
.
menuEtapa
.
setObjectName
(
"
menuEtapa
"
)
self
.
menuPorta
=
QtWidgets
.
QMenu
(
self
.
menuBar
)
self
.
menuPorta
.
setObjectName
(
"
menuPorta
"
)
self
.
menuP
lay
_
Pause
=
QtWidgets
.
QMenu
(
self
.
menuBar
)
self
.
menuP
lay
_
Pause
.
setObjectName
(
"
menuP
lay
_
Pause"
)
self
.
menuTermopar
=
QtWidgets
.
QMenu
(
self
.
menuBar
)
self
.
menuTermopar
.
setObjectName
(
"menuTermopar
"
)
self
.
menuF
inaliz
ar
=
QtWidgets
.
QMenu
(
self
.
menuBar
)
self
.
menuF
inaliz
ar
.
setObjectName
(
"
menuF
inaliz
ar
"
)
self
.
fileMenu
=
QtWidgets
.
QMenu
(
self
.
menuBar
)
self
.
fileMenu
.
setObjectName
(
"
fileMenu
"
)
self
.
stageMenu
=
QtWidgets
.
QMenu
(
self
.
menuBar
)
self
.
stageMenu
.
setObjectName
(
"
stageMenu
"
)
self
.
serialMenu
=
QtWidgets
.
QMenu
(
self
.
menuBar
)
self
.
serialMenu
.
setObjectName
(
"
serialMenu
"
)
self
.
p
layPause
Button
=
QtWidgets
.
QMenu
(
self
.
menuBar
)
self
.
p
layPause
Button
.
setObjectName
(
"
p
layPause
Button
"
)
self
.
ThermocoupleMenu
=
QtWidgets
.
QMenu
(
self
.
menuBar
)
self
.
ThermocoupleMenu
.
setObjectName
(
"ThermocoupleMenu
"
)
self
.
f
inaliz
eButton
=
QtWidgets
.
QMenu
(
self
.
menuBar
)
self
.
f
inaliz
eButton
.
setObjectName
(
"
f
inaliz
eButton
"
)
MainWindow
.
setMenuBar
(
self
.
menuBar
)
self
.
alternaCalibraP
=
QtWidgets
.
QAction
(
MainWindow
)
self
.
alternaCalibraP
.
setObjectName
(
"alternaCalibraP"
)
...
...
@@ -307,78 +300,39 @@ class Ui_MainWindow(InterfaceTimer):
self
.
alternaCalibraT
.
setObjectName
(
"alternaCalibraT"
)
self
.
alternaProc
=
QtWidgets
.
QAction
(
MainWindow
)
self
.
alternaProc
.
setObjectName
(
"alternaProc"
)
self
.
botaoAbrir
=
QtWidgets
.
QAction
(
MainWindow
)
self
.
botaoAbrir
.
setEnabled
(
False
)
self
.
botaoAbrir
.
setIconVisibleInMenu
(
True
)
self
.
botaoAbrir
.
setObjectName
(
"
botaoAbrir
"
)
self
.
openButton
=
QtWidgets
.
QAction
(
MainWindow
)
self
.
openButton
.
setEnabled
(
False
)
self
.
openButton
.
setIconVisibleInMenu
(
True
)
self
.
openButton
.
setObjectName
(
"
openButton
"
)
self
.
actionSalvar
=
QtWidgets
.
QAction
(
MainWindow
)
self
.
actionSalvar
.
setObjectName
(
"actionSalvar"
)
self
.
actionSalvar_Como
=
QtWidgets
.
QAction
(
MainWindow
)
self
.
actionSalvar_Como
.
setObjectName
(
"actionSalvar_Como"
)
self
.
botaoSalvar
=
QtWidgets
.
QAction
(
MainWindow
)
self
.
botaoSalvar
.
setObjectName
(
"
botaoSalvar
"
)
self
.
botaoSalvarComo
=
QtWidgets
.
QAction
(
MainWindow
)
self
.
botaoSalvarComo
.
setObjectName
(
"
botaoSalvarComo
"
)
self
.
saveButton
=
QtWidgets
.
QAction
(
MainWindow
)
self
.
saveButton
.
setObjectName
(
"
saveButton
"
)
self
.
saveAsButton
=
QtWidgets
.
QAction
(
MainWindow
)
self
.
saveAsButton
.
setObjectName
(
"
saveAsButton
"
)
self
.
selectPortaUSB
=
QtWidgets
.
QAction
(
MainWindow
)
self
.
selectPortaUSB
.
setObjectName
(
"selectPortaUSB"
)
self
.
menuArquivo
.
addAction
(
self
.
botaoAbrir
)
self
.
menuArquivo
.
addAction
(
self
.
botaoSalvar
)
self
.
menuArquivo
.
addAction
(
self
.
botaoSalvarComo
)
self
.
menuEtapa
.
addAction
(
self
.
alternaCalibraP
)
self
.
menuEtapa
.
addAction
(
self
.
alternaCalibraT
)
self
.
menuEtapa
.
addAction
(
self
.
alternaProc
)
self
.
menuBar
.
addAction
(
self
.
menuArquivo
.
menuAction
())
self
.
menuBar
.
addAction
(
self
.
menuEtapa
.
menuAction
())
self
.
menuBar
.
addAction
(
self
.
menuPorta
.
menuAction
())
self
.
menuBar
.
addAction
(
self
.
menuTermopar
.
menuAction
())
self
.
menuBar
.
addAction
(
self
.
menuFinalizar
.
menuAction
())
self
.
fileMenu
.
addAction
(
self
.
openButton
)
self
.
fileMenu
.
addAction
(
self
.
saveButton
)
self
.
fileMenu
.
addAction
(
self
.
saveAsButton
)
self
.
stageMenu
.
addAction
(
self
.
alternaCalibraP
)
self
.
stageMenu
.
addAction
(
self
.
alternaCalibraT
)
self
.
stageMenu
.
addAction
(
self
.
alternaProc
)
self
.
menuBar
.
addAction
(
self
.
fileMenu
.
menuAction
())
self
.
menuBar
.
addAction
(
self
.
stageMenu
.
menuAction
())
self
.
menuBar
.
addAction
(
self
.
serialMenu
.
menuAction
())
self
.
menuBar
.
addAction
(
self
.
ThermocoupleMenu
.
menuAction
())
self
.
menuBar
.
addAction
(
self
.
playPauseButton
.
menuAction
())
self
.
menuBar
.
addAction
(
self
.
finalizeButton
.
menuAction
())
self
.
retranslateUi
(
MainWindow
)
QtCore
.
QMetaObject
.
connectSlotsByName
(
MainWindow
)
self
.
pauseTimerButton
=
self
.
startRegTimerButton
self
.
menuPlay_Pause
=
QtWidgets
.
QAction
(
MainWindow
)
self
.
menuPlay_Pause
.
setText
(
"Play"
)
self
.
menuPlay_Pause
.
setObjectName
(
"menuPlay_Pause"
)
self
.
menuBar
.
addAction
(
self
.
menuPlay_Pause
)
self
.
menuPlay_Pause
.
setCheckable
(
True
)
self
.
menuPlay_Pause
.
toggled
.
connect
(
self
.
playPauseButtonAnimation
)
self
.
linkActions
()
self
.
retranslateUi
(
MainWindow
)
def
sceneSelector
(
self
,
scene
):
self
.
CentralGraph
.
setScene
(
scene
)
self
.
CentralGraph
.
setBackgroundBrush
(
QtCore
.
Qt
.
black
)
self
.
CentralGraph
.
setInteractive
(
False
)
def
serialListPanel
(
self
,
seriaList
):
self
.
usb
=
[]
for
i
in
range
(
0
,
len
(
seriaList
)):
self
.
usb
.
append
(
QtWidgets
.
QAction
(
self
.
MainWindow
))
self
.
usb
[
i
].
setText
(
seriaList
[
i
].
device
)
self
.
usb
[
i
].
setCheckable
(
True
)
self
.
menuPorta
.
addAction
(
self
.
usb
[
i
])
def
playPauseButtonAnimation
(
self
):
if
(
self
.
menuPlay_Pause
.
text
()
==
"Play"
):
self
.
menuPlay_Pause
.
setText
(
"Pause"
)
self
.
startTimeLabel
.
setText
(
self
.
currentTimeLabel
.
text
)
else
:
self
.
menuPlay_Pause
.
setText
(
"Play"
)
def
retranslateUi
(
self
,
MainWindow
):
_translate
=
QtCore
.
QCoreApplication
.
translate
MainWindow
.
setWindowTitle
(
_translate
(
"MainWindow"
,
"SADAMAP - Análise de Dados: Etapa
2
- Calibração de
Temperatura
"
))
MainWindow
.
setWindowTitle
(
_translate
(
"MainWindow"
,
"SADAMAP - Análise de Dados: Etapa
1
- Calibração de
Pressão
"
))
self
.
scaleBox
.
setTitle
(
_translate
(
"MainWindow"
,
"Escalas de Visualização (Range)"
))
self
.
tempBox
.
setTitle
(
_translate
(
"MainWindow"
,
"Temperatura (ºC)"
))
self
.
temp_max
.
setText
(
_translate
(
"MainWindow"
,
"1000"
))
...
...
@@ -409,16 +363,16 @@ class Ui_MainWindow(InterfaceTimer):
self
.
samplingCBox
.
setItemText
(
7
,
_translate
(
"MainWindow"
,
"5 seg"
))
self
.
samplingCBox
.
setItemText
(
8
,
_translate
(
"MainWindow"
,
"10 seg"
))
self
.
cronometroBox
.
setTitle
(
_translate
(
"MainWindow"
,
"Timer"
))
self
.
startTimerButton
.
setText
(
_translate
(
"MainWindow"
,
"Iniciar"
))
self
.
timerGBox
.
setTitle
(
_translate
(
"MainWindow"
,
"Cronômetro"
))
self
.
timerLabel
.
setText
(
_translate
(
"MainWindow"
,
"10.2674 s"
))
self
.
currentTimeGBox
.
setTitle
(
_translate
(
"MainWindow"
,
"Horário de Início"
))
self
.
currentTimeLabel
.
setText
(
_translate
(
"MainWindow"
,
"16:30:15"
))
self
.
horaAtualGBox
.
setTitle
(
_translate
(
"MainWindow"
,
"Horário Atual"
))
self
.
horaAtualLabel
.
setText
(
_translate
(
"MainWindow"
,
"17:05:56"
))
self
.
timerLabel
.
setText
(
_translate
(
"MainWindow"
,
"0.00 s"
))
self
.
startTimerButton
.
setText
(
_translate
(
"MainWindow"
,
"Iniciar"
))
self
.
stopTimerButton
.
setText
(
_translate
(
"MainWindow"
,
"Parar"
))
self
.
startTimeGBox
.
setTitle
(
_translate
(
"MainWindow"
,
"Horário de Início"
))
self
.
startTimeLabel
.
setText
(
_translate
(
"MainWindow"
,
"16:30:15"
))
self
.
currentTimeGBox
.
setTitle
(
_translate
(
"MainWindow"
,
"Horário Atual"
))
self
.
currentTimeLabel
.
setText
(
_translate
(
"MainWindow"
,
"17:05:56"
))
self
.
regTimerGBox
.
setTitle
(
_translate
(
"MainWindow"
,
"Cont. Regressivo"
))
self
.
regTimerLabel
.
setText
(
_translate
(
"MainWindow"
,
"
1
0.
2674
s"
))
self
.
regTimerLabel
.
setText
(
_translate
(
"MainWindow"
,
"0.
00
s"
))
self
.
startRegTimerButton
.
setText
(
_translate
(
"MainWindow"
,
"Iniciar"
))
self
.
stopRegTimerButton
.
setText
(
_translate
(
"MainWindow"
,
"Parar"
))
self
.
prensaNameGBox
.
setTitle
(
_translate
(
"MainWindow"
,
"Prensa"
))
...
...
@@ -434,19 +388,19 @@ class Ui_MainWindow(InterfaceTimer):
self
.
powLabel
.
setText
(
_translate
(
"MainWindow"
,
"23.567 kW"
))
self
.
forceGBox
.
setTitle
(
_translate
(
"MainWindow"
,
"Força"
))
self
.
forceLabel
.
setText
(
_translate
(
"MainWindow"
,
"340.34 kN"
))
self
.
menuArquivo
.
setTitle
(
_translate
(
"MainWindow"
,
"Arquivo"
))
self
.
menuEtapa
.
setTitle
(
_translate
(
"MainWindow"
,
"Etapa"
))
self
.
menuPorta
.
setTitle
(
_translate
(
"MainWindow"
,
"Porta"
))
#
self.
menuP
lay
_
Pause.setTitle(_translate("MainWindow", "Iniciar/Pausar"))
self
.
menuTermopar
.
setTitle
(
_translate
(
"MainWindow"
,
"Termopar"
))
self
.
menuF
inaliz
ar
.
setTitle
(
_translate
(
"MainWindow"
,
"Finalizar"
))
self
.
fileMenu
.
setTitle
(
_translate
(
"MainWindow"
,
"Arquivo"
))
self
.
stageMenu
.
setTitle
(
_translate
(
"MainWindow"
,
"Etapa"
))
self
.
serialMenu
.
setTitle
(
_translate
(
"MainWindow"
,
"Porta"
))
self
.
p
layPause
Button
.
setTitle
(
_translate
(
"MainWindow"
,
"Iniciar/Pausar"
))
self
.
ThermocoupleMenu
.
setTitle
(
_translate
(
"MainWindow"
,
"Termopar"
))
self
.
f
inaliz
eButton
.
setTitle
(
_translate
(
"MainWindow"
,
"Finalizar"
))
self
.
alternaCalibraP
.
setText
(
_translate
(
"MainWindow"
,
"Calibração P"
))
self
.
alternaCalibraT
.
setText
(
_translate
(
"MainWindow"
,
"Calibração T"
))
self
.
alternaProc
.
setText
(
_translate
(
"MainWindow"
,
"Processamento"
))
self
.
botaoAbrir
.
setText
(
_translate
(
"MainWindow"
,
"Abrir"
))
self
.
openButton
.
setText
(
_translate
(
"MainWindow"
,
"Abrir"
))
self
.
actionSalvar
.
setText
(
_translate
(
"MainWindow"
,
"Salvar"
))
self
.
actionSalvar_Como
.
setText
(
_translate
(
"MainWindow"
,
"Salvar Como"
))
self
.
botaoSalvar
.
setText
(
_translate
(
"MainWindow"
,
"Salvar"
))
self
.
botaoSalvarComo
.
setText
(
_translate
(
"MainWindow"
,
"Salvar Como"
))
self
.
saveButton
.
setText
(
_translate
(
"MainWindow"
,
"Salvar"
))
self
.
saveAsButton
.
setText
(
_translate
(
"MainWindow"
,
"Salvar Como"
))
self
.
selectPortaUSB
.
setText
(
_translate
(
"MainWindow"
,
"Selecionar porta USB"
))
Interface/Graph.py
View file @
28d55da4
...
...
@@ -5,60 +5,72 @@ import time
class
Graph
(
PlotItem
):
index
=
0
def
__init__
(
self
,
x_sampling
,
x_range
,
y1_min
,
y1_max
,
y
2
_min
,
y
2
_max
,
x_size
,
y_size
,
color
1
,
color2
,
name1
,
name2
):
def
__init__
(
self
,
x_sampling
,
x_range
,
n_axis
,
y_min
,
y_max
,
x_size
,
y_size
,
color
,
name
,
unit
):
super
(
Graph
,
self
).
__init__
()
self
.
x_sampling
=
1
self
.
x_range
=
x_range
/
x_sampling
self
.
y1_min
=
y1_min
self
.
y1_max
=
y1_max
self
.
y2_min
=
y2_min
self
.
y2_max
=
y2_max
self
.
x_size
=
x_size
self
.
y_size
=
y_size
self
.
color1
=
color1
self
.
color2
=
color2
self
.
name1
=
name1
self
.
name2
=
name2
self
.
curve1
=
self
.
plot
(
pen
=
color1
,
name
=
self
.
name1
)
self
.
curve2
=
self
.
plot
(
pen
=
color2
,
name
=
self
.
name2
)
self
.
curve
=
[]
self
.
axis
=
[]
self
.
y
=
[]
self
.
curve
.
append
(
self
.
plot
(
pen
=
color
[
0
],
name
=
name
[
0
]))
self
.
axis
.
append
(
AxisItem
(
"left"
,
color
[
0
]))
self
.
axis
[
0
].
setLabel
(
name
[
0
],
unit
[
0
])
self
.
axis
[
0
].
setRange
(
y_min
[
0
],
y_max
[
0
])
y_axis
=
[
0
]
self
.
y
.
append
(
y_axis
)
try
:
for
n
in
range
(
1
,
n_axis
):
self
.
curve
.
append
(
self
.
plot
(
pen
=
color
[
n
],
name
=
name
[
n
]))
self
.
axis
.
append
(
AxisItem
(
"right"
,
color
[
n
]))
self
.
axis
[
n
].
setLabel
(
name
[
n
],
unit
[
n
])
self
.
axis
[
n
].
setRange
(
y_min
[
n
],
y_max
[
n
])
self
.
y
.
append
(
y_axis
)
print
(
y_axis
)
except
Exception
as
e
:
print
(
e
)
self
.
axisTime
=
AxisItem
(
"bottom"
,
'w'
)
self
.
axis2
=
AxisItem
(
"right"
,
color2
)
self
.
axis1
=
AxisItem
(
"left"
,
color1
)
self
.
axis1
.
setLabel
(
self
.
name1
,
'Tonf'
)
self
.
axis2
.
setLabel
(
self
.
name2
,
'mV'
)
self
.
axisTime
.
setLabel
(
"Tempo"
,
's'
)
self
.
axisTime
.
setRange
(
0
,
x_range
)
self
.
x
=
[]
self
.
x
.
append
(
0
)
self
.
showAxis
(
"left"
,
False
)
self
.
showAxis
(
"bottom"
,
False
)
self
.
axisTime
.
setRange
(
0
,
x_range
)
self
.
axis1
.
setRange
(
y1_min
,
y1_max
)
self
.
axis2
.
setRange
(
y2_min
,
y2_max
)
self
.
showAxis
(
"left"
,
False
)
self
.
showAxis
(
"bottom"
,
False
)
self
.
setMinimumSize
(
x_size
,
y_size
)
self
.
setMinimumSize
(
x_size
,
y_size
)
self
.
setXRange
(
0
,
self
.
x_range
,
padding
=
0
)
self
.
setYRange
(
min
(
self
.
y1_min
,
self
.
y2_min
),
max
(
self
.
y1_max
,
self
.
y2_max
),
padding
=
0
)
self
.
x1
=
[]
self
.
y1
=
[]
self
.
y2
=
[]
self
.
timeant
=
time
.
time
()
self
.
setYRange
(
min
(
y_min
),
max
(
y_max
),
padding
=
0
)
self
.
timeant
=
time
.
time
()
def
updateGraph
(
self
,
y
1
,
y2
):
def
updateGraph
(
self
,
y
):
# print(time.time()-self.timeant)
self
.
y1
.
append
(
y1
)
self
.
y2
.
append
(
y2
)
if
len
(
self
.
y1
)
>
self
.
x_range
+
1
:
self
.
y1
.
pop
(
0
)
self
.
y2
.
pop
(
0
)
for
n
in
range
(
0
,
len
(
y
)):
print
(
y
[
n
])
print
(
self
.
y
[
n
])
self
.
y
[
n
].
append
(
y
[
n
])
if
len
(
self
.
y
[
0
])
>
self
.
x_range
+
1
:
for
n
in
range
(
0
,
len
(
y
)):
self
.
y
[
n
].
pop
(
0
)
self
.
index
=
self
.
x_range
else
:
self
.
x1
.
append
(
self
.
index
)
self
.
x
.
append
(
self
.
index
)
self
.
index
=
self
.
index
+
1
self
.
curve1
.
setData
(
self
.
x1
,
self
.
y1
)
self
.
curve2
.
setData
(
self
.
x1
,
self
.
y2
)
#self.timeant = time.time()
for
n
in
range
(
0
,
len
(
y
)):
self
.
curve
[
0
].
setData
(
self
.
x
,
self
.
y
[
0
])
self
.
timeant
=
time
.
time
()
Interface/InterfaceTimer.py
View file @
28d55da4
from
datetime
import
datetime
from
PyQt5
import
QtWidgets
,
QtCore
from
PyQt5
import
QtWidgets
,
QtCore
,
QtGui
class
InterfaceTimer
(
object
):
def
__init__
(
self
):
self
.
startTimerButton
=
QtWidgets
.
QPushButton
()
self
.
pauseTimerButton
=
QtWidgets
.
QPushButton
()
self
.
stopTimerButton
=
QtWidgets
.
QPushButton
()
self
.
startRegTimerButton
=
QtWidgets
.
QPushButton
()
self
.
stopRegTimerButton
=
QtWidgets
.
QPushButton
()
self
.
regTimerLabel
=
QtWidgets
.
QLabel
()
self
.
screenT
imerLabel
=
QtWidgets
.
QLabel
()
self
.
t
imerLabel
=
QtWidgets
.
QLabel
()
self
.
currentTimeLabel
=
QtWidgets
.
QLabel
()
self
.
currentTimer
=
QtCore
.
QTimer
()
self
.
regTimer
=
QtCore
.
QTimer
()
self
.
MainWindow
=
QtWidgets
.
QDialog
()
self
.
regT
imerLabel
.
setText
(
"0 s"
)
self
.
regTimerLabel
.
setText
(
"0.0 s"
)
self
.
t
imerLabel
.
setText
(
"0
.0
s"
)
self
.
timeValue
=
0
self
.
regTimerValue
=
0
self
.
regTimerValue
=
100
0
def
linkActions
(
self
):
self
.
startTimerButton
.
pressed
.
connect
(
self
.
startScreenTimer
)
self
.
pauseTimerButton
.
pressed
.
connect
(
self
.
playPauseScreenTimer
)
self
.
stopTimerButton
.
pressed
.
connect
(
self
.
stopScreenTimer
)
self
.
currentTimer
.
timeout
.
connect
(
self
.
updateCurrentTime
)
self
.
startRegTimerButton
.
pressed
.
connect
(
self
.
startRegressiveTimer
)
self
.
stopRegTimerButton
.
pressed
.
connect
(
self
.
st
art
RegressiveTimer
)
self
.
stopRegTimerButton
.
pressed
.
connect
(
self
.
st
op
RegressiveTimer
)
self
.
currentTimer
.
start
(
500
)
self
.
screenTimerFlag
=
False
def
startRegressiveTimer
(
self
):
try
:
if
(
self
.
regTimerLabel
.
text
().
split
(
" "
,
3
)[
1
]
==
"s"
):
self
.
regTimerValue
=
self
.
regTimerLabel
.
text
().
split
(
" "
,
3
)[
0
]
else
:
self
.
regTimerValue
=
self
.
regTimerLabel
.
text
()
print
(
self
.
regTimerValue
)
self
.
regTimerValue
=
float
(
self
.
regTimerValue
)
except
(
IndexError
):
self
.
regTimerValue
=
self
.
regTimerLabel
.
text
()
self
.
regTimerValue
.
split
(
" "
,
3
)
self
.
regTimerValue
=
float
(
self
.
regTimerValue
[
0
])
except
(
ValueError
):
print
(
self
.
regTimerLabel
.
text
)
except
(
ValueError
,
TypeError
):
error
=
QtWidgets
.
QMessageBox
(
self
.
MainWindow
)
error
.
setText
(
"Valor Inválido! Definindo valor padrão de 1000 segundos"
)
error
.
setWindowTitle
(
"ERRO!"
)
error
.
exec
()
self
.
regTimerValue
=
1000
print
(
self
.
regTimerValue
)
self
.
regTimerValue
=
float
(
self
.
regTimerValue
)
self
.
regTimer
=
QtCore
.
QTimer
()
self
.
regTimer
.
timeout
.
connect
(
self
.
updateRegTimer
)
...
...
@@ -55,53 +71,39 @@ class InterfaceTimer(object):
self
.
regTimer
.
stop
()
self
.
startRegTimerButton
.
setText
(
"Iniciar"
)
self
.
startRegTimerButton
.
pressed
.
disconnect
()
self
.
startRegTimerButton
.
pressed
.
connect
(
startRegressiveTimer
)
self
.
startRegTimerButton
.
pressed
.
connect
(
self
.
startRegressiveTimer
)
self
.
regTimerLabel
.
setText
(
"0.00 s"
)
def
updateRegTimer
(
self
):
while
(
self
.
regTimerValue
!
=
0
):
if
(
self
.
regTimerValue
>
=
0
.1
):
self
.
regTimerValue
-=
0.1
self
.
regTimerLabel
.
setText
(
"%.1f s
eg
"
%
self
.
regTimerValue
)
self
.
regTimerLabel
.
setText
(
"%.1f s"
%
self
.
regTimerValue
)
def
startScreenTimer
(
self
):
self
.
timeValue
=
0
self
.
screenTimer
=
QtCore
.
QTimer
()
self
.
screenTimer
.
timeout
.
connect
(
self
.
updateScreenTimer
)
self
.
screenTimer
.
start
(
100
)
self
.
startTimerButton
.
setText
(
"Reiniciar"
)
self
.
pauseTimerButton
.
setText
(
"Pausar"
)
self
.
screenTimerFlag
=
True
def
playPauseScreenTimer
(
self
):
self
.
startTimerButton
.
setText
(
"Reiniciar"
)
if
(
self
.
pauseTimerButton
==
"Iniciar"
):
self
.
startScreenTimer
()
if
(
self
.
screenTimerFlag
==
True
):
self
.
screenTimer
.
stop
()
self
.
screenTimerFlag
=
False
self
.
pauseTimerButton
.
setText
(
"Continuar"
)
else
:
try
:
self
.
screenTimer
.
start
(
100
)
self
.
screenTimerFlag
=
True
self
.
pauseTimerButton
.
setText
(
"Pausar"
)
except
:
self
.
startScreenTimer
()
self
.
startTimerButton
.
pressed
.
disconnect
()
self
.
startTimerButton
.
pressed
.
connect
(
self
.
pauseScreenTimer
)
self
.
startTimerButton
.
setText
(
"Pausar"
)
def
pauseScreenTimer
(
self
):
self
.
screenTimer
.
stop
()
self
.
startTimerButton
.
setText
(
"Continuar"
)
self
.
startTimerButton
.
pressed
.
disconnect
()
self
.
startTimerButton
.
pressed
.
connect
(
self
.
startScreenTimer
)
def
stopScreenTimer
(
self
):
self
.
screenTimer
.
stop
()
self
.
screenT
imerLabel
.
setText
(
"0.00 s
eg
"
)
self
.
t
imerLabel
.
setText
(
"0.00 s"
)
self
.
timeValue
=
0
self
.
screenTimerFlag
=
False
self
.
startTimerButton
.
setText
(
"Iniciar"
)
self
.
pauseTimerButton
.
setText
(
"Iniciar"
)
def
updateScreenTimer
(
self
):
self
.
timeValue
+=
0.1
self
.
screenT
imerLabel
.
setText
(
"%.1f s
eg
"
%
self
.
timeValue
)
self
.
t
imerLabel
.
setText
(
"%.1f s"
%
self
.
timeValue
)
def
updateCurrentTime
(
self
):
self
.
currentTime
=
(
str
(
datetime
.
now
().
time
()))
...
...
Interface/Resources/CalibracaoP.ui
View file @
28d55da4
...
...
@@ -30,10 +30,10 @@ color: rgb(255,255,255);</string>
<widget
class=
"QGraphicsView"
name=
"CentralGraph"
>
<property
name=
"geometry"
>
<rect>
<x>
4
2
0
</x>
<x>
4
3
0
</x>
<y>
10
</y>
<width>
9
3
1
</width>
<height>
6
2
1
</height>
<width>
9
2
1
</width>
<height>
6
1
1
</height>
</rect>
</property>
<property
name=
"sizePolicy"
>
...
...
@@ -60,8 +60,8 @@ color: rgb(255,255,255);</string>
<rect>
<x>
20
</x>
<y>
10
</y>
<width>
39
1
</width>
<height>
2
3
1
</height>
<width>
40
1
</width>
<height>
2
2
1
</height>