#include "BondMatrixProgramPage.h" #include "Src/Common/JSignalSlotManager.h" #include "Src/RewriteControl/Controls/SpinBox.h" #include "Src/RewriteControl/Controls/DoubleSpinBox.h" #include "Src/RewriteControl/Controls/CustomCheckBox.h" #include "Src/RewriteControl/Controls/CustomComboBox.h" #include #include #include #include #include "QTimer" //#include //#include /* isSet 是否设置值,后续获取得到之后在修改 */ inline void safeSetComboBoxIndex(QComboBox* combo, int value, bool isSet = false) { combo->blockSignals(true); int idx = combo->findData(value); if (isSet) { combo->addItem(QString::number(value)); combo->setCurrentIndex(0); // 明确不设置为第一个 } else { if (idx >= 0) { combo->setCurrentIndex(idx); } else { // 如果没找到值,保持不变或不设置任何值 combo->setCurrentIndex(-1); // 明确不设置为第一个 } } combo->blockSignals(false); } BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) : QWidget(parent) { ui.setupUi(this); QTimer::singleShot(10, this, [&]() { Init(); }); } BondMatrixProgramPage::~BondMatrixProgramPage() { } // 判断是否可以删除的函数 bool BondMatrixProgramPage::canDeleteBondInfo(int selectedBondInfoId) { // 遍历数据矩阵,检查是否有任何一个矩阵引用了这个ID for (const auto& matrix : m_vectBondMatrixs) { if (matrix.BondInfoId == selectedBondInfoId) { return false; // 如果有引用,不能删除 } } return true; // 如果没有引用,允许删除 } void BondMatrixProgramPage::onPushButtonDeleteParamClicked() { // 获取当前选中的ID int selectedId = ui.comboBoxCurrentPara->currentData().toInt(); // 遍历数据矩阵,检查是否有任何一个矩阵引用了这个ID bool canDelete = canDeleteBondInfo(selectedId); // 根据是否能删除来决定删除操作 if (canDelete) { // 执行删除操作:删除 m_vecBondInfoData 中对应的元素 for (int i = 0; i < m_vecBondInfoData.size(); ++i) { if (selectedId == m_vecBondInfoData[i].iInfoId) { m_vecBondInfoData.erase(m_vecBondInfoData.begin() + i); // 从数据中删除 break; // 删除成功后退出循环 } } m_manageDB->GetCProduct()->DeleteBondInfoData(selectedId); // 更新 comboBox:从 comboBox 中移除对应的项 for (int i = 0; i < ui.comboBoxCurrentPara->count(); ++i) { if (ui.comboBoxCurrentPara->itemData(i).toInt() == selectedId) { ui.comboBoxCurrentPara->removeItem(i); // 从下拉框中移除 break; } } m_isBondInfoParaChange = true; } else { // 提示用户该ID被引用,不能删除 QMessageBox::warning(this, "警告", "该参数ID已被引用,无法删除!"); } int iMatrix = ui.comboBoxCurrentMatrix->currentData().toInt(); int iInfoId = -1; for (const auto& matrix : m_vectBondMatrixs) { if (matrix.BondMatrixId == iMatrix) { iInfoId = matrix.BondInfoId; break; } } ui.comboBoxCurrentPara->setCurrentIndex(ui.comboBoxCurrentPara->findData(iInfoId)); // 设置默认项 // 动态更新删除按钮的状态 canDelete = canDeleteBondInfo(iInfoId); updateDeleteButtonStatus(canDelete, ui.pushButtonDeleteParam); updateFourParamDeleteButtonStatus(); } //判断使用次数:0没有被使用,1自己使用,>=1 多个使用 int BondMatrixProgramPage::canDeleteParameter(int selectedId) { int referenceCount = 0; // 遍历 m_vecBondInfoData,检查是否有任何一个元素引用了 selectedId for (const auto& bondInfo : m_vecBondInfoData) { if (bondInfo.iPickParamId == selectedId) { //return false; // 如果有引用,不能删除 referenceCount++; } if (bondInfo.iCalibPickParamId == selectedId) { //return false; // 如果有引用,不能删除 referenceCount++; } if (bondInfo.iCalibBondParamId == selectedId) { //return false; // 如果有引用,不能删除 referenceCount++; } if (bondInfo.iBondParamId == selectedId) { //return false; // 如果有引用,不能删除 referenceCount++; } } return referenceCount;// <= 1;如果<=1则说明只有自己或者没有引用,则可以删除 } bool BondMatrixProgramPage::deleteParameter(QPushButton* deleteButton, int selectedId) { // 判断是否可以删除 int canDelete = canDeleteParameter(selectedId); if (canDelete <= 1) { m_manageDB->GetCProduct()->DeleteBondParam(selectedId); m_vecBondInfoData = m_manageDB->GetCProduct()->GetAllBondInfoData(); for (auto it = m_vecParam.begin(); it != m_vecParam.end(); ++it) { if (it->iId == selectedId) { m_vecParam.erase(it); break; } } m_isComBoxUpdating = true; // 从所有comboBox中移除对应项 for (int i = 0; i < ui.comboBoxCurrentPara_Pick1->count(); ++i) { if (ui.comboBoxCurrentPara_Pick1->itemData(i).toInt() == selectedId) { ui.comboBoxCurrentPara_Pick1->removeItem(i); break; } } for (int i = 0; i < ui.comboBoxCurrentPara_Pick2->count(); ++i) { if (ui.comboBoxCurrentPara_Pick2->itemData(i).toInt() == selectedId) { ui.comboBoxCurrentPara_Pick2->removeItem(i); break; } } for (int i = 0; i < ui.comboBoxCurrentPara_Place1->count(); ++i) { if (ui.comboBoxCurrentPara_Place1->itemData(i).toInt() == selectedId) { ui.comboBoxCurrentPara_Place1->removeItem(i); break; } } for (int i = 0; i < ui.comboBoxCurrentPara_Place2->count(); ++i) { if (ui.comboBoxCurrentPara_Place2->itemData(i).toInt() == selectedId) { ui.comboBoxCurrentPara_Place2->removeItem(i); break; } } m_isComBoxUpdating = false; return true; } else { //QMessageBox::warning(this, "警告", "该参数ID已被引用,无法删除!"); return false; } } //// 对应按钮按下时的槽函数:暂时弃用 //void BondMatrixProgramPage::on_pushButtonDeletePick1_clicked(QPushButton* deleteButton, QComboBox* comboBox) //{ // // 获取 Pick1 下拉框的选中项ID // int selectedId = ui.comboBoxCurrentPara_Pick1->currentData().toInt(); // deleteParameter(deleteButton, selectedId); // 调用删除函数 //} // //void BondMatrixProgramPage::on_pushButtonDeletePick2_clicked(QPushButton* deleteButton, QComboBox* comboBox) //{ // // 获取 Pick2 下拉框的选中项ID // int selectedId = ui.comboBoxCurrentPara_Pick2->currentData().toInt(); // deleteParameter(deleteButton, selectedId); // 调用删除函数 //} // //void BondMatrixProgramPage::on_pushButtonDeletePlace1_clicked(QPushButton* deleteButton, QComboBox* comboBox) //{ // // 获取 Place1 下拉框的选中项ID // int selectedId = ui.comboBoxCurrentPara_Place1->currentData().toInt(); // deleteParameter(deleteButton, selectedId); // 调用删除函数 //} // //void BondMatrixProgramPage::on_pushButtonDeletePlace2_clicked(QPushButton* deleteButton, QComboBox* comboBox) //{ // // 获取 Place2 下拉框的选中项ID // int selectedId = ui.comboBoxCurrentPara_Place2->currentData().toInt(); // deleteParameter(deleteButton, selectedId); // 调用删除函数 //} // 通用的删除槽函数 void BondMatrixProgramPage::onPushButtonDeleteClicked(QPushButton* deleteButton, QComboBox* comboBox) { // 获取选中的 ID int selectedId = comboBox->currentData().toInt(); // 调用删除函数 if (!deleteParameter(deleteButton, selectedId)) { return; } int canDelete = canDeleteParameter(selectedId); if (canDelete == 1) //此参数机只有当前参数引用 { // 删除成功后设置 comboBox 为第一个选项,若没有选项则 设置为空:一般不会为空 if (comboBox->count() > 0) { comboBox->setCurrentIndex(0); } else { comboBox->setCurrentIndex(-1); } } else if (canDelete == 0)//此参数机没有任何引用 { // 判断 deleteButton 是哪个按钮,执行不同的操作 if (deleteButton == ui.pushButtonDeletePick1) { safeSetComboBoxIndex(ui.comboBoxCurrentPara_Pick1, m_tempBondInfo.iPickParamId); } else if (deleteButton == ui.pushButtonDeletePick2) { safeSetComboBoxIndex(ui.comboBoxCurrentPara_Pick2, m_tempBondInfo.iCalibPickParamId); } else if (deleteButton == ui.pushButtonDeletePlace1) { safeSetComboBoxIndex(ui.comboBoxCurrentPara_Place1, m_tempBondInfo.iCalibBondParamId); } else if (deleteButton == ui.pushButtonDeletePlace2) { safeSetComboBoxIndex(ui.comboBoxCurrentPara_Place2, m_tempBondInfo.iBondParamId); } } else { return; } selectedId = comboBox->currentData().toInt(); canDelete = canDeleteParameter(selectedId); updateDeleteButtonStatus(canDelete <= 1, deleteButton); } void BondMatrixProgramPage::updateFourParamDeleteButtonStatus() { // 处理 Pick1 的删除按钮 int selectedIdPick1 = ui.comboBoxCurrentPara_Pick1->currentData().toInt(); bool canDeletePick1 = canDeleteParameter(selectedIdPick1) <= 1; updateDeleteButtonStatus(canDeletePick1, ui.pushButtonDeletePick1); // 处理 Pick2 的删除按钮 int selectedIdPick2 = ui.comboBoxCurrentPara_Pick2->currentData().toInt(); bool canDeletePick2 = canDeleteParameter(selectedIdPick2) <= 1; updateDeleteButtonStatus(canDeletePick2, ui.pushButtonDeletePick2); // 处理 Place1 的删除按钮 int selectedIdPlace1 = ui.comboBoxCurrentPara_Place1->currentData().toInt(); bool canDeletePlace1 = canDeleteParameter(selectedIdPlace1) <= 1; updateDeleteButtonStatus(canDeletePlace1, ui.pushButtonDeletePlace1); // 处理 Place2 的删除按钮 int selectedIdPlace2 = ui.comboBoxCurrentPara_Place2->currentData().toInt(); bool canDeletePlace2 = canDeleteParameter(selectedIdPlace2) <= 1; updateDeleteButtonStatus(canDeletePlace2, ui.pushButtonDeletePlace2); } void BondMatrixProgramPage::updateDeleteButtonStatus(bool canDelete, QPushButton* deleteButton) { deleteButton->setEnabled(canDelete); if (canDelete) { deleteButton->setStyleSheet(""); // 使用默认样式 } else { // 更浅的灰色背景 + 深色文字,提升对比度 deleteButton->setStyleSheet("background-color: #d3d3d3; color: #333333;"); } } // 同步相同 iId 的参数 void BondMatrixProgramPage::syncParamWithSameId(ns_db::PICKBOND_PARAM_STRUCT& currentParam, ns_db::PICKBOND_PARAM_STRUCT& targetParam, QWidget* targetWidget) { if (currentParam.iId == targetParam.iId) { targetParam = currentParam; // 同步参数值 if (auto checkBox = qobject_cast(targetWidget)) { checkBox->setChecked(targetParam.bCheckBlock); } if (auto doubleSpinBox = qobject_cast(targetWidget)) { if (targetWidget == ui.doubleSpinBoxPrePickZ || targetWidget == ui.doubleSpinBoxPickForce || targetWidget == ui.doubleSpinBoxPickPosZ) { doubleSpinBox->setValue(targetParam.dPreLevOffset); } } if (auto spinBox = qobject_cast(targetWidget)) { spinBox->setValue(targetParam.iGrabDelay); } } } // 取晶头取晶参数连接 void BondMatrixProgramPage::connectWaferPickControls() { connect(ui.checkBoxPickBlockCheck, &QCheckBox::clicked, this, [=](bool isChecked) { m_curWaferPickParam.bCheckBlock = ui.checkBoxPickBlockCheck->isChecked(); if (m_curWaferPickParam.bCheckBlock == m_tempWaferPickParam.bCheckBlock) { ui.checkBoxPickBlockCheck->setStyleSheet(""); // 恢复默认样式 } else { ui.checkBoxPickBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.bCheckBlock = ui.checkBoxPickBlockCheck->isChecked(); ui.checkBoxPickBlockCheck_2->setChecked(m_curCalibPickParam.bCheckBlock); if (m_curCalibPickParam.bCheckBlock == m_tempCalibPickParam.bCheckBlock) { ui.checkBoxPickBlockCheck_2->setStyleSheet(""); // 恢复默认样式 } else { ui.checkBoxPickBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.bCheckBlock = ui.checkBoxPickBlockCheck->isChecked(); ui.checkBoxBondBlockCheck->setChecked(m_curCalibPlaceParam.bCheckBlock); if (m_curCalibPlaceParam.bCheckBlock == m_tempCalibPlaceParam.bCheckBlock) { ui.checkBoxBondBlockCheck->setStyleSheet(""); // 恢复默认样式 } else { ui.checkBoxBondBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红 } } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.bCheckBlock = ui.checkBoxPickBlockCheck->isChecked(); ui.checkBoxBondBlockCheck_2->setChecked(m_curBondParam.bCheckBlock); if (m_curBondParam.bCheckBlock == m_tempBondParam.bCheckBlock) { ui.checkBoxBondBlockCheck_2->setStyleSheet(""); // 恢复默认样式 } else { ui.checkBoxBondBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } } }); connect(ui.checkBoxPickLoseCheck, &QCheckBox::clicked, this, [=](bool isChecked) { m_curWaferPickParam.bCheckLose = ui.checkBoxPickLoseCheck->isChecked(); if (m_curWaferPickParam.bCheckLose == m_tempWaferPickParam.bCheckLose) { ui.checkBoxPickLoseCheck->setStyleSheet(""); // 恢复默认样式 } else { ui.checkBoxPickLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.bCheckLose = ui.checkBoxPickLoseCheck->isChecked(); ui.checkBoxPickLoseCheck_2->setChecked(m_curCalibPickParam.bCheckLose); if (m_curCalibPickParam.bCheckLose == m_tempCalibPickParam.bCheckLose) { ui.checkBoxPickLoseCheck_2->setStyleSheet(""); // 恢复默认样式 } else { ui.checkBoxPickLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.bCheckLose = ui.checkBoxPickLoseCheck->isChecked(); ui.checkBoxBondLoseCheck->setChecked(m_curCalibPlaceParam.bCheckLose); if (m_curCalibPlaceParam.bCheckLose == m_tempCalibPlaceParam.bCheckLose) { ui.checkBoxBondLoseCheck->setStyleSheet(""); // 恢复默认样式 } else { ui.checkBoxBondLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红 } } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.bCheckLose = ui.checkBoxPickLoseCheck->isChecked(); ui.checkBoxBondLoseCheck_2->setChecked(m_curBondParam.bCheckLose); if (m_curBondParam.bCheckLose == m_tempBondParam.bCheckLose) { ui.checkBoxBondLoseCheck_2->setStyleSheet(""); // 恢复默认样式 } else { ui.checkBoxBondLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } } }); connect(ui.checkBoxPickFindForceCheck, &QCheckBox::clicked, this, [=](bool isChecked) { m_curWaferPickParam.bFindForce = ui.checkBoxPickFindForceCheck->isChecked(); if (m_curWaferPickParam.bFindForce == m_tempWaferPickParam.bFindForce) { ui.checkBoxPickFindForceCheck->setStyleSheet(""); // 恢复默认样式 } else { ui.checkBoxPickFindForceCheck->setStyleSheet("color: red;"); // 字体颜色变红 } ui.doubleSpinBoxPickPosZ->setEnabled(!isChecked); if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.bFindForce = ui.checkBoxPickFindForceCheck->isChecked(); ui.checkBoxPickFindForceCheck_2->setChecked(m_curCalibPickParam.bFindForce); if (m_curCalibPickParam.bFindForce == m_tempCalibPickParam.bFindForce) { ui.checkBoxPickFindForceCheck_2->setStyleSheet(""); // 恢复默认样式 } else { ui.checkBoxPickFindForceCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } ui.doubleSpinBoxPickPosZ_2->setEnabled(!isChecked); } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.bFindForce = ui.checkBoxPickFindForceCheck->isChecked(); ui.checkBoxBondFindForce->setChecked(m_curCalibPlaceParam.bFindForce); if (m_curCalibPlaceParam.bFindForce == m_tempCalibPlaceParam.bFindForce) { ui.checkBoxBondFindForce->setStyleSheet(""); // 恢复默认样式 } else { ui.checkBoxBondFindForce->setStyleSheet("color: red;"); // 字体颜色变红 } ui.doubleSpinBoxBondPosZ->setEnabled(!isChecked); } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.bFindForce = ui.checkBoxPickFindForceCheck->isChecked(); ui.checkBoxBondFindForce_2->setChecked(m_curBondParam.bFindForce); if (m_curBondParam.bFindForce == m_tempBondParam.bFindForce) { ui.checkBoxBondFindForce_2->setStyleSheet(""); // 恢复默认样式 } else { ui.checkBoxBondFindForce_2->setStyleSheet("color: red;"); // 字体颜色变红 } ui.doubleSpinBoxBondPosZ_2->setEnabled(!isChecked); } }); connect(ui.doubleSpinBoxPrePickZ, &DoubleSpinBox::editDone, this, [=]() { m_curWaferPickParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ->value(); // 颜色变红显示变化 if (m_curWaferPickParam.dPreLevOffset == m_tempWaferPickParam.dPreLevOffset) ui.doubleSpinBoxPrePickZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPrePickZ->setStyleSheet("color: red;"); // 字体颜色变红 // 如果有同步需求,添加类似的代码 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ->value(); ui.doubleSpinBoxPrePickZ_2->setValue(m_curCalibPickParam.dPreLevOffset); if (m_curCalibPickParam.dPreLevOffset == m_tempCalibPickParam.dPreLevOffset) ui.doubleSpinBoxPrePickZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPrePickZ_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ->value(); ui.doubleSpinBoxPreBondPosZ->setValue(m_curCalibPlaceParam.dPreLevOffset); if (m_curCalibPlaceParam.dPreLevOffset == m_tempCalibPlaceParam.dPreLevOffset) ui.doubleSpinBoxPreBondPosZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPreBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ->value(); ui.doubleSpinBoxPreBondPosZ_2->setValue(m_curBondParam.dPreLevOffset); if (m_curBondParam.dPreLevOffset == m_tempBondParam.dPreLevOffset) ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.doubleSpinBoxPickForce, &DoubleSpinBox::editDone, this, [=]() { m_curWaferPickParam.dForce = ui.doubleSpinBoxPickForce->value(); // 颜色变红显示变化 if (m_curWaferPickParam.dForce == m_tempWaferPickParam.dForce) ui.doubleSpinBoxPickForce->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickForce->setStyleSheet("color: red;"); // 字体颜色变红 // 如果有同步需求,添加类似的代码 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.dForce = ui.doubleSpinBoxPickForce->value(); ui.doubleSpinBoxPickForce_2->setValue(m_curCalibPickParam.dForce); if (m_curCalibPickParam.dForce == m_tempCalibPickParam.dForce) ui.doubleSpinBoxPickForce_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickForce_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.dForce = ui.doubleSpinBoxPickForce->value(); ui.doubleSpinBoxBondForce->setValue(m_curCalibPlaceParam.dForce); if (m_curCalibPlaceParam.dForce == m_tempCalibPlaceParam.dForce) ui.doubleSpinBoxBondForce->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondForce->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.dForce = ui.doubleSpinBoxPickForce->value(); ui.doubleSpinBoxBondForce_2->setValue(m_curBondParam.dForce); if (m_curBondParam.dForce == m_tempBondParam.dForce) ui.doubleSpinBoxBondForce_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondForce_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.doubleSpinBoxPickPosZ, &DoubleSpinBox::editDone, this, [=]() { m_curWaferPickParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ->value(); // 颜色变红显示变化 if (m_curWaferPickParam.dWorkLevOffset == m_tempWaferPickParam.dWorkLevOffset) ui.doubleSpinBoxPickPosZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickPosZ->setStyleSheet("color: red;"); // 字体颜色变红 // 如果有同步需求,添加类似的代码 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ->value(); ui.doubleSpinBoxPickPosZ_2->setValue(m_curCalibPickParam.dWorkLevOffset); if (m_curCalibPickParam.dWorkLevOffset == m_tempCalibPickParam.dWorkLevOffset) ui.doubleSpinBoxPickPosZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ->value(); ui.doubleSpinBoxBondPosZ->setValue(m_curCalibPlaceParam.dWorkLevOffset); if (m_curCalibPlaceParam.dWorkLevOffset == m_tempCalibPlaceParam.dWorkLevOffset) ui.doubleSpinBoxBondPosZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ->value(); ui.doubleSpinBoxBondPosZ_2->setValue(m_curBondParam.dWorkLevOffset); if (m_curBondParam.dWorkLevOffset == m_tempBondParam.dWorkLevOffset) ui.doubleSpinBoxBondPosZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.spinBoxPickGrabDelay, &SpinBox::editDone, this, [=]() { m_curWaferPickParam.iGrabDelay = ui.spinBoxPickGrabDelay->value(); // 颜色变红显示变化 if (m_curWaferPickParam.iGrabDelay == m_tempWaferPickParam.iGrabDelay) ui.spinBoxPickGrabDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红 // 如果有同步需求,添加类似的代码 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.iGrabDelay = ui.spinBoxPickGrabDelay->value(); ui.spinBoxPickGrabDelay_2->setValue(m_curCalibPickParam.iGrabDelay); if (m_curCalibPickParam.iGrabDelay == m_tempCalibPickParam.iGrabDelay) ui.spinBoxPickGrabDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.iGrabDelay = ui.spinBoxPickGrabDelay->value(); ui.spinBoxBondGrabDelay->setValue(m_curCalibPlaceParam.iGrabDelay); if (m_curCalibPlaceParam.iGrabDelay == m_tempCalibPlaceParam.iGrabDelay) ui.spinBoxBondGrabDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iGrabDelay = ui.spinBoxPickGrabDelay->value(); ui.spinBoxBondGrabDelay_2->setValue(m_curBondParam.iGrabDelay); if (m_curBondParam.iGrabDelay == m_tempBondParam.iGrabDelay) ui.spinBoxBondGrabDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.spinBoxPickDelay, &SpinBox::editDone, this, [=]() { m_curWaferPickParam.iPickOrBondDelay = ui.spinBoxPickDelay->value(); // 颜色变红显示变化 if (m_curWaferPickParam.iPickOrBondDelay == m_tempWaferPickParam.iPickOrBondDelay) ui.spinBoxPickDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickDelay->setStyleSheet("color: red;"); // 字体颜色变红 // 如果有同步需求,添加类似的代码 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.iPickOrBondDelay = ui.spinBoxPickDelay->value(); ui.spinBoxPickDelay_2->setValue(m_curCalibPickParam.iPickOrBondDelay); if (m_curCalibPickParam.iPickOrBondDelay == m_tempCalibPickParam.iPickOrBondDelay) ui.spinBoxPickDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.iPickOrBondDelay = ui.spinBoxPickDelay->value(); ui.spinBoxBondDelay->setValue(m_curCalibPlaceParam.iPickOrBondDelay); if (m_curCalibPlaceParam.iPickOrBondDelay == m_tempCalibPlaceParam.iPickOrBondDelay) ui.spinBoxBondDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iPickOrBondDelay = ui.spinBoxPickDelay->value(); ui.spinBoxBondDelay_2->setValue(m_curBondParam.iPickOrBondDelay); if (m_curBondParam.iPickOrBondDelay == m_tempBondParam.iPickOrBondDelay) ui.spinBoxBondDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.spinBoxPickBlockCheckDelay, &SpinBox::editDone, this, [=]() { m_curWaferPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value(); // 颜色变红显示变化 if (m_curWaferPickParam.iBlockOrLoseDelay == m_tempWaferPickParam.iBlockOrLoseDelay) ui.spinBoxPickBlockCheckDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红 // 如果有同步需求,添加类似的代码 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value(); ui.spinBoxPickBlockCheckDelay_2->setValue(m_curCalibPickParam.iBlockOrLoseDelay); if (m_curCalibPickParam.iBlockOrLoseDelay == m_tempCalibPickParam.iBlockOrLoseDelay) ui.spinBoxPickBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value(); ui.spinBoxBondBlockCheckDelay->setValue(m_curCalibPlaceParam.iBlockOrLoseDelay); if (m_curCalibPlaceParam.iBlockOrLoseDelay == m_tempCalibPlaceParam.iBlockOrLoseDelay) ui.spinBoxBondBlockCheckDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value(); ui.spinBoxBondBlockCheckDelay_2->setValue(m_curBondParam.iBlockOrLoseDelay); if (m_curBondParam.iBlockOrLoseDelay == m_tempBondParam.iBlockOrLoseDelay) ui.spinBoxBondBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.spinBoxPickVacDelay, &SpinBox::editDone, this, [=]() { m_curWaferPickParam.iVacuumDelay = ui.spinBoxPickVacDelay->value(); // 颜色变红显示变化 if (m_curWaferPickParam.iVacuumDelay == m_tempWaferPickParam.iVacuumDelay) ui.spinBoxPickVacDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickVacDelay->setStyleSheet("color: red;"); // 字体颜色变红 // 如果有同步需求,添加类似的代码 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.iVacuumDelay = ui.spinBoxPickVacDelay->value(); ui.spinBoxPickVacDelay_2->setValue(m_curCalibPickParam.iVacuumDelay); if (m_curCalibPickParam.iVacuumDelay == m_tempCalibPickParam.iVacuumDelay) ui.spinBoxPickVacDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.iVacuumDelay = ui.spinBoxPickVacDelay->value(); ui.spinBoxBondVacDelay->setValue(m_curCalibPlaceParam.iVacuumDelay); if (m_curCalibPlaceParam.iVacuumDelay == m_tempCalibPlaceParam.iVacuumDelay) ui.spinBoxBondVacDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondVacDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iVacuumDelay = ui.spinBoxPickVacDelay->value(); ui.spinBoxBondVacDelay_2->setValue(m_curBondParam.iVacuumDelay); if (m_curBondParam.iVacuumDelay == m_tempBondParam.iVacuumDelay) ui.spinBoxBondVacDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.spinBoxPickBlowDelay, &SpinBox::editDone, this, [=]() { m_curWaferPickParam.iBlowDelay = ui.spinBoxPickBlowDelay->value(); // 颜色变红显示变化 if (m_curWaferPickParam.iBlowDelay == m_tempWaferPickParam.iBlowDelay) ui.spinBoxPickBlowDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红 // 如果有同步需求,添加类似的代码 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.iBlowDelay = ui.spinBoxPickBlowDelay->value(); ui.spinBoxPickBlowDelay_2->setValue(m_curCalibPickParam.iBlowDelay); if (m_curCalibPickParam.iBlowDelay == m_tempCalibPickParam.iBlowDelay) ui.spinBoxPickBlowDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.iBlowDelay = ui.spinBoxPickBlowDelay->value(); ui.spinBoxBondBlowDelay->setValue(m_curCalibPlaceParam.iBlowDelay); if (m_curCalibPlaceParam.iBlowDelay == m_tempCalibPlaceParam.iBlowDelay) ui.spinBoxBondBlowDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iBlowDelay = ui.spinBoxPickBlowDelay->value(); ui.spinBoxBondBlowDelay_2->setValue(m_curBondParam.iBlowDelay); if (m_curBondParam.iBlowDelay == m_tempBondParam.iBlowDelay) ui.spinBoxBondBlowDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); } // 晶圆台取晶连接控件 void BondMatrixProgramPage::connectCalibPickControls() { connect(ui.checkBoxPickBlockCheck_2, &QCheckBox::clicked, this, [=](bool isChecked) { m_curCalibPickParam.bCheckBlock = isChecked; // 颜色变红显示变化 if (m_curCalibPickParam.bCheckBlock == m_tempCalibPickParam.bCheckBlock) ui.checkBoxPickBlockCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.bCheckBlock = isChecked; ui.checkBoxPickBlockCheck->setChecked(m_curWaferPickParam.bCheckBlock); if (m_curWaferPickParam.bCheckBlock == m_tempWaferPickParam.bCheckBlock) ui.checkBoxPickBlockCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.bCheckBlock = isChecked; ui.checkBoxBondBlockCheck->setChecked(m_curCalibPlaceParam.bCheckBlock); if (m_curCalibPlaceParam.bCheckBlock == m_tempCalibPlaceParam.bCheckBlock) ui.checkBoxBondBlockCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.bCheckBlock = isChecked; ui.checkBoxBondBlockCheck_2->setChecked(m_curBondParam.bCheckBlock); if (m_curBondParam.bCheckBlock == m_tempBondParam.bCheckBlock) ui.checkBoxBondBlockCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.checkBoxPickLoseCheck_2, &QCheckBox::clicked, this, [=](bool isChecked) { m_curCalibPickParam.bCheckLose = isChecked; // 颜色变红显示变化 if (m_curCalibPickParam.bCheckLose == m_tempCalibPickParam.bCheckLose) ui.checkBoxPickLoseCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.bCheckLose = isChecked; ui.checkBoxPickLoseCheck->setChecked(m_curWaferPickParam.bCheckLose); if (m_curWaferPickParam.bCheckLose == m_tempWaferPickParam.bCheckLose) ui.checkBoxPickLoseCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.bCheckLose = isChecked; ui.checkBoxBondLoseCheck->setChecked(m_curCalibPlaceParam.bCheckLose); if (m_curCalibPlaceParam.bCheckLose == m_tempCalibPlaceParam.bCheckLose) ui.checkBoxBondLoseCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.bCheckLose = isChecked; ui.checkBoxBondLoseCheck_2->setChecked(m_curBondParam.bCheckLose); if (m_curBondParam.bCheckLose == m_tempBondParam.bCheckLose) ui.checkBoxBondLoseCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.checkBoxPickFindForceCheck_2, &QCheckBox::clicked, this, [=](bool isChecked) { m_curCalibPickParam.bFindForce = isChecked; ui.doubleSpinBoxPickPosZ_2->setEnabled(!isChecked); // 颜色变红显示变化 if (m_curCalibPickParam.bFindForce == m_tempCalibPickParam.bFindForce) ui.checkBoxPickFindForceCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickFindForceCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.bFindForce = isChecked; ui.checkBoxPickFindForceCheck->setChecked(m_curWaferPickParam.bFindForce); if (m_curWaferPickParam.bFindForce == m_tempWaferPickParam.bFindForce) ui.checkBoxPickFindForceCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickFindForceCheck->setStyleSheet("color: red;"); // 字体颜色变红 ui.doubleSpinBoxPickPosZ->setEnabled(!isChecked); } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.bFindForce = isChecked; ui.checkBoxBondFindForce->setChecked(m_curCalibPlaceParam.bFindForce); if (m_curCalibPlaceParam.bFindForce == m_tempCalibPlaceParam.bFindForce) ui.checkBoxBondFindForce->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondFindForce->setStyleSheet("color: red;"); // 字体颜色变红 ui.doubleSpinBoxBondPosZ->setEnabled(!isChecked); } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.bFindForce = isChecked; ui.checkBoxBondFindForce_2->setChecked(m_curBondParam.bFindForce); if (m_curBondParam.bFindForce == m_tempBondParam.bFindForce) ui.checkBoxBondFindForce_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondFindForce_2->setStyleSheet("color: red;"); // 字体颜色变红 ui.doubleSpinBoxBondPosZ_2->setEnabled(!isChecked); } }); connect(ui.doubleSpinBoxPrePickZ_2, &DoubleSpinBox::editDone, this, [=]() { m_curCalibPickParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ_2->value(); // 颜色变红显示变化 if (m_curCalibPickParam.dPreLevOffset == m_tempCalibPickParam.dPreLevOffset) ui.doubleSpinBoxPrePickZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPrePickZ_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ_2->value(); ui.doubleSpinBoxPrePickZ->setValue(m_curWaferPickParam.dPreLevOffset); if (m_curWaferPickParam.dPreLevOffset == m_tempWaferPickParam.dPreLevOffset) ui.doubleSpinBoxPrePickZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPrePickZ->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ_2->value(); ui.doubleSpinBoxPreBondPosZ->setValue(m_curCalibPlaceParam.dPreLevOffset); if (m_curCalibPlaceParam.dPreLevOffset == m_tempCalibPlaceParam.dPreLevOffset) ui.doubleSpinBoxPreBondPosZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPreBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ_2->value(); ui.doubleSpinBoxPreBondPosZ_2->setValue(m_curBondParam.dPreLevOffset); if (m_curBondParam.dPreLevOffset == m_tempBondParam.dPreLevOffset) ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.doubleSpinBoxPickForce_2, &DoubleSpinBox::editDone, this, [=]() { m_curCalibPickParam.dForce = ui.doubleSpinBoxPickForce_2->value(); // 颜色变红显示变化 if (m_curCalibPickParam.dForce == m_tempCalibPickParam.dForce) ui.doubleSpinBoxPickForce_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickForce_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.dForce = ui.doubleSpinBoxPickForce_2->value(); ui.doubleSpinBoxPickForce->setValue(m_curWaferPickParam.dForce); if (m_curWaferPickParam.dForce == m_tempWaferPickParam.dForce) ui.doubleSpinBoxPickForce->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickForce->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.dForce = ui.doubleSpinBoxPickForce_2->value(); ui.doubleSpinBoxBondForce->setValue(m_curCalibPlaceParam.dForce); if (m_curCalibPlaceParam.dForce == m_tempCalibPlaceParam.dForce) ui.doubleSpinBoxBondForce->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondForce->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.dForce = ui.doubleSpinBoxPickForce_2->value(); ui.doubleSpinBoxBondForce_2->setValue(m_curBondParam.dForce); if (m_curBondParam.dForce == m_tempBondParam.dForce) ui.doubleSpinBoxBondForce_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondForce_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.doubleSpinBoxPickPosZ_2, &DoubleSpinBox::editDone, this, [=]() { m_curCalibPickParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ_2->value(); // 颜色变红显示变化 if (m_curCalibPickParam.dWorkLevOffset == m_tempCalibPickParam.dWorkLevOffset) ui.doubleSpinBoxPickPosZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ_2->value(); ui.doubleSpinBoxPickPosZ->setValue(m_curWaferPickParam.dWorkLevOffset); if (m_curWaferPickParam.dWorkLevOffset == m_tempWaferPickParam.dWorkLevOffset) ui.doubleSpinBoxPickPosZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickPosZ->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ_2->value(); ui.doubleSpinBoxBondPosZ->setValue(m_curCalibPlaceParam.dWorkLevOffset); if (m_curCalibPlaceParam.dWorkLevOffset == m_tempCalibPlaceParam.dWorkLevOffset) ui.doubleSpinBoxBondPosZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ_2->value(); ui.doubleSpinBoxBondPosZ_2->setValue(m_curBondParam.dWorkLevOffset); if (m_curBondParam.dWorkLevOffset == m_tempBondParam.dWorkLevOffset) ui.doubleSpinBoxBondPosZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.spinBoxPickGrabDelay_2, &SpinBox::editDone, this, [=]() { m_curCalibPickParam.iGrabDelay = ui.spinBoxPickGrabDelay_2->value(); // 颜色变红显示变化 if (m_curCalibPickParam.iGrabDelay == m_tempCalibPickParam.iGrabDelay) ui.spinBoxPickGrabDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iGrabDelay = ui.spinBoxPickGrabDelay_2->value(); ui.spinBoxPickGrabDelay->setValue(m_curWaferPickParam.iGrabDelay); if (m_curWaferPickParam.iGrabDelay == m_tempWaferPickParam.iGrabDelay) ui.spinBoxPickGrabDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.iGrabDelay = ui.spinBoxPickGrabDelay_2->value(); ui.spinBoxBondGrabDelay->setValue(m_curCalibPlaceParam.iGrabDelay); if (m_curCalibPlaceParam.iGrabDelay == m_tempCalibPlaceParam.iGrabDelay) ui.spinBoxBondGrabDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iGrabDelay = ui.spinBoxPickGrabDelay_2->value(); ui.spinBoxBondGrabDelay_2->setValue(m_curBondParam.iGrabDelay); if (m_curBondParam.iGrabDelay == m_tempBondParam.iGrabDelay) ui.spinBoxBondGrabDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.spinBoxPickDelay_2, &SpinBox::editDone, this, [=]() { m_curCalibPickParam.iPickOrBondDelay = ui.spinBoxPickDelay_2->value(); // 颜色变红显示变化 if (m_curCalibPickParam.iPickOrBondDelay == m_tempCalibPickParam.iPickOrBondDelay) ui.spinBoxPickDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iPickOrBondDelay = ui.spinBoxPickDelay_2->value(); ui.spinBoxPickDelay->setValue(m_curWaferPickParam.iPickOrBondDelay); if (m_curWaferPickParam.iPickOrBondDelay == m_tempWaferPickParam.iPickOrBondDelay) ui.spinBoxPickDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.iPickOrBondDelay = ui.spinBoxPickDelay_2->value(); ui.spinBoxBondDelay->setValue(m_curCalibPlaceParam.iPickOrBondDelay); if (m_curCalibPlaceParam.iPickOrBondDelay == m_tempCalibPlaceParam.iPickOrBondDelay) ui.spinBoxBondDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iPickOrBondDelay = ui.spinBoxPickDelay_2->value(); ui.spinBoxBondDelay_2->setValue(m_curBondParam.iPickOrBondDelay); if (m_curBondParam.iPickOrBondDelay == m_tempBondParam.iPickOrBondDelay) ui.spinBoxBondDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.spinBoxPickBlockCheckDelay_2, &SpinBox::editDone, this, [=]() { m_curCalibPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay_2->value(); // 颜色变红显示变化 if (m_curCalibPickParam.iBlockOrLoseDelay == m_tempCalibPickParam.iBlockOrLoseDelay) ui.spinBoxPickBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay_2->value(); ui.spinBoxPickBlockCheckDelay->setValue(m_curWaferPickParam.iBlockOrLoseDelay); if (m_curWaferPickParam.iBlockOrLoseDelay == m_tempWaferPickParam.iBlockOrLoseDelay) ui.spinBoxPickBlockCheckDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay_2->value(); ui.spinBoxBondBlockCheckDelay->setValue(m_curCalibPlaceParam.iBlockOrLoseDelay); if (m_curCalibPlaceParam.iBlockOrLoseDelay == m_tempCalibPlaceParam.iBlockOrLoseDelay) ui.spinBoxBondBlockCheckDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay_2->value(); ui.spinBoxBondBlockCheckDelay_2->setValue(m_curBondParam.iBlockOrLoseDelay); if (m_curBondParam.iBlockOrLoseDelay == m_tempBondParam.iBlockOrLoseDelay) ui.spinBoxBondBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.spinBoxPickVacDelay_2, &SpinBox::editDone, this, [=]() { m_curCalibPickParam.iVacuumDelay = ui.spinBoxPickVacDelay_2->value(); // 颜色变红显示变化 if (m_curCalibPickParam.iVacuumDelay == m_tempCalibPickParam.iVacuumDelay) ui.spinBoxPickVacDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iVacuumDelay = ui.spinBoxPickVacDelay_2->value(); ui.spinBoxPickVacDelay->setValue(m_curWaferPickParam.iVacuumDelay); if (m_curWaferPickParam.iVacuumDelay == m_tempWaferPickParam.iVacuumDelay) ui.spinBoxPickVacDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickVacDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.iVacuumDelay = ui.spinBoxPickVacDelay_2->value(); ui.spinBoxBondVacDelay->setValue(m_curCalibPlaceParam.iVacuumDelay); if (m_curCalibPlaceParam.iVacuumDelay == m_tempCalibPlaceParam.iVacuumDelay) ui.spinBoxBondVacDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondVacDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iVacuumDelay = ui.spinBoxPickVacDelay_2->value(); ui.spinBoxBondVacDelay_2->setValue(m_curBondParam.iVacuumDelay); if (m_curBondParam.iVacuumDelay == m_tempBondParam.iVacuumDelay) ui.spinBoxBondVacDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); connect(ui.spinBoxPickBlowDelay_2, &SpinBox::editDone, this, [=]() { m_curCalibPickParam.iBlowDelay = ui.spinBoxPickBlowDelay_2->value(); // 颜色变红显示变化 if (m_curCalibPickParam.iBlowDelay == m_tempCalibPickParam.iBlowDelay) ui.spinBoxPickBlowDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iBlowDelay = ui.spinBoxPickBlowDelay_2->value(); ui.spinBoxPickBlowDelay->setValue(m_curWaferPickParam.iBlowDelay); if (m_curWaferPickParam.iBlowDelay == m_tempWaferPickParam.iBlowDelay) ui.spinBoxPickBlowDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curCalibPlaceParam.iBlowDelay = ui.spinBoxPickBlowDelay_2->value(); ui.spinBoxBondBlowDelay->setValue(m_curCalibPlaceParam.iBlowDelay); if (m_curCalibPlaceParam.iBlowDelay == m_tempCalibPlaceParam.iBlowDelay) ui.spinBoxBondBlowDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iBlowDelay = ui.spinBoxPickBlowDelay_2->value(); ui.spinBoxBondBlowDelay_2->setValue(m_curBondParam.iBlowDelay); if (m_curBondParam.iBlowDelay == m_tempBondParam.iBlowDelay) ui.spinBoxBondBlowDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } }); } // 连接 "中转台固晶" 控件 void BondMatrixProgramPage::connectCalibPlaceControls() { connect(ui.checkBoxBondBlockCheck, &QCheckBox::clicked, this, &BondMatrixProgramPage::onCheckBoxBondBlockCheckClicked); connect(ui.checkBoxBondLoseCheck, &QCheckBox::clicked, this, &BondMatrixProgramPage::onCheckBoxBondLoseCheckClicked); connect(ui.checkBoxBondFindForce, &QCheckBox::clicked, this, &BondMatrixProgramPage::onCheckBoxBondFindForceClicked); connect(ui.doubleSpinBoxPreBondPosZ, &QDoubleSpinBox::editingFinished, this, &BondMatrixProgramPage::onDoubleSpinBoxPreBondPosZEditingFinished); connect(ui.doubleSpinBoxBondForce, &QDoubleSpinBox::editingFinished, this, &BondMatrixProgramPage::onDoubleSpinBoxBondForceEditingFinished); connect(ui.doubleSpinBoxBondPosZ, &QDoubleSpinBox::editingFinished, this, &BondMatrixProgramPage::onDoubleSpinBoxBondPosZEditingFinished); connect(ui.spinBoxBondGrabDelay, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondGrabDelayEditingFinished); connect(ui.spinBoxBondBlockCheckDelay, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondBlockCheckDelayEditingFinished); connect(ui.spinBoxBondDelay, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondDelayEditingFinished); connect(ui.spinBoxBondVacDelay, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondVacDelayEditingFinished); connect(ui.spinBoxBondBlowDelay, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondBlowDelayEditingFinished); } // 连接 "固晶台固晶" 控件 void BondMatrixProgramPage::connectBondControls() { connect(ui.checkBoxBondBlockCheck_2, &QCheckBox::clicked, this, &BondMatrixProgramPage::onCheckBoxBondBlockCheck_2Clicked); connect(ui.checkBoxBondLoseCheck_2, &QCheckBox::clicked, this, &BondMatrixProgramPage::onCheckBoxBondLoseCheck_2Clicked); connect(ui.checkBoxBondFindForce_2, &QCheckBox::clicked, this, &BondMatrixProgramPage::onCheckBoxBondFindForce_2Clicked); connect(ui.doubleSpinBoxPreBondPosZ_2, &QDoubleSpinBox::editingFinished, this, &BondMatrixProgramPage::onDoubleSpinBoxPreBondPosZ_2EditingFinished); connect(ui.doubleSpinBoxBondForce_2, &QDoubleSpinBox::editingFinished, this, &BondMatrixProgramPage::onDoubleSpinBoxBondForce_2EditingFinished); connect(ui.doubleSpinBoxBondPosZ_2, &QDoubleSpinBox::editingFinished, this, &BondMatrixProgramPage::onDoubleSpinBoxBondPosZ_2EditingFinished); connect(ui.spinBoxBondGrabDelay_2, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondGrabDelay_2EditingFinished); connect(ui.spinBoxBondBlockCheckDelay_2, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondBlockCheckDelay_2EditingFinished); connect(ui.spinBoxBondDelay_2, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondDelay_2EditingFinished); connect(ui.spinBoxBondVacDelay_2, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondVacDelay_2EditingFinished); connect(ui.spinBoxBondBlowDelay_2, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondBlowDelay_2EditingFinished); } // IsCheck void BondMatrixProgramPage::handlePickPRCheckBox(bool isChecked) { m_curBondInfo.bPickPREnable = isChecked; // Update the style //if (isChecked == m_tempBondInfo.bPickPREnable) // ui.checkBoxIsPickPR->setStyleSheet(""); // Restore default style //else // ui.checkBoxIsPickPR->setStyleSheet("color: red;"); // Font color red // Show/Hide components based on checkbox state ui.label_77->setVisible(isChecked); ui.comboBoxPickTempID->setVisible(isChecked); ui.SetParamPickTemp->setVisible(isChecked); ui.CreatParamPickTemp->setVisible(isChecked); ui.TakePhotoPickTemp->setVisible(isChecked); } void BondMatrixProgramPage::handlePreBondPRCheckBox(bool isChecked) { m_curBondInfo.bPreBondPREnable = isChecked; // Update the style //if (isChecked == m_tempBondInfo.bPreBondPREnable) // ui.checkBoxIsPreBondPR->setStyleSheet(""); // Restore default style //else // ui.checkBoxIsPreBondPR->setStyleSheet("color: red;"); // Font color red // Show/Hide components based on checkbox state ui.label_4->setVisible(isChecked); ui.comboBoxPreBondTemp->setVisible(isChecked); ui.SetParamPreBond->setVisible(isChecked); ui.CreatParamPreBond->setVisible(isChecked); ui.TakePhotoPreBond->setVisible(isChecked); } void BondMatrixProgramPage::handlePostBondPRCheckBox(bool isChecked) { m_curBondInfo.bPostBondPREnable = isChecked; // Update the style //if (isChecked == m_tempBondInfo.bPostBondPREnable) // ui.checkBoxIsPostBondPR->setStyleSheet(""); // Restore default style //else // ui.checkBoxIsPostBondPR->setStyleSheet("color: red;"); // Font color red // Show/Hide components based on checkbox state ui.label_5->setVisible(isChecked); ui.comboBoxPostBondTemp->setVisible(isChecked); ui.SetParamPostBond->setVisible(isChecked); ui.CreatParamPostBond->setVisible(isChecked); ui.TakePhotoPostBond->setVisible(isChecked); } void BondMatrixProgramPage::handleAllBondAlnCheckBox(bool isChecked) { m_curBondInfo.bAllBondAlnEnable = isChecked; // Update the style //if (isChecked == m_tempBondInfo.bAllBondAlnEnable) // ui.checkBoxIsAllBondAln->setStyleSheet(""); // Restore default style //else // ui.checkBoxIsAllBondAln->setStyleSheet("color: red;"); // Font color red // Show/Hide components based on checkbox state ui.label_6->setVisible(isChecked); ui.comboBoxBondTemp->setVisible(isChecked); ui.SetParamBond->setVisible(isChecked); ui.CreatParamBond->setVisible(isChecked); ui.TakePhotoBond->setVisible(isChecked); } void BondMatrixProgramPage::handlePcbAlnCheckBox(bool isChecked) { m_curBondInfo.bPcbAlnEnable = isChecked; // Update the style //if (isChecked == m_tempBondInfo.bPcbAlnEnable) // ui.checkBoxIsPcbAln->setStyleSheet(""); // Restore default style //else // ui.checkBoxIsPcbAln->setStyleSheet("color: red;"); // Font color red // Show/Hide components based on checkbox state ui.label_39->setVisible(isChecked); ui.comboBoxPcbAlnPRStrategyId->setVisible(isChecked); ui.SetParamPcbAlnPRStrategy->setVisible(isChecked); ui.CreatParamPcbAlnPRStrategy->setVisible(isChecked); ui.TakePhotoPcbAlnPRStrategy->setVisible(isChecked); } void BondMatrixProgramPage::handleLookUpPRCheckBox(bool isChecked) { m_curBondInfo.bLookUpPREnable = isChecked; // Update the style //if (isChecked == m_tempBondInfo.bLookUpPREnable) // ui.checkBoxIsLookUpPR->setStyleSheet(""); // Restore default style //else // ui.checkBoxIsLookUpPR->setStyleSheet("color: red;"); // Font color red // Show/Hide components based on checkbox state ui.label_7->setVisible(isChecked); ui.comboBoxLookUpTemp->setVisible(isChecked); ui.SetParamLookUp->setVisible(isChecked); ui.CreatParamLookUp->setVisible(isChecked); ui.TakePhotoLookUp->setVisible(isChecked); } void BondMatrixProgramPage::handleCalibPickCheckBox(bool isChecked) { m_curBondInfo.bTransferPREnable = isChecked; // Update the style //if (isChecked == m_tempBondInfo.bTransferPREnable) // ui.checkBoxIsCalibPick->setStyleSheet(""); // Restore default style //else // ui.checkBoxIsCalibPick->setStyleSheet("color: red;"); // Font color red // Show/Hide components based on checkbox state ui.label_8->setVisible(isChecked); ui.comboBoxCalibPickTemp->setVisible(isChecked); ui.SetParamCalibPick->setVisible(isChecked); ui.CreatParamCalibPick->setVisible(isChecked); ui.TakePhotoCalibPick->setVisible(isChecked); } //ModifyTemplate void BondMatrixProgramPage::onSetParamPickTempClicked() { int iTemplateId = ui.comboBoxPickTempID->currentData().toInt(); m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId); } void BondMatrixProgramPage::onSetParamPreBondClicked() { int iTemplateId = ui.comboBoxPreBondTemp->currentData().toInt(); m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId); } void BondMatrixProgramPage::onSetParamPostBondClicked() { int iTemplateId = ui.comboBoxPostBondTemp->currentData().toInt(); m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId); } void BondMatrixProgramPage::onSetParamBondClicked() { int iTemplateId = ui.comboBoxBondTemp->currentData().toInt(); m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId); } void BondMatrixProgramPage::onSetParamLookUpClicked() { int iTemplateId = ui.comboBoxLookUpTemp->currentData().toInt(); m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId); } void BondMatrixProgramPage::onSetParamCalibPickClicked() { int iTemplateId = ui.comboBoxCalibPickTemp->currentData().toInt(); m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId); } void BondMatrixProgramPage::onSetParamPcbAlnPRStrategyClicked() { int iTemplateId = ui.comboBoxPcbAlnPRStrategyId->currentData().toInt(); m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId); } //CreateParam:目前都是一样的,如后续没有个性化的差异可以只用一个函数即可 void BondMatrixProgramPage::onCreateParamPickTempClicked() { UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt(); m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_WAFER_PICK, iBondInfoId); //UpdateShowBondInfoData(iBondInfoId); BOND_INFO_STRUCT _stBondInfoData; m_manageDB->GetCProduct()->GetBondInfoData(iBondInfoId, _stBondInfoData); m_curBondInfo.iPickPRStrategyId = _stBondInfoData.iPickPRStrategyId; m_vecPrTemplate = m_manageDB->GetCProduct()->GetPrTemplate(); m_vecPrStrategy = m_manageDB->GetCProduct()->GetPrStrategy(); UpdateTemplateParamCombox(1, _stBondInfoData.iPickPRStrategyId); // 更新样式 if (m_curBondInfo.iPickPRStrategyId == m_tempBondInfo.iPickPRStrategyId) ui.comboBoxPickTempID->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxPickTempID->setStyleSheet("color: red;"); // 字体颜色变红 } void BondMatrixProgramPage::onCreateParamPreBondClicked() { UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt(); m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_BONDFRONT, iBondInfoId); //UpdateShowBondInfoData(iBondInfoId); BOND_INFO_STRUCT _stBondInfoData; m_manageDB->GetCProduct()->GetBondInfoData(iBondInfoId, _stBondInfoData); m_curBondInfo.iBondFrontPRStrategyId = _stBondInfoData.iBondFrontPRStrategyId; m_vecPrTemplate = m_manageDB->GetCProduct()->GetPrTemplate(); m_vecPrStrategy = m_manageDB->GetCProduct()->GetPrStrategy(); UpdateTemplateParamCombox(1, _stBondInfoData.iBondFrontPRStrategyId); // 更新样式 if (m_curBondInfo.iBondFrontPRStrategyId == m_tempBondInfo.iBondFrontPRStrategyId) ui.comboBoxPreBondTemp->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxPreBondTemp->setStyleSheet("color: red;"); // 字体颜色变红 } void BondMatrixProgramPage::onCreateParamPostBondClicked() { UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt(); m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_BONDBACK, iBondInfoId); //UpdateShowBondInfoData(iBondInfoId); BOND_INFO_STRUCT _stBondInfoData; m_manageDB->GetCProduct()->GetBondInfoData(iBondInfoId, _stBondInfoData); m_curBondInfo.iBondBackPRStrategyId = _stBondInfoData.iBondBackPRStrategyId; m_vecPrBondInsp = m_manageDB->GetCProduct()->GetPrBondInsp(); UpdateTemplateParamCombox(1, _stBondInfoData.iBondBackPRStrategyId); // 更新样式 if (m_curBondInfo.iBondBackPRStrategyId == m_tempBondInfo.iBondBackPRStrategyId) ui.comboBoxPostBondTemp->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxPostBondTemp->setStyleSheet("color: red;"); // 字体颜色变红 } void BondMatrixProgramPage::onCreateParamBondClicked() { UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt(); m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_WORKTABLE_BOND, iBondInfoId); //UpdateShowBondInfoData(iBondInfoId); BOND_INFO_STRUCT _stBondInfoData; m_manageDB->GetCProduct()->GetBondInfoData(iBondInfoId, _stBondInfoData); m_curBondInfo.iBondAlnPRStrategyId = _stBondInfoData.iBondAlnPRStrategyId; m_vecPrTemplate = m_manageDB->GetCProduct()->GetPrTemplate(); m_vecPrStrategy = m_manageDB->GetCProduct()->GetPrStrategy(); UpdateTemplateParamCombox(1, _stBondInfoData.iBondAlnPRStrategyId); // 更新样式 if (m_curBondInfo.iBondAlnPRStrategyId == m_tempBondInfo.iBondAlnPRStrategyId) ui.comboBoxBondTemp->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxBondTemp->setStyleSheet("color: red;"); // 字体颜色变红 } void BondMatrixProgramPage::onCreateParamLookUpClicked() { UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt(); m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_LOOKUP, iBondInfoId); //UpdateShowBondInfoData(iBondInfoId); BOND_INFO_STRUCT _stBondInfoData; m_manageDB->GetCProduct()->GetBondInfoData(iBondInfoId, _stBondInfoData); m_curBondInfo.iLookUpPRStrategyId = _stBondInfoData.iLookUpPRStrategyId; m_vecPrTemplate = m_manageDB->GetCProduct()->GetPrTemplate(); m_vecPrStrategy = m_manageDB->GetCProduct()->GetPrStrategy(); UpdateTemplateParamCombox(1, _stBondInfoData.iLookUpPRStrategyId); // 更新样式 if (m_curBondInfo.iLookUpPRStrategyId == m_tempBondInfo.iLookUpPRStrategyId) ui.comboBoxLookUpTemp->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxLookUpTemp->setStyleSheet("color: red;"); // 字体颜色变红 } void BondMatrixProgramPage::onCreateParamCalibPickClicked() { UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt(); m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_TRANSFER_PICK, iBondInfoId); //UpdateShowBondInfoData(iBondInfoId); BOND_INFO_STRUCT _stBondInfoData; m_manageDB->GetCProduct()->GetBondInfoData(iBondInfoId, _stBondInfoData); m_curBondInfo.iCalibPRStrategyId = _stBondInfoData.iCalibPRStrategyId; m_vecPrTemplate = m_manageDB->GetCProduct()->GetPrTemplate(); m_vecPrStrategy = m_manageDB->GetCProduct()->GetPrStrategy(); UpdateTemplateParamCombox(1, _stBondInfoData.iCalibPRStrategyId); // 更新样式 if (m_curBondInfo.iCalibPRStrategyId == m_tempBondInfo.iCalibPRStrategyId) ui.comboBoxCalibPickTemp->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxCalibPickTemp->setStyleSheet("color: red;"); // 字体颜色变红 } void BondMatrixProgramPage::onCreatParamPcbAlnPRStrategyClicked() { UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt(); m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_WORKTABLE_BOND_ALN, iBondInfoId); //UpdateShowBondInfoData(iBondInfoId); BOND_INFO_STRUCT _stBondInfoData; m_manageDB->GetCProduct()->GetBondInfoData(iBondInfoId, _stBondInfoData); m_curBondInfo.iPcbAlnPRStrategyId = _stBondInfoData.iPcbAlnPRStrategyId; m_vecPrTemplate = m_manageDB->GetCProduct()->GetPrTemplate(); m_vecPrStrategy = m_manageDB->GetCProduct()->GetPrStrategy(); UpdateTemplateParamCombox(1, _stBondInfoData.iPcbAlnPRStrategyId); // 更新样式 if (m_curBondInfo.iPcbAlnPRStrategyId == m_tempBondInfo.iPcbAlnPRStrategyId) ui.comboBoxPcbAlnPRStrategyId->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxPcbAlnPRStrategyId->setStyleSheet("color: red;"); // 字体颜色变红 } // 为华夫盒连接控件:优化使用 void BondMatrixProgramPage::onCheckBoxPickBlockCheckClicked(bool isChecked) { m_curWaferPickParam.bCheckBlock = isChecked; } void BondMatrixProgramPage::onCheckBoxPickLoseCheckClicked(bool isChecked) { m_curWaferPickParam.bCheckLose = isChecked; } void BondMatrixProgramPage::onCheckBoxPickFindForceCheckClicked(bool isChecked) { m_curWaferPickParam.bFindForce = isChecked; } void BondMatrixProgramPage::onDoubleSpinBoxPrePickZEditingFinished() { m_curWaferPickParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ->value(); } void BondMatrixProgramPage::onDoubleSpinBoxPickForceEditingFinished() { m_curWaferPickParam.dForce = ui.doubleSpinBoxPickForce->value(); } void BondMatrixProgramPage::onDoubleSpinBoxPickPosZEditingFinished() { m_curWaferPickParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ->value(); } void BondMatrixProgramPage::onSpinBoxPickGrabDelayEditingFinished() { m_curWaferPickParam.iGrabDelay = ui.spinBoxPickGrabDelay->value(); } void BondMatrixProgramPage::onSpinBoxPickDelayEditingFinished() { m_curWaferPickParam.iPickOrBondDelay = ui.spinBoxPickDelay->value(); } void BondMatrixProgramPage::onSpinBoxPickBlockCheckDelayEditingFinished() { m_curWaferPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value(); } void BondMatrixProgramPage::onSpinBoxPickVacDelayEditingFinished() { m_curWaferPickParam.iVacuumDelay = ui.spinBoxPickVacDelay->value(); } void BondMatrixProgramPage::onSpinBoxPickBlowDelayEditingFinished() { m_curWaferPickParam.iBlowDelay = ui.spinBoxPickBlowDelay->value(); } // 中转台取晶槽函数实现:优化使用 void BondMatrixProgramPage::onCheckBoxPickBlockCheck_2Clicked(bool isChecked) { m_curCalibPickParam.bCheckBlock = isChecked; } void BondMatrixProgramPage::onCheckBoxPickLoseCheck_2Clicked(bool isChecked) { m_curCalibPickParam.bCheckLose = isChecked; } void BondMatrixProgramPage::onCheckBoxPickFindForceCheck_2Clicked(bool isChecked) { m_curCalibPickParam.bFindForce = isChecked; } void BondMatrixProgramPage::onDoubleSpinBoxPrePickZ_2EditingFinished() { m_curCalibPickParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ_2->value(); } void BondMatrixProgramPage::onDoubleSpinBoxPickForce_2EditingFinished() { m_curCalibPickParam.dForce = ui.doubleSpinBoxPickForce_2->value(); } void BondMatrixProgramPage::onDoubleSpinBoxPickPosZ_2EditingFinished() { m_curCalibPickParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ_2->value(); } void BondMatrixProgramPage::onSpinBoxPickGrabDelay_2EditingFinished() { m_curCalibPickParam.iGrabDelay = ui.spinBoxPickGrabDelay_2->value(); } void BondMatrixProgramPage::onSpinBoxPickDelay_2EditingFinished() { m_curCalibPickParam.iPickOrBondDelay = ui.spinBoxPickDelay_2->value(); } void BondMatrixProgramPage::onSpinBoxPickBlockCheckDelay_2EditingFinished() { m_curCalibPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay_2->value(); } void BondMatrixProgramPage::onSpinBoxPickVacDelay_2EditingFinished() { m_curCalibPickParam.iVacuumDelay = ui.spinBoxPickVacDelay_2->value(); } void BondMatrixProgramPage::onSpinBoxPickBlowDelay_2EditingFinished() { m_curCalibPickParam.iBlowDelay = ui.spinBoxPickBlowDelay_2->value(); } // 处理 "中转台放晶" 控件的槽函数 void BondMatrixProgramPage::onCheckBoxBondBlockCheckClicked(bool isChecked) { m_curCalibPlaceParam.bCheckBlock = isChecked; // 更新样式 if (m_curCalibPlaceParam.bCheckBlock == m_tempCalibPlaceParam.bCheckBlock) ui.checkBoxBondBlockCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红 if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.bCheckBlock = isChecked; ui.checkBoxPickBlockCheck->setChecked(m_curWaferPickParam.bCheckBlock); // 更新样式 if (m_curWaferPickParam.bCheckBlock == m_tempWaferPickParam.bCheckBlock) ui.checkBoxPickBlockCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.bCheckBlock = isChecked; ui.checkBoxPickBlockCheck_2->setChecked(m_curCalibPickParam.bCheckBlock); // 更新样式 if (m_curCalibPickParam.bCheckBlock == m_tempCalibPickParam.bCheckBlock) ui.checkBoxPickBlockCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.bCheckBlock = isChecked; ui.checkBoxBondBlockCheck_2->setChecked(m_curBondParam.bCheckBlock); // 更新样式 if (m_curBondParam.bCheckBlock == m_tempBondParam.bCheckBlock) ui.checkBoxBondBlockCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onCheckBoxBondLoseCheckClicked(bool isChecked) { m_curCalibPlaceParam.bCheckLose = isChecked; // 更新样式 if (m_curCalibPlaceParam.bCheckLose == m_tempCalibPlaceParam.bCheckLose) ui.checkBoxBondLoseCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红 if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.bCheckLose = isChecked; ui.checkBoxPickLoseCheck->setChecked(m_curWaferPickParam.bCheckLose); // 更新样式 if (m_curWaferPickParam.bCheckLose == m_tempWaferPickParam.bCheckLose) ui.checkBoxPickLoseCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.bCheckLose = isChecked; ui.checkBoxPickLoseCheck_2->setChecked(m_curCalibPickParam.bCheckLose); // 更新样式 if (m_curCalibPickParam.bCheckLose == m_tempCalibPickParam.bCheckLose) ui.checkBoxPickLoseCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.bCheckLose = isChecked; ui.checkBoxBondLoseCheck_2->setChecked(m_curBondParam.bCheckLose); // 更新样式 if (m_curBondParam.bCheckLose == m_tempBondParam.bCheckLose) ui.checkBoxBondLoseCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onCheckBoxBondFindForceClicked(bool isChecked) { m_curCalibPlaceParam.bFindForce = isChecked; ui.doubleSpinBoxBondPosZ->setEnabled(!isChecked); // 更新样式 if (m_curCalibPlaceParam.bFindForce == m_tempCalibPlaceParam.bFindForce) ui.checkBoxBondFindForce->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondFindForce->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.bFindForce = isChecked; ui.checkBoxPickFindForceCheck->setChecked(m_curWaferPickParam.bFindForce); // 更新样式 if (m_curWaferPickParam.bFindForce == m_tempWaferPickParam.bFindForce) ui.checkBoxPickFindForceCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickFindForceCheck->setStyleSheet("color: red;"); // 字体颜色变红 ui.doubleSpinBoxPickPosZ->setEnabled(!isChecked); } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.bFindForce = isChecked; ui.checkBoxPickFindForceCheck_2->setChecked(m_curCalibPickParam.bFindForce); // 更新样式 if (m_curCalibPickParam.bFindForce == m_tempCalibPickParam.bFindForce) ui.checkBoxPickFindForceCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickFindForceCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 ui.doubleSpinBoxPickPosZ_2->setEnabled(!isChecked); } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.bFindForce = isChecked; ui.checkBoxBondFindForce_2->setChecked(m_curBondParam.bFindForce); // 更新样式 if (m_curBondParam.bFindForce == m_tempBondParam.bFindForce) ui.checkBoxBondFindForce_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondFindForce_2->setStyleSheet("color: red;"); // 字体颜色变红 ui.doubleSpinBoxBondPosZ_2->setEnabled(!isChecked); } } void BondMatrixProgramPage::onDoubleSpinBoxPreBondPosZEditingFinished() { m_curCalibPlaceParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ->value(); // 更新样式 if (m_curCalibPlaceParam.dPreLevOffset == m_tempCalibPlaceParam.dPreLevOffset) ui.doubleSpinBoxPreBondPosZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPreBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红 if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ->value(); ui.doubleSpinBoxPrePickZ->setValue(m_curWaferPickParam.dPreLevOffset); // 更新样式 if (m_curWaferPickParam.dPreLevOffset == m_tempWaferPickParam.dPreLevOffset) ui.doubleSpinBoxPrePickZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPrePickZ->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ->value(); ui.doubleSpinBoxPrePickZ_2->setValue(m_curCalibPickParam.dPreLevOffset); // 更新样式 if (m_curCalibPickParam.dPreLevOffset == m_tempCalibPickParam.dPreLevOffset) ui.doubleSpinBoxPrePickZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPrePickZ_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ->value(); ui.doubleSpinBoxPreBondPosZ_2->setValue(m_curBondParam.dPreLevOffset); // 更新样式 if (m_curBondParam.dPreLevOffset == m_tempBondParam.dPreLevOffset) ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onDoubleSpinBoxBondForceEditingFinished() { m_curCalibPlaceParam.dForce = ui.doubleSpinBoxBondForce->value(); // 更新样式 if (m_curCalibPlaceParam.dForce == m_tempCalibPlaceParam.dForce) ui.doubleSpinBoxBondForce->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondForce->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.dForce = ui.doubleSpinBoxBondForce->value(); ui.doubleSpinBoxPickForce->setValue(m_curWaferPickParam.dForce); // 更新样式 if (m_curWaferPickParam.dForce == m_tempWaferPickParam.dForce) ui.doubleSpinBoxPickForce->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickForce->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.dForce = ui.doubleSpinBoxBondForce->value(); ui.doubleSpinBoxPickForce_2->setValue(m_curCalibPickParam.dForce); // 更新样式 if (m_curCalibPickParam.dForce == m_tempCalibPickParam.dForce) ui.doubleSpinBoxPickForce_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickForce_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.dForce = ui.doubleSpinBoxBondForce->value(); ui.doubleSpinBoxBondForce_2->setValue(m_curBondParam.dForce); // 更新样式 if (m_curBondParam.dForce == m_tempBondParam.dForce) ui.doubleSpinBoxBondForce_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondForce_2->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onDoubleSpinBoxBondPosZEditingFinished() { m_curCalibPlaceParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ->value(); // 更新样式 if (m_curCalibPlaceParam.dWorkLevOffset == m_tempCalibPlaceParam.dWorkLevOffset) ui.doubleSpinBoxBondPosZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ->value(); ui.doubleSpinBoxPickPosZ->setValue(m_curWaferPickParam.dWorkLevOffset); // 更新样式 if (m_curWaferPickParam.dWorkLevOffset == m_tempWaferPickParam.dWorkLevOffset) ui.doubleSpinBoxPickPosZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickPosZ->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ->value(); ui.doubleSpinBoxPickPosZ_2->setValue(m_curCalibPickParam.dWorkLevOffset); // 更新样式 if (m_curCalibPickParam.dWorkLevOffset == m_tempCalibPickParam.dWorkLevOffset) ui.doubleSpinBoxPickPosZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ->value(); ui.doubleSpinBoxBondPosZ_2->setValue(m_curBondParam.dWorkLevOffset); // 更新样式 if (m_curBondParam.dWorkLevOffset == m_tempBondParam.dWorkLevOffset) ui.doubleSpinBoxBondPosZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onSpinBoxBondGrabDelayEditingFinished() { m_curCalibPlaceParam.iGrabDelay = ui.spinBoxBondGrabDelay->value(); // 更新样式 if (m_curCalibPlaceParam.iGrabDelay == m_tempCalibPlaceParam.iGrabDelay) ui.spinBoxBondGrabDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iGrabDelay = ui.spinBoxBondGrabDelay->value(); ui.spinBoxPickGrabDelay->setValue(m_curWaferPickParam.iGrabDelay); // 更新样式 if (m_curWaferPickParam.iGrabDelay == m_tempWaferPickParam.iGrabDelay) ui.spinBoxPickGrabDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.iGrabDelay = ui.spinBoxBondGrabDelay->value(); ui.spinBoxPickGrabDelay_2->setValue(m_curCalibPickParam.iGrabDelay); // 更新样式 if (m_curCalibPickParam.iGrabDelay == m_tempCalibPickParam.iGrabDelay) ui.spinBoxPickGrabDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iGrabDelay = ui.spinBoxBondGrabDelay->value(); ui.spinBoxBondGrabDelay_2->setValue(m_curBondParam.iGrabDelay); // 更新样式 if (m_curBondParam.iGrabDelay == m_tempBondParam.iGrabDelay) ui.spinBoxBondGrabDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onSpinBoxBondBlockCheckDelayEditingFinished() { m_curCalibPlaceParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay->value(); // 更新样式 if (m_curCalibPlaceParam.iBlockOrLoseDelay == m_tempCalibPlaceParam.iBlockOrLoseDelay) ui.spinBoxBondBlockCheckDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay->value(); ui.spinBoxPickBlockCheckDelay->setValue(m_curWaferPickParam.iBlockOrLoseDelay); // 更新样式 if (m_curWaferPickParam.iBlockOrLoseDelay == m_tempWaferPickParam.iBlockOrLoseDelay) ui.spinBoxPickBlockCheckDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay->value(); ui.spinBoxPickBlockCheckDelay_2->setValue(m_curCalibPickParam.iBlockOrLoseDelay); // 更新样式 if (m_curCalibPickParam.iBlockOrLoseDelay == m_tempCalibPickParam.iBlockOrLoseDelay) ui.spinBoxPickBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay->value(); ui.spinBoxBondBlockCheckDelay_2->setValue(m_curBondParam.iBlockOrLoseDelay); // 更新样式 if (m_curBondParam.iBlockOrLoseDelay == m_tempBondParam.iBlockOrLoseDelay) ui.spinBoxBondBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onSpinBoxBondDelayEditingFinished() { m_curCalibPlaceParam.iPickOrBondDelay = ui.spinBoxBondDelay->value(); // 更新样式 if (m_curCalibPlaceParam.iPickOrBondDelay == m_tempCalibPlaceParam.iPickOrBondDelay) ui.spinBoxBondDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondDelay->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iPickOrBondDelay = ui.spinBoxBondDelay->value(); ui.spinBoxPickDelay->setValue(m_curWaferPickParam.iPickOrBondDelay); // 更新样式 if (m_curWaferPickParam.iPickOrBondDelay == m_tempWaferPickParam.iPickOrBondDelay) ui.spinBoxPickDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.iPickOrBondDelay = ui.spinBoxBondDelay->value(); ui.spinBoxPickDelay_2->setValue(m_curCalibPickParam.iPickOrBondDelay); // 更新样式 if (m_curCalibPickParam.iPickOrBondDelay == m_tempCalibPickParam.iPickOrBondDelay) ui.spinBoxPickDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iPickOrBondDelay = ui.spinBoxBondDelay->value(); ui.spinBoxBondDelay_2->setValue(m_curBondParam.iPickOrBondDelay); // 更新样式 if (m_curBondParam.iPickOrBondDelay == m_tempBondParam.iPickOrBondDelay) ui.spinBoxBondDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onSpinBoxBondVacDelayEditingFinished() { m_curCalibPlaceParam.iVacuumDelay = ui.spinBoxBondVacDelay->value(); // 更新样式 if (m_curCalibPlaceParam.iVacuumDelay == m_tempCalibPlaceParam.iVacuumDelay) ui.spinBoxBondVacDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondVacDelay->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iVacuumDelay = ui.spinBoxBondVacDelay->value(); ui.spinBoxPickVacDelay->setValue(m_curWaferPickParam.iVacuumDelay); // 更新样式 if (m_curWaferPickParam.iVacuumDelay == m_tempWaferPickParam.iVacuumDelay) ui.spinBoxPickVacDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickVacDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.iVacuumDelay = ui.spinBoxBondVacDelay->value(); ui.spinBoxPickVacDelay_2->setValue(m_curCalibPickParam.iVacuumDelay); // 更新样式 if (m_curCalibPickParam.iVacuumDelay == m_tempCalibPickParam.iVacuumDelay) ui.spinBoxPickVacDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iVacuumDelay = ui.spinBoxBondVacDelay->value(); ui.spinBoxBondVacDelay_2->setValue(m_curBondParam.iVacuumDelay); // 更新样式 if (m_curBondParam.iVacuumDelay == m_tempBondParam.iVacuumDelay) ui.spinBoxBondVacDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onSpinBoxBondBlowDelayEditingFinished() { m_curCalibPlaceParam.iBlowDelay = ui.spinBoxBondBlowDelay->value(); // 更新样式 if (m_curCalibPlaceParam.iBlowDelay == m_tempCalibPlaceParam.iBlowDelay) ui.spinBoxBondBlowDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iBlowDelay = ui.spinBoxBondBlowDelay->value(); ui.spinBoxPickBlowDelay->setValue(m_curWaferPickParam.iBlowDelay); // 更新样式 if (m_curWaferPickParam.iBlowDelay == m_tempWaferPickParam.iBlowDelay) ui.spinBoxPickBlowDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) { m_curCalibPickParam.iBlowDelay = ui.spinBoxBondBlowDelay->value(); ui.spinBoxPickBlowDelay_2->setValue(m_curCalibPickParam.iBlowDelay); // 更新样式 if (m_curCalibPickParam.iBlowDelay == m_tempCalibPickParam.iBlowDelay) ui.spinBoxPickBlowDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curBondParam.iBlowDelay = ui.spinBoxBondBlowDelay->value(); ui.spinBoxBondBlowDelay_2->setValue(m_curBondParam.iBlowDelay); // 更新样式 if (m_curBondParam.iBlowDelay == m_tempBondParam.iBlowDelay) ui.spinBoxBondBlowDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } } // 处理 "固晶台固晶" 控件的槽函数 void BondMatrixProgramPage::onCheckBoxBondBlockCheck_2Clicked(bool isChecked) { m_curBondParam.bCheckBlock = isChecked; // 更新样式 if (m_curBondParam.bCheckBlock == m_tempBondParam.bCheckBlock) ui.checkBoxBondBlockCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.bCheckBlock = isChecked; ui.checkBoxPickBlockCheck->setChecked(m_curWaferPickParam.bCheckBlock); // 更新样式 if (m_curWaferPickParam.bCheckBlock == m_tempWaferPickParam.bCheckBlock) ui.checkBoxPickBlockCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curBondParam.iId) { m_curCalibPickParam.bCheckBlock = isChecked; ui.checkBoxPickBlockCheck_2->setChecked(m_curCalibPickParam.bCheckBlock); // 更新样式 if (m_curCalibPickParam.bCheckBlock == m_tempCalibPickParam.bCheckBlock) ui.checkBoxPickBlockCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curBondParam.iId) { m_curCalibPlaceParam.bCheckBlock = isChecked; ui.checkBoxBondBlockCheck->setChecked(m_curCalibPlaceParam.bCheckBlock); // 更新样式 if (m_curCalibPlaceParam.bCheckBlock == m_tempCalibPlaceParam.bCheckBlock) ui.checkBoxBondBlockCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onCheckBoxBondLoseCheck_2Clicked(bool isChecked) { m_curBondParam.bCheckLose = isChecked; // 更新样式 if (m_curBondParam.bCheckLose == m_tempBondParam.bCheckLose) ui.checkBoxBondLoseCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.bCheckLose = isChecked; ui.checkBoxPickLoseCheck->setChecked(m_curWaferPickParam.bCheckLose); // 更新样式 if (m_curWaferPickParam.bCheckLose == m_tempWaferPickParam.bCheckLose) ui.checkBoxPickLoseCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curBondParam.iId) { m_curCalibPickParam.bCheckLose = isChecked; ui.checkBoxPickLoseCheck_2->setChecked(m_curCalibPickParam.bCheckLose); // 更新样式 if (m_curCalibPickParam.bCheckLose == m_tempCalibPickParam.bCheckLose) ui.checkBoxPickLoseCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curBondParam.iId) { m_curCalibPlaceParam.bCheckLose = isChecked; ui.checkBoxBondLoseCheck->setChecked(m_curCalibPlaceParam.bCheckLose); // 更新样式 if (m_curCalibPlaceParam.bCheckLose == m_tempCalibPlaceParam.bCheckLose) ui.checkBoxBondLoseCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onCheckBoxBondFindForce_2Clicked(bool isChecked) { m_curBondParam.bFindForce = isChecked; ui.doubleSpinBoxBondPosZ_2->setEnabled(!isChecked); // 更新样式 if (m_curBondParam.bFindForce == m_tempBondParam.bFindForce) ui.checkBoxBondFindForce_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondFindForce_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.bFindForce = isChecked; ui.checkBoxPickFindForceCheck->setChecked(m_curWaferPickParam.bFindForce); // 更新样式 if (m_curWaferPickParam.bFindForce == m_tempWaferPickParam.bFindForce) ui.checkBoxPickFindForceCheck->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickFindForceCheck->setStyleSheet("color: red;"); // 字体颜色变红 ui.doubleSpinBoxPickPosZ->setEnabled(!isChecked); } if (m_curCalibPickParam.iId == m_curBondParam.iId) { m_curCalibPickParam.bFindForce = isChecked; ui.checkBoxPickFindForceCheck_2->setChecked(m_curCalibPickParam.bFindForce); // 更新样式 if (m_curCalibPickParam.bFindForce == m_tempCalibPickParam.bFindForce) ui.checkBoxPickFindForceCheck_2->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxPickFindForceCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 ui.doubleSpinBoxPickPosZ_2->setEnabled(!isChecked); } if (m_curCalibPlaceParam.iId == m_curBondParam.iId) { m_curCalibPlaceParam.bFindForce = isChecked; ui.checkBoxBondFindForce->setChecked(m_curCalibPlaceParam.bFindForce); // 更新样式 if (m_curCalibPlaceParam.bFindForce == m_tempCalibPlaceParam.bFindForce) ui.checkBoxBondFindForce->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxBondFindForce->setStyleSheet("color: red;"); // 字体颜色变红 ui.doubleSpinBoxBondPosZ->setEnabled(!isChecked); } } void BondMatrixProgramPage::onDoubleSpinBoxPreBondPosZ_2EditingFinished() { m_curBondParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ_2->value(); // 更新样式 if (m_curBondParam.dPreLevOffset == m_tempBondParam.dPreLevOffset) ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ_2->value(); ui.doubleSpinBoxPrePickZ->setValue(m_curWaferPickParam.dPreLevOffset); // 更新样式 if (m_curWaferPickParam.dPreLevOffset == m_tempWaferPickParam.dPreLevOffset) ui.doubleSpinBoxPrePickZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPrePickZ->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curBondParam.iId) { m_curCalibPickParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ_2->value(); ui.doubleSpinBoxPrePickZ_2->setValue(m_curCalibPickParam.dPreLevOffset); // 更新样式 if (m_curCalibPickParam.dPreLevOffset == m_tempCalibPickParam.dPreLevOffset) ui.doubleSpinBoxPrePickZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPrePickZ_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curBondParam.iId) { m_curCalibPlaceParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ_2->value(); ui.doubleSpinBoxPreBondPosZ->setValue(m_curCalibPlaceParam.dPreLevOffset); // 更新样式 if (m_curCalibPlaceParam.dPreLevOffset == m_tempCalibPlaceParam.dPreLevOffset) ui.doubleSpinBoxPreBondPosZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPreBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onDoubleSpinBoxBondForce_2EditingFinished() { m_curBondParam.dForce = ui.doubleSpinBoxBondForce_2->value(); // 更新样式 if (m_curBondParam.dForce == m_tempBondParam.dForce) ui.doubleSpinBoxBondForce_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondForce_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.dForce = ui.doubleSpinBoxBondForce_2->value(); ui.doubleSpinBoxPickForce->setValue(m_curWaferPickParam.dForce); // 更新样式 if (m_curWaferPickParam.dForce == m_tempWaferPickParam.dForce) ui.doubleSpinBoxPickForce->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickForce->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curBondParam.iId) { m_curCalibPickParam.dForce = ui.doubleSpinBoxBondForce_2->value(); ui.doubleSpinBoxPickForce_2->setValue(m_curCalibPickParam.dForce); // 更新样式 if (m_curCalibPickParam.dForce == m_tempCalibPickParam.dForce) ui.doubleSpinBoxPickForce_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickForce_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curBondParam.iId) { m_curCalibPlaceParam.dForce = ui.doubleSpinBoxBondForce_2->value(); ui.doubleSpinBoxBondForce->setValue(m_curCalibPlaceParam.dForce); // 更新样式 if (m_curCalibPlaceParam.dForce == m_tempCalibPlaceParam.dForce) ui.doubleSpinBoxBondForce->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondForce->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onDoubleSpinBoxBondPosZ_2EditingFinished() { m_curBondParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ_2->value(); // 更新样式 if (m_curBondParam.dWorkLevOffset == m_tempBondParam.dWorkLevOffset) ui.doubleSpinBoxBondPosZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ_2->value(); ui.doubleSpinBoxPickPosZ->setValue(m_curWaferPickParam.dWorkLevOffset); // 更新样式 if (m_curWaferPickParam.dWorkLevOffset == m_tempWaferPickParam.dWorkLevOffset) ui.doubleSpinBoxPickPosZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickPosZ->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curBondParam.iId) { m_curCalibPickParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ_2->value(); ui.doubleSpinBoxPickPosZ_2->setValue(m_curCalibPickParam.dWorkLevOffset); // 更新样式 if (m_curCalibPickParam.dWorkLevOffset == m_tempCalibPickParam.dWorkLevOffset) ui.doubleSpinBoxPickPosZ_2->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxPickPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curBondParam.iId) { m_curCalibPlaceParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ_2->value(); ui.doubleSpinBoxBondPosZ->setValue(m_curCalibPlaceParam.dWorkLevOffset); // 更新样式 if (m_curCalibPlaceParam.dWorkLevOffset == m_tempCalibPlaceParam.dWorkLevOffset) ui.doubleSpinBoxBondPosZ->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onSpinBoxBondGrabDelay_2EditingFinished() { m_curBondParam.iGrabDelay = ui.spinBoxBondGrabDelay_2->value(); // 更新样式 if (m_curBondParam.iGrabDelay == m_tempBondParam.iGrabDelay) ui.spinBoxBondGrabDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iGrabDelay = ui.spinBoxBondGrabDelay_2->value(); ui.spinBoxPickGrabDelay->setValue(m_curWaferPickParam.iGrabDelay); // 更新样式 if (m_curWaferPickParam.iGrabDelay == m_tempWaferPickParam.iGrabDelay) ui.spinBoxPickGrabDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curBondParam.iId) { m_curCalibPickParam.iGrabDelay = ui.spinBoxBondGrabDelay_2->value(); ui.spinBoxPickGrabDelay_2->setValue(m_curCalibPickParam.iGrabDelay); // 更新样式 if (m_curCalibPickParam.iGrabDelay == m_tempCalibPickParam.iGrabDelay) ui.spinBoxPickGrabDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curBondParam.iId) { m_curCalibPlaceParam.iGrabDelay = ui.spinBoxBondGrabDelay_2->value(); ui.spinBoxBondGrabDelay->setValue(m_curCalibPlaceParam.iGrabDelay); // 更新样式 if (m_curCalibPlaceParam.iGrabDelay == m_tempCalibPlaceParam.iGrabDelay) ui.spinBoxBondGrabDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onSpinBoxBondBlockCheckDelay_2EditingFinished() { m_curBondParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay_2->value(); // 更新样式 if (m_curBondParam.iBlockOrLoseDelay == m_tempBondParam.iBlockOrLoseDelay) ui.spinBoxBondBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay_2->value(); ui.spinBoxPickBlockCheckDelay->setValue(m_curWaferPickParam.iBlockOrLoseDelay); // 更新样式 if (m_curWaferPickParam.iBlockOrLoseDelay == m_tempWaferPickParam.iBlockOrLoseDelay) ui.spinBoxPickBlockCheckDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curBondParam.iId) { m_curCalibPickParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay_2->value(); ui.spinBoxPickBlockCheckDelay_2->setValue(m_curCalibPickParam.iBlockOrLoseDelay); // 更新样式 if (m_curCalibPickParam.iBlockOrLoseDelay == m_tempCalibPickParam.iBlockOrLoseDelay) ui.spinBoxPickBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curBondParam.iId) { m_curCalibPlaceParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay_2->value(); ui.spinBoxBondBlockCheckDelay->setValue(m_curCalibPlaceParam.iBlockOrLoseDelay); // 更新样式 if (m_curCalibPlaceParam.iBlockOrLoseDelay == m_tempCalibPlaceParam.iBlockOrLoseDelay) ui.spinBoxBondBlockCheckDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onSpinBoxBondDelay_2EditingFinished() { m_curBondParam.iPickOrBondDelay = ui.spinBoxBondDelay_2->value(); // 更新样式 if (m_curBondParam.iPickOrBondDelay == m_tempBondParam.iPickOrBondDelay) ui.spinBoxBondDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iPickOrBondDelay = ui.spinBoxBondDelay_2->value(); ui.spinBoxPickDelay->setValue(m_curWaferPickParam.iPickOrBondDelay); // 更新样式 if (m_curWaferPickParam.iPickOrBondDelay == m_tempWaferPickParam.iPickOrBondDelay) ui.spinBoxPickDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curBondParam.iId) { m_curCalibPickParam.iPickOrBondDelay = ui.spinBoxBondDelay_2->value(); ui.spinBoxPickDelay_2->setValue(m_curCalibPickParam.iPickOrBondDelay); // 更新样式 if (m_curCalibPickParam.iPickOrBondDelay == m_tempCalibPickParam.iPickOrBondDelay) ui.spinBoxPickDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curBondParam.iId) { m_curCalibPlaceParam.iPickOrBondDelay = ui.spinBoxBondDelay_2->value(); ui.spinBoxBondDelay->setValue(m_curCalibPlaceParam.iPickOrBondDelay); // 更新样式 if (m_curCalibPlaceParam.iPickOrBondDelay == m_tempCalibPlaceParam.iPickOrBondDelay) ui.spinBoxBondDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondDelay->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onSpinBoxBondVacDelay_2EditingFinished() { m_curBondParam.iVacuumDelay = ui.spinBoxBondVacDelay_2->value(); // 更新样式 if (m_curBondParam.iVacuumDelay == m_tempBondParam.iVacuumDelay) ui.spinBoxBondVacDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iVacuumDelay = ui.spinBoxBondVacDelay_2->value(); ui.spinBoxPickVacDelay->setValue(m_curWaferPickParam.iVacuumDelay); // 更新样式 if (m_curWaferPickParam.iVacuumDelay == m_tempWaferPickParam.iVacuumDelay) ui.spinBoxPickVacDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickVacDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curBondParam.iId) { m_curCalibPickParam.iVacuumDelay = ui.spinBoxBondVacDelay_2->value(); ui.spinBoxPickVacDelay_2->setValue(m_curCalibPickParam.iVacuumDelay); // 更新样式 if (m_curCalibPickParam.iVacuumDelay == m_tempCalibPickParam.iVacuumDelay) ui.spinBoxPickVacDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curBondParam.iId) { m_curCalibPlaceParam.iVacuumDelay = ui.spinBoxBondVacDelay_2->value(); ui.spinBoxBondVacDelay->setValue(m_curCalibPlaceParam.iVacuumDelay); // 更新样式 if (m_curCalibPlaceParam.iVacuumDelay == m_tempCalibPlaceParam.iVacuumDelay) ui.spinBoxBondVacDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondVacDelay->setStyleSheet("color: red;"); // 字体颜色变红 } } void BondMatrixProgramPage::onSpinBoxBondBlowDelay_2EditingFinished() { m_curBondParam.iBlowDelay = ui.spinBoxBondBlowDelay_2->value(); // 更新样式 if (m_curBondParam.iBlowDelay == m_tempBondParam.iBlowDelay) ui.spinBoxBondBlowDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 // 同步其他控件并处理样式 if (m_curBondParam.iId == m_curWaferPickParam.iId) { m_curWaferPickParam.iBlowDelay = ui.spinBoxBondBlowDelay_2->value(); ui.spinBoxPickBlowDelay->setValue(m_curWaferPickParam.iBlowDelay); // 更新样式 if (m_curWaferPickParam.iBlowDelay == m_tempWaferPickParam.iBlowDelay) ui.spinBoxPickBlowDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPickParam.iId == m_curBondParam.iId) { m_curCalibPickParam.iBlowDelay = ui.spinBoxBondBlowDelay_2->value(); ui.spinBoxPickBlowDelay_2->setValue(m_curCalibPickParam.iBlowDelay); // 更新样式 if (m_curCalibPickParam.iBlowDelay == m_tempCalibPickParam.iBlowDelay) ui.spinBoxPickBlowDelay_2->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxPickBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } if (m_curCalibPlaceParam.iId == m_curBondParam.iId) { m_curCalibPlaceParam.iBlowDelay = ui.spinBoxBondBlowDelay_2->value(); ui.spinBoxBondBlowDelay->setValue(m_curCalibPlaceParam.iBlowDelay); // 更新样式 if (m_curCalibPlaceParam.iBlowDelay == m_tempCalibPlaceParam.iBlowDelay) ui.spinBoxBondBlowDelay->setStyleSheet(""); // 恢复默认样式 else ui.spinBoxBondBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红 } } XY_DOUBLE_STRUCT BondMatrixProgramPage::BondGetAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos) { /*CAxis* _Axis; CAxis::AXIS_TYPE eAxisType = _Axis->GetAxisType();*/ if (m_pProgramCViewInterface == nullptr) { XY_DOUBLE_STRUCT errorPt = pos; // 可以根据需要返回一个错误状态 // 弹出消息框显示位置 QString positionString = QString("Unable to retrieve axis position for module type: %1").arg(QString::fromStdString(ModuleType)); QMessageBox::information(this, "Axis Position Error", positionString); return errorPt; } m_pProgramCViewInterface->GetViewMotion()->GetAxisPosition(ModuleType, "X", pos.x); m_pProgramCViewInterface->GetViewMotion()->GetAxisPosition(ModuleType, "Y", pos.y); return pos; } XY_DOUBLE_STRUCT BondMatrixProgramPage::BondMoveToXYAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos) { if (m_pProgramCViewInterface == nullptr) { XY_DOUBLE_STRUCT errorPt = pos; // 可以根据需要返回一个错误状态 // 弹出消息框显示位置 QString positionString = QString("Unable to retrieve axis position for module type: %1").arg(QString::fromStdString(ModuleType)); QMessageBox::information(this, "Axis Position Error", positionString); return errorPt; } m_pProgramCViewInterface->GetViewMotion()->ModuleMoveTo(ModuleType, "X", pos.x); m_pProgramCViewInterface->GetViewMotion()->ModuleMoveTo(ModuleType, "Y", pos.y); return pos; } void BondMatrixProgramPage::Init() { ui.comboBoxCurrentPara->installEventFilter(this); ui.comboBoxDieSource->installEventFilter(this); ui.comboBoxPickNozzleID->installEventFilter(this); ui.comboBoxPostBondTemp->installEventFilter(this); ui.comboBoxPickTempID->installEventFilter(this); ui.comboBoxPreBondTemp->installEventFilter(this); ui.comboBoxBondTemp->installEventFilter(this); ui.comboBoxLookUpTemp->installEventFilter(this); ui.comboBoxCalibPickTemp->installEventFilter(this); ui.comboBoxPcbAlnPRStrategyId->installEventFilter(this); ui.comboBoxCurrentPara_Pick1->installEventFilter(this); ui.comboBoxCurrentPara_Pick2->installEventFilter(this); ui.comboBoxCurrentPara_Place1->installEventFilter(this); ui.comboBoxCurrentPara_Place2->installEventFilter(this); ui.comboBoxBondNozzleID->installEventFilter(this); ui.pushButtonSave->setProperty("type", "save"); ui.pushButtonAddOutMatrix->setProperty("type", "addOutMatrix"); ui.pushButtonSaveParaAs->setProperty("type", "saveParaAs"); ui.pushButtonSavePara->setProperty("type", "savePara"); ui.pushButtonAddOutMatrix->setIcon(QIcon(":/images/Program/addMatrix.png")); ui.pushButtonSave->setIcon(QIcon(":/images/Program/saveMatrix.png")); ui.pushButtonSavePara->setIcon(QIcon(":/images/Program/saveBondInfo.png")); ui.pushButtonSaveParaAs->setIcon(QIcon(":/images/Program/saveAsBondInfo.png")); ui.pushButtonDeleteParam->setIcon(QIcon(":/images/Program/deleteOuter.png")); // 设置 editTemplate.png 图标的按钮 QIcon editIcon(":/images/Program/editTemplate.png"); ui.SetParamPickTemp->setIcon(editIcon); ui.SetParamPreBond->setIcon(editIcon); ui.SetParamPostBond->setIcon(editIcon); ui.SetParamBond->setIcon(editIcon); ui.SetParamPcbAlnPRStrategy->setIcon(editIcon); ui.SetParamLookUp->setIcon(editIcon); ui.SetParamCalibPick->setIcon(editIcon); // 设置 createTemplate.png 图标的按钮 QIcon createIcon(":/images/Program/createTemplate.png"); ui.CreatParamPickTemp->setIcon(createIcon); ui.CreatParamPreBond->setIcon(createIcon); ui.CreatParamPostBond->setIcon(createIcon); ui.CreatParamBond->setIcon(createIcon); ui.CreatParamPcbAlnPRStrategy->setIcon(createIcon); ui.CreatParamLookUp->setIcon(createIcon); ui.CreatParamCalibPick->setIcon(createIcon); // 图标对象 QIcon saveAsIcon(":/images/Program/saveAs.png"); QIcon deleteIcon(":/images/Program/deleteInner.png"); // 设置 saveAs 图标的按钮 ui.pushButtonSaveAsPick1->setIcon(saveAsIcon); ui.pushButtonSaveAsPick2->setIcon(saveAsIcon); ui.pushButtonSaveAsPlace1->setIcon(saveAsIcon); ui.pushButtonSaveAsPlace2->setIcon(saveAsIcon); // 设置 delete 图标的按钮 ui.pushButtonDeletePick1->setIcon(deleteIcon); ui.pushButtonDeletePick2->setIcon(deleteIcon); ui.pushButtonDeletePlace1->setIcon(deleteIcon); ui.pushButtonDeletePlace2->setIcon(deleteIcon); ui.checkBoxIsCalib->setVisible(false); setStyleSheet( "QWidget { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F1F4FD, stop: 1 #E5E4F6); }" "QDoubleSpinBox { background: #FFFFFF; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }" "QSpinBox { background: #FFFFFF; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }" "QLineEdit { background: #FFFFFF; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }" "QCheckBox::indicator { width: 20px; height: 20px; }" "QCheckBox::indicator:unchecked { background-color: #FFFFFF; border-radius: 2px; }" "QComboBox { background: #FFFFFF; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }" "QComboBox::drop-down { width: 20px; }" "QPushButton { background: #D0D0E8; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }" // Button background color "QPushButton:hover { background-color: #B0B0D8; }" // Lighter color on hover "QPushButton:pressed { background-color: #A0A0C8; }" // Darker color on press ); //ui.frame->setFrameShape(QFrame::NoFrame); // 移除默认框架 //ui.frame->setFixedHeight(2); // 设置固定高度 //ui.frame->setStyleSheet("background-color: #C7CAEB;"); //ui.tab->setStyleSheet("background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F1F4FD, stop: 1 #E5E4F6)"); QTimer::singleShot(20, this, [&]() { initPage(); }); QTimer::singleShot(100, this, [&]() { ConnectFun(); }); } void BondMatrixProgramPage::ConnectFun() { connect(ui.pushButtonSave, &QPushButton::clicked, this, [=] { MatrixChangeEvent(); onSaveClickedToRefreshStyle(); CBondMatrix* pBondMatrix = CResources::GetInstance()->GetBondMatrix(); pBondMatrix->LoadMatrix(BOND_DIR::OrderAndS); }); connect(ui.pushButtonAddOutMatrix, &QPushButton::clicked, this, [=]() { PROGRAM_BOND_MATRIX_STRUCT newMatrix; //排序 std::sort(m_vectBondMatrixs.begin(), m_vectBondMatrixs.end(), [](const PROGRAM_BOND_MATRIX_STRUCT& a, const PROGRAM_BOND_MATRIX_STRUCT& b) { return a.BondMatrixId < b.BondMatrixId; }); int newBondMatrixID = 0; UINT maxID = 0; // 查找最大 MatrixId for (PROGRAM_BOND_MATRIX_STRUCT& bondMatrix : m_vectBondMatrixs) { if (bondMatrix.BondMatrixId > maxID) { maxID = bondMatrix.BondMatrixId; } } newBondMatrixID = ++maxID; while (std::any_of(m_vectBondMatrixs.begin(), m_vectBondMatrixs.end(), [newBondMatrixID](const PROGRAM_BOND_MATRIX_STRUCT& bondMatrix) { return bondMatrix.BondMatrixId == newBondMatrixID; })) { newBondMatrixID++; // 如果生成的 ID 已经存在,递增直到找到唯一的 ID } newMatrix.BondMatrixId = newBondMatrixID; newMatrix.BondMatrixRow = 0; newMatrix.BondMatrixCol = 0; newMatrix.strModuleName = "BondHead"; newMatrix.iModuleId = MODULE_LIST::BondHead; int newVectorIndex = m_vectBondMatrixs.size(); newMatrix.BondInfoId = 1; //std::vector newVecSubMatrix; m_vectBondMatrixs.push_back(newMatrix); AddOutMatrixPage(newVectorIndex, newMatrix, m_vecSubMatrixs); //AddOutMatrixPage(0, m_vectBondMatrixs[0], m_vecSubMatrixs); ui.comboBoxCurrentMatrix->clear(); for (int i = 0; i < m_vectBondMatrixs.size(); i++) { // 显示 矩阵编号 int _bondMatrixId = m_vectBondMatrixs[i].BondMatrixId; QString itemText = QString::number(_bondMatrixId); // 将 矩阵编号 添加到下拉框 ui.comboBoxCurrentMatrix->addItem(itemText, _bondMatrixId); } ShowCurrentMatrix(m_vectBondMatrixs[m_vectBondMatrixs.size() - 1].BondMatrixId); }); connect(ui.pushButtonSavePara, &QPushButton::clicked, this, [=] { //MatrixChangeEvent(); ParamChangeEvent(); CBondMatrix* pBondMatrix = CResources::GetInstance()->GetBondMatrix(); pBondMatrix->LoadMatrix(BOND_DIR::OrderAndS); }); //BondInfo SaveAs connect(ui.pushButtonSaveParaAs, &QPushButton::clicked, this, [=] { BondInfoParamSaveAsEvent(); CBondMatrix* pBondMatrix = CResources::GetInstance()->GetBondMatrix(); pBondMatrix->LoadMatrix(BOND_DIR::OrderAndS); }); //BondInfo Delete connect(ui.pushButtonDeleteParam, &QPushButton::clicked, this, &BondMatrixProgramPage::onPushButtonDeleteParamClicked); // Param Delete connect(ui.pushButtonDeletePick1, &QPushButton::clicked, this, [this]() { onPushButtonDeleteClicked(ui.pushButtonDeletePick1, ui.comboBoxCurrentPara_Pick1); restorePick1DefaultStyles(); }); connect(ui.pushButtonDeletePick2, &QPushButton::clicked, this, [this]() { onPushButtonDeleteClicked(ui.pushButtonDeletePick2, ui.comboBoxCurrentPara_Pick2); restorePick2DefaultStyles(); }); connect(ui.pushButtonDeletePlace1, &QPushButton::clicked, this, [this]() { onPushButtonDeleteClicked(ui.pushButtonDeletePlace1, ui.comboBoxCurrentPara_Place1); restorePlace1DefaultStyles(); }); connect(ui.pushButtonDeletePlace2, &QPushButton::clicked, this, [this]() { onPushButtonDeleteClicked(ui.pushButtonDeletePlace2, ui.comboBoxCurrentPara_Place2); restorePlccle2DefaultStyles(); }); //Param SaveAs // 取晶头取晶 connect(ui.pushButtonSaveAsPick1, &QPushButton::clicked, this, [=]() { ParamSaveAsEvent(m_curWaferPickParam); restorePick1DefaultStyles(); }); // 中转台取晶 connect(ui.pushButtonSaveAsPick2, &QPushButton::clicked, this, [=]() { ParamSaveAsEvent(m_curCalibPickParam); restorePick2DefaultStyles(); }); // 中转台固晶 connect(ui.pushButtonSaveAsPlace1, &QPushButton::clicked, this, [=]() { ParamSaveAsEvent(m_curCalibPlaceParam); restorePlace1DefaultStyles(); }); // 固晶台固晶 connect(ui.pushButtonSaveAsPlace2, &QPushButton::clicked, this, [=]() { ParamSaveAsEvent(m_curBondParam); restorePlccle2DefaultStyles(); }); connect(ui.comboBoxCurrentMatrix, SIGNAL(currentIndexChanged(int)), this, SLOT(onComboBoxCurrentMatrixChanged(int))); connect(ui.comboBoxCurrentPara, SIGNAL(currentIndexChanged(int)), this, SLOT(onComboBoxIndexChangedForParam(int))); //参数 // 处理 ComboBox 选择的 "Die Source" connect(ui.comboBoxDieSource, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { if (index == 0) { m_curBondInfo.eDieSource = DIE_SOURCE::BY_WAFFLE; } else if (index == 1) { m_curBondInfo.eDieSource = DIE_SOURCE::BY_WAFER; } // 更新样式 if (m_curBondInfo.eDieSource == m_tempBondInfo.eDieSource) ui.comboBoxDieSource->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxDieSource->setStyleSheet("color: red;"); // 字体颜色变红 }); connect(ui.comboBoxCalibTableId, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { m_curBondInfo.iCalibTableId = index; // 更新样式 if (m_curBondInfo.iCalibTableId == m_tempBondInfo.iCalibTableId) ui.comboBoxCalibTableId->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxCalibTableId->setStyleSheet("color: red;"); // 字体颜色变红 }); // IsCheck connect(ui.checkBoxIsCalib, &QCheckBox::clicked, this, [=](bool isChecked) { //m_curBondInfo.bTransferPREnable = isChecked; //// 更新样式 //if (isChecked == m_tempBondInfo.bTransferPREnable) // ui.checkBoxIsCalib->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxIsCalib->setStyleSheet("color: red;"); // 字体颜色变红 }); connect(ui.checkBoxIsUseMulStageTempera, &QCheckBox::clicked, this, [=](bool isChecked) { m_curBondInfo.bTransferPREnable = isChecked; // 更新样式 if (isChecked == m_tempBondInfo.bUseMultiStageTemperature) ui.checkBoxIsUseMulStageTempera->setStyleSheet(""); // 恢复默认样式 else ui.checkBoxIsUseMulStageTempera->setStyleSheet("color: red;"); // 字体颜色变红 }); connect(ui.checkBoxIsPickPR, &QCheckBox::clicked, this, &BondMatrixProgramPage::handlePickPRCheckBox); connect(ui.checkBoxIsPreBondPR, &QCheckBox::clicked, this, &BondMatrixProgramPage::handlePreBondPRCheckBox); connect(ui.checkBoxIsPostBondPR, &QCheckBox::clicked, this, &BondMatrixProgramPage::handlePostBondPRCheckBox); connect(ui.checkBoxIsAllBondAln, &QCheckBox::clicked, this, &BondMatrixProgramPage::handleAllBondAlnCheckBox); connect(ui.checkBoxIsPcbAln, &QCheckBox::clicked, this, &BondMatrixProgramPage::handlePcbAlnCheckBox); connect(ui.checkBoxIsLookUpPR, &QCheckBox::clicked, this, &BondMatrixProgramPage::handleLookUpPRCheckBox); connect(ui.checkBoxIsCalibPick, &QCheckBox::clicked, this, &BondMatrixProgramPage::handleCalibPickCheckBox); // 处理 "Die Height" 的变化 connect(ui.spinBoxDieHeight, &DoubleSpinBox::editDone, this, [=]() { m_curBondInfo.dDieHeight = ui.spinBoxDieHeight->value(); // 更新样式 //if (m_curBondInfo.dDieHeight == m_tempBondInfo.dDieHeight) // ui.spinBoxDieHeight->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxDieHeight->setStyleSheet("color: red;"); // 字体颜色变红 }); // 处理 "Pick Nozzle ID" 的变化 connect(ui.comboBoxPickNozzleID, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iPickHeadId = ui.comboBoxPickNozzleID->currentData().toInt(); // 更新样式 if (m_curBondInfo.iPickHeadId == m_tempBondInfo.iPickHeadId) ui.comboBoxPickNozzleID->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxPickNozzleID->setStyleSheet("color: red;"); // 字体颜色变红 }); // 处理 "Post Bond Temp" 的变化 connect(ui.comboBoxPostBondTemp, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iBondBackPRStrategyId = ui.comboBoxPostBondTemp->currentData().toInt(); // 更新样式 if (m_curBondInfo.iBondBackPRStrategyId == m_tempBondInfo.iBondBackPRStrategyId) ui.comboBoxPostBondTemp->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxPostBondTemp->setStyleSheet("color: red;"); // 字体颜色变红 }); // 处理 "Pick Temp ID" 的变化 connect(ui.comboBoxPickTempID, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iPickPRStrategyId = ui.comboBoxPickTempID->currentData().toInt(); // 更新样式 if (m_curBondInfo.iPickPRStrategyId == m_tempBondInfo.iPickPRStrategyId) ui.comboBoxPickTempID->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxPickTempID->setStyleSheet("color: red;"); // 字体颜色变红 }); // 处理 "Pre Bond Temp" 的变化 connect(ui.comboBoxPreBondTemp, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iBondFrontPRStrategyId = ui.comboBoxPreBondTemp->currentData().toInt(); // 更新样式 if (m_curBondInfo.iBondFrontPRStrategyId == m_tempBondInfo.iBondFrontPRStrategyId) ui.comboBoxPreBondTemp->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxPreBondTemp->setStyleSheet("color: red;"); // 字体颜色变红 }); // 处理 "Bond Temp" 的变化 connect(ui.comboBoxBondTemp, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iBondAlnPRStrategyId = ui.comboBoxBondTemp->currentData().toInt(); // 更新样式 if (m_curBondInfo.iBondAlnPRStrategyId == m_tempBondInfo.iBondAlnPRStrategyId) ui.comboBoxBondTemp->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxBondTemp->setStyleSheet("color: red;"); // 字体颜色变红 }); // 处理 "Look Up Temp" 的变化 connect(ui.comboBoxLookUpTemp, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iLookUpPRStrategyId = ui.comboBoxLookUpTemp->currentData().toInt(); // 更新样式 if (m_curBondInfo.iLookUpPRStrategyId == m_tempBondInfo.iLookUpPRStrategyId) ui.comboBoxLookUpTemp->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxLookUpTemp->setStyleSheet("color: red;"); // 字体颜色变红 }); // 处理 "Calib Pick Temp" 的变化 connect(ui.comboBoxCalibPickTemp, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iCalibPRStrategyId = ui.comboBoxCalibPickTemp->currentData().toInt(); // 更新样式 if (m_curBondInfo.iCalibPRStrategyId == m_tempBondInfo.iCalibPRStrategyId) ui.comboBoxCalibPickTemp->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxCalibPickTemp->setStyleSheet("color: red;"); // 字体颜色变红 }); // 处理 "PcbAlnPRStrategyId" 的变化 connect(ui.comboBoxPcbAlnPRStrategyId, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iPcbAlnPRStrategyId = ui.comboBoxPcbAlnPRStrategyId->currentData().toInt(); // 更新样式 if (m_curBondInfo.iPcbAlnPRStrategyId == m_tempBondInfo.iPcbAlnPRStrategyId) ui.comboBoxPcbAlnPRStrategyId->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxPcbAlnPRStrategyId->setStyleSheet("color: red;"); // 字体颜色变红 }); //取/固晶参数集修改 connect(ui.comboBoxCurrentPara_Pick1, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iPickParamId = ui.comboBoxCurrentPara_Pick1->currentData().toInt(); if (m_curBondInfo.iPickParamId == m_curBondInfo.iCalibPickParamId) { m_curWaferPickParam = m_curCalibPickParam; } else if (m_curBondInfo.iPickParamId == m_curBondInfo.iCalibBondParamId) { m_curWaferPickParam = m_curCalibPlaceParam; } else if (m_curBondInfo.iPickParamId == m_curBondInfo.iBondParamId) { m_curWaferPickParam = m_curBondParam; } else { m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iPickParamId, m_curWaferPickParam); } //m_tempWaferPickParam = m_curWaferPickParam; UpdatePagePick1Param(); // 更新样式 if (m_curBondInfo.iPickParamId == m_tempBondInfo.iPickParamId) ui.comboBoxCurrentPara_Pick1->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxCurrentPara_Pick1->setStyleSheet("color: red;"); // 字体颜色变红 }); connect(ui.comboBoxCurrentPara_Pick2, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iCalibPickParamId = ui.comboBoxCurrentPara_Pick2->currentData().toInt(); // 根据其他的Pick参数进行判断 if (m_curBondInfo.iCalibPickParamId == m_curBondInfo.iPickParamId) { m_curCalibPickParam = m_curWaferPickParam; } else if (m_curBondInfo.iCalibPickParamId == m_curBondInfo.iCalibBondParamId) { m_curCalibPickParam = m_curCalibPlaceParam; } else if (m_curBondInfo.iCalibPickParamId == m_curBondInfo.iBondParamId) { m_curCalibPickParam = m_curBondParam; } else { m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iCalibPickParamId, m_curCalibPickParam); } //UpdatePagePickPlaceParam(); //m_tempCalibPickParam = m_curCalibPickParam; UpdatePagePick2Param(); // 更新样式 if (m_curBondInfo.iCalibPickParamId == m_tempBondInfo.iCalibPickParamId) ui.comboBoxCurrentPara_Pick2->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxCurrentPara_Pick2->setStyleSheet("color: red;"); // 字体颜色变红 }); connect(ui.comboBoxCurrentPara_Place1, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iCalibBondParamId = ui.comboBoxCurrentPara_Place1->currentData().toInt(); // 根据其他的Pick参数进行判断 if (m_curBondInfo.iCalibBondParamId == m_curBondInfo.iPickParamId) { m_curCalibPlaceParam = m_curWaferPickParam; } else if (m_curBondInfo.iCalibBondParamId == m_curBondInfo.iCalibPickParamId) { m_curCalibPlaceParam = m_curCalibPickParam; } else if (m_curBondInfo.iCalibBondParamId == m_curBondInfo.iBondParamId) { m_curCalibPlaceParam = m_curBondParam; } else { m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iCalibBondParamId, m_curCalibPlaceParam); } //UpdatePagePickPlaceParam(); //m_tempCalibPlaceParam = m_curCalibPlaceParam; UpdatePageBond1Param(); // 更新样式 if (m_curBondInfo.iCalibBondParamId == m_tempBondInfo.iCalibBondParamId) ui.comboBoxCurrentPara_Place1->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxCurrentPara_Place1->setStyleSheet("color: red;"); // 字体颜色变红 }); connect(ui.comboBoxCurrentPara_Place2, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iBondParamId = ui.comboBoxCurrentPara_Place2->currentData().toInt(); if (m_curBondInfo.iBondParamId == m_curBondInfo.iPickParamId) { m_curBondParam = m_curWaferPickParam; } else if (m_curBondInfo.iBondParamId == m_curBondInfo.iCalibPickParamId) { m_curBondParam = m_curCalibPickParam; } else if (m_curBondInfo.iBondParamId == m_curBondInfo.iCalibBondParamId) { m_curBondParam = m_curCalibPlaceParam; } else { m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iBondParamId, m_curBondParam); } //UpdatePagePickPlaceParam(); //m_tempBondParam = m_curBondParam; UpdatePageBond2Param(); // 更新样式 if (m_curBondInfo.iBondParamId == m_tempBondInfo.iBondParamId) ui.comboBoxCurrentPara_Place2->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxCurrentPara_Place2->setStyleSheet("color: red;"); // 字体颜色变红 }); // Connect Modify&Create buttons to slots connect(ui.SetParamPickTemp, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamPickTempClicked); connect(ui.SetParamPreBond, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamPreBondClicked); connect(ui.SetParamPostBond, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamPostBondClicked); connect(ui.SetParamBond, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamBondClicked); connect(ui.SetParamLookUp, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamLookUpClicked); connect(ui.SetParamCalibPick, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamCalibPickClicked); connect(ui.SetParamPcbAlnPRStrategy, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamPcbAlnPRStrategyClicked); connect(ui.CreatParamPickTemp, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreateParamPickTempClicked); connect(ui.CreatParamPreBond, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreateParamPreBondClicked); connect(ui.CreatParamPostBond, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreateParamPostBondClicked); connect(ui.CreatParamBond, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreateParamBondClicked); connect(ui.CreatParamLookUp, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreateParamLookUpClicked); connect(ui.CreatParamCalibPick, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreateParamCalibPickClicked); connect(ui.CreatParamPcbAlnPRStrategy, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreatParamPcbAlnPRStrategyClicked); // 处理 "Bond Nozzle ID" 的变化 connect(ui.comboBoxBondNozzleID, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { if (m_isComBoxUpdating) { return; } m_curBondInfo.iBondHeadId = ui.comboBoxBondNozzleID->currentData().toInt(); // 更新样式 if (m_curBondInfo.iBondHeadId == m_tempBondInfo.iBondHeadId) ui.comboBoxBondNozzleID->setStyleSheet(""); // 恢复默认样式 else ui.comboBoxBondNozzleID->setStyleSheet("color: red;"); // 字体颜色变红 }); // 处理 "Bond Offset X" 的变化 connect(ui.doubleSpinBoxBondOffsetX, &DoubleSpinBox::editDone, this, [=]() { m_curBondInfo.stOffset.x = ui.doubleSpinBoxBondOffsetX->value(); // 更新样式 if (m_curBondInfo.stOffset.x == m_tempBondInfo.stOffset.x) ui.doubleSpinBoxBondOffsetX->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondOffsetX->setStyleSheet("color: red;"); // 字体颜色变红 }); // 处理 "Bond Offset Y" 的变化 connect(ui.doubleSpinBoxBondOffsetY, &DoubleSpinBox::editDone, this, [=]() { m_curBondInfo.stOffset.y = ui.doubleSpinBoxBondOffsetY->value(); // 更新样式 if (m_curBondInfo.stOffset.y == m_tempBondInfo.stOffset.y) ui.doubleSpinBoxBondOffsetY->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondOffsetY->setStyleSheet("color: red;"); // 字体颜色变红 }); // 处理 "Bond Offset Angle" 的变化 connect(ui.doubleSpinBoxBondOffsetAngle, &DoubleSpinBox::editDone, this, [=]() { m_curBondInfo.stOffset.a = ui.doubleSpinBoxBondOffsetAngle->value(); // 更新样式 if (m_curBondInfo.stOffset.a == m_tempBondInfo.stOffset.a) ui.doubleSpinBoxBondOffsetAngle->setStyleSheet(""); // 恢复默认样式 else ui.doubleSpinBoxBondOffsetAngle->setStyleSheet("color: red;"); // 字体颜色变红 }); // 初始化取晶控件连接 connectWaferPickControls(); connectCalibPickControls(); // 初始化放晶控件连接 connectCalibPlaceControls(); connectBondControls(); // connect(QTSignalSlotManager::get_instance(), &QTSignalSlotManager::SignalUpdateBondMatrixTemplateID, this, &BondMatrixProgramPage::UpdateTemplateParamCombox); } void BondMatrixProgramPage::AddOutMatrixPage(int vectorIndex, PROGRAM_BOND_MATRIX_STRUCT matrixData, std::vector vecSubMatrix) { int matrixNum = m_mapSubMatrixControls.size(); int newMatrixID = ++matrixNum; QVector vecControls; QWidget* outWidget = new QWidget(); QGridLayout* outMatrixGridLayout = new QGridLayout(); outMatrixGridLayout->setSpacing(4); outMatrixGridLayout->setObjectName(QString::fromUtf8("Out GridLayout")); outMatrixGridLayout->setContentsMargins(0, 0, 0, 0); // 设置布局的边距为0 QGridLayout* boxGridLayout = new QGridLayout(); boxGridLayout->setSpacing(4); boxGridLayout->setObjectName(QString::fromUtf8("Box GridLayout")); boxGridLayout->setContentsMargins(0, 0, 0, 0); // 设置布局的边距为0 QHBoxLayout* buttonLayout = new QHBoxLayout(); QSpacerItem* item = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); buttonLayout->addSpacerItem(item); QGroupBox* groupBox = new QGroupBox(outWidget); groupBox->setLayout(boxGridLayout); QGridLayout* matrixGridLayout = new QGridLayout(); matrixGridLayout->setSpacing(4); matrixGridLayout->setObjectName(QString::fromUtf8("matrixGridLayout")); matrixGridLayout->setContentsMargins(0, 0, 0, 0); // 设置布局的边距为0 // Add matrix title QLabel* labelTitle = new QLabel(outWidget); labelTitle->setObjectName(QString::fromUtf8("labelTitle")); labelTitle->setText(tr("Bond Matrix ","晶圆矩阵 ") + QString::number(vectorIndex + 1)); labelTitle->setStyleSheet("color: #6A78FF;height: 30px"); matrixGridLayout->addWidget(labelTitle, 0, 0, 1, 1); vecControls.push_back(labelTitle); // Add "Add Sub Matrix" button QPushButton* pushButtonAdd = new QPushButton(outWidget); pushButtonAdd->setObjectName(QString::fromUtf8("button Add")); pushButtonAdd->setIcon(QIcon(":/images/Program/addSubMatrix.png")); pushButtonAdd->setToolTip(tr("AddSubMatrix","添加子矩阵")); // 设置鼠标悬停时显示的文字提示 //pushButtonAdd->setText(tr("Add sub Matrix","添加子矩阵")); matrixGridLayout->addWidget(pushButtonAdd, 0, 3, 1, 1); pushButtonAdd->setProperty("type", "default"); connect(pushButtonAdd, &QPushButton::clicked, this, [=]() { int newSubMatrixIndex = m_vecSubMatrixs.size(); PROGRAM_POINT_MATRIX_STRUCT subMatrix; std::sort(m_vecSubMatrixs.begin(), m_vecSubMatrixs.end(), [](const PROGRAM_POINT_MATRIX_STRUCT& a, const PROGRAM_POINT_MATRIX_STRUCT& b) { return a.MatrixId < b.MatrixId; }); int newSubMatrixID = 0; UINT maxID = 0; // 查找最大 MatrixId for (PROGRAM_POINT_MATRIX_STRUCT& subMatrix : m_vecSubMatrixs) { if (subMatrix.MatrixId > maxID) { maxID = subMatrix.MatrixId; } } newSubMatrixID = ++maxID; while (std::any_of(m_vecSubMatrixs.begin(), m_vecSubMatrixs.end(), [newSubMatrixID](const PROGRAM_POINT_MATRIX_STRUCT& subMatrix) { return subMatrix.MatrixId == newSubMatrixID; })) { newSubMatrixID++; // 如果生成的 ID 已经存在,递增直到找到唯一的 ID } subMatrix.MatrixId = newSubMatrixID; subMatrix.strModuleName = "BondHead"; subMatrix.iModuleId = MODULE_LIST::BondHead; subMatrix.MatrixRow = 0; subMatrix.MatrixCol = 0; m_vecSubMatrixs.push_back(subMatrix); // Add the submatrix to the bond matrix's VecPointMatrixId //找大矩阵ID/Index auto currentIt = m_mapOutWidgetIndex.find(outWidget); int bondMatrixId = currentIt.value(); //迭代器 erase后currentIt被删除了 //m_vectBondMatrixs[index].VecPointMatrixId.push_back(newSubMatrixID); // 遍历 m_vectBondMatrixs 找到对应的矩阵 for (size_t i = 0; i < m_vectBondMatrixs.size(); ++i) { if (m_vectBondMatrixs[i].BondMatrixId == bondMatrixId) { // 找到对应的矩阵,添加新的子矩阵 ID m_vectBondMatrixs[i].VecPointMatrixId.push_back(newSubMatrixID); break; // 找到后退出循环 } } AddMatrixPage(bondMatrixId, newSubMatrixIndex, subMatrix, outMatrixGridLayout); }); // Add Delete Out Matrix button QPushButton* pushButtonDelete = new QPushButton(outWidget); pushButtonDelete->setObjectName(QString::fromUtf8("button delete")); pushButtonDelete->setIcon(QIcon(":/images/Program/deleteInner.png")); pushButtonDelete->setToolTip(tr("DeleteOutMatrix", "删除大矩阵")); // 设置鼠标悬停时显示的文字提示 matrixGridLayout->addWidget(pushButtonDelete, 0, 4, 1, 1); connect(pushButtonDelete, &QPushButton::clicked, this, [=]() { //处理index auto currentIt = m_mapOutWidgetIndex.find(outWidget); int index = currentIt.value(); //迭代器 erase后currentIt被删除了 m_mapOutWidgetIndex.erase(currentIt); delete outWidget; ui.comboBoxCurrentMatrix->clear(); for (int i = 0; i < m_vectBondMatrixs.size(); i++) { int bondMatrixId = m_vectBondMatrixs[i].BondMatrixId; // 显示 矩阵编号 QString itemText = QString::number(bondMatrixId); if (bondMatrixId == index) { //删除缓存数据 m_vectBondMatrixs.erase(m_vectBondMatrixs.begin() + i); continue; } // 将 矩阵编号 添加到下拉框 ui.comboBoxCurrentMatrix->addItem(itemText, bondMatrixId); } if (!m_vectBondMatrixs.empty()) { ShowCurrentMatrix(m_vectBondMatrixs[0].BondMatrixId); } }); QLabel* labelRow = new QLabel(outWidget); QLabel* labelLeftTop = new QLabel(outWidget); QLabel* labelRightTopPos = new QLabel(outWidget); QLabel* labelRightButtomPos = new QLabel(outWidget); SpinBox* spinBoxRow = new SpinBox(outWidget); SpinBox* spinBoxCol = new SpinBox(outWidget); DoubleSpinBox* doubleSpinBoxLeftTopX = new DoubleSpinBox(outWidget); DoubleSpinBox* doubleSpinBoxLeftTopY = new DoubleSpinBox(outWidget); DoubleSpinBox* doubleSpinBoxRightTopX = new DoubleSpinBox(outWidget); DoubleSpinBox* doubleSpinBoxRightTopY = new DoubleSpinBox(outWidget); DoubleSpinBox* doubleSpinBoxRightButtomX = new DoubleSpinBox(outWidget); DoubleSpinBox* doubleSpinBoxRightButtomY = new DoubleSpinBox(outWidget); labelRow->setObjectName(QString::fromUtf8("labelRow")); labelLeftTop->setObjectName(QString::fromUtf8("labelLeftTop")); labelRightTopPos->setObjectName(QString::fromUtf8("labelRightTopPos")); labelRightButtomPos->setObjectName(QString::fromUtf8("labelRightButtomPos")); spinBoxRow->setObjectName(QString::fromUtf8("spinBoxRow")); spinBoxCol->setObjectName(QString::fromUtf8("spinBoxCol")); doubleSpinBoxLeftTopX->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopX")); doubleSpinBoxLeftTopY->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopY")); doubleSpinBoxRightTopX->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopX")); doubleSpinBoxRightTopY->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopY")); doubleSpinBoxRightButtomX->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomX")); doubleSpinBoxRightButtomY->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomY")); labelRow->setText(tr("Row & Cow","行 & 列")); labelLeftTop->setText(tr("Left Top Pos ", "左上点")); labelRightTopPos->setText(tr("Right Top Pos ", "右上点")); labelRightButtomPos->setText(tr("Right Buttom pos", "右下点")); spinBoxRow->setValue(matrixData.BondMatrixRow); spinBoxCol->setValue(matrixData.BondMatrixCol); doubleSpinBoxLeftTopX->setValue(matrixData.LeftTopPoint.x); doubleSpinBoxLeftTopY->setValue(matrixData.LeftTopPoint.y); doubleSpinBoxRightTopX->setValue(matrixData.RightTopPoint.x); doubleSpinBoxRightTopY->setValue(matrixData.RightTopPoint.y); doubleSpinBoxRightButtomX->setValue(matrixData.RightBottomPoint.x); doubleSpinBoxRightButtomY->setValue(matrixData.RightBottomPoint.y); //spinBoxRow->setFixedWidth(95); // Set fixed width to 95 //spinBoxCol->setFixedWidth(95); // Set fixed width to 95 //doubleSpinBoxLeftTopX->setFixedWidth(95); // Set fixed width to 95 //doubleSpinBoxLeftTopY->setFixedWidth(95); // Set fixed width to 95 //doubleSpinBoxRightTopX->setFixedWidth(95); // Set fixed width to 95 //doubleSpinBoxRightTopY->setFixedWidth(95); // Set fixed width to 95 //doubleSpinBoxRightButtomX->setFixedWidth(95); // Set fixed width to 95 //doubleSpinBoxRightButtomY->setFixedWidth(95); // Set fixed width to 95 matrixGridLayout->addWidget(labelRow, 2, 0, 1, 1); matrixGridLayout->addWidget(spinBoxRow, 2, 1, 1, 1); matrixGridLayout->addWidget(spinBoxCol, 2, 2, 1, 1); matrixGridLayout->addWidget(labelLeftTop, 4, 0, 1, 1); matrixGridLayout->addWidget(doubleSpinBoxLeftTopX, 4, 1, 1, 1); matrixGridLayout->addWidget(doubleSpinBoxLeftTopY, 4, 2, 1, 1); matrixGridLayout->addWidget(labelRightTopPos, 5, 0, 1, 1); matrixGridLayout->addWidget(doubleSpinBoxRightTopX, 5, 1, 1, 1); matrixGridLayout->addWidget(doubleSpinBoxRightTopY, 5, 2, 1, 1); matrixGridLayout->addWidget(labelRightButtomPos, 6, 0, 1, 1); matrixGridLayout->addWidget(doubleSpinBoxRightButtomX, 6, 1, 1, 1); matrixGridLayout->addWidget(doubleSpinBoxRightButtomY, 6, 2, 1, 1); vecControls.push_back(labelRow); vecControls.push_back(labelLeftTop); vecControls.push_back(labelRightTopPos); vecControls.push_back(labelRightButtomPos); vecControls.push_back(spinBoxRow); vecControls.push_back(spinBoxCol); vecControls.push_back(doubleSpinBoxLeftTopX); vecControls.push_back(doubleSpinBoxLeftTopY); vecControls.push_back(doubleSpinBoxRightTopX); vecControls.push_back(doubleSpinBoxRightTopY); vecControls.push_back(doubleSpinBoxRightButtomX); vecControls.push_back(doubleSpinBoxRightTopX); connect(spinBoxRow, &SpinBox::editDone, this, [=]() { m_vectBondMatrixs[vectorIndex].BondMatrixRow = spinBoxRow->value(); }); connect(spinBoxCol, &SpinBox::editDone, this, [=]() { m_vectBondMatrixs[vectorIndex].BondMatrixCol = spinBoxCol->value(); }); connect(doubleSpinBoxLeftTopX, &DoubleSpinBox::editDone, this, [=]() { m_vectBondMatrixs[vectorIndex].LeftTopPoint.x = doubleSpinBoxLeftTopX->value(); }); connect(doubleSpinBoxLeftTopY, &DoubleSpinBox::editDone, this, [=]() { m_vectBondMatrixs[vectorIndex].LeftTopPoint.y = doubleSpinBoxLeftTopY->value(); }); connect(doubleSpinBoxRightTopX, &DoubleSpinBox::editDone, this, [=]() { m_vectBondMatrixs[vectorIndex].RightTopPoint.x = doubleSpinBoxRightTopX->value(); }); connect(doubleSpinBoxRightTopY, &DoubleSpinBox::editDone, this, [=]() { m_vectBondMatrixs[vectorIndex].RightTopPoint.y = doubleSpinBoxRightTopY->value(); }); connect(doubleSpinBoxRightButtomX, &DoubleSpinBox::editDone, this, [=]() { m_vectBondMatrixs[vectorIndex].RightBottomPoint.x = doubleSpinBoxRightButtomX->value(); }); connect(doubleSpinBoxRightButtomY, &DoubleSpinBox::editDone, this, [=]() { m_vectBondMatrixs[vectorIndex].RightBottomPoint.y = doubleSpinBoxRightButtomY->value(); }); // Add GP button for Left Top QPushButton* buttonLeftTop = new QPushButton(this); QPushButton* buttonMoveToLeftTop = new QPushButton(this); QPushButton* buttonRightTop = new QPushButton(this); QPushButton* buttonMoveToRightTop = new QPushButton(this); QPushButton* buttonRightButtom = new QPushButton(this); QPushButton* buttonMoveToRightButtom = new QPushButton(this); matrixGridLayout->addWidget(buttonLeftTop, 4, 3, 1, 1); // Position the button next to LeftTopPos matrixGridLayout->addWidget(buttonRightTop, 5, 3, 1, 1); // Position the button next to RightTopPos matrixGridLayout->addWidget(buttonRightButtom, 6, 3, 1, 1); // Position the button next to RightBottomPos matrixGridLayout->addWidget(buttonMoveToLeftTop, 4, 4, 1, 1); // Position the button next to LeftTopPos matrixGridLayout->addWidget(buttonMoveToRightTop, 5, 4, 1, 1); matrixGridLayout->addWidget(buttonMoveToRightButtom, 6, 4, 1, 1); buttonLeftTop->setFixedWidth(31); // Set the same width for the button buttonRightTop->setFixedWidth(31); // Set the same width for the button buttonRightButtom->setFixedWidth(31); // Set the same width for the button buttonMoveToLeftTop->setFixedWidth(31); // Set the same width for the button buttonMoveToRightTop->setFixedWidth(31); buttonMoveToRightButtom->setFixedWidth(31); buttonLeftTop->setToolTip(tr("GetBondAxisPosition", "设置左上点为当前坐标")); buttonRightTop->setToolTip(tr("GetBondAxisPosition", "设置右上点为当前坐标")); buttonRightButtom->setToolTip(tr("GetBondAxisPosition", "设置右下点为当前坐标")); buttonMoveToLeftTop->setToolTip(tr("MoveToPosition", "移动到左上点")); buttonMoveToRightTop->setToolTip(tr("MoveToRightTop", "移动到右上点")); buttonMoveToRightButtom->setToolTip(tr("MoveToRightTop", "移动到右下点")); buttonLeftTop->setIcon(QIcon(":/images/Program/getPos.png")); buttonMoveToLeftTop->setIcon(QIcon(":/images/Program/moveTo.png")); buttonRightTop->setIcon(QIcon(":/images/Program/getPos.png")); buttonMoveToRightTop->setIcon(QIcon(":/images/Program/moveTo.png")); buttonRightButtom->setIcon(QIcon(":/images/Program/getPos.png")); buttonMoveToRightButtom->setIcon(QIcon(":/images/Program/moveTo.png")); connect(buttonLeftTop, &QPushButton::clicked, this, [=]() { XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondHead", m_vectBondMatrixs[vectorIndex].LeftTopPoint); doubleSpinBoxLeftTopX->setValue(position.x); doubleSpinBoxLeftTopY->setValue(position.y); }); connect(buttonMoveToLeftTop, &QPushButton::clicked, this, [=]() { XY_DOUBLE_STRUCT position = BondMoveToXYAxisPosition("BondHead", m_vectBondMatrixs[vectorIndex].LeftTopPoint); }); connect(buttonRightTop, &QPushButton::clicked, this, [=]() { XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondHead", m_vectBondMatrixs[vectorIndex].RightTopPoint); doubleSpinBoxRightTopX->setValue(position.x); doubleSpinBoxRightTopY->setValue(position.y); }); connect(buttonMoveToRightTop, &QPushButton::clicked, this, [=]() { XY_DOUBLE_STRUCT position = BondMoveToXYAxisPosition("BondHead", m_vectBondMatrixs[vectorIndex].RightTopPoint); }); connect(buttonRightButtom, &QPushButton::clicked, this, [=]() { XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondHead", m_vectBondMatrixs[vectorIndex].RightBottomPoint); doubleSpinBoxRightButtomX->setValue(position.x); doubleSpinBoxRightButtomY->setValue(position.y); }); connect(buttonMoveToRightButtom, &QPushButton::clicked, this, [=]() { XY_DOUBLE_STRUCT position = BondMoveToXYAxisPosition("BondHead", m_vectBondMatrixs[vectorIndex].RightBottomPoint); }); // Add No Bond Points line edit QLabel* labelNoBondPts = new QLabel(outWidget); labelNoBondPts->setObjectName(QString::fromUtf8("labelNoBondPts")); labelNoBondPts->setText(tr("No Bond Points", "不固晶点")); matrixGridLayout->addWidget(labelNoBondPts, 7, 0, 1, 1); vecControls.push_back(labelNoBondPts); QStringList ptList; for (const auto& pt : m_vectBondMatrixs[vectorIndex].VecNoBondPt) ptList << QString("(%1,%2)").arg(pt.x).arg(pt.y); QLineEdit* lineEditNoBondPts = new QLineEdit(outWidget); lineEditNoBondPts->setObjectName(QString::fromUtf8("lineEditNoBondPts")); lineEditNoBondPts->setReadOnly(true); lineEditNoBondPts->setCursor(Qt::PointingHandCursor); lineEditNoBondPts->setProperty("vectorIndex", vectorIndex); // 存储索引 lineEditNoBondPts->setProperty("parentMatrixIndex", -1); // 设置父矩阵的索引 lineEditNoBondPts->installEventFilter(this); lineEditNoBondPts->setText(ptList.join(" ")); matrixGridLayout->addWidget(lineEditNoBondPts, 7, 1, 1, 4); vecControls.push_back(lineEditNoBondPts); connect(lineEditNoBondPts, &QLineEdit::textChanged, this, [=]() { }); // Paragram line edit QLabel* labelParagram = new QLabel(outWidget); labelParagram->setObjectName(QString::fromUtf8("labelParagram")); labelParagram->setText(tr("ParagramSet", "参数集")); matrixGridLayout->addWidget(labelParagram, 8, 0, 1, 1); vecControls.push_back(labelParagram); CustomComboBox* comboBoxParagramSet = new CustomComboBox(outWidget); comboBoxParagramSet->setObjectName(QString::fromUtf8("comboBoxParagramSet")); m_mapParagramSetComboBox.insert(comboBoxParagramSet, matrixData.BondMatrixId); // 添加选项到下拉框并关联 iInfoId for (const auto& bondMatrix : m_vecBondInfoData) { // 将 iInfoId 作为显示项添加到下拉框 QString itemText = QString::number(bondMatrix.iInfoId); // 显示编号 iInfoId // 添加项并使用 setData 存储 iInfoId 作为附加数据 comboBoxParagramSet->addItem(itemText, bondMatrix.iInfoId); } comboBoxParagramSet->setCurrentIndex(comboBoxParagramSet->findData(matrixData.BondInfoId)); // 设置默认项 ui.comboBoxCurrentPara->setCurrentIndex(ui.comboBoxCurrentPara->findData(matrixData.BondInfoId)); // 设置默认项 // 将下拉框添加到布局中 matrixGridLayout->addWidget(comboBoxParagramSet, 8, 1, 1, 1); // 将控件保存到 vecControls 中 vecControls.push_back(comboBoxParagramSet); // 连接 QComboBox 的信号和槽 connect(comboBoxParagramSet, SIGNAL(currentIndexChanged(int)), this, SLOT(onComboBoxIndexChangedForMatrixParam(int))); comboBoxParagramSet->installEventFilter(this); //QPushButton* buttonParagram = new QPushButton("ShowParagram", this); ////buttonParagram->setFixedWidth(31); // Set the same width for the button //matrixGridLayout->addWidget(buttonParagram, 8, 2, 1, 2); // Position the button next to RightBottomPos //connect(buttonParagram, &QPushButton::clicked, this, [=]() { // UpdateShowBondInfoData(m_vectBondMatrixs[vectorIndex].BondInfoId); // }); QFrame* line = new QFrame(outWidget); line->setFrameShape(QFrame::NoFrame); // 移除默认框架 line->setFixedHeight(2); // 设置固定高度 line->setStyleSheet("background-color: #C7CAEB;"); boxGridLayout->addLayout(matrixGridLayout, 2, 0); boxGridLayout->addWidget(line); //outMatrixGridLayout->addLayout(buttonLayout, 1, 0); outMatrixGridLayout->addWidget(groupBox); outWidget->setLayout(outMatrixGridLayout); ui.verticalLayout_3->addWidget(outWidget); ui.verticalLayout_3->setContentsMargins(0, 0, 0, 0); // Adjust margins if necessary ui.verticalLayout_3->setAlignment(Qt::AlignTop | Qt::AlignLeft); // Align the layout to the top-left m_mapOutWidgetIndex.insert(outWidget, matrixData.BondMatrixId); // Add Sub Matrices for (int j = 0; j < matrixData.VecPointMatrixId.size(); j++) { for (int i = 0; i < m_vecSubMatrixs.size(); i++) { if (matrixData.VecPointMatrixId[j] == m_vecSubMatrixs[i].MatrixId) { AddMatrixPage(j, i, m_vecSubMatrixs[i], outMatrixGridLayout); } } } // Add all controls and finalize layout /*outWidget->setLayout(outMatrixGridLayout); ui.scrollArea_2->setLayout(outMatrixGridLayout);*/ } void BondMatrixProgramPage::onComboBoxPopupBondInfo(QComboBox* comboBox) { if (!comboBox) { return; } int currentIndex = comboBox->currentIndex(); // 获取当前选中的索引 QVariant currentData = comboBox->currentData(); // 获取当前选中的附加数据(例如 iInfoId) // 清空下拉框中的所有项 comboBox->clear(); // 重新填充下拉框选项,并更新 QMap 中的绑定关系 for (const auto& bondMatrix : m_vecBondInfoData) { // 显示编号 iInfoId QString itemText = QString::number(bondMatrix.iInfoId); // 将 iInfoId 添加到下拉框 comboBox->addItem(itemText, bondMatrix.iInfoId); } // 恢复原来的选中项 if (currentData.isValid()) { // 通过 currentData 恢复选中项 int index = comboBox->findData(currentData); if (index >= 0) { comboBox->setCurrentIndex(index); // 设置当前选中项 } } //UINT iInfoId = currentData.toUInt(); // 将 currentData 转换为 UINT //UpdateShowBondInfoData(iInfoId); } void BondMatrixProgramPage::ShowCurrentMatrix(int bondMatrixId) { // 遍历 comboBox 中的项,找到与 bondMatrixId 匹配的项的索引 int index = -1; for (int i = 0; i < ui.comboBoxCurrentMatrix->count(); ++i) { if (ui.comboBoxCurrentMatrix->itemData(i).toInt() == bondMatrixId) { index = i; // 找到对应的索引 break; } } // 如果找到了对应的索引,则设置为当前选中的项 if (index != -1) { ui.comboBoxCurrentMatrix->setCurrentIndex(index); } // 清空布局内容并隐藏之前的控件 QLayoutItem* item; while ((item = ui.verticalLayout_3->takeAt(0)) != nullptr) { QWidget* widget = item->widget(); if (widget) { widget->hide(); // 隐藏控件,而不是删除它 } delete item; // 删除布局项 } // 查找对应矩阵的控件 QWidget* outWidget = nullptr; // 遍历 m_mapOutWidgetIndex 查找对应的 QWidget for (auto it = m_mapOutWidgetIndex.begin(); it != m_mapOutWidgetIndex.end(); ++it) { if (it.value() == bondMatrixId) { // 找到对应的矩阵索引 outWidget = it.key(); // 获取对应的 QWidget break; } } // 找到并添加 outWidget if (outWidget && ui.verticalLayout_3->indexOf(outWidget) == -1) { ui.verticalLayout_3->addWidget(outWidget); outWidget->show(); // 显示控件 } // 最后加 back 一个 vSpacer ui.verticalLayout_3->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); int selectedBondInfoId = -1; for (int i = 0; i < m_vectBondMatrixs.size(); ++i) { if (m_vectBondMatrixs[i].BondMatrixId == bondMatrixId) { selectedBondInfoId = m_vectBondMatrixs[i].BondInfoId; break; } } UpdateShowBondInfoData(selectedBondInfoId); } void BondMatrixProgramPage::onComboBoxCurrentMatrixChanged(int index) { // 判断 index 是否有效 if (index < 0 || index >= ui.comboBoxCurrentMatrix->count()) return; // 获取当前选项的 bondMatrixId int bondMatrixId = ui.comboBoxCurrentMatrix->itemData(index).toInt(); ShowCurrentMatrix(bondMatrixId); // 调用 ShowCurrentMatrix 更新显示 } //void BondMatrixProgramPage::ShowCurrentMatrix(int bondMatrixId) //{ // // 遍历 comboBox 中的项,找到与 bondMatrixId 匹配的项的索引 // int index = -1; // for (int i = 0; i < ui.comboBoxCurrentMatrix->count(); ++i) { // if (ui.comboBoxCurrentMatrix->itemData(i).toInt() == bondMatrixId) { // index = i; // 找到对应的索引 // break; // } // } // // // 如果找到了对应的索引,则设置为当前选中的项 // if (index != -1) { // ui.comboBoxCurrentMatrix->setCurrentIndex(index); // } // // // 清光布局内容 // QLayoutItem* item; // while ((item = ui.verticalLayout_3->takeAt(0)) != nullptr) { // QWidget* widget = item->widget(); // if (widget) { // widget->setParent(nullptr); // } // delete item; // } // // // 查找对应矩阵的控件 // QWidget* outWidget = nullptr; // // // 遍历 m_mapOutWidgetIndex 查找对应的 QWidget // for (auto it = m_mapOutWidgetIndex.begin(); it != m_mapOutWidgetIndex.end(); ++it) { // if (it.value() == bondMatrixId) { // 找到对应的矩阵索引 // outWidget = it.key(); // 获取对应的 QWidget // break; // } // } // // // 找到并添加 outWidget // if (outWidget && ui.verticalLayout_3->indexOf(outWidget) == -1) { // ui.verticalLayout_3->addWidget(outWidget); // } // // // 最后加 back 一个 vSpacer // ui.verticalLayout_3->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); //} // //void BondMatrixProgramPage::onComboBoxCurrentMatrixChanged(int index) //{ // // 判断index有效 // if (index < 0 || index >= ui.comboBoxCurrentMatrix->count()) // return; // // // 获取当前选项的 bondMatrixId // int bondMatrixId = ui.comboBoxCurrentMatrix->itemData(index).toInt(); // ShowCurrentMatrix(bondMatrixId); //} void BondMatrixProgramPage::onComboBoxIndexChangedForMatrixParam(int index) { // 获取当前选中的 QComboBox QComboBox* comboBox = qobject_cast(sender()); if (!comboBox) { return; } // 获取当前选中的 BondInfoId UINT selectedBondInfoId = comboBox->currentData().toUInt(); // 获取当前 QComboBox 对应的 matrixId int matrixId = m_mapParagramSetComboBox.value(comboBox, -1); // 从 QMap 中获取 vectorIndex if (matrixId > 0) { // 更新 m_vectBondMatrixs[vectorIndex].BondInfoId for (int i = 0; i < m_vectBondMatrixs.size(); i++) { if (m_vectBondMatrixs[i].BondMatrixId == matrixId) { m_vectBondMatrixs[i].BondInfoId = selectedBondInfoId; break; } } } // 调用 UpdateShowBondInfoData 更新数据 UpdateShowBondInfoData(selectedBondInfoId); } void BondMatrixProgramPage::onComboBoxIndexChangedForParam(int index) { // 获取当前选中的 QComboBox QComboBox* comboBox = qobject_cast(sender()); if (!comboBox) { return; } // 获取当前选中的 BondInfoId UINT selectedBondInfoId = comboBox->currentData().toUInt(); // 调用 UpdateShowBondInfoData 更新数据 UpdateShowBondInfoData(selectedBondInfoId); } void BondMatrixProgramPage::AddMatrixPage(int vectorIndex, int subVectorIndex, PROGRAM_POINT_MATRIX_STRUCT subMatrix, QGridLayout* layout) { QVector vecControls; QWidget* subWidget = new QWidget(); QGridLayout* subGridLayout = new QGridLayout(subWidget); subGridLayout->setSpacing(4); subGridLayout->setObjectName(QString::fromUtf8("subGridLayout")); //groupBox->setLayout(subGridLayout); subGridLayout->setContentsMargins(0, 0, 0, 0); // 设置布局的边距为0 subGridLayout->setAlignment(Qt::AlignCenter); QLabel* labelTitle = new QLabel(subWidget); labelTitle->setObjectName(QString::fromUtf8("labelTitle")); labelTitle->setText(tr("Sub Matrix ", "子矩阵 ") + QString::number(subVectorIndex)); labelTitle->setStyleSheet("color: #808BFF;height: 30px"); subGridLayout->addWidget(labelTitle, 0, 1, 1, 1); vecControls.push_back(labelTitle); QPushButton* pushButtonDelete = new QPushButton(subWidget); pushButtonDelete->setObjectName(QString::fromUtf8("button delete")); pushButtonDelete->setToolTip(tr("DeleteSubMatrix", "删除子矩阵")); pushButtonDelete->setIcon(QIcon(":/images/Program/deleteInner.png")); subGridLayout->addWidget(pushButtonDelete, 0, 4, 1, 1); connect(pushButtonDelete, &QPushButton::clicked, this, [=]() { //处理index auto currentIt = m_mapSubWidgetIndex.find(subWidget); int index = currentIt.value(); //迭代器 erase后currentIt被删除了 m_mapSubWidgetIndex.erase(currentIt); for (auto it = m_mapSubWidgetIndex.begin(); it != m_mapSubWidgetIndex.end(); ++it) { if (it.value() > index) { //value() 返回的是副本不是引用 int newIndex = it.value() - 1; m_mapSubWidgetIndex.insert(it.key(), newIndex); } } // 子矩阵ID int subMatrixId = m_vecSubMatrixs[index].MatrixId; //删除缓存 m_vecSubMatrixs.erase(m_vecSubMatrixs.begin() + index); //删除大矩阵子ID数据(遍历删除) for (PROGRAM_BOND_MATRIX_STRUCT& matrix : m_vectBondMatrixs) { auto it = std::find(matrix.VecPointMatrixId.begin(), matrix.VecPointMatrixId.end(), subMatrixId); if (it != matrix.VecPointMatrixId.end()) { matrix.VecPointMatrixId.erase(it); } } delete subWidget; }); QLabel* labelRow = new QLabel(subWidget); labelRow->setObjectName(QString::fromUtf8("labelRow")); labelRow->setText(tr("Row & Cow", "行 & 列")); subGridLayout->addWidget(labelRow, 2, 0, 1, 1); vecControls.push_back(labelRow); SpinBox* spinBoxRow = new SpinBox(subWidget); spinBoxRow->setObjectName(QString::fromUtf8("spinBoxRow")); subGridLayout->addWidget(spinBoxRow, 2, 1, 1, 1); vecControls.push_back(spinBoxRow); SpinBox* spinBoxCol = new SpinBox(subWidget); spinBoxCol->setObjectName(QString::fromUtf8("spinBoxCol")); subGridLayout->addWidget(spinBoxCol, 2, 2, 1, 1); vecControls.push_back(spinBoxCol); QLabel* labelLeftTop = new QLabel(subWidget); labelLeftTop->setObjectName(QString::fromUtf8("labelLeftTop")); labelLeftTop->setText(tr("Left Top Pos","左上点")); subGridLayout->addWidget(labelLeftTop, 4, 0, 1, 1); vecControls.push_back(labelLeftTop); DoubleSpinBox* doubleSpinBoxLeftTopX = new DoubleSpinBox(subWidget); doubleSpinBoxLeftTopX->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopX")); //doubleSpinBoxLeftTopX->setFixedWidth(95); // Set fixed width to 95 subGridLayout->addWidget(doubleSpinBoxLeftTopX, 4, 1, 1, 1); vecControls.push_back(doubleSpinBoxLeftTopX); DoubleSpinBox* doubleSpinBoxLeftTopY = new DoubleSpinBox(subWidget); doubleSpinBoxLeftTopY->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopY")); //doubleSpinBoxLeftTopY->setFixedWidth(95); // Set fixed width to 95 subGridLayout->addWidget(doubleSpinBoxLeftTopY, 4, 2, 1, 1); vecControls.push_back(doubleSpinBoxLeftTopY); QLabel* labelRightTopPos = new QLabel(subWidget); labelRightTopPos->setObjectName(QString::fromUtf8("labelRightTopPos")); labelRightTopPos->setText(tr("Right Top Pos ", "右上点")); subGridLayout->addWidget(labelRightTopPos, 5, 0, 1, 1); vecControls.push_back(labelRightTopPos); DoubleSpinBox* doubleSpinBoxRightTopX = new DoubleSpinBox(subWidget); doubleSpinBoxRightTopX->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopX")); //doubleSpinBoxRightTopX->setFixedWidth(95); // Set fixed width to 95 subGridLayout->addWidget(doubleSpinBoxRightTopX, 5, 1, 1, 1); vecControls.push_back(doubleSpinBoxRightTopX); DoubleSpinBox* doubleSpinBoxRightTopY = new DoubleSpinBox(subWidget); doubleSpinBoxRightTopY->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopY")); //doubleSpinBoxRightTopY->setFixedWidth(95); // Set fixed width to 95 subGridLayout->addWidget(doubleSpinBoxRightTopY, 5, 2, 1, 1); vecControls.push_back(doubleSpinBoxRightTopY); QLabel* labelRightButtomPos = new QLabel(subWidget); labelRightButtomPos->setObjectName(QString::fromUtf8("labelRightButtomPos")); labelRightButtomPos->setText(tr("Right Buttom pos", "右下点")); subGridLayout->addWidget(labelRightButtomPos, 6, 0, 1, 1); vecControls.push_back(labelRightButtomPos); DoubleSpinBox* doubleSpinBoxRightButtomX = new DoubleSpinBox(subWidget); doubleSpinBoxRightButtomX->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomX")); //doubleSpinBoxRightButtomX->setFixedWidth(95); // Set fixed width to 95 subGridLayout->addWidget(doubleSpinBoxRightButtomX, 6, 1, 1, 1); vecControls.push_back(doubleSpinBoxRightButtomX); DoubleSpinBox* doubleSpinBoxRightButtomY = new DoubleSpinBox(subWidget); doubleSpinBoxRightButtomY->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomY")); //doubleSpinBoxRightButtomY->setFixedWidth(95); // Set fixed width to 95 subGridLayout->addWidget(doubleSpinBoxRightButtomY, 6, 2, 1, 1); vecControls.push_back(doubleSpinBoxRightTopX); QLabel* labelNoBondPts = new QLabel(subWidget); labelNoBondPts->setObjectName(QString::fromUtf8("labelNoBondPts")); labelNoBondPts->setText(tr("No Bond Points", "不固晶点")); subGridLayout->addWidget(labelNoBondPts, 7, 0, 1, 1); vecControls.push_back(labelNoBondPts); QLineEdit* lineEditNoBondPts = new QLineEdit(subWidget); lineEditNoBondPts->setObjectName(QString::fromUtf8("lineEditNoBondPts")); lineEditNoBondPts->setReadOnly(true); lineEditNoBondPts->setCursor(Qt::PointingHandCursor); lineEditNoBondPts->setProperty("vectorIndex", subVectorIndex); // 存储索引 lineEditNoBondPts->setProperty("parentMatrixIndex", vectorIndex); // 设置父矩阵的索引 lineEditNoBondPts->installEventFilter(this); QStringList ptList; for (const auto& pt : m_vecSubMatrixs[subVectorIndex].VecNoBondPt) ptList << QString("(%1,%2)").arg(pt.x).arg(pt.y); lineEditNoBondPts->setText(ptList.join(" ")); subGridLayout->addWidget(lineEditNoBondPts, 7, 1, 1, 3); vecControls.push_back(lineEditNoBondPts); // Left Top Position X and Y QPushButton* buttonLeftTop = new QPushButton(subWidget); buttonLeftTop->setFixedWidth(31); // 设置固定宽度 subGridLayout->addWidget(buttonLeftTop, 4, 3, 1, 1); // 添加按钮到4行3列 connect(buttonLeftTop, &QPushButton::clicked, this, [=]() { XY_DOUBLE_STRUCT positionPlus = BondGetAxisPosition("BondHead", m_vecSubMatrixs[subVectorIndex].LeftTopPoint); m_vecSubMatrixs[subVectorIndex].LeftTopPoint.x = m_vectBondMatrixs[vectorIndex].LeftTopPoint.x - positionPlus.x; m_vecSubMatrixs[subVectorIndex].LeftTopPoint.y = m_vectBondMatrixs[vectorIndex].LeftTopPoint.y - positionPlus.y; doubleSpinBoxLeftTopX->setValue(m_vecSubMatrixs[subVectorIndex].LeftTopPoint.x); // 更新 X 轴 doubleSpinBoxLeftTopY->setValue(m_vecSubMatrixs[subVectorIndex].LeftTopPoint.y); // 更新 Y 轴 }); QPushButton* buttonMoveToLeftTop = new QPushButton(subWidget); buttonMoveToLeftTop->setFixedWidth(31); // 设置固定宽度 subGridLayout->addWidget(buttonMoveToLeftTop, 4, 4, 1, 1); // 添加按钮到4行3列 connect(buttonMoveToLeftTop, &QPushButton::clicked, this, [=]() { XY_DOUBLE_STRUCT position; position.x= m_vecSubMatrixs[subVectorIndex].LeftTopPoint.x + m_vectBondMatrixs[vectorIndex].LeftTopPoint.x; position.y= m_vecSubMatrixs[subVectorIndex].LeftTopPoint.y + m_vectBondMatrixs[vectorIndex].LeftTopPoint.y; position = BondMoveToXYAxisPosition("BondHead", position); }); // Right Top Position X and Y QPushButton* buttonRightTop = new QPushButton(subWidget); buttonRightTop->setFixedWidth(31); // 设置固定宽度 subGridLayout->addWidget(buttonRightTop, 5, 3, 1, 1); // 添加按钮到5行3列 connect(buttonRightTop, &QPushButton::clicked, this, [=]() { XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondHead", m_vecSubMatrixs[subVectorIndex].RightTopPoint); m_vecSubMatrixs[subVectorIndex].RightTopPoint.x = m_vectBondMatrixs[vectorIndex].RightTopPoint.x - position.x; m_vecSubMatrixs[subVectorIndex].RightTopPoint.y = m_vectBondMatrixs[vectorIndex].RightTopPoint.y - position.y; doubleSpinBoxRightTopX->setValue(position.x); // 更新 X 轴 doubleSpinBoxRightTopY->setValue(position.y); // 更新 Y 轴 }); QPushButton* buttonMoveToRightTop = new QPushButton(subWidget); buttonMoveToRightTop->setFixedWidth(31); // 设置固定宽度 subGridLayout->addWidget(buttonMoveToRightTop, 5, 4, 1, 1); // 添加按钮到4行3列 connect(buttonMoveToRightTop, &QPushButton::clicked, this, [=]() { XY_DOUBLE_STRUCT position = {}; position.x = m_vecSubMatrixs[subVectorIndex].RightTopPoint.x + m_vectBondMatrixs[vectorIndex].RightTopPoint.x; position.y = m_vecSubMatrixs[subVectorIndex].RightTopPoint.y + m_vectBondMatrixs[vectorIndex].RightTopPoint.y; position = BondMoveToXYAxisPosition("BondHead", position); }); // Right Bottom Position X and Y QPushButton* buttonRightButtom = new QPushButton(subWidget); buttonRightButtom->setFixedWidth(31); // 设置固定宽度 subGridLayout->addWidget(buttonRightButtom, 6, 3, 1, 1); // 添加按钮到6行3列 connect(buttonRightButtom, &QPushButton::clicked, this, [=]() { XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondHead", m_vecSubMatrixs[subVectorIndex].RightBottomPoint); m_vecSubMatrixs[subVectorIndex].RightBottomPoint.x = m_vectBondMatrixs[vectorIndex].RightBottomPoint.x - position.x; m_vecSubMatrixs[subVectorIndex].RightBottomPoint.y = m_vectBondMatrixs[vectorIndex].RightBottomPoint.y - position.y; doubleSpinBoxRightButtomX->setValue(position.x); // 更新 X 轴 doubleSpinBoxRightButtomY->setValue(position.y); // 更新 Y 轴 }); QPushButton* buttonMoveToRightButtom = new QPushButton(subWidget); buttonMoveToRightButtom->setFixedWidth(31); // 设置固定宽度 subGridLayout->addWidget(buttonMoveToRightButtom, 6, 4, 1, 1); // 添加按钮到4行3列 connect(buttonMoveToRightButtom, &QPushButton::clicked, this, [=]() { XY_DOUBLE_STRUCT position; position.x = m_vecSubMatrixs[subVectorIndex].RightBottomPoint.x + m_vectBondMatrixs[vectorIndex].RightBottomPoint.x; position.y = m_vecSubMatrixs[subVectorIndex].RightBottomPoint.y + m_vectBondMatrixs[vectorIndex].RightBottomPoint.y; position = BondMoveToXYAxisPosition("BondHead", position); }); //layout->addLayout(subGridLayout, 11, 0); QFrame* line = new QFrame(subWidget); line->setFrameShape(QFrame::NoFrame); // 移除默认框架 line->setFixedHeight(2); // 设置固定高度 line->setStyleSheet("background-color: #C7CAEB;"); subGridLayout->addWidget(line, 10, 0, 1, 4); buttonLeftTop->setToolTip(tr("GetBondAxisPosition", "设置左上点为当前坐标")); buttonRightTop->setToolTip(tr("GetBondAxisPosition", "设置右上点为当前坐标")); buttonRightButtom->setToolTip(tr("GetBondAxisPosition", "设置右下点为当前坐标")); buttonMoveToLeftTop->setToolTip(tr("MoveToPosition", "移动到左上点")); buttonMoveToRightTop->setToolTip(tr("MoveToRightTop", "移动到右上点")); buttonMoveToRightButtom->setToolTip(tr("MoveToRightTop", "移动到右下点")); buttonLeftTop->setIcon(QIcon(":/images/Program/getPos.png")); buttonMoveToLeftTop->setIcon(QIcon(":/images/Program/moveTo.png")); buttonRightTop->setIcon(QIcon(":/images/Program/getPos.png")); buttonMoveToRightTop->setIcon(QIcon(":/images/Program/moveTo.png")); buttonRightButtom->setIcon(QIcon(":/images/Program/getPos.png")); buttonMoveToRightButtom->setIcon(QIcon(":/images/Program/moveTo.png")); spinBoxRow->setValue(subMatrix.MatrixRow); spinBoxCol->setValue(subMatrix.MatrixCol); doubleSpinBoxLeftTopX->setValue(subMatrix.LeftTopPoint.x); doubleSpinBoxLeftTopY->setValue(subMatrix.LeftTopPoint.y); doubleSpinBoxRightTopX->setValue(subMatrix.RightTopPoint.x); doubleSpinBoxRightTopY->setValue(subMatrix.RightTopPoint.y); doubleSpinBoxRightButtomX->setValue(subMatrix.RightBottomPoint.x); doubleSpinBoxRightButtomY->setValue(subMatrix.RightBottomPoint.y); layout->addWidget(subWidget); m_mapSubWidgetIndex.insert(subWidget, subVectorIndex); connect(spinBoxRow, &SpinBox::editDone, this, [=]() { auto it = m_mapSubWidgetIndex.find(subWidget); m_vecSubMatrixs[it.value()].MatrixRow = spinBoxRow->value(); }); connect(spinBoxCol, &SpinBox::editDone, this, [=]() { auto it = m_mapSubWidgetIndex.find(subWidget); m_vecSubMatrixs[it.value()].MatrixCol = spinBoxCol->value(); }); connect(doubleSpinBoxLeftTopX, &DoubleSpinBox::editDone, this, [=]() { auto it = m_mapSubWidgetIndex.find(subWidget); m_vecSubMatrixs[it.value()].LeftTopPoint.x = doubleSpinBoxLeftTopX->value(); }); connect(doubleSpinBoxLeftTopY, &DoubleSpinBox::editDone, this, [=]() { auto it = m_mapSubWidgetIndex.find(subWidget); m_vecSubMatrixs[it.value()].LeftTopPoint.y = doubleSpinBoxLeftTopY->value(); }); connect(doubleSpinBoxRightTopX, &DoubleSpinBox::editDone, this, [=]() { auto it = m_mapSubWidgetIndex.find(subWidget); m_vecSubMatrixs[it.value()].RightTopPoint.x = doubleSpinBoxRightTopX->value(); }); connect(doubleSpinBoxRightTopY, &DoubleSpinBox::editDone, this, [=]() { auto it = m_mapSubWidgetIndex.find(subWidget); m_vecSubMatrixs[it.value()].RightTopPoint.y = doubleSpinBoxRightTopY->value(); }); connect(doubleSpinBoxRightButtomX, &DoubleSpinBox::editDone, this, [=]() { auto it = m_mapSubWidgetIndex.find(subWidget); m_vecSubMatrixs[it.value()].RightBottomPoint.x = doubleSpinBoxRightButtomX->value(); }); connect(doubleSpinBoxRightButtomY, &DoubleSpinBox::editDone, this, [=]() { auto it = m_mapSubWidgetIndex.find(subWidget); m_vecSubMatrixs[it.value()].RightBottomPoint.y = doubleSpinBoxRightButtomY->value(); }); connect(lineEditNoBondPts, &QLineEdit::textChanged, this, [=]() { auto it = m_mapSubWidgetIndex.find(subWidget); }); } bool BondMatrixProgramPage::eventFilter(QObject* obj, QEvent* event) { // 捕获鼠标点击事件(QEvent::MouseButtonPress) if (event->type() == QEvent::MouseButtonPress) { // 处理 QComboBox 的点击事件 auto* comboBox = qobject_cast(obj); if (comboBox) { // 当BondInfo 的 QComboBox 被点击时执行 onComboBoxPopupBondInfo() if (comboBox == ui.comboBoxCurrentPara || comboBox->objectName() == QString::fromUtf8("comboBoxParagramSet")) { //if (m_isBondInfoParaChange == true) { onComboBoxPopupBondInfo(comboBox); m_isBondInfoParaChange = false; } return false; // 拦截事件,防止进一步传播 } //其他组件单独控制 } // 处理 QLineEdit 的点击事件 auto* lineEdit = qobject_cast(obj); if (lineEdit) { // lineEditNoBondPts 点击事件 if (lineEdit->objectName() == QString::fromUtf8("lineEditNoBondPts")) { int index = lineEdit->property("vectorIndex").toInt(); // 当前矩阵索引 int parentIndex = lineEdit->property("parentMatrixIndex").toInt(); // 父矩阵索引 onNoBondPtsClicked(lineEdit, index, parentIndex); // 传递父矩阵索引 return true; // 拦截事件 } //其他组件点击事件 } } // 捕获鼠标滚轮事件(QEvent::Wheel) if (event->type() == QEvent::Wheel) { auto* comboBox = qobject_cast(obj); if (comboBox) { // 阻止滚轮事件,不让它改变选中的项 return true; // 阻止滚轮事件的传播 } } return QWidget::eventFilter(obj, event); } void BondMatrixProgramPage::onNoBondPtsClicked(QLineEdit* lineEdit, int index, int parentIndex) { if (parentIndex != -1) { // 处理子矩阵的操作 if (index < 0 || index >= m_vecSubMatrixs.size()) return; const auto& subMatrix = m_vecSubMatrixs[index]; NoBondPtEditDialog dlg(subMatrix.MatrixRow, subMatrix.MatrixCol, subMatrix.VecNoBondPt, this); if (dlg.exec() == QDialog::Accepted) { QVector selected = dlg.getSelectedPoints(); m_vecSubMatrixs[index].VecNoBondPt = std::vector(selected.begin(), selected.end()); QStringList ptList; for (const auto& pt : selected) ptList << QString("(%1,%2)").arg(pt.x).arg(pt.y); lineEdit->setText(ptList.join(" ")); } // 这里可以用 parentIndex 来关联父矩阵(即大矩阵)做相应的操作 } else { // 处理大矩阵的操作 if (index < 0 || index >= m_vectBondMatrixs.size()) return; const auto& bondMatrix = m_vectBondMatrixs[index]; NoBondPtEditDialog dlg(bondMatrix.BondMatrixRow, bondMatrix.BondMatrixCol, bondMatrix.VecNoBondPt, this); if (dlg.exec() == QDialog::Accepted) { QVector selected = dlg.getSelectedPoints(); m_vectBondMatrixs[index].VecNoBondPt = std::vector(selected.begin(), selected.end()); QStringList ptList; for (const auto& pt : selected) ptList << QString("(%1,%2)").arg(pt.x).arg(pt.y); lineEdit->setText(ptList.join(" ")); } // 这里也可以用 parentIndex 来关联父矩阵(即大矩阵)做相应的操作 } } void BondMatrixProgramPage::AddMatrixParam() { } void BondMatrixProgramPage::UpdateTemplateParamCombox(int DeleteOrAdd, UINT StrategyTempleteID){ m_vecPrTemplate = m_manageDB->GetCProduct()->GetPrTemplate(); m_vecPrStrategy = m_manageDB->GetCProduct()->GetPrStrategy(); m_vecPrBondInsp = m_manageDB->GetCProduct()->GetPrBondInsp(); m_TipMatrix->GetAllNozzleIndex(m_vecNozzles); m_isComBoxUpdating = true; // 初始化 并设置默认选项 // 吸嘴 ui.comboBoxPickNozzleID->clear(); ui.comboBoxBondNozzleID->clear(); // 固后 ui.comboBoxPostBondTemp->clear(); // 模板 ui.comboBoxPickTempID->clear(); ui.comboBoxPreBondTemp->clear(); ui.comboBoxBondTemp->clear(); ui.comboBoxLookUpTemp->clear(); ui.comboBoxCalibPickTemp->clear(); ui.comboBoxPcbAlnPRStrategyId->clear(); //吸嘴Combox填充 for (const auto& nozzleData : m_vecNozzles) { ui.comboBoxPickNozzleID->addItem(QString::number(nozzleData), nozzleData); // 设置数据 ui.comboBoxBondNozzleID->addItem(QString::number(nozzleData), nozzleData); // 设置数据 } //模板ComBox填充 for (const auto& templateData : m_vecPrTemplate) { ui.comboBoxPickTempID->addItem(QString::number(templateData.iTemplateId), templateData.iTemplateId); ui.comboBoxPreBondTemp->addItem(QString::number(templateData.iTemplateId), templateData.iTemplateId); ui.comboBoxBondTemp->addItem(QString::number(templateData.iTemplateId), templateData.iTemplateId); ui.comboBoxLookUpTemp->addItem(QString::number(templateData.iTemplateId), templateData.iTemplateId); ui.comboBoxCalibPickTemp->addItem(QString::number(templateData.iTemplateId), templateData.iTemplateId); ui.comboBoxPcbAlnPRStrategyId->addItem(QString::number(templateData.iTemplateId), templateData.iTemplateId); } for (const auto& strategy : m_vecPrStrategy) { ui.comboBoxPickTempID->addItem(QString::number(strategy.iStrategyId), strategy.iStrategyId); ui.comboBoxPreBondTemp->addItem(QString::number(strategy.iStrategyId), strategy.iStrategyId); ui.comboBoxBondTemp->addItem(QString::number(strategy.iStrategyId), strategy.iStrategyId); ui.comboBoxLookUpTemp->addItem(QString::number(strategy.iStrategyId), strategy.iStrategyId); ui.comboBoxCalibPickTemp->addItem(QString::number(strategy.iStrategyId), strategy.iStrategyId); ui.comboBoxPcbAlnPRStrategyId->addItem(QString::number(strategy.iStrategyId), strategy.iStrategyId); } // 固后Combox填充 for (const auto& bondInspData : m_vecPrBondInsp) { ui.comboBoxPostBondTemp->addItem(QString::number(bondInspData.iID), bondInspData.iID); // 设置数据 } m_isComBoxUpdating = false; // 吸嘴 safeSetComboBoxIndex(ui.comboBoxPickNozzleID, m_curBondInfo.iPickHeadId); safeSetComboBoxIndex(ui.comboBoxBondNozzleID, m_curBondInfo.iBondHeadId); // --- PostBondTemp --- //ui.comboBoxPostBondTemp->addItem(QString::number(m_curBondInfo.iBondBackPRStrategyId), m_curBondInfo.iBondBackPRStrategyId); // 设置数据 //int index3 = ui.comboBoxPostBondTemp->findData(m_curBondInfo.iBondBackPRStrategyId); //ui.comboBoxPostBondTemp->setCurrentIndex(ui.comboBoxPostBondTemp->findData(m_curBondInfo.iBondBackPRStrategyId)); // 设置默认项 // m_vecPrBondInsp 后续这个有值了,在回复回来 safeSetComboBoxIndex(ui.comboBoxPostBondTemp, m_curBondInfo.iBondBackPRStrategyId,true); // --- PickTempID --- safeSetComboBoxIndex(ui.comboBoxPickTempID, m_curBondInfo.iPickPRStrategyId); // --- PreBondTemp --- safeSetComboBoxIndex(ui.comboBoxPreBondTemp, m_curBondInfo.iBondFrontPRStrategyId); // --- BondTemp --- safeSetComboBoxIndex(ui.comboBoxBondTemp, m_curBondInfo.iBondAlnPRStrategyId); // --- LookUpTemp --- safeSetComboBoxIndex(ui.comboBoxLookUpTemp, m_curBondInfo.iLookUpPRStrategyId); // --- CalibPickTemp --- safeSetComboBoxIndex(ui.comboBoxCalibPickTemp, m_curBondInfo.iCalibPRStrategyId); // --- PcbAlnPRStrategy --- safeSetComboBoxIndex(ui.comboBoxPcbAlnPRStrategyId, m_curBondInfo.iPcbAlnPRStrategyId); } void BondMatrixProgramPage::UpdatePageParam() { int dieSourceIndex = 0; if (m_curBondInfo.eDieSource == DIE_SOURCE::BY_WAFER) { dieSourceIndex = 1; } else if (m_curBondInfo.eDieSource == DIE_SOURCE::BY_WAFFLE) { dieSourceIndex = 0; } ui.comboBoxDieSource->setCurrentIndex(dieSourceIndex); int calibTableIdIndex = -1; if (m_curBondInfo.iCalibTableId == CALIB_TYPE::TYPE_1) { calibTableIdIndex = 0; } else if (m_curBondInfo.iCalibTableId == CALIB_TYPE::TYPE_2) { calibTableIdIndex = 1; } else if (m_curBondInfo.iCalibTableId == CALIB_TYPE::TYPE_3) { calibTableIdIndex = 2; } ui.comboBoxCalibTableId->setCurrentIndex(calibTableIdIndex); //ui.checkBoxIsCalib->setChecked(m_curBondInfo.bTransferPREnable); ui.checkBoxIsUseMulStageTempera->setChecked(m_curBondInfo.bUseMultiStageTemperature); ui.checkBoxIsPickPR->setChecked(m_curBondInfo.bPickPREnable); ui.checkBoxIsPreBondPR->setChecked(m_curBondInfo.bPreBondPREnable); ui.checkBoxIsPostBondPR->setChecked(m_curBondInfo.bPostBondPREnable); ui.checkBoxIsAllBondAln->setChecked(m_curBondInfo.bAllBondAlnEnable); ui.checkBoxIsPcbAln->setChecked(m_curBondInfo.bPcbAlnEnable); ui.checkBoxIsLookUpPR->setChecked(m_curBondInfo.bLookUpPREnable); ui.checkBoxIsCalibPick->setChecked(m_curBondInfo.bTransferPREnable); handlePickPRCheckBox(ui.checkBoxIsPickPR->isChecked()); handlePreBondPRCheckBox(ui.checkBoxIsPreBondPR->isChecked()); handlePostBondPRCheckBox(ui.checkBoxIsPostBondPR->isChecked()); handleAllBondAlnCheckBox(ui.checkBoxIsAllBondAln->isChecked()); handlePcbAlnCheckBox(ui.checkBoxIsPcbAln->isChecked()); handleLookUpPRCheckBox(ui.checkBoxIsLookUpPR->isChecked()); handleCalibPickCheckBox(ui.checkBoxIsCalibPick->isChecked()); //ui.spinBoxPickNozzleID->setValue(m_curBondInfo.iPickHeadId); ui.spinBoxDieHeight->setValue(m_curBondInfo.dDieHeight); UpdateTemplateParamCombox(1,-1); ui.doubleSpinBoxBondOffsetX->setValue(m_curBondInfo.stOffset.x); ui.doubleSpinBoxBondOffsetY->setValue(m_curBondInfo.stOffset.y); ui.doubleSpinBoxBondOffsetAngle->setValue(m_curBondInfo.stOffset.a); UpdatePagePickPlaceParam(); restoreBondInfoDefaultStyles(); } void BondMatrixProgramPage::restoreBondInfoDefaultStyles() { // 恢复 ComboBox 控件样式 restoreDefaultStyles({ ui.comboBoxDieSource, ui.comboBoxCalibTableId, ui.comboBoxPickNozzleID, ui.comboBoxPostBondTemp, ui.comboBoxPickTempID, ui.comboBoxPreBondTemp, ui.comboBoxBondTemp, ui.comboBoxLookUpTemp, ui.comboBoxCalibPickTemp, ui.comboBoxPcbAlnPRStrategyId, ui.comboBoxCurrentPara_Pick1, ui.comboBoxCurrentPara_Pick2, ui.comboBoxCurrentPara_Place1, ui.comboBoxCurrentPara_Place2, ui.comboBoxBondNozzleID, ui.checkBoxIsCalib, ui.checkBoxIsUseMulStageTempera, ui.checkBoxIsPickPR, ui.checkBoxIsPreBondPR, ui.checkBoxIsPostBondPR, ui.checkBoxIsAllBondAln, ui.checkBoxIsPcbAln, ui.checkBoxIsLookUpPR, ui.checkBoxIsCalibPick, ui.spinBoxDieHeight, ui.doubleSpinBoxBondOffsetX, ui.doubleSpinBoxBondOffsetY, ui.doubleSpinBoxBondOffsetAngle }); restorePick1DefaultStyles(); restorePick2DefaultStyles(); restorePlace1DefaultStyles(); restorePlccle2DefaultStyles(); } void BondMatrixProgramPage::restorePick1DefaultStyles() { // 恢复 控件样式 restoreDefaultStyles({ ui.checkBoxPickBlockCheck, ui.checkBoxPickBlockCheck_2, ui.checkBoxBondBlockCheck, ui.checkBoxBondBlockCheck_2, ui.checkBoxPickLoseCheck, ui.checkBoxPickLoseCheck_2, ui.checkBoxBondLoseCheck, ui.checkBoxBondLoseCheck_2, ui.checkBoxPickFindForceCheck, ui.checkBoxPickFindForceCheck_2, ui.checkBoxBondFindForce, ui.checkBoxBondFindForce_2, ui.doubleSpinBoxPrePickZ, ui.doubleSpinBoxPickForce, ui.doubleSpinBoxPickPosZ, ui.spinBoxPickGrabDelay, ui.spinBoxPickDelay, ui.spinBoxPickBlockCheckDelay, ui.spinBoxPickVacDelay, ui.spinBoxPickBlowDelay }); } void BondMatrixProgramPage::restorePick2DefaultStyles() { // 恢复中转台取晶相关控件样式 restoreDefaultStyles({ ui.checkBoxPickBlockCheck_2, ui.checkBoxPickLoseCheck_2, ui.checkBoxPickFindForceCheck_2, ui.doubleSpinBoxPrePickZ_2, ui.doubleSpinBoxPickForce_2, ui.doubleSpinBoxPickPosZ_2, ui.spinBoxPickGrabDelay_2, ui.spinBoxPickDelay_2, ui.spinBoxPickBlockCheckDelay_2, ui.spinBoxPickVacDelay_2, ui.spinBoxPickBlowDelay_2 }); } void BondMatrixProgramPage::restorePlace1DefaultStyles() { // 恢复中转台放晶相关控件样式 restoreDefaultStyles({ ui.checkBoxBondBlockCheck, ui.checkBoxBondLoseCheck, ui.checkBoxBondFindForce, ui.doubleSpinBoxPreBondPosZ, ui.doubleSpinBoxBondForce, ui.doubleSpinBoxBondPosZ, ui.spinBoxBondGrabDelay, ui.spinBoxBondDelay, ui.spinBoxBondBlockCheckDelay, ui.spinBoxBondVacDelay, ui.spinBoxBondBlowDelay }); } void BondMatrixProgramPage::restorePlccle2DefaultStyles() { // 恢复固晶台固晶相关控件样式 restoreDefaultStyles({ ui.checkBoxBondBlockCheck_2, ui.checkBoxBondLoseCheck_2, ui.checkBoxBondFindForce_2, ui.doubleSpinBoxPreBondPosZ_2, ui.doubleSpinBoxBondForce_2, ui.doubleSpinBoxBondPosZ_2, ui.spinBoxBondGrabDelay_2, ui.spinBoxBondDelay_2, ui.spinBoxBondBlockCheckDelay_2, ui.spinBoxBondVacDelay_2, ui.spinBoxBondBlowDelay_2 }); } void BondMatrixProgramPage::UpdatePagePickPlaceParam() { m_isComBoxUpdating = true; ui.comboBoxCurrentPara_Pick1->clear(); ui.comboBoxCurrentPara_Pick2->clear(); ui.comboBoxCurrentPara_Place1->clear(); ui.comboBoxCurrentPara_Pick2->clear(); //取/固晶参数 for (const auto& param : m_vecParam) { ui.comboBoxCurrentPara_Pick1->addItem(QString::number(param.iId), param.iId); ui.comboBoxCurrentPara_Pick2->addItem(QString::number(param.iId), param.iId); ui.comboBoxCurrentPara_Place1->addItem(QString::number(param.iId), param.iId); ui.comboBoxCurrentPara_Place2->addItem(QString::number(param.iId), param.iId); } m_isComBoxUpdating = false; // --- 取晶头取晶 --- safeSetComboBoxIndex(ui.comboBoxCurrentPara_Pick1, m_curBondInfo.iPickParamId); // --- 中转台取晶 --- safeSetComboBoxIndex(ui.comboBoxCurrentPara_Pick2, m_curBondInfo.iCalibPickParamId); // --- 中转台固晶 --- safeSetComboBoxIndex(ui.comboBoxCurrentPara_Place1, m_curBondInfo.iCalibBondParamId); // --- 固晶台固晶 --- safeSetComboBoxIndex(ui.comboBoxCurrentPara_Place2, m_curBondInfo.iBondParamId); //m_tempWaferPickParam = m_curWaferPickParam; //m_tempCalibPlaceParam = m_curCalibPlaceParam; //m_tempCalibPickParam = m_curCalibPickParam; //m_tempBondParam = m_curBondParam; UpdatePagePick1Param(); UpdatePagePick2Param(); UpdatePageBond1Param(); UpdatePageBond2Param(); updateFourParamDeleteButtonStatus(); } //取/固晶参数另存为 int BondMatrixProgramPage::ParamSaveAsEvent(ns_db::PICKBOND_PARAM_STRUCT &m_curToSaveAsParam) { int iToSaveAsParamId; m_manageDB->GetCProduct()->AddBondParam(m_curToSaveAsParam, iToSaveAsParamId); // 判断传入的是哪一个参数,并相应修改m_curBondInfo中的ID if (&m_curToSaveAsParam == &m_curWaferPickParam) { m_curBondInfo.iPickParamId = iToSaveAsParamId; } else if (&m_curToSaveAsParam == &m_curCalibPlaceParam) { m_curBondInfo.iCalibBondParamId = iToSaveAsParamId; } else if (&m_curToSaveAsParam == &m_curCalibPickParam) { m_curBondInfo.iCalibPickParamId = iToSaveAsParamId; } else if (&m_curToSaveAsParam == &m_curBondParam) { m_curBondInfo.iBondParamId = iToSaveAsParamId; } m_manageDB->GetCProduct()->GetBondParam(iToSaveAsParamId, m_curToSaveAsParam); m_vecParam.push_back(m_curToSaveAsParam);// = m_manageDB->GetCProduct()->GetAllBondInfoData(); // 填充 QComboBox UpdatePagePickPlaceParam(); return iToSaveAsParamId; } //BondInfo另存为 int BondMatrixProgramPage::BondInfoParamSaveAsEvent() { //int iWaferPickParamId,iCalibPlaceParamId,iCalibPickParamId,iBondParamId; //m_manageDB->GetCProduct()->AddBondParam(m_curWaferPickParam, iWaferPickParamId); //SetBondParam(m_curWaferPickParam.iId, m_curWaferPickParam); //m_manageDB->GetCProduct()->AddBondParam(m_curCalibPlaceParam, iCalibPlaceParamId); //m_manageDB->GetCProduct()->AddBondParam(m_curCalibPickParam, iCalibPickParamId); //m_manageDB->GetCProduct()->AddBondParam(m_curBondParam, iBondParamId); int iInfoId; m_manageDB->GetCProduct()->AddBondInfoData(m_curBondInfo, iInfoId); ns_db::BOND_INFO_STRUCT newBondInfo; m_manageDB->GetCProduct()->GetBondInfoData(iInfoId, newBondInfo); m_vecBondInfoData.push_back(newBondInfo);// = m_manageDB->GetCProduct()->GetAllBondInfoData(); // 填充 QComboBox ui.comboBoxCurrentPara->clear(); for (const auto& bondMatrix : m_vecBondInfoData) { QString itemText = QString::number(bondMatrix.iInfoId); ui.comboBoxCurrentPara->addItem(itemText, bondMatrix.iInfoId); } ui.comboBoxCurrentPara->setCurrentIndex(ui.comboBoxCurrentPara->findData(iInfoId)); // 设置默认项 m_isBondInfoParaChange = true; updateDeleteButtonStatus(canDeleteBondInfo(iInfoId), ui.pushButtonDeleteParam); updateFourParamDeleteButtonStatus(); return iInfoId; } void BondMatrixProgramPage::ParamChangeEvent() { m_manageDB->GetCProduct()->SetBondInfoData(m_curBondInfo.iInfoId, m_curBondInfo); m_manageDB->GetCProduct()->SetBondParam(m_curWaferPickParam.iId, m_curWaferPickParam); m_manageDB->GetCProduct()->SetBondParam(m_curCalibPlaceParam.iId, m_curCalibPlaceParam); m_manageDB->GetCProduct()->SetBondParam(m_curCalibPickParam.iId, m_curCalibPickParam); m_manageDB->GetCProduct()->SetBondParam(m_curBondParam.iId, m_curBondParam); m_tempWaferPickParam = m_curWaferPickParam; m_tempCalibPlaceParam = m_curCalibPlaceParam; m_tempCalibPickParam = m_curCalibPickParam; m_tempBondParam = m_curBondParam; m_vecBondInfoData = m_manageDB->GetCProduct()->GetAllBondInfoData(); m_tempBondInfo = m_curBondInfo; updateFourParamDeleteButtonStatus(); CProduct* _Product = m_manageDB->GetCProduct(); UpdatePageParam(); } void BondMatrixProgramPage::restoreDefaultStyles(QList widgets) { for (QWidget* widget : widgets) { // 如果控件是 QCheckBox 或其他类型的控件,恢复样式 if (auto checkBox = qobject_cast(widget)) { checkBox->setSavedColor(); // 恢复默认样式 } else if (auto spinBox = qobject_cast(widget)) { spinBox->setSavedColor(); // 恢复默认样式 } else if (auto doubleSpinBox = qobject_cast(widget)) { doubleSpinBox->setSavedColor(); // 恢复默认样式 } else if (auto comboBox = qobject_cast(widget)) { comboBox->setSavedColor(); // 恢复历史值 } else if (auto comboBox = qobject_cast(widget)) { comboBox->setStyleSheet(""); // 恢复默认样式 } // 其他控件可以继续扩展 } } void BondMatrixProgramPage::onSaveClickedToRefreshStyle() { // 遍历所有外部矩阵控件,并恢复默认样式 for (auto it = m_mapOutWidgetIndex.begin(); it != m_mapOutWidgetIndex.end(); ++it) { QWidget* widget = it.key(); // 获取外部矩阵控件 // 遍历该 widget 的所有子控件 QList childWidgets = widget->findChildren(); restoreDefaultStyles(childWidgets); } // 遍历所有子矩阵控件,并恢复默认样式 for (auto it = m_mapSubWidgetIndex.begin(); it != m_mapSubWidgetIndex.end(); ++it) { QWidget* widget = it.key(); // 获取子矩阵控件 // 遍历该 widget 的所有子控件 QList childWidgets = widget->findChildren(); restoreDefaultStyles(childWidgets); } // 在这里可以添加其他保存操作,如数据存储等 } void BondMatrixProgramPage::MatrixChangeEvent() { //TODO:此处可能有问题,可改成后端更新,没有相应ID则添加的形式 m_manageDB->GetCProduct()->SetAllBondMatrix(m_vectBondMatrixs, true); m_manageDB->GetCProduct()->SetAllPointMatrix(m_vecSubMatrixs, true); m_manageDB->GetCProduct()->GetAllPointMatrix(m_vecSubMatrixs); m_manageDB->GetCProduct()->GetAllPointMatrix(m_TempVecSubMatrixs); /*for (PROGRAM_BOND_MATRIX_STRUCT& bondMatrix : m_vectBondMatrixs) { m_manageDB->GetCProduct()->SetBondMatrix(bondMatrix.BondMatrixId, bondMatrix); }*/ /*for (PROGRAM_POINT_MATRIX_STRUCT& pointMatrix : m_vecSubMatrixs) { m_manageDB->GetCProduct()->SetPointMatrix(pointMatrix.MatrixId, pointMatrix); }*/ } void BondMatrixProgramPage::UpdatePagePick1Param() { //"取晶头取晶" { ui.checkBoxPickBlockCheck->setChecked(m_curWaferPickParam.bCheckBlock); ui.checkBoxPickLoseCheck->setChecked(m_curWaferPickParam.bCheckLose); ui.checkBoxPickFindForceCheck->setChecked(m_curWaferPickParam.bFindForce); ui.doubleSpinBoxPrePickZ->setValue(m_curWaferPickParam.dPreLevOffset); ui.doubleSpinBoxPickForce->setValue(m_curWaferPickParam.dForce); ui.doubleSpinBoxPickPosZ->setValue(m_curWaferPickParam.dWorkLevOffset); ui.spinBoxPickGrabDelay->setValue(m_curWaferPickParam.iGrabDelay); ui.spinBoxPickDelay->setValue(m_curWaferPickParam.iPickOrBondDelay); ui.spinBoxPickBlockCheckDelay->setValue(m_curWaferPickParam.iBlockOrLoseDelay); ui.spinBoxPickVacDelay->setValue(m_curWaferPickParam.iVacuumDelay); ui.spinBoxPickBlowDelay->setValue(m_curWaferPickParam.iBlowDelay); //ui.doubleSpinBoxPrePickZ->setEnabled(!ui.checkBoxPickFindForceCheck->isChecked()); ui.doubleSpinBoxPickPosZ->setEnabled(!ui.checkBoxPickFindForceCheck->isChecked()); } //// 更新样式 //if (m_curWaferPickParam.bCheckBlock == m_tempWaferPickParam.bCheckBlock) // ui.checkBoxPickLoseCheck->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxPickLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curWaferPickParam.bCheckLose == m_tempWaferPickParam.bCheckLose) // ui.checkBoxPickLoseCheck->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxPickLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curWaferPickParam.bFindForce == m_tempWaferPickParam.bFindForce) // ui.checkBoxPickFindForceCheck->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxPickFindForceCheck->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curWaferPickParam.dPreLevOffset == m_tempWaferPickParam.dPreLevOffset) // ui.doubleSpinBoxPrePickZ->setStyleSheet(""); // 恢复默认样式 //else // ui.doubleSpinBoxPrePickZ->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curWaferPickParam.dForce == m_tempWaferPickParam.dForce) // ui.doubleSpinBoxPickForce->setStyleSheet(""); // 恢复默认样式 //else // ui.doubleSpinBoxPickForce->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curWaferPickParam.dWorkLevOffset == m_tempWaferPickParam.dWorkLevOffset) // ui.doubleSpinBoxPickPosZ->setStyleSheet(""); // 恢复默认样式 //else // ui.doubleSpinBoxPickPosZ->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curWaferPickParam.iGrabDelay == m_tempWaferPickParam.iGrabDelay) // ui.spinBoxPickGrabDelay->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxPickGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curWaferPickParam.iPickOrBondDelay == m_tempWaferPickParam.iPickOrBondDelay) // ui.spinBoxPickDelay->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxPickDelay->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curWaferPickParam.iBlockOrLoseDelay == m_tempWaferPickParam.iBlockOrLoseDelay) // ui.spinBoxPickBlockCheckDelay->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxPickBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curWaferPickParam.iVacuumDelay == m_tempWaferPickParam.iVacuumDelay) // ui.spinBoxPickVacDelay->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxPickVacDelay->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curWaferPickParam.iBlowDelay == m_tempWaferPickParam.iBlowDelay) // ui.spinBoxPickBlowDelay->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxPickBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红 } void BondMatrixProgramPage::UpdatePagePick2Param() { //"中转台取晶" { ui.checkBoxPickBlockCheck_2->setChecked(m_curCalibPickParam.bCheckBlock); ui.checkBoxPickLoseCheck_2->setChecked(m_curCalibPickParam.bCheckLose); ui.checkBoxPickFindForceCheck_2->setChecked(m_curCalibPickParam.bFindForce); ui.doubleSpinBoxPrePickZ_2->setValue(m_curCalibPickParam.dPreLevOffset); ui.doubleSpinBoxPickForce_2->setValue(m_curCalibPickParam.dForce); ui.doubleSpinBoxPickPosZ_2->setValue(m_curCalibPickParam.dWorkLevOffset); ui.spinBoxPickGrabDelay_2->setValue(m_curCalibPickParam.iGrabDelay); ui.spinBoxPickDelay_2->setValue(m_curCalibPickParam.iPickOrBondDelay); ui.spinBoxPickBlockCheckDelay_2->setValue(m_curCalibPickParam.iBlockOrLoseDelay); ui.spinBoxPickVacDelay_2->setValue(m_curCalibPickParam.iVacuumDelay); ui.spinBoxPickBlowDelay_2->setValue(m_curCalibPickParam.iBlowDelay); //ui.doubleSpinBoxPrePickZ_2->setEnabled(!ui.checkBoxPickFindForceCheck_2->isChecked()); ui.doubleSpinBoxPickPosZ_2->setEnabled(!ui.checkBoxPickFindForceCheck_2->isChecked()); } // 判断复选框并更新样式 //if (m_curCalibPickParam.bCheckBlock == m_tempCalibPickParam.bCheckBlock) // ui.checkBoxPickBlockCheck_2->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxPickBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPickParam.bCheckLose == m_tempCalibPickParam.bCheckLose) // ui.checkBoxPickLoseCheck_2->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxPickLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPickParam.bFindForce == m_tempCalibPickParam.bFindForce) // ui.checkBoxPickFindForceCheck_2->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxPickFindForceCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 //// 判断 DoubleSpinBox 控件并更新样式 //if (m_curCalibPickParam.dPreLevOffset == m_tempCalibPickParam.dPreLevOffset) // ui.doubleSpinBoxPrePickZ_2->setStyleSheet(""); // 恢复默认样式 //else // ui.doubleSpinBoxPrePickZ_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPickParam.dForce == m_tempCalibPickParam.dForce) // ui.doubleSpinBoxPickForce_2->setStyleSheet(""); // 恢复默认样式 //else // ui.doubleSpinBoxPickForce_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPickParam.dWorkLevOffset == m_tempCalibPickParam.dWorkLevOffset) // ui.doubleSpinBoxPickPosZ_2->setStyleSheet(""); // 恢复默认样式 //else // ui.doubleSpinBoxPickPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 //// 判断 SpinBox 控件并更新样式 //if (m_curCalibPickParam.iGrabDelay == m_tempCalibPickParam.iGrabDelay) // ui.spinBoxPickGrabDelay_2->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxPickGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPickParam.iPickOrBondDelay == m_tempCalibPickParam.iPickOrBondDelay) // ui.spinBoxPickDelay_2->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxPickDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPickParam.iBlockOrLoseDelay == m_tempCalibPickParam.iBlockOrLoseDelay) // ui.spinBoxPickBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxPickBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPickParam.iVacuumDelay == m_tempCalibPickParam.iVacuumDelay) // ui.spinBoxPickVacDelay_2->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxPickVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPickParam.iBlowDelay == m_tempCalibPickParam.iBlowDelay) // ui.spinBoxPickBlowDelay_2->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxPickBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } void BondMatrixProgramPage::UpdatePageBond1Param() { //"中转台放晶" { ui.checkBoxBondBlockCheck->setChecked(m_curCalibPlaceParam.bCheckBlock); ui.checkBoxBondLoseCheck->setChecked(m_curCalibPlaceParam.bCheckLose); ui.checkBoxBondFindForce->setChecked(m_curCalibPlaceParam.bFindForce); ui.doubleSpinBoxPreBondPosZ->setValue(m_curCalibPlaceParam.dPreLevOffset); ui.doubleSpinBoxBondForce->setValue(m_curCalibPlaceParam.dForce); ui.doubleSpinBoxBondPosZ->setValue(m_curCalibPlaceParam.dWorkLevOffset); ui.spinBoxBondGrabDelay->setValue(m_curCalibPlaceParam.iGrabDelay); ui.spinBoxBondDelay->setValue(m_curCalibPlaceParam.iPickOrBondDelay); ui.spinBoxBondBlockCheckDelay->setValue(m_curCalibPlaceParam.iBlockOrLoseDelay); ui.spinBoxBondVacDelay->setValue(m_curCalibPlaceParam.iVacuumDelay); ui.spinBoxBondBlowDelay->setValue(m_curCalibPlaceParam.iBlowDelay); ui.doubleSpinBoxPreBondPosZ->setEnabled(!ui.checkBoxBondFindForce->isChecked()); ui.doubleSpinBoxBondPosZ->setEnabled(!ui.checkBoxBondFindForce->isChecked()); } // 样式判断:根据条件更新样式 //if (m_curCalibPlaceParam.bCheckBlock == m_tempCalibPlaceParam.bCheckBlock) // ui.checkBoxBondBlockCheck->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxBondBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPlaceParam.bCheckLose == m_tempCalibPlaceParam.bCheckLose) // ui.checkBoxBondLoseCheck->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxBondLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPlaceParam.bFindForce == m_tempCalibPlaceParam.bFindForce) // ui.checkBoxBondFindForce->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxBondFindForce->setStyleSheet("color: red;"); // 字体颜色变红 //// DoubleSpinBox 样式判断 //if (m_curCalibPlaceParam.dPreLevOffset == m_tempCalibPlaceParam.dPreLevOffset) // ui.doubleSpinBoxPreBondPosZ->setStyleSheet(""); // 恢复默认样式 //else // ui.doubleSpinBoxPreBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPlaceParam.dForce == m_tempCalibPlaceParam.dForce) // ui.doubleSpinBoxBondForce->setStyleSheet(""); // 恢复默认样式 //else // ui.doubleSpinBoxBondForce->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPlaceParam.dWorkLevOffset == m_tempCalibPlaceParam.dWorkLevOffset) // ui.doubleSpinBoxBondPosZ->setStyleSheet(""); // 恢复默认样式 //else // ui.doubleSpinBoxBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红 //// SpinBox 样式判断 //if (m_curCalibPlaceParam.iGrabDelay == m_tempCalibPlaceParam.iGrabDelay) // ui.spinBoxBondGrabDelay->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxBondGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPlaceParam.iPickOrBondDelay == m_tempCalibPlaceParam.iPickOrBondDelay) // ui.spinBoxBondDelay->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxBondDelay->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPlaceParam.iBlockOrLoseDelay == m_tempCalibPlaceParam.iBlockOrLoseDelay) // ui.spinBoxBondBlockCheckDelay->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxBondBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPlaceParam.iVacuumDelay == m_tempCalibPlaceParam.iVacuumDelay) // ui.spinBoxBondVacDelay->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxBondVacDelay->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curCalibPlaceParam.iBlowDelay == m_tempCalibPlaceParam.iBlowDelay) // ui.spinBoxBondBlowDelay->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxBondBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红 } void BondMatrixProgramPage::UpdatePageBond2Param() { //"固晶台固晶" { ui.checkBoxBondBlockCheck_2->setChecked(m_curBondParam.bCheckBlock); ui.checkBoxBondLoseCheck_2->setChecked(m_curBondParam.bCheckLose); ui.checkBoxBondFindForce_2->setChecked(m_curBondParam.bFindForce); ui.doubleSpinBoxPreBondPosZ_2->setValue(m_curBondParam.dPreLevOffset); ui.doubleSpinBoxBondForce_2->setValue(m_curBondParam.dForce); ui.doubleSpinBoxBondPosZ_2->setValue(m_curBondParam.dWorkLevOffset); ui.spinBoxBondGrabDelay_2->setValue(m_curBondParam.iGrabDelay); ui.spinBoxBondDelay_2->setValue(m_curBondParam.iPickOrBondDelay); ui.spinBoxBondBlockCheckDelay_2->setValue(m_curBondParam.iBlockOrLoseDelay); ui.spinBoxBondVacDelay_2->setValue(m_curBondParam.iVacuumDelay); ui.spinBoxBondBlowDelay_2->setValue(m_curBondParam.iBlowDelay); //ui.doubleSpinBoxPreBondPosZ_2->setEnabled(!ui.checkBoxBondFindForce_2->isChecked()); ui.doubleSpinBoxBondPosZ_2->setEnabled(!ui.checkBoxBondFindForce_2->isChecked()); } // 更新样式:根据条件判断改变样式 //if (m_curBondParam.bCheckBlock == m_tempBondParam.bCheckBlock) // ui.checkBoxBondBlockCheck_2->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxBondBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curBondParam.bCheckLose == m_tempBondParam.bCheckLose) // ui.checkBoxBondLoseCheck_2->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxBondLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curBondParam.bFindForce == m_tempBondParam.bFindForce) // ui.checkBoxBondFindForce_2->setStyleSheet(""); // 恢复默认样式 //else // ui.checkBoxBondFindForce_2->setStyleSheet("color: red;"); // 字体颜色变红 //// 判断 DoubleSpinBox 样式 //if (m_curBondParam.dPreLevOffset == m_tempBondParam.dPreLevOffset) // ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet(""); // 恢复默认样式 //else // ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curBondParam.dForce == m_tempBondParam.dForce) // ui.doubleSpinBoxBondForce_2->setStyleSheet(""); // 恢复默认样式 //else // ui.doubleSpinBoxBondForce_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curBondParam.dWorkLevOffset == m_tempBondParam.dWorkLevOffset) // ui.doubleSpinBoxBondPosZ_2->setStyleSheet(""); // 恢复默认样式 //else // ui.doubleSpinBoxBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红 //// 判断 SpinBox 样式 //if (m_curBondParam.iGrabDelay == m_tempBondParam.iGrabDelay) // ui.spinBoxBondGrabDelay_2->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxBondGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curBondParam.iPickOrBondDelay == m_tempBondParam.iPickOrBondDelay) // ui.spinBoxBondDelay_2->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxBondDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curBondParam.iBlockOrLoseDelay == m_tempBondParam.iBlockOrLoseDelay) // ui.spinBoxBondBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxBondBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curBondParam.iVacuumDelay == m_tempBondParam.iVacuumDelay) // ui.spinBoxBondVacDelay_2->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxBondVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 //if (m_curBondParam.iBlowDelay == m_tempBondParam.iBlowDelay) // ui.spinBoxBondBlowDelay_2->setStyleSheet(""); // 恢复默认样式 //else // ui.spinBoxBondBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红 } void BondMatrixProgramPage::initPage() { m_manageDB = CManageDB::GetInstance(); if (m_manageDB == nullptr) return; m_pProduct = m_manageDB->GetCProduct(); if (m_pProduct == nullptr) return; m_TipMatrix = ns_mat::TipMatrix::GetInstance(); m_pProgramCViewInterface = ns_module::CViewInterface::GetInstance(); //从后端获取数据 m_vectBondMatrixs = m_manageDB->GetCProduct()->GetBondMatrix(); m_TempVectBondMatrixs = m_manageDB->GetCProduct()->GetBondMatrix(); m_manageDB->GetCProduct()->GetAllPointMatrix(m_vecSubMatrixs); m_manageDB->GetCProduct()->GetAllPointMatrix(m_TempVecSubMatrixs); m_vecBondInfoData = m_manageDB->GetCProduct()->GetAllBondInfoData(); //if (m_vectBondMatrixs.size() == 0) return; //for (int i = 0; i < m_vectBondMatrixs.size(); i++) //{ // for (int j = 0; j < m_vectBondMatrixs[i].VecPointMatrixId.size(); j++) // { // PROGRAM_POINT_MATRIX_STRUCT subMatrix; // m_manageDB->GetCProduct()->GetPointMatrix(m_vectBondMatrixs[i].VecPointMatrixId[j], subMatrix); // m_vecSubMatrixs.push_back(subMatrix); // //AddMatrixPage(i, j, subMatrix); // } // AddOutMatrixPage(i, m_vectBondMatrixs[i], m_vecSubMatrixs); //} for (int i = 0; i < m_vectBondMatrixs.size(); i++) { AddOutMatrixPage(i, m_vectBondMatrixs[i], m_vecSubMatrixs); } //for (int i = 0; i < m_vectBondMatrixs[0].VecPointMatrixId.size(); ++i) //{ // PROGRAM_POINT_MATRIX_STRUCT subMatrix; // m_manageDB->GetCProduct()->GetPointMatrix(m_vectBondMatrixs[0].VecPointMatrixId[i], subMatrix); // m_vecSubMatrixs.push_back(subMatrix); //} //m_manageDB->GetCProduct()->GetDieMatrix(m_vectBondMatrixs[0].VecPointMatrixId[0], m_vecSubMatrixs); ////显示矩阵数据 //ui.spinBoxRow->setValue(m_vectBondMatrixs[0].BondMatrixRow); //ui.spinBoxCol->setValue(m_vectBondMatrixs[0].BondMatrixCol); //ui.doubleSpinBoxLeftTopX->setValue(m_vectBondMatrixs[0].LeftTopPoint.x); //ui.doubleSpinBoxLeftTopY->setValue(m_vectBondMatrixs[0].LeftTopPoint.y); //ui.doubleSpinBoxRightTopX->setValue(m_vectBondMatrixs[0].RightTopPoint.x); //ui.doubleSpinBoxRightTopY->setValue(m_vectBondMatrixs[0].RightTopPoint.y); //ui.doubleSpinBoxRightButtomX->setValue(m_vectBondMatrixs[0].RightBottomPoint.x); //ui.doubleSpinBoxRightButtomY->setValue(m_vectBondMatrixs[0].RightBottomPoint.y); //QString noBondPts = ""; //bool firstTime = false; //for (XY_LONG_STRUCT& pt : m_vectBondMatrixs[0].VecNoBondPt) //{ // if (firstTime) // { // noBondPts += "(" + QString::number(pt.x) + "," + QString::number(pt.y) + ")"; // firstTime = true; // } // noBondPts += ";(" + QString::number(pt.x) + "," + QString::number(pt.y) + ")"; //} //ui.lineEditNoBondPts->setText(noBondPts); ////显示子矩阵及数据 //for (PROGRAM_POINT_MATRIX_STRUCT& subMatrix : m_vecSubMatrixs) //{ // AddMatrixPage(subMatrix); //} //从后端获取参数, 一套数据 CResources* pResources = CResources::GetInstance(); //if (pResources == nullptr) return; CBondMatrix* pBondMatrix = pResources->GetBondMatrix(); //if (pBondMatrix == nullptr) return; //AddOutMatrixPage(0, m_vectBondMatrixs[0], m_vecSubMatrixs); ui.comboBoxCurrentMatrix->clear(); for (int i = 0; i < m_vectBondMatrixs.size(); i++) { // 显示 矩阵编号 int _bondMatrixId = m_vectBondMatrixs[i].BondMatrixId; QString itemText = QString::number(_bondMatrixId); // 将 矩阵编号 添加到下拉框 ui.comboBoxCurrentMatrix->addItem(itemText,_bondMatrixId); } if (!m_vectBondMatrixs.empty()) { ShowCurrentMatrix(m_vectBondMatrixs[0].BondMatrixId); } // 清空下拉框中的所有项 ui.comboBoxCurrentPara->clear(); // 重新填充下拉框选项,并更新 QMap 中的绑定关系 for (const auto& bondMatrix : m_vecBondInfoData) { // 显示编号 iInfoId QString itemText = QString::number(bondMatrix.iInfoId); // 将 iInfoId 添加到下拉框 ui.comboBoxCurrentPara->addItem(itemText, bondMatrix.iInfoId); } UpdateShowBondInfoData(m_vectBondMatrixs[0].BondInfoId); } void BondMatrixProgramPage::UpdateShowBondInfoData(UINT iInfoId) { if (iInfoId <= 0)return; //pBondMatrix->GetPintInfoByIndex(0, m_curPointInfo); m_manageDB->GetCProduct()->GetBondInfoData(iInfoId, m_curBondInfo); m_tempBondInfo = m_curBondInfo; m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iPickParamId, m_curWaferPickParam); m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iCalibBondParamId, m_curCalibPlaceParam); m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iCalibPickParamId, m_curCalibPickParam); m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iBondParamId, m_curBondParam); m_vecParam = m_manageDB->GetCProduct()->GetAllBondParamData(); m_tempWaferPickParam = m_curWaferPickParam; m_tempCalibPlaceParam = m_curCalibPlaceParam; m_tempCalibPickParam = m_curCalibPickParam; m_tempBondParam = m_curBondParam; //m_vecPrTemplate = m_manageDB->GetCProduct()->GetPrTemplate(); //m_vecPrStrategy = m_manageDB->GetCProduct()->GetPrStrategy(); //m_vecPrBondInsp = m_manageDB->GetCProduct()->GetPrBondInsp(); //m_TipMatrix->GetAllNozzleIndex(m_vecNozzles); ui.comboBoxCurrentPara->setCurrentIndex(ui.comboBoxCurrentPara->findData(iInfoId)); // 设置默认项 updateDeleteButtonStatus(canDeleteBondInfo(iInfoId), ui.pushButtonDeleteParam); //updateFourParamDeleteButtonStatus(); //显示界面参数 UpdatePageParam(); }