refactor: extract StreamControlPanel and MetricRow from WaferMapTab

This commit is contained in:
jack
2026-07-09 15:16:11 -07:00
parent b6249c2b8e
commit bdc667b2ed
6 changed files with 397 additions and 402 deletions
+5 -105
View File
@@ -14,6 +14,8 @@ ColumnLayout {
property alias heatmapBlend: heatmapSlider.value
property alias showThickness: thicknessToggle.checked
signal exportRequested(string filePath)
component PanelCheckBox: CheckBox {
id: toggle
indicator: Rectangle {
@@ -75,112 +77,10 @@ ColumnLayout {
}
}
// Live-mode stream stats + stop — moved here from the footer transport bar
// so that bar collapses to zero height in live mode, freeing vertical
// space for the trend chart.
Rectangle {
StreamControlPanel {
Layout.fillWidth: true
visible: streamController.mode === "live"
implicitHeight: visible ? liveStatsCard.implicitHeight + 24 : 0
color: Theme.sidePanelBackground
radius: Theme.sidePanelRadius
border.color: Theme.sideBorder
border.width: 1
ColumnLayout {
id: liveStatsCard
anchors {
left: parent.left
right: parent.right
top: parent.top
margins: 12
}
spacing: 8
Label {
text: "LIVE STREAM"
color: Theme.sideMutedText
font.family: Theme.uiFontFamily
font.pixelSize: Theme.fontSm
font.letterSpacing: 1.5
font.bold: true
Layout.bottomMargin: 4
}
RowLayout {
Layout.fillWidth: true
Label {
text: "Received"
color: Theme.sideMutedText
font.family: Theme.uiFontFamily
font.pixelSize: Theme.fontSm
font.bold: true
}
Item { Layout.fillWidth: true }
Label {
text: streamController.receivedCount
color: Theme.headingColor
font.family: Theme.codeFontFamily
font.pixelSize: Theme.fontLg
font.bold: true
}
}
Rectangle {
Layout.fillWidth: true
height: 1
color: Theme.cardBorder
}
RowLayout {
Layout.fillWidth: true
Label {
text: "Errors"
color: Theme.sideMutedText
font.family: Theme.uiFontFamily
font.pixelSize: Theme.fontSm
font.bold: true
}
Item { Layout.fillWidth: true }
Label {
text: streamController.errorCount
color: streamController.errorCount > 0 ? Theme.statusWarningColor : Theme.headingColor
font.family: Theme.codeFontFamily
font.pixelSize: Theme.fontLg
font.bold: true
}
}
Button {
id: stopStreamBtn
Layout.fillWidth: true
Layout.topMargin: 4
hoverEnabled: true
text: "STOP"
font.family: Theme.uiFontFamily
font.pixelSize: Theme.fontSm
font.weight: Font.Medium
font.letterSpacing: 1.0
background: Rectangle {
radius: 8
color: stopStreamBtn.down ? Theme.transportButtonHover
: (stopStreamBtn.hovered ? Theme.transportButtonBg : "transparent")
border.width: Theme.borderThin
border.color: Theme.sideBorder
Behavior on color {
ColorAnimation { duration: Theme.durationFast }
}
}
contentItem: Text {
text: stopStreamBtn.text
color: Theme.headingColor
font: stopStreamBtn.font
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
onClicked: streamController.stopStream()
}
onExportRequested: function(filePath) {
root.exportRequested(filePath);
}
}