def _context_menu(self, point): if not self.is_table_enabled: return item = self.bondpadTable.itemAt(point) if item is None: return column = item.column() if column == PAD_INFO.PAD_NAME_COLUMN(): self.create_menu(self.pad_type, self.pad_direction) return if column == PAD_INFO.PAD_TYPE_COLUMN(): # type self.create_menu(self.pad_type) item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) return if column == PAD_INFO.PAD_DIRECTION_COLUMN(): # direction self.create_menu(self.pad_direction) item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) return if column in (PAD_INFO.PAD_SIZE_X_COLUMN(), PAD_INFO.PAD_SIZE_Y_COLUMN()): self.create_menu(self.pad_standard_size) item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) return
def _double_click_handler(self, item): if not self.is_table_enabled: return column = item.column() if column == PAD_INFO.PAD_TYPE_COLUMN(): item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) elif column == PAD_INFO.PAD_DIRECTION_COLUMN(): item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) else: self._create_checkable_cell(item) self.selected_cell = item
def _setup_item(self, maskset_name): self.setWindowTitle("Maskset Setting") self.masksetName.setText(maskset_name) self.masksetName.setEnabled(False) self.bondpads.setEnabled(False) self.waferDiameter.setEnabled(False) self.dieSizeX.setEnabled(False) self.dieSizeY.setEnabled(False) self.scribeX.setEnabled(False) self.scribeY.setEnabled(False) self.dieRefY.setEnabled(False) self.dieRefX.setEnabled(False) self.xOffset.setEnabled(False) self.yOffset.setEnabled(False) self.flat.setEnabled(False) self.Type.setEnabled(False) self.editWaferMapButton.setEnabled(False) self.importFor.setEnabled(False) self.XYFlipButton.setEnabled(False) self.viewDieButton.setEnabled(False) self.bondpadTable.setRowCount(len(self.maskset_configuration["BondpadTable"])) row = self.bondpadTable.rowCount() column = self.bondpadTable.columnCount() for r in range(row): for c in range(column): item = QtWidgets.QTableWidgetItem('') self.bondpadTable.setItem(r, c, item) item.setFlags(QtCore.Qt.NoItemFlags) # resize cell columns for c in range(self.bondpadTable.columnCount()): if c == PAD_INFO.PAD_NAME_COLUMN(): self.bondpadTable.setColumnWidth(c, PAD_INFO.NAME_COL_SIZE()) elif c in (PAD_INFO.PAD_POS_X_COLUMN(), PAD_INFO.PAD_POS_Y_COLUMN(), PAD_INFO.PAD_SIZE_X_COLUMN(), PAD_INFO.PAD_SIZE_Y_COLUMN(), PAD_INFO.PAD_TYPE_COLUMN()): self.bondpadTable.setColumnWidth(c, PAD_INFO.REF_COL_SIZE()) elif c == PAD_INFO.PAD_DIRECTION_COLUMN(): self.bondpadTable.setColumnWidth(c, PAD_INFO.DIR_COL_SIZE()) self.bondpadTable.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Fixed) self.bondpadTable.verticalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Fixed) self.bondpadTable.setEnabled(False)
def _init_table(dialog, table_size, enable_edit): dialog.bondpadTable.setRowCount(table_size) row = dialog.bondpadTable.rowCount() column = dialog.bondpadTable.columnCount() for r in range(row): for c in range(column): item = QtWidgets.QTableWidgetItem('') dialog.bondpadTable.setItem(r, c, item) item.setFlags(QtCore.Qt.NoItemFlags) if c == 0: item.setTextAlignment( int(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)) else: item.setTextAlignment( int(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)) # resize cell columns for c in range(dialog.bondpadTable.columnCount()): if c == PAD_INFO.PAD_NAME_COLUMN(): dialog.bondpadTable.setColumnWidth(c, PAD_INFO.NAME_COL_SIZE()) elif c in (PAD_INFO.PAD_POS_X_COLUMN(), PAD_INFO.PAD_POS_Y_COLUMN(), PAD_INFO.PAD_SIZE_X_COLUMN(), PAD_INFO.PAD_SIZE_Y_COLUMN(), PAD_INFO.PAD_TYPE_COLUMN()): dialog.bondpadTable.setColumnWidth(c, PAD_INFO.REF_COL_SIZE()) elif c == PAD_INFO.PAD_DIRECTION_COLUMN(): dialog.bondpadTable.setColumnWidth(c, PAD_INFO.DIR_COL_SIZE()) dialog.bondpadTable.horizontalHeader().setSectionResizeMode( QtWidgets.QHeaderView.Fixed) dialog.bondpadTable.verticalHeader().setSectionResizeMode( QtWidgets.QHeaderView.Fixed) dialog.bondpadTable.setEnabled(enable_edit)
def select_bidirectional_direction(self): self.set_pad_selection(PadDirection.Bidirectional(), PAD_INFO.PAD_DIRECTION_COLUMN())
def select_output_direction(self): self.set_pad_selection(PadDirection.Output(), PAD_INFO.PAD_DIRECTION_COLUMN())
def _setup(self): self.setWindowTitle(' '.join( re.findall('.[^A-Z]*', os.path.basename(__file__).replace('.py', '')))) from ATE.spyder.widgets.validation import valid_positive_integer_regex rxi = QtCore.QRegExp(valid_positive_integer_regex) self.positive_integer_validator = QtGui.QRegExpValidator(rxi, self) from ATE.spyder.widgets.validation import valid_positive_float_1_regex rxf = QtCore.QRegExp(valid_positive_float_1_regex) positive_float_validator = QtGui.QRegExpValidator(rxf, self) from ATE.spyder.widgets.validation import valid_maskset_name_regex rxMaskSetName = QtCore.QRegExp(valid_maskset_name_regex) self.maskset_name_validator = QtGui.QRegExpValidator( rxMaskSetName, self) # maskset self.existing_masksets = self.project_info.get_maskset_names() self.masksetName.setText("") self.masksetName.setValidator(self.maskset_name_validator) # Type & Customer self.Type.setCurrentText('ASSP') self.customerLabel.setVisible(False) self.customer.setText('') self.customer.setVisible(False) # wafer diameter self.waferDiameter.setCurrentIndex(self.waferDiameter.findText('200')) # bondpads self.bondpads.setMinimum(2) self.bondpads.setMaximum(99) self.bondpads.setValue(2) self._set_row_elements(DEFAULT_ROW) # XY Flip Button self.XYFlipButton.setText("") self.XYFlipButton.setIcon(qta.icon('mdi.arrow-up-down', color='white')) # die size X NewMasksetWizard._setup_input_element(self.dieSizeX, "", self.positive_integer_validator) # die size Y NewMasksetWizard._setup_input_element(self.dieSizeY, "", self.positive_integer_validator) # die Ref X NewMasksetWizard._setup_input_element(self.dieRefX, "", positive_float_validator) # die Ref Y NewMasksetWizard._setup_input_element(self.dieRefY, "", positive_float_validator) # X Offset NewMasksetWizard._setup_input_element(self.xOffset, "0", positive_float_validator) # Y Offset NewMasksetWizard._setup_input_element(self.yOffset, "0", positive_float_validator) # scribe X NewMasksetWizard._setup_input_element(self.scribeX, str(standard_scribe), positive_float_validator) # scribe Y NewMasksetWizard._setup_input_element(self.scribeY, str(standard_scribe), positive_float_validator) # Flat WaferDiameter = int(self.waferDiameter.currentText()) Flat = (WaferDiameter / 2) - standard_flat_height if Flat - int(Flat) == 0: self.flat.setText(str(int(Flat))) else: self.flat.setText(str(Flat)) # bondpad table self.bondpadTable.setRowCount(self.bondpads.value()) self.bondpadTable.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.bondpadTable.customContextMenuRequested.connect( self._context_menu) self.bondpadTable.itemDoubleClicked.connect(self._double_click_handler) self.bondpadTable.itemClicked.connect(self._select_item) self.bondpadTable.itemSelectionChanged.connect(self._table_clicked) self.bondpadTable.itemEntered.connect(self._item_entered) self.pad_type = { PadType.Analog(): self.select_analog_pad_type, PadType.Digital(): self.select_digital_pad_type, PadType.Mixed(): self.select_mixed_pad_type, PadType.Power(): self.select_power_pad_type } self.pad_direction = { PadDirection.Input(): self.select_input_direction, PadDirection.Output(): self.select_output_direction, PadDirection.Bidirectional(): self.select_bidirectional_direction } self.pad_standard_size = { PadStandardSize.Standard_1(): self._standard_1_selected, PadStandardSize.Standard_2(): self._standard_2_selected, PadStandardSize.Standard_3(): self._standard_3_selected } # resize cell columns for c in range(self.columns): if c == PAD_INFO.PAD_NAME_COLUMN(): self.bondpadTable.setColumnWidth(c, PAD_INFO.NAME_COL_SIZE()) elif c in (PAD_INFO.PAD_POS_X_COLUMN(), PAD_INFO.PAD_POS_Y_COLUMN(), PAD_INFO.PAD_SIZE_X_COLUMN(), PAD_INFO.PAD_SIZE_Y_COLUMN(), PAD_INFO.PAD_TYPE_COLUMN()): self.bondpadTable.setColumnWidth(c, PAD_INFO.REF_COL_SIZE()) elif c == PAD_INFO.PAD_DIRECTION_COLUMN(): self.bondpadTable.setColumnWidth(c, PAD_INFO.DIR_COL_SIZE()) self.bondpadTable.horizontalHeader().setSectionResizeMode( 0, QtWidgets.QHeaderView.Stretch) self.bondpadTable.verticalHeader().setSectionResizeMode( QtWidgets.QHeaderView.Fixed) # view die button self.viewDieButton.setText("") self.viewDieButton.setIcon(qta.icon('mdi.eye-outline', color='white')) self.viewDieButton.clicked.connect(self.viewDie) # import For importer_name_lists = self.plugin_manager.hook.get_importer_names() self.importFor.clear() self.importFor.addItem('') for importer_name_list in importer_name_lists: for importer_name in importer_name_list: self.importFor.addItem(importer_name["display_name"]) self.plugin_names.append(importer_name) self.importFor.setCurrentIndex(0) # empty string # feedback self.feedback.setText("") self.feedback.setStyleSheet('color: orange') self.validate()
def _item_entered(self, item): if item.column() in (PAD_INFO.PAD_DIRECTION_COLUMN(), PAD_INFO.PAD_TYPE_COLUMN()): self._update_row(item.row())