-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput.py
47 lines (35 loc) · 1.69 KB
/
output.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'dialog_base.ui'
#
# Created by: PyQt5 UI code generator 5.15.10
#
# 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
from pyqtgraph import PlotWidget
class Ui_DynamicPlotDialogBase(object):
def setupUi(self, DynamicPlotDialogBase):
DynamicPlotDialogBase.setObjectName("DynamicPlotDialogBase")
DynamicPlotDialogBase.resize(572, 525)
self.PlotWidget = PlotWidget(DynamicPlotDialogBase)
self.PlotWidget.setGeometry(QtCore.QRect(170, 110, 261, 201))
self.PlotWidget.setObjectName("PlotWidget")
self.lineEdit = QtWidgets.QLineEdit(DynamicPlotDialogBase)
self.lineEdit.setGeometry(QtCore.QRect(160, 340, 251, 24))
self.lineEdit.setObjectName("lineEdit")
# Connect the textChanged signal to the update_plot method
self.lineEdit.textChanged.connect(self.update_plot)
self.retranslateUi(DynamicPlotDialogBase)
QtCore.QMetaObject.connectSlotsByName(DynamicPlotDialogBase)
def retranslateUi(self, DynamicPlotDialogBase):
_translate = QtCore.QCoreApplication.translate
DynamicPlotDialogBase.setWindowTitle(_translate("DynamicPlotDialogBase", "Dynamic Plot"))
def update_plot(self):
# Clear the existing plot
self.PlotWidget.clear()
# Get the text from the line edit widget
text = self.lineEdit.text()
# Convert the text to a list of integers
data = [int(i) for i in text.split()]
# Plot the data
self.PlotWidget.plot(data)