refactor: update UI layout for wafer data display and add file browser auto-refresh on tab switch
This commit is contained in:
@@ -19,6 +19,11 @@ Rectangle {
|
|||||||
|
|
||||||
// ===== View State =====
|
// ===== View State =====
|
||||||
property int selectedTabIndex: 0
|
property int selectedTabIndex: 0
|
||||||
|
onSelectedTabIndexChanged: {
|
||||||
|
if (selectedTabIndex === 2) {
|
||||||
|
file_browser.refreshFiles();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
property bool memoryRead: false
|
property bool memoryRead: false
|
||||||
property bool waferDetected: false
|
property bool waferDetected: false
|
||||||
|
|||||||
@@ -51,29 +51,31 @@ ColumnLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
component GridCell : ColumnLayout {
|
component GridCell : RowLayout {
|
||||||
property alias label: labelText.text
|
property alias label: labelText.text
|
||||||
property alias value: valueText.text
|
property alias value: valueText.text
|
||||||
property bool isRight: false
|
|
||||||
property bool active: root.waferDetected
|
property bool active: root.waferDetected
|
||||||
|
|
||||||
spacing: 1
|
spacing: 8
|
||||||
Layout.alignment: isRight ? Qt.AlignRight : Qt.AlignLeft
|
Layout.fillWidth: true
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: labelText
|
id: labelText
|
||||||
color: Theme.sideMutedText
|
color: Theme.sideMutedText
|
||||||
font.pixelSize: Theme.fontXs
|
font.pixelSize: Theme.fontXs
|
||||||
font.family: Theme.uiFontFamily
|
font.family: Theme.uiFontFamily
|
||||||
Layout.alignment: isRight ? Qt.AlignRight : Qt.AlignLeft
|
Layout.fillWidth: true
|
||||||
|
elide: Text.ElideRight
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
id: valueText
|
id: valueText
|
||||||
color: active ? Theme.headingColor : Theme.sideMutedText
|
color: active ? Theme.headingColor : Theme.sideMutedText
|
||||||
font.pixelSize: Theme.fontMd
|
font.pixelSize: Theme.fontSm
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
font.family: Theme.uiFontFamily
|
font.family: Theme.uiFontFamily
|
||||||
Layout.alignment: isRight ? Qt.AlignRight : Qt.AlignLeft
|
Layout.alignment: Qt.AlignRight
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +109,12 @@ ColumnLayout {
|
|||||||
function parseAndSavePendingRead() {
|
function parseAndSavePendingRead() {
|
||||||
deviceController.parseAndSaveData(root.currentFamilyCode(), deviceController.selectedPort || "");
|
deviceController.parseAndSaveData(root.currentFamilyCode(), deviceController.selectedPort || "");
|
||||||
}
|
}
|
||||||
|
function getCsvFileName() {
|
||||||
|
var path = root.csvPath;
|
||||||
|
if (!path) return "";
|
||||||
|
var parts = path.split(/[\/\\]/);
|
||||||
|
return parts[parts.length - 1].toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
FolderDialog {
|
FolderDialog {
|
||||||
id: saveDirDialog
|
id: saveDirDialog
|
||||||
@@ -292,64 +300,32 @@ ColumnLayout {
|
|||||||
spacing: 2
|
spacing: 2
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: "DIRECTORY"
|
text: root.csvPath !== "" ? root.getCsvFileName() : "DIRECTORY"
|
||||||
color: Theme.sideMutedText
|
color: root.csvPath !== "" ? Theme.headingColor : Theme.sideMutedText
|
||||||
font.pixelSize: Theme.fontMd
|
font.pixelSize: root.csvPath !== "" ? Theme.fontSm : Theme.fontMd
|
||||||
font.weight: Font.Medium
|
font.weight: root.csvPath !== "" ? Font.Bold : Font.Medium
|
||||||
font.letterSpacing: 1.2
|
font.letterSpacing: root.csvPath !== "" ? 0 : 1.2
|
||||||
font.family: Theme.uiFontFamily
|
font.family: Theme.uiFontFamily
|
||||||
}
|
elide: Text.ElideRight
|
||||||
Text {
|
|
||||||
text: deviceController.saveDataDir || "Not configured"
|
|
||||||
color: Theme.bodyColor
|
|
||||||
font.pixelSize: Theme.fontSm
|
|
||||||
font.family: Theme.uiFontFamily
|
|
||||||
font.italic: true
|
|
||||||
opacity: 0.7
|
|
||||||
elide: Text.ElideMiddle
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Item { Layout.fillHeight: true }
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
||||||
Button {
|
Text {
|
||||||
id: browseBtn
|
text: deviceController.saveDataDir || "Not configured"
|
||||||
text: "Browse"
|
|
||||||
font.pixelSize: Theme.fontSm
|
|
||||||
font.weight: Font.Medium
|
|
||||||
font.family: Theme.uiFontFamily
|
|
||||||
implicitHeight: 24
|
|
||||||
implicitWidth: 60
|
|
||||||
hoverEnabled: true
|
|
||||||
background: Rectangle {
|
|
||||||
color: browseBtn.hovered ? Theme.buttonNeutralHover : Theme.buttonNeutralBackground
|
|
||||||
border.color: Theme.cardBorder
|
|
||||||
border.width: 1
|
|
||||||
radius: Theme.radiusSm
|
|
||||||
}
|
|
||||||
contentItem: Text {
|
|
||||||
text: browseBtn.text
|
|
||||||
color: Theme.bodyColor
|
color: Theme.bodyColor
|
||||||
font: browseBtn.font
|
font.pixelSize: Theme.fontXs
|
||||||
horizontalAlignment: Text.AlignHCenter
|
font.family: Theme.uiFontFamily
|
||||||
verticalAlignment: Text.AlignVCenter
|
font.italic: true
|
||||||
}
|
opacity: 0.6
|
||||||
onClicked: saveDirDialog.open()
|
elide: Text.ElideMiddle
|
||||||
}
|
Layout.fillWidth: true
|
||||||
|
|
||||||
Item { Layout.fillWidth: true }
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: 4
|
|
||||||
visible: root.isConnected
|
|
||||||
Rectangle {
|
|
||||||
width: 6; height: 6; radius: 3
|
|
||||||
color: Theme.statusSuccessColor
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -372,6 +348,31 @@ ColumnLayout {
|
|||||||
font.letterSpacing: 0.6
|
font.letterSpacing: 0.6
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: browseBtn
|
||||||
|
text: "Save As"
|
||||||
|
font.pixelSize: Theme.fontSm
|
||||||
|
font.weight: Font.Medium
|
||||||
|
font.family: Theme.uiFontFamily
|
||||||
|
implicitHeight: 24
|
||||||
|
implicitWidth: 70
|
||||||
|
hoverEnabled: true
|
||||||
|
background: Rectangle {
|
||||||
|
color: browseBtn.hovered ? Theme.buttonNeutralHover : Theme.buttonNeutralBackground
|
||||||
|
border.color: Theme.cardBorder
|
||||||
|
border.width: 1
|
||||||
|
radius: Theme.radiusSm
|
||||||
|
}
|
||||||
|
contentItem: Text {
|
||||||
|
text: browseBtn.text
|
||||||
|
color: Theme.bodyColor
|
||||||
|
font: browseBtn.font
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
}
|
||||||
|
onClicked: saveDirDialog.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -386,17 +387,24 @@ ColumnLayout {
|
|||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Theme.panelPadding
|
anchors.margins: 10
|
||||||
spacing: 8
|
spacing: 4
|
||||||
|
|
||||||
Item {
|
Text {
|
||||||
Layout.fillWidth: true
|
text: "WAFER & SENSOR DATA"
|
||||||
Layout.fillHeight: true
|
color: Theme.sideMutedText
|
||||||
|
font.pixelSize: Theme.fontXs
|
||||||
|
font.weight: Font.Bold
|
||||||
|
font.family: Theme.uiFontFamily
|
||||||
|
font.letterSpacing: 0.6
|
||||||
|
Layout.bottomMargin: 2
|
||||||
|
}
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
anchors.fill: parent
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
columns: 2
|
columns: 2
|
||||||
rowSpacing: 6
|
rowSpacing: 4
|
||||||
columnSpacing: 16
|
columnSpacing: 16
|
||||||
|
|
||||||
GridCell {
|
GridCell {
|
||||||
@@ -414,9 +422,17 @@ ColumnLayout {
|
|||||||
var info = deviceController.lastWaferInfo;
|
var info = deviceController.lastWaferInfo;
|
||||||
return (info && info.length > 5 && info[5] !== undefined) ? String(info[5]) : "—";
|
return (info && info.length > 5 && info[5] !== undefined) ? String(info[5]) : "—";
|
||||||
}
|
}
|
||||||
isRight: true
|
|
||||||
active: root.waferDetected
|
active: root.waferDetected
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 1
|
||||||
|
color: Theme.cardBorder
|
||||||
|
opacity: 0.5
|
||||||
|
}
|
||||||
|
|
||||||
GridCell {
|
GridCell {
|
||||||
id: waferSerialCell
|
id: waferSerialCell
|
||||||
label: "Serial"
|
label: "Serial"
|
||||||
@@ -432,8 +448,6 @@ ColumnLayout {
|
|||||||
var info = deviceController.lastWaferInfo;
|
var info = deviceController.lastWaferInfo;
|
||||||
return (info && info.length > 2 && info[2]) ? String(info[2]) : "—";
|
return (info && info.length > 2 && info[2]) ? String(info[2]) : "—";
|
||||||
}
|
}
|
||||||
isRight: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user