I am building code to present a wafer map based on inspection data. The loop function for plotting the die seems to be working correctly except that there are extra lines extending beyond and below the map area. All of the calculated numbers look right. Can someone help me understand why this is happening.
Here is what I am trying to achieve: enter image description here
Here is what the code is displaying:
This is the drawing loop:
# Creating image object
self.image = QImage(512, 512, QImage.Format_RGB32)
# Set the background color
self.image.fill(Qt.white)
def _draw_die(self): # Setup QPainter qp = QPainter(self.image)
# Draw wafer die
count = 0
for item in self.mapCoords:
color = Qt.blue if item[1] == "OFF" else Qt.lightGray
pen = QPen(color, 1, Qt.SolidLine)
qp.setPen(pen)
brushcolor = Qt.white if item[1] == "OFF" else Qt.white
brush = QBrush(brushcolor)
qp.setBrush(brush)
print(f'Point {count}: x0 = {item[0][0]},'
f' y0 = {item[0][1]},'
f' x1 = {item[0][0] + self.dieX},'
f' y1 = {item[0][1] + self.dieY}')
qp.drawRect(item[0][0],
item[0][1],
item[0][0] + self.dieX,
item[0][1] + self.dieY)
count += 1 # used for printing the plotted points only
return
If I have not uploaded enough information, please let me know what I need to add in. Thank you.
I believe that I have found the issue and solution. It appears that I was calculating the die size incorrectly which was generating the map at about 1/4 the size it should have been. I have corrected the die size calculation and now the map is displaying correctly.
Here is the .ui file generated by PyQt5 Designer:
Here is the full source:
The following data needs to be saved in the local directory as "ins.dat"