Commit ed46729b authored by Alisson Claudino's avatar Alisson Claudino

Ajustada escala de tempo de acordo com a amostragem

parent 8e861d39
......@@ -33,13 +33,10 @@ class Ui_MainWindow(object):
self.CentralGraph.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.CentralGraph.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.CentralGraph.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
self.CentralGraph.setAlignment(QtCore.Qt.AlignCenter)
self.CentralGraph.setAlignment(QtCore.Qt.AlignJustify)
self.CentralGraph.setObjectName("CentralGraph")
self.scaleBox = QtWidgets.QGroupBox(self.centralWidget)
self.scaleBox.setGeometry(QtCore.QRect(20, 10, 391, 231))
self.scaleBox.setToolTip("")
self.scaleBox.setStatusTip("")
self.scaleBox.setWhatsThis("")
self.scaleBox.setAutoFillBackground(False)
self.scaleBox.setStyleSheet("background-color: rgb(86, 86, 86);\n"
"border:1px solid rgb(194, 8, 6);\n"
......@@ -283,6 +280,7 @@ class Ui_MainWindow(object):
self.CentralGraph.setBackgroundBrush(QtCore.Qt.black)
self.CentralGraph.setInteractive(False)
def serialListPanel(self, seriaList):
self.usb = []
for i in range(0, len(seriaList)):
......@@ -348,19 +346,19 @@ class Ui_MainWindow(object):
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.forceBox.setTitle(_translate("MainWindow", "Força"))
self.forceBox.setTitle(_translate("MainWindow", "Força (kN)"))
self.f_max.setText(_translate("MainWindow", "32700"))
self.f_max_label.setText(_translate("MainWindow", "Máximo:"))
self.f_min_label.setText(_translate("MainWindow", "Mínimo:"))
self.f_min.setText(_translate("MainWindow", "0"))
self.pressureBox.setTitle(_translate("MainWindow", "Tensão no Calibrante"))
self.pressureBox.setTitle(_translate("MainWindow", "Tensão no Calibrante (mV)"))
self.p_max.setText(_translate("MainWindow", "32700"))
self.p_max_label.setText(_translate("MainWindow", "Máximo:"))
self.p_min_label.setText(_translate("MainWindow", "Mínimo:"))
self.p_min.setText(_translate("MainWindow", "0"))
self.timeGBox.setTitle(_translate("MainWindow", "Tempo"))
self.timeGBox.setTitle(_translate("MainWindow", "Tempo (s)"))
self.t_max.setText(_translate("MainWindow", "100"))
self.t_max_label.setText(_translate("MainWindow", "Intervalo (amostras):"))
self.t_max_label.setText(_translate("MainWindow", "Intervalo:"))
self.samplingBox.setTitle(_translate("MainWindow", "Amostragem"))
self.samplingCBox.setItemText(0, _translate("MainWindow", "100 mseg"))
self.samplingCBox.setItemText(1, _translate("MainWindow", "200 mseg"))
......
......@@ -5,9 +5,10 @@ import time
class Graph(PlotItem):
index = 0
def __init__(self, x_range, y1_min, y1_max, y2_min, y2_max, x_size, y_size, color1, color2, name1, name2):
def __init__(self,x_sampling, x_range, y1_min, y1_max, y2_min, y2_max, x_size, y_size, color1, color2, name1, name2):
super(Graph, self).__init__()
self.x_range = x_range
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
......
......@@ -52,7 +52,7 @@ color: rgb(255,255,255);</string>
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignHCenter</set>
<set>Qt::AlignBottom|Qt::AlignJustify</set>
</property>
</widget>
<widget class="QGroupBox" name="scaleBox">
......@@ -479,8 +479,6 @@ font: 14pt &quot;Noto Serif&quot;;</string>
<string>00:00:00</string>
</property>
</widget>
<zorder>startTimeLabel</zorder>
<zorder>samplingCBox</zorder>
</widget>
<widget class="QGroupBox" name="currentTimeGBox">
<property name="geometry">
......
......@@ -6,7 +6,8 @@ from pyqtgraph import GraphicsLayout
from SerialManager import SerialManager
from CalibracaoP import Ui_MainWindow
from Graph import Graph
import numpy as np
from math import sin,log
class SystemEngine(object):
......@@ -28,16 +29,29 @@ class SystemEngine(object):
self.y2_max=10000
self.layout=GraphicsLayout()
self.graph = self.graph = Graph(self.x_scale, self.y1_min, self.y1_max, self.y2_min, self.y2_max, 770, 550, 'r', 'g', "Força", "Tensão no Calibrante")
self.updateTimer()
self.graph = Graph(self.time[0]/1000,self.x_scale, self.y1_min, self.y1_max, self.y2_min, self.y2_max, 800, 500, 'r', 'g', "Força", "Tensão no Calibrante")
self.layout.addItem(self.graph.axis2,row=1,col=3,rowspan=1,colspan=1)
self.layout.addItem(self.graph.axis1,row=1,col=1,rowspan=1,colspan=1)
self.layout.addItem(self.graph.axisTime,row=2,col=2,rowspan=1,colspan=1)
self.layout.addItem(self.graph,row=1,col=2,rowspan=1,colspan=1)
self.layout.setMinimumSize(500, 600)
self.layout.setMaximumSize(500,600)
self.scene = QtGui.QGraphicsScene()
self.scene.addItem(self.layout)
self.layout.setMaximumSize(770,550)
#self.layout.setMaximumSize(770,550)
self.scene.focusItem()
self.uiCalibra1.sceneSelector(self.scene)
self.dialog.showMaximized()
......@@ -97,7 +111,7 @@ class SystemEngine(object):
self.x_scale="1"
self.layout.clear()
self.graph = Graph(self.x_scale, self.y1_min, self.y1_max, self.y2_min, self.y2_max, 770, 550, 'r', 'g', "Força", "Tensão no Calibrante")
self.graph = Graph(self.time[0]/1000,self.x_scale, self.y1_min, self.y1_max, self.y2_min, self.y2_max, 770, 550, 'r', 'g', "Força", "Tensão no Calibrante")
self.layout.addItem(self.graph.axis2,row=1,col=3,rowspan=1,colspan=1)
self.layout.addItem(self.graph.axis1,row=1,col=1,rowspan=1,colspan=1)
self.layout.addItem(self.graph.axisTime,row=2,col=2,rowspan=1,colspan=1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment