Commit 2fc45933 authored by Jameson Rollins's avatar Jameson Rollins

5 second timeout for status bar error messages

parent 7b02179c
......@@ -58,5 +58,10 @@ DATA_SPAN_PADDING = 0.5
DATA_LOOKBACK_LIMIT_BYTES = 2**22
# regular expression to match channel strings
CHANNEL_REGEXP = '^([a-zA-Z0-9-]+:)?[a-zA-Z0-9-_\.]+$'
CHANNEL_RE = re.compile(CHANNEL_REGEXP)
# timeout for NDS error messages in the status bar
STATUS_ERROR_TIMEOUT = 5000
......@@ -4,11 +4,11 @@ import os
import numpy as np
import pyqtgraph as pg
try:
from qtpy import QtGui, QtWidgets
from qtpy import QtGui, QtWidgets, QtCorea
from qtpy.QtWidgets import QStyle
from qtpy import uic
except ImportError:
from PyQt5 import QtGui, QtWidgets
from PyQt5 import QtGui, QtWidgets, QtCore
from PyQt5.QtGui import QStyle
from PyQt5 import uic
import logging
......@@ -426,9 +426,9 @@ class NDScope(QMainWindow, Ui_MainWindow):
if error:
self.statusBar.setStyleSheet("QStatusBar{background:rgba(255,0,0,255);color:black;font-weight:bold;}")
self.statusBar.showMessage(error)
QtCore.QTimer.singleShot(const.STATUS_ERROR_TIMEOUT, self._clear_status)
else:
self.statusBar.setStyleSheet("")
self.statusBar.clearMessage()
self._clear_status()
# for plot in self.plots:
# plot.disableAutoRange(axis='y')
self.startstopButton.setText("online")
......@@ -442,6 +442,10 @@ class NDScope(QMainWindow, Ui_MainWindow):
if self.crosshairGroup.isChecked():
self.toggle_crosshair(checked=True)
def _clear_status(self):
self.statusBar.setStyleSheet("")
self.statusBar.clearMessage()
##########
# PLOTTING
......
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