Skip to content

Commit

Permalink
Add monitor status widget and update it
Browse files Browse the repository at this point in the history
See also: #227
  • Loading branch information
BECATRUE committed Dec 4, 2023
1 parent ac78b97 commit 3539fb6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions iquip/apps/dataviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,22 @@ def _editingFinished(self):
self.ridEditingFinished.emit(str(self.spinbox.value()))


class MonitorStatusWidget(QWidget):
"""Widget for showing monitor status.
Attributes:
statusLabel: The label for showing monitor status.
"""

def __init__(self, parent: Optional[QWidget] = None):
"""Extended."""
super().__init__(parent=parent)
self.statusLabel = QLabel("Not Overriding?", self)
# layout
layout = QVBoxLayout(self)
layout.addWidget(self.statusLabel)


class SourceWidget(QWidget):
"""Widget for data source selection.
Expand Down Expand Up @@ -784,6 +800,7 @@ class DataViewerFrame(QSplitter):
"""Frame for data viewer app.
Attributes:
monitorStatusWidget: MonitorStatusWidget for showing monitor status.
sourceWidget: SourceWidget for source selection.
dataPointWidget: DataPointWidget for data point configuration.
mainPlotWidget: MainPlotWidget for the main plot.
Expand All @@ -799,18 +816,22 @@ class DataViewerFrame(QSplitter):
def __init__(self, parent: Optional[QWidget] = None):
"""Extended."""
super().__init__(parent=parent)
monitorStatusBox = QGroupBox("Monitor status", self)
sourceBox = QGroupBox("Source", self)
dataPointBox = QGroupBox("Data point", self)
mainPlotBox = QGroupBox("Main plot", self)
toolBox = QGroupBox("Tools", self)
self.monitorStatusWidget = MonitorStatusWidget(self)
self.sourceWidget = SourceWidget(self)
self.dataPointWidget = DataPointWidget(self)
self.mainPlotWidget = MainPlotWidget(self)
QHBoxLayout(monitorStatusBox).addWidget(self.monitorStatusWidget)
QHBoxLayout(sourceBox).addWidget(self.sourceWidget)
QHBoxLayout(dataPointBox).addWidget(self.dataPointWidget)
QHBoxLayout(mainPlotBox).addWidget(self.mainPlotWidget)
leftWidget = QWidget(self)
leftLayout = QVBoxLayout(leftWidget)
leftLayout.addWidget(monitorStatusBox)
leftLayout.addWidget(sourceBox)
leftLayout.addWidget(dataPointBox)
self.addWidget(leftWidget)
Expand All @@ -832,6 +853,11 @@ def updateMonitorStatus(self, override: bool):
Args:
override: Whether overriding is on or off.
"""
label = self.monitorStatusWidget.statusLabel
if override:
label.setText("Overriding")
else:
label.setText("Not Overriding")


class _DatasetListThread(QThread):
Expand Down

0 comments on commit 3539fb6

Please sign in to comment.