JonYang 17 hours ago
parent
commit
a8eb88d0c6

+ 227 - 76
View/die-bonder-ui/Src/BondMatrixProgramPage.cpp

@@ -13,6 +13,9 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 
 	ui.pushButtonSave->setProperty("type", "save");
 	ui.pushButtonAddOutMatrix->setProperty("type", "addOutMatrix");
+	ui.pushButtonSaveParaAs->setProperty("type", "saveParaAs");
+	ui.pushButtonSavePara->setProperty("type", "savePara");
+
 	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; }"
@@ -42,10 +45,17 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 
 	//ui.tab->setStyleSheet("background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F1F4FD, stop: 1 #E5E4F6)");
 
+	//从后端获取数据
+	m_vectBondMatrixs = m_manageDB->GetCProduct()->GetBondMatrix();
+	m_manageDB->GetCProduct()->GetAllPointMatrix(m_vecSubMatrixs);
+	m_vecBondInfoData = m_manageDB->GetCProduct()->GetAllBondInfoData();
+	if (m_vectBondMatrixs.size() == 0)
+	{
+		return;
+	}
 	initPage();
 
 	connect(ui.pushButtonSave, &QPushButton::clicked, this, [=] {
-		ParamChangeEvent();
 		MatrixChangeEvent();
 		});
 
@@ -56,30 +66,49 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 			[](const PROGRAM_BOND_MATRIX_STRUCT& a, const PROGRAM_BOND_MATRIX_STRUCT& b) {
 				return a.BondMatrixId < b.BondMatrixId;
 			});
-		//找Id
-		int newId = 1;
-		for (const auto& matrix : m_vectBondMatrixs)
+
+		int newBondMatrixID = 0;
+		UINT maxID = 0;
+		// 查找最大 MatrixId
+		for (PROGRAM_BOND_MATRIX_STRUCT& bondMatrix : m_vectBondMatrixs)
 		{
-			if (matrix.BondMatrixId == newId)
+			if (bondMatrix.BondMatrixId > maxID)
 			{
-				newId++;
-			}
-			else if (matrix.BondMatrixId > newId)
-			{
-				break;
+				maxID = bondMatrix.BondMatrixId;
 			}
 		}
 
-		newMatrix.BondMatrixId = newId;
+		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 = "UltraHead";
+		newMatrix.iModuleId = MODULE_LIST::BondHead;
 		int newVectorIndex = m_vectBondMatrixs.size();
-		std::vector<PROGRAM_POINT_MATRIX_STRUCT> newVecSubMatrix;
+
+
+		newMatrix.BondInfoId = 1;
+		//std::vector<PROGRAM_POINT_MATRIX_STRUCT> newVecSubMatrix;
 		m_vectBondMatrixs.push_back(newMatrix);
-		AddOutMatrixPage(newVectorIndex, newMatrix, newVecSubMatrix);
+		AddOutMatrixPage(newVectorIndex, newMatrix, m_vecSubMatrixs);
 
 		});
 
+	connect(ui.pushButtonSavePara, &QPushButton::clicked, this, [=] {
+		MatrixChangeEvent();
+		ParamChangeEvent();
+		});
+	connect(ui.pushButtonSaveParaAs, &QPushButton::clicked, this, [=] {
+		ParamSaveAsEvent();
+		});
 	//参数
 	connect(ui.comboBoxDieSource, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](int index) {
 		if (index == 0)
@@ -90,7 +119,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curBondInfo.eDieSource = DIE_SOURCE::BY_WAFER;
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 
 	connect(ui.checkBoxIsCalib, &QCheckBox::clicked, this, [=](bool isChecked) {
@@ -99,58 +128,58 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 
 	connect(ui.spinBoxPickTempID, &SpinBox::editDone, this, [=]() {
 		m_curBondInfo.iPickPRStrategyId = ui.spinBoxPickTempID->value();
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 
 	connect(ui.spinBoxPickNozzleID, &SpinBox::editDone, this, [=]() {
 		m_curBondInfo.iPickHeadId = ui.spinBoxPickNozzleID->value();
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 
 	connect(ui.spinBoxPreBondTemp, &SpinBox::editDone, this, [=]() {
 		m_curBondInfo.iBondFrontPRStrategyId = ui.spinBoxPreBondTemp->value();
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 
 	connect(ui.spinBoxPostBondTemp, &SpinBox::editDone, this, [=]() {
 		m_curBondInfo.iBondBackPRStrategyId = ui.spinBoxPostBondTemp->value();
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 
 	connect(ui.spinBoxBondTemp, &SpinBox::editDone, this, [=]() {
 		m_curBondInfo.iBondPRStrategyId = ui.spinBoxBondTemp->value();
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 
 	connect(ui.spinBoxLookUpTemp, &SpinBox::editDone, this, [=]() {
 		m_curBondInfo.iLookUpPRStrategyId = ui.spinBoxLookUpTemp->value();
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 
 	connect(ui.spinBoxCalibPickTemp, &SpinBox::editDone, this, [=]() {
 		m_curBondInfo.iCalibPRStrategyId = ui.spinBoxCalibPickTemp->value();
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 
 	connect(ui.spinBoxBondNozzleID, &SpinBox::editDone, this, [=]() {
 		m_curBondInfo.iBondHeadId = ui.spinBoxBondNozzleID->value();
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.doubleSpinBoxBondOffsetX, &DoubleSpinBox::editDone, this, [=]() {
 		m_curBondInfo.stOffset.x = ui.doubleSpinBoxBondOffsetX->value();
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.doubleSpinBoxBondOffsetY, &DoubleSpinBox::editDone, this, [=]() {
 		m_curBondInfo.stOffset.y = ui.doubleSpinBoxBondOffsetY->value();
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.doubleSpinBoxBondOffsetAngle, &DoubleSpinBox::editDone, this, [=]() {
 		m_curBondInfo.stOffset.a = ui.doubleSpinBoxBondOffsetAngle->value();
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 
 	connect(ui.comboBoxPickParamType, &QComboBox::currentTextChanged, this, [=]() {
-		UpdatePagePickParam();
+		//UpdatePagePickParam();
 		});
 	connect(ui.checkBoxPickBlockCheck, &QCheckBox::clicked, this, [=](bool isChecked) {
 
@@ -162,7 +191,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curCalibPickParam.bCheckBlock = ui.checkBoxPickBlockCheck->isChecked();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.checkBoxPickLoseCheck, &QCheckBox::clicked, this, [=](bool isChecked) {
 		if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
@@ -173,7 +202,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curCalibPickParam.bCheckLose = ui.checkBoxPickLoseCheck->isChecked();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.checkBoxPickFindForceCheck, &QCheckBox::clicked, this, [=](bool isChecked) {
 		if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
@@ -184,7 +213,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curCalibPickParam.bFindForce = ui.checkBoxPickFindForceCheck->isChecked();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.doubleSpinBoxPrePickZ, &DoubleSpinBox::editDone, this, [=]() {
 		if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
@@ -195,7 +224,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curCalibPickParam.dPreLev = ui.doubleSpinBoxPrePickZ->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.doubleSpinBoxPickForce, &DoubleSpinBox::editDone, this, [=]() {
 		if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
@@ -206,7 +235,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curCalibPickParam.dForce = ui.doubleSpinBoxPickForce->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.doubleSpinBoxPickPosZ, &DoubleSpinBox::editDone, this, [=]() {
 		if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
@@ -217,7 +246,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curCalibPickParam.dWorkLev = ui.doubleSpinBoxPickPosZ->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.spinBoxPickGrabDelay, &SpinBox::editDone, this, [=]() {
 		if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
@@ -228,7 +257,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curCalibPickParam.iGrabDelay = ui.spinBoxPickGrabDelay->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.spinBox_PickDelay, &SpinBox::editDone, this, [=]() {
 		if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
@@ -239,7 +268,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curCalibPickParam.iPickOrBondDelay = ui.spinBox_PickDelay->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.spinBoxPickBlockCheckDelay, &SpinBox::editDone, this, [=]() {
 		if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
@@ -250,7 +279,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curCalibPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.spinBoxPickVacDelay, &SpinBox::editDone, this, [=]() {
 		if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
@@ -261,7 +290,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curCalibPickParam.iVacuumDelay = ui.spinBoxPickVacDelay->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.spinBoxPickBlowDelay, &SpinBox::editDone, this, [=]() {
 		if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
@@ -272,7 +301,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curCalibPickParam.iBlowDelay = ui.spinBoxPickBlowDelay->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 
 
@@ -288,7 +317,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curBondParam.bCheckBlock = ui.checkBoxBondBlockCheck->isChecked();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.checkBoxBondLoseCheck, &QCheckBox::clicked, this, [=](bool isChecked) {
 		if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
@@ -299,7 +328,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curBondParam.bCheckLose = ui.checkBoxBondLoseCheck->isChecked();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.checkBoxBondFindForce, &QCheckBox::clicked, this, [=](bool isChecked) {
 		if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
@@ -310,7 +339,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curBondParam.bFindForce = ui.checkBoxBondFindForce->isChecked();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.doubleSpinBoxPreBondPosZ, &DoubleSpinBox::editDone, this, [=]() {
 		if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
@@ -321,7 +350,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curBondParam.dPreLev = ui.doubleSpinBoxPreBondPosZ->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 
 	connect(ui.doubleSpinBoxBondForce, &DoubleSpinBox::editDone, this, [=]() {
@@ -333,7 +362,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curBondParam.dForce = ui.doubleSpinBoxBondForce->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 
 	connect(ui.doubleSpinBoxBondPosZ, &DoubleSpinBox::editDone, this, [=]() {
@@ -345,7 +374,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curBondParam.dWorkLev = ui.doubleSpinBoxBondPosZ->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.spinBoxBondGrabDelay, &SpinBox::editDone, this, [=]() {
 		if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
@@ -356,7 +385,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curBondParam.iGrabDelay = ui.spinBoxBondGrabDelay->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.spinBoxBondBlockCheckDelay, &SpinBox::editDone, this, [=]() {
 		if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
@@ -367,7 +396,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curBondParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.spinBoxBondDelay, &SpinBox::editDone, this, [=]() {
 		if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
@@ -378,7 +407,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curBondParam.iPickOrBondDelay = ui.spinBoxBondDelay->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.spinBoxBondVacDelay, &SpinBox::editDone, this, [=]() {
 		if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
@@ -389,7 +418,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curBondParam.iVacuumDelay = ui.spinBoxBondVacDelay->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 	connect(ui.spinBoxBondBlowDelay, &SpinBox::editDone, this, [=]() {
 		if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
@@ -400,7 +429,7 @@ BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
 		{
 			m_curBondParam.iBlowDelay = ui.spinBoxBondBlowDelay->value();
 		}
-		ParamChangeEvent();
+		//ParamChangeEvent();
 		});
 }
 
@@ -498,31 +527,40 @@ void BondMatrixProgramPage::AddOutMatrixPage(int vectorIndex, PROGRAM_BOND_MATRI
 			[](const PROGRAM_POINT_MATRIX_STRUCT& a, const PROGRAM_POINT_MATRIX_STRUCT& b) {
 				return a.MatrixId < b.MatrixId;
 			});
-		//找Id
-		int newId = 1;
-		for (const auto& matrix : m_vecSubMatrixs)
+
+		int newSubMatrixID = 0;
+		UINT maxID = 0;
+
+		// 查找最大 MatrixId
+		for (PROGRAM_POINT_MATRIX_STRUCT& subMatrix : m_vecSubMatrixs)
 		{
-			if (matrix.MatrixId == newId)
-			{
-				newId++;
-			}
-			else if (matrix.MatrixId > newId)
+			if (subMatrix.MatrixId > maxID)
 			{
-				break;
+				maxID = subMatrix.MatrixId;
 			}
 		}
-		subMatrix.MatrixId = newId;
+		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 = "UltraHead";
 		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 index = currentIt.value(); //迭代器 erase后currentIt被删除了
-		m_vectBondMatrixs[index].VecPointMatrixId.push_back(newId);
+		m_vectBondMatrixs[index].VecPointMatrixId.push_back(newSubMatrixID);
 
 		AddMatrixPage(index, newSubMatrixIndex, subMatrix, outMatrixGridLayout);
 		});
@@ -685,6 +723,49 @@ void BondMatrixProgramPage::AddOutMatrixPage(int vectorIndex, PROGRAM_BOND_MATRI
 	lineEditNoBondPts->setProperty("parentMatrixIndex", -1);  // 设置父矩阵的索引
 	lineEditNoBondPts->installEventFilter(this);
 
+	/*QLineEdit* lineEditNoBondPts = new QLineEdit(outWidget);
+	lineEditNoBondPts->setObjectName(QString::fromUtf8("lineEditNoBondPts"));
+	matrixGridLayout->addWidget(lineEditNoBondPts, 7, 1, 1, 3);
+	vecControls.push_back(lineEditNoBondPts);*/
+
+	// 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);
+
+	QComboBox* comboBoxParagramSet = new QComboBox(outWidget);
+	comboBoxParagramSet->setObjectName(QString::fromUtf8("comboBoxNoBondPts"));
+	m_mapParagramSetComboBox.insert(comboBoxParagramSet, vectorIndex);
+
+	// 添加选项到下拉框并关联 iInfoId
+	for (const auto& bondMatrix : m_vecBondInfoData) {
+		// 将 iInfoId 作为显示项添加到下拉框
+		QString itemText = QString::number(bondMatrix.iInfoId);  // 显示编号 iInfoId
+
+		// 添加项并使用 setData 存储 iInfoId 作为附加数据
+		comboBoxParagramSet->addItem(itemText, bondMatrix.iInfoId);
+	}
+
+	// 将下拉框添加到布局中
+	matrixGridLayout->addWidget(comboBoxParagramSet, 8, 1, 1, 1);
+
+	// 将控件保存到 vecControls 中
+	vecControls.push_back(comboBoxParagramSet);
+	// 连接 QComboBox 的信号和槽
+	connect(comboBoxParagramSet, SIGNAL(currentIndexChanged(int)), this, SLOT(onComboBoxIndexChanged(int)));
+	connect(comboBoxParagramSet, SIGNAL(showPopup()), this, SLOT(onComboBoxPopup()));
+
+
+	QPushButton* buttonParagram = new QPushButton("ShowParagram", this);
+	//buttonParagram->setFixedWidth(62);  // 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);         // 设置固定高度
@@ -715,10 +796,7 @@ void BondMatrixProgramPage::AddOutMatrixPage(int vectorIndex, PROGRAM_BOND_MATRI
 			}
 		}
 	}
-	/*for (int i = 0; i < vecSubMatrix.size(); i++)
-	{
-		AddMatrixPage(i, vecSubMatrix[i], outMatrixGridLayout);
-	}*/
+
 	QSpacerItem* vSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
 	ui.verticalLayout_3->addItem(vSpacer);
 	// Add all controls and finalize layout
@@ -770,6 +848,66 @@ void BondMatrixProgramPage::AddOutMatrixPage(int vectorIndex, PROGRAM_BOND_MATRI
 		});
 }
 
+void BondMatrixProgramPage::onComboBoxPopup() {
+	// 获取当前的 QComboBox
+	QComboBox* comboBox = qobject_cast<QComboBox*>(sender());
+	if (!comboBox) {
+		return;
+	}
+
+	// 清空下拉框中的所有项
+	comboBox->clear();
+
+	// 重新填充下拉框选项,并更新 QMap 中的绑定关系
+	for (const auto& bondMatrix : m_vecBondInfoData) {
+		// 显示编号 iInfoId
+		QString itemText = QString::number(bondMatrix.iInfoId);
+
+		// 将 iInfoId 添加到下拉框
+		comboBox->addItem(itemText, bondMatrix.iInfoId);
+	}
+}
+
+//// 槽函数:每次下拉框弹出时刷新内容
+//void BondMatrixProgramPage::onComboBoxPopup() {
+//	// 清空下拉框中的所有项
+//	comboBoxParagramSet->clear();
+//
+//	// 重新填充下拉框选项
+//	for (const auto& bondMatrix : m_vecBondInfoData) {
+//		// 显示编号 iInfoId
+//		QString itemText = QString::number(bondMatrix.iInfoId);
+//
+//		// 将 iInfoId 添加到下拉框
+//		comboBoxParagramSet->addItem(itemText, bondMatrix.iInfoId);
+//	}
+//}
+void BondMatrixProgramPage::onComboBoxIndexChanged(int index) {
+	// 获取当前选中的 QComboBox
+	QComboBox* comboBox = qobject_cast<QComboBox*>(sender());
+	if (!comboBox) {
+		return;
+	}
+
+	// 获取当前选中的 BondInfoId
+	UINT selectedBondInfoId = comboBox->currentData().toUInt();
+
+	// 获取当前 QComboBox 对应的 vectorIndex
+	int vectorIndex = m_mapParagramSetComboBox.value(comboBox, -1);  // 从 QMap 中获取 vectorIndex
+
+	if (vectorIndex != -1) {
+		// 更新 m_vectBondMatrixs[vectorIndex].BondInfoId
+		m_vectBondMatrixs[vectorIndex].BondInfoId = selectedBondInfoId;
+
+		//qDebug() << "Updated BondInfoId for vectorIndex: " << vectorIndex;
+	}
+	else {
+		//qDebug() << "No vectorIndex found for the combo box!";
+	}
+
+	// 调用 UpdateShowBondInfoData 更新数据
+	UpdateShowBondInfoData(selectedBondInfoId);
+}
 
 void BondMatrixProgramPage::AddMatrixPage(int vectorIndex, int subVectorIndex, PROGRAM_POINT_MATRIX_STRUCT subMatrix, QGridLayout* layout)
 {
@@ -1094,7 +1232,6 @@ void BondMatrixProgramPage::onNoBondPtsClicked(QLineEdit* lineEdit, int index, i
 	}
 }
 
-
 void BondMatrixProgramPage::AddMatrixParam()
 {
 
@@ -1129,6 +1266,17 @@ void BondMatrixProgramPage::UpdatePageParam()
 
 }
 
+int BondMatrixProgramPage::ParamSaveAsEvent() 
+{
+	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);
+	return iInfoId;
+}
 void BondMatrixProgramPage::ParamChangeEvent()
 {
 	m_manageDB->GetCProduct()->SetBondInfoData(m_curBondInfo.iInfoId, m_curBondInfo);
@@ -1229,17 +1377,6 @@ void BondMatrixProgramPage::UpdatePageBondParam()
 
 void BondMatrixProgramPage::initPage()
 {
-	if (m_manageDB == nullptr)
-	{
-		return;
-	}
-	//从后端获取数据
-	m_vectBondMatrixs = m_manageDB->GetCProduct()->GetBondMatrix();
-	m_manageDB->GetCProduct()->GetAllPointMatrix(m_vecSubMatrixs);
-	if (m_vectBondMatrixs.size() == 0)
-	{
-		return;
-	}
 
 	//for (int i = 0; i < m_vectBondMatrixs.size(); i++)
 	//{
@@ -1309,9 +1446,22 @@ void BondMatrixProgramPage::initPage()
 	{
 		return;
 	}
+	UpdateShowBondInfoData(m_vectBondMatrixs[0].BondInfoId);
+	////pBondMatrix->GetPintInfoByIndex(0, m_curPointInfo);
+	//m_manageDB->GetCProduct()->GetBondInfoData(m_vectBondMatrixs[0].BondInfoId, 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);
+
+	////显示界面参数
+	//UpdatePageParam();
+}
+
+void BondMatrixProgramPage::UpdateShowBondInfoData(UINT iInfoId) {
 
 	//pBondMatrix->GetPintInfoByIndex(0, m_curPointInfo);
-	m_manageDB->GetCProduct()->GetBondInfoData(m_vectBondMatrixs[0].BondInfoId, m_curBondInfo);
+	m_manageDB->GetCProduct()->GetBondInfoData(iInfoId, 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);
@@ -1320,3 +1470,4 @@ void BondMatrixProgramPage::initPage()
 	//显示界面参数
 	UpdatePageParam();
 }
+

+ 11 - 0
View/die-bonder-ui/Src/BondMatrixProgramPage.h

@@ -40,6 +40,7 @@ private:
 
 	//参数被修改后发送给后端
 	void ParamChangeEvent();
+	int ParamSaveAsEvent();
 
 	//参数被修改后发送给后端
 	void MatrixChangeEvent();
@@ -52,6 +53,7 @@ private:
 
 	void initPage();
 
+
 protected:
 	bool eventFilter(QObject* watched, QEvent* event) override;
 
@@ -59,6 +61,10 @@ protected:
 private slots:
 	void onNoBondPtsClicked(QLineEdit* lineEdit, int index, int parentIndex);
 
+	void UpdateShowBondInfoData(UINT iInfoId);
+	void onComboBoxIndexChanged(int index);
+	void onComboBoxPopup();
+
 private:
 	Ui::BondMatrixProgramPageClass ui;
 
@@ -87,6 +93,8 @@ private:
 
 	std::vector<ns_db::PROGRAM_POINT_MATRIX_STRUCT> m_vecSubMatrixs;
 
+	std::vector<BOND_INFO_STRUCT> m_vecBondInfoData;
+
 	//子矩阵控件,ID从1开始
 	QMap<int, QVector<QObject*>> m_mapSubMatrixControls;
 
@@ -101,4 +109,7 @@ private:
 	QMap<QWidget*, int> m_mapSubWidgetIndex;
 
 	QMap<QWidget*, int> m_mapOutWidgetIndex;
+
+	//QComboBox* comboBoxParagramSet;
+	QMap<QComboBox*, int> m_mapParagramSetComboBox;
 };

+ 50 - 31
View/die-bonder-ui/Src/BondMatrixProgramPage.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>437</width>
-    <height>943</height>
+    <width>441</width>
+    <height>952</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -17,7 +17,7 @@
    <property name="geometry">
     <rect>
      <x>0</x>
-     <y>50</y>
+     <y>40</y>
      <width>431</width>
      <height>231</height>
     </rect>
@@ -102,7 +102,7 @@
      <rect>
       <x>0</x>
       <y>0</y>
-      <width>408</width>
+      <width>412</width>
       <height>1282</height>
      </rect>
     </property>
@@ -639,22 +639,6 @@
     </layout>
    </widget>
   </widget>
-  <widget class="QFrame" name="frame_3">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>30</y>
-     <width>431</width>
-     <height>16</height>
-    </rect>
-   </property>
-   <property name="frameShape">
-    <enum>QFrame::StyledPanel</enum>
-   </property>
-   <property name="frameShadow">
-    <enum>QFrame::Raised</enum>
-   </property>
-  </widget>
   <widget class="QWidget" name="layoutWidget">
    <property name="geometry">
     <rect>
@@ -687,7 +671,7 @@
        </size>
       </property>
       <property name="text">
-       <string>Add</string>
+       <string>AddMatrix</string>
       </property>
      </widget>
     </item>
@@ -700,27 +684,62 @@
        </size>
       </property>
       <property name="text">
-       <string>Save</string>
+       <string>SaveMatrix</string>
       </property>
      </widget>
     </item>
    </layout>
   </widget>
-  <widget class="QFrame" name="frame_4">
+  <widget class="QWidget" name="layoutWidget_2">
    <property name="geometry">
     <rect>
      <x>0</x>
-     <y>290</y>
+     <y>280</y>
      <width>431</width>
-     <height>16</height>
+     <height>30</height>
     </rect>
    </property>
-   <property name="frameShape">
-    <enum>QFrame::StyledPanel</enum>
-   </property>
-   <property name="frameShadow">
-    <enum>QFrame::Raised</enum>
-   </property>
+   <layout class="QHBoxLayout" name="horizontalLayout_2">
+    <item>
+     <spacer name="horizontalSpacer_2">
+      <property name="orientation">
+       <enum>Qt::Horizontal</enum>
+      </property>
+      <property name="sizeHint" stdset="0">
+       <size>
+        <width>40</width>
+        <height>20</height>
+       </size>
+      </property>
+     </spacer>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButtonSaveParaAs">
+      <property name="minimumSize">
+       <size>
+        <width>150</width>
+        <height>0</height>
+       </size>
+      </property>
+      <property name="text">
+       <string>SaveParaAs</string>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButtonSavePara">
+      <property name="minimumSize">
+       <size>
+        <width>150</width>
+        <height>0</height>
+       </size>
+      </property>
+      <property name="text">
+       <string>SavePara</string>
+      </property>
+     </widget>
+    </item>
+   </layout>
   </widget>
  </widget>
  <layoutdefault spacing="6" margin="11"/>

+ 3 - 3
View/die-bonder-ui/Src/RewriteControl/Controls/JReLineEdit.cpp

@@ -129,9 +129,9 @@ void JReLineEdit::CreateSpeedAdjPage()
 void JReLineEdit::GetCloseWndSlots(int nVal)
 {
     m_isSetVal = true;
-    double doVal = text().toDouble();
-    doVal = doVal + nVal;
-    setText(QString::number(doVal, 'f', 2));
+    //double doVal = text().toDouble();
+    //doVal = doVal + nVal;
+    setText(QString::number(nVal, 'f', 2));
 
     m_isSetVal = false;
 }

+ 8 - 2
View/die-bonder-ui/Src/RewriteControl/LightJoystickSwitchPage.cpp

@@ -75,7 +75,7 @@ void LightJoystickSwitchPage::UpDataAxisToUi()
             {"Y", ui->yLayout},
             {"R", ui->rLayout},
             {"Z", ui->zLayout},
-            {"Z1", ui->zLayout}
+            {"Z1", ui->z1Layout}
         };
         for (const auto& val : m_listCurrentShowAxis) 
         {
@@ -111,7 +111,7 @@ void LightJoystickSwitchPage::MoveModule(const QString strAxis, const QString po
             {"Y", ui->yLayout},
             {"R", ui->rLayout},
             {"Z", ui->zLayout},
-            {"Z1", ui->zLayout}
+            {"Z1", ui->z1Layout}
         };
 
         if (m_HaAxisToLayout.contains(strAxis))
@@ -680,6 +680,11 @@ void LightJoystickSwitchPage::on_zLineEdit_textChanged(const QString &arg1)
 }
 
 
+void LightJoystickSwitchPage::on_z1LineEdit_textChanged(const QString& arg1)
+{
+    MoveModule("Z1", arg1);
+}
+
 void LightJoystickSwitchPage::on_rLineEdit_textChanged(const QString &arg1)
 {
     MoveModule("R", arg1);
@@ -701,6 +706,7 @@ void LightJoystickSwitchPage::on_modeComboBox_currentIndexChanged(int index)
         ui->yLayout,
         ui->rLayout,
         ui->zLayout,
+        ui->z1Layout
     };
     for (auto* layout : allLayouts) 
     {

+ 2 - 0
View/die-bonder-ui/Src/RewriteControl/LightJoystickSwitchPage.h

@@ -68,6 +68,8 @@ private slots:
 
     void on_zLineEdit_textChanged(const QString &arg1);
 
+    void on_z1LineEdit_textChanged(const QString& arg1);
+
     void on_rLineEdit_textChanged(const QString &arg1);
 
     void on_forceLineEdit_textChanged(const QString &arg1);

+ 61 - 8
View/die-bonder-ui/Src/RewriteControl/LightJoystickSwitchPage.ui

@@ -473,9 +473,9 @@
      <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
-        <x>190</x>
+        <x>150</x>
         <y>90</y>
-        <width>141</width>
+        <width>121</width>
         <height>33</height>
        </rect>
       </property>
@@ -531,7 +531,7 @@
        <rect>
         <x>10</x>
         <y>50</y>
-        <width>161</width>
+        <width>131</width>
         <height>32</height>
        </rect>
       </property>
@@ -587,7 +587,7 @@
        <rect>
         <x>10</x>
         <y>90</y>
-        <width>161</width>
+        <width>131</width>
         <height>32</height>
        </rect>
       </property>
@@ -643,8 +643,8 @@
        <rect>
         <x>190</x>
         <y>10</y>
-        <width>141</width>
-        <height>32</height>
+        <width>121</width>
+        <height>31</height>
        </rect>
       </property>
       <layout class="QHBoxLayout" name="zLayout">
@@ -697,9 +697,9 @@
      <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
-        <x>190</x>
+        <x>150</x>
         <y>50</y>
-        <width>141</width>
+        <width>121</width>
         <height>32</height>
        </rect>
       </property>
@@ -750,6 +750,59 @@
        </item>
       </layout>
      </widget>
+     <widget class="QWidget" name="">
+      <property name="geometry">
+       <rect>
+        <x>280</x>
+        <y>50</y>
+        <width>61</width>
+        <height>71</height>
+       </rect>
+      </property>
+      <layout class="QVBoxLayout" name="z1Layout">
+       <item>
+        <widget class="QCheckBox" name="z1CheckBox">
+         <property name="minimumSize">
+          <size>
+           <width>56</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="font">
+          <font>
+           <family>宋体</family>
+           <pointsize>12</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>z1</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="JReLineEdit" name="z1LineEdit">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="font">
+          <font>
+           <family>宋体</family>
+           <pointsize>12</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>0</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
     </widget>
    </widget>
   </widget>

+ 2 - 0
View/die-bonder-ui/Src/Sql/SqlOperation.cpp

@@ -299,6 +299,7 @@ int SqlOperation::loadAllControlData()
     moduleTableNameList.append(BOND_TABLE_CONFIG_TABLE_NAME);
     moduleTableNameList.append(NOZZLE_TABLE_CONFIG_TABLE_NAME);
     moduleTableNameList.append(ULTRAHEAD_TABLE_NAME);
+    moduleTableNameList.append(ULTRAHEAD_DIAGNOSIS_TABLE_NAME);
 
     for (QString& dbName : moduleTableNameList)
     {
@@ -667,6 +668,7 @@ bool SqlOperation::isModuleTable(QString tableName)
         tableName == BOND_TABLE_CONFIG_TABLE_NAME ||
         tableName == NOZZLE_TABLE_CONFIG_TABLE_NAME ||
         tableName == ULTRAHEAD_TABLE_NAME ||
+        tableName == ULTRAHEAD_DIAGNOSIS_TABLE_NAME ||
         tableName == CALIB_CTD_TABLE_NAME ||
         tableName == CALIB_XY_TABLE_NAME ||
         tableName == CALIB_R_TABLE_NAME)

+ 14 - 13
View/die-bonder-ui/Src/WaferProgramPage.cpp

@@ -45,23 +45,26 @@ WaferProgramPage::WaferProgramPage(QWidget* parent)
             [](const PROGRAM_WAFER_MATRIX_STRUCT& a, const PROGRAM_WAFER_MATRIX_STRUCT& b) {
                 return a.MatrixId < b.MatrixId;
             });
-        //找Id
-        int newId = 1;
-        for (const auto& matrix : m_vecWaferMatrix)
+
+
+        int newId = 0;
+        UINT maxID = 0;
+
+        // 查找最大 MatrixId
+        for (PROGRAM_WAFER_MATRIX_STRUCT& matrix : m_vecWaferMatrix)
         {
-            if (matrix.MatrixId == newId)
-            {
-                newId++;
-            }
-            else if (matrix.MatrixId > newId)
+            if (matrix.MatrixId > maxID)
             {
-                break;
+                maxID = matrix.MatrixId;
             }
         }
 
+        // 生成新的子矩阵 ID,确保唯一性
+        newId = ++maxID;
+
         newMatrix.MatrixId = newId;
-        newMatrix.MatrixRow = 0;
-        newMatrix.MatrixCol = 0;
+        newMatrix.MatrixRow = 1;
+        newMatrix.MatrixCol = 1;
 
         int newVectorIndex = m_vecWaferMatrix.size();
         m_vecWaferMatrix.push_back(newMatrix);
@@ -78,8 +81,6 @@ void WaferProgramPage::initPage()
     {
         AddMatrixPage(i, m_vecWaferMatrix[i]);
     }
-
-
 }
 
 XY_DOUBLE_STRUCT WaferProgramPage::WaferGetAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos)

+ 44 - 28
View/die-bonder-ui/Src/WaffleProgramPage.cpp

@@ -58,28 +58,36 @@ WaffleProgramPage::WaffleProgramPage(QWidget* parent)
 			[](const PROGRAM_WAFFLE_MATRIX_STRUCT& a, const PROGRAM_WAFFLE_MATRIX_STRUCT& b) {
 				return a.MatrixId < b.MatrixId;
 			});
-		//找Id
-		int newId = 1;
-		for (const auto& matrix : m_vecWaffleMatrix)
+
+		int newId = 0;
+		UINT maxID = 0;
+
+		// 查找最大 MatrixId
+		for (PROGRAM_WAFFLE_MATRIX_STRUCT& waffleMatrix : m_vecWaffleMatrix)
 		{
-			if (matrix.MatrixId == newId)
-			{
-				newId++;
-			}
-			else if (matrix.MatrixId > newId)
+			if (waffleMatrix.MatrixId > maxID)
 			{
-				break;
+				maxID = waffleMatrix.MatrixId;
 			}
 		}
 
+		// 生成新的子矩阵 ID,确保唯一性
+		newId = ++maxID;
+		while (std::any_of(m_vecWaffleMatrix.begin(), m_vecWaffleMatrix.end(),
+			[newId](const PROGRAM_WAFFLE_MATRIX_STRUCT& waffleMatrix) {
+				return waffleMatrix.MatrixId == newId;
+			}))
+		{
+			newId++;  // 如果生成的 ID 已经存在,递增直到找到唯一的 ID
+		}
+
 		newMatrix.MatrixId = newId;
-		newMatrix.PackRow = 0;
-		newMatrix.PackCol = 0;
+		/*newMatrix.PackRow = 0;
+		newMatrix.PackCol = 0;*/
 		int newVectorIndex = m_vecWaffleMatrix.size();
-		std::vector<PROGRAM_DIE_MATRIX_STRUCT> newVecSubMatrix;
+		//std::vector<PROGRAM_DIE_MATRIX_STRUCT> newVecSubMatrix;
 		m_vecWaffleMatrix.push_back(newMatrix);
-		AddMatrixPage(newVectorIndex, newMatrix, newVecSubMatrix);
-
+		AddMatrixPage(newVectorIndex, newMatrix, m_vecSubWaffleMatrix);
 		});
 }
 
@@ -168,30 +176,40 @@ void WaffleProgramPage::AddMatrixPage(int vectorIndex, PROGRAM_WAFFLE_MATRIX_STR
 			[](const PROGRAM_DIE_MATRIX_STRUCT& a, const PROGRAM_DIE_MATRIX_STRUCT& b) {
 				return a.MatrixId < b.MatrixId;
 			});
-		//找Id
-		int newId = 1;
-		for (const auto& matrix : m_vecSubWaffleMatrix)
+
+		int newSubMatrixID = 0;
+		UINT maxID = 0;
+
+		// 查找最大 MatrixId
+		for (PROGRAM_DIE_MATRIX_STRUCT& subMatrix : m_vecSubWaffleMatrix)
 		{
-			if (matrix.MatrixId == newId)
+			if (subMatrix.MatrixId > maxID)
 			{
-				newId++;
-			} else if (matrix.MatrixId > newId)
-			{
-				break;
+				maxID = subMatrix.MatrixId;
 			}
 		}
+		// 生成新的子矩阵 ID,确保唯一性
+		newSubMatrixID = ++maxID;
+		while (std::any_of(m_vecSubWaffleMatrix.begin(), m_vecSubWaffleMatrix.end(),
+			[newSubMatrixID](const PROGRAM_DIE_MATRIX_STRUCT& subMatrix) {
+				return subMatrix.MatrixId == newSubMatrixID;
+			}))
+		{
+			newSubMatrixID++;  // 如果生成的 ID 已经存在,递增直到找到唯一的 ID
+		}
+
 
-		dieMatrix.MatrixId = newId;
-		dieMatrix.strModuleName = "WaffleHead";
+		dieMatrix.MatrixId = newSubMatrixID;
+		/*dieMatrix.strModuleName = "WaffleHead";
 		dieMatrix.iModuleId = MODULE_LIST::WaffleHead;
 		dieMatrix.MatrixRow = 0;
-		dieMatrix.MatrixCol = 0;
+		dieMatrix.MatrixCol = 0;*/
 		m_vecSubWaffleMatrix.push_back(dieMatrix);
 
 		//找大矩阵ID/Index
 		auto currentIt = m_mapOutWidgetIndex.find(outWidget);
 		int index = currentIt.value(); //迭代器 erase后currentIt被删除了
-		m_vecWaffleMatrix[index].VecDieMatrixId.push_back(newId);
+		m_vecWaffleMatrix[index].VecDieMatrixId.push_back(newSubMatrixID);
 
 		AddSubMatrixPage(vectorIndex,newIndex, dieMatrix, boxGridLayout);
 		});
@@ -202,8 +220,6 @@ void WaffleProgramPage::AddMatrixPage(int vectorIndex, PROGRAM_WAFFLE_MATRIX_STR
 	pushButtonDelete->setText(tr("Delete"));
 	matrixGridLayout->addWidget(pushButtonDelete, 0, 1, 1, 1);
 
-
-
 	connect(pushButtonDelete, &QPushButton::clicked, this, [=]() {
 
 		//处理index