Skip to content
Merged
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
24 changes: 13 additions & 11 deletions STDF-Viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Author: noonchen - chennoon233@foxmail.com
# Created Date: December 13th 2020
# -----
# Last Modified: Sun Oct 19 2025
# Last Modified: Sun Nov 02 2025
# Modified By: noonchen
# -----
# Copyright (c) 2020 noonchen
Expand Down Expand Up @@ -726,7 +726,9 @@ def updateDutSummaryTable(self):
self.tmodel_dut.setQuery(QtSql.QSqlQuery(DUT_SUMMARY_QUERY, self.db_dut))

for column in range(0, header.count()):
if column in [2, 3, header.count()-1]:
if column in [DutTableColIndex.PartID,
DutTableColIndex.HeadSite,
DutTableColIndex.DutFlag]:
# PartID, Head-Site and DUT Flag
# column may be too long to display
mode = QHeaderView.ResizeMode.ResizeToContents
Expand All @@ -735,15 +737,15 @@ def updateDutSummaryTable(self):
header.setSectionResizeMode(column, mode)

# always hide dut index column
self.ui.dutInfoTable.hideColumn(0)
# hide file id column if 1 file is opened
if self.data_interface.num_files <= 1:
self.ui.dutInfoTable.hideColumn(1)
else:
self.ui.dutInfoTable.showColumn(1)
# # show all rows
# while self.tmodel_dut.canFetchMore():
# self.tmodel_dut.fetchMore()
self.ui.dutInfoTable.hideColumn(DutTableColIndex.DutIndex)
# hide other columns under specific condition
for hideCond, col in [(self.data_interface.num_files <= 1, DutTableColIndex.FileID),
(self.data_interface.noWaferID, DutTableColIndex.WaferID),
(self.data_interface.noWaferXY, DutTableColIndex.XYCOORD)]:
if hideCond:
self.ui.dutInfoTable.hideColumn(col)
else:
self.ui.dutInfoTable.showColumn(col)


def updateGDR_DTR_Table(self):
Expand Down
7 changes: 5 additions & 2 deletions deps/DataInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Author: noonchen - chennoon233@foxmail.com
# Created Date: November 3rd 2022
# -----
# Last Modified: Sun Oct 12 2025
# Last Modified: Sun Nov 02 2025
# Modified By: noonchen
# -----
# Copyright (c) 2022 noonchen
Expand Down Expand Up @@ -50,7 +50,7 @@ def __init__(self):
self.completeWaferList = []
# cache test pin list and names for MPR
self.pinInfoDictCache = {}


def loadDatabase(self):
if not os.path.isfile(self.dbPath):
Expand Down Expand Up @@ -80,6 +80,9 @@ def loadDatabase(self):
# for UI display
self.completeTestList = self.DatabaseFetcher.getTestItemsList()
self.completeWaferList = self.DatabaseFetcher.getWaferList()
# for dut summary
self.noWaferID = self.DatabaseFetcher.isDutInfoColumnEmpty("WaferIndex")
self.noWaferXY = self.DatabaseFetcher.isDutInfoColumnEmpty("XCOORD")


def close(self):
Expand Down
18 changes: 17 additions & 1 deletion deps/DatabaseFetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Author: noonchen - chennoon233@foxmail.com
# Created Date: May 15th 2021
# -----
# Last Modified: Sun Oct 19 2025
# Last Modified: Sun Nov 02 2025
# Modified By: noonchen
# -----
# Copyright (c) 2021 noonchen
Expand Down Expand Up @@ -84,6 +84,22 @@ def readFilePaths(self):
self.file_paths = file_paths


def isDutInfoColumnEmpty(self, columnName: str) -> bool:
'''return True if the given column of Dut_Info table has no valid value'''
if self.cursor is None: raise RuntimeError("No database is connected")

sql = f'''SELECT EXISTS (
SELECT 1
FROM Dut_Info
WHERE {columnName} IS NOT NULL
AND
(typeof({columnName}) != 'text' OR trim({columnName}) != "")
)'''

validDataExist = self.cursor.execute(sql).fetchone()[0]
return not validDataExist


@property
def num_files(self):
return len(self.file_paths)
Expand Down
Loading