Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add button to clear logs #22 #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ui_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ def setupUi(self, Widget):

self.controlLayout.addLayout(self.logLayout)

self.clearLogButton = QPushButton(self.telemetryTab)
self.clearLogButton.setObjectName(u"clearLogButton")
self.clearLogButton.setMaximumSize(QSize(300, 16777215))
self.udpConnectButton.setStyleSheet(u"")

self.controlLayout.addWidget(self.clearLogButton)

self.valveStatusLayout = QFormLayout()
self.valveStatusLayout.setObjectName(u"valveStatusLayout")
self.gridLayout_2 = QGridLayout()
Expand Down Expand Up @@ -405,6 +412,7 @@ def retranslateUi(self, Widget):
self.udpIpAddressLabel.setText(QCoreApplication.translate("Widget", u"MG IPv4 address: ", None))
self.udpPortLabel.setText(QCoreApplication.translate("Widget", u"MG port: ", None))
self.udpConnectButton.setText(QCoreApplication.translate("Widget", u"Create UDP connection", None))
self.clearLogButton.setText(QCoreApplication.translate("Widget", u"Clear", None))
self.xv5.setText(QCoreApplication.translate("Widget", u"XV-5", None))
self.xv8State.setText(QCoreApplication.translate("Widget", u"CLOSED", None))
self.quickDisconnect.setText(QCoreApplication.translate("Widget", u"<html><head/><body><p>Quick Disconnect</p></body></html>", None))
Expand Down
6 changes: 5 additions & 1 deletion widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ def __init__(self, parent=None):

# Button handlers
self.ui.udpConnectButton.clicked.connect(self.udp_connection_button_handler)

self.ui.clearLogButton.clicked.connect(self.clear_log)

def clear_log(self):
"""Clears the log output."""
self.ui.logOutput.clear()
def plot_point(self, header, message):
plots = self.plots
match header.type:
Expand Down