BondMatrixProgramPage.cpp 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322
  1. #include "BondMatrixProgramPage.h"
  2. #include "Src/RewriteControl/Controls/SpinBox.h"
  3. #include "Src/RewriteControl/Controls/DoubleSpinBox.h"
  4. #include <QPushButton>
  5. #include <QtWidgets/qmessagebox.h>
  6. #include <View/die-bonder-ui/Src/MatrixDialogs/NoBondPtEditDialog.h>
  7. BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
  8. QWidget(parent)
  9. {
  10. ui.setupUi(this);
  11. ui.pushButtonSave->setProperty("type", "save");
  12. ui.pushButtonAddOutMatrix->setProperty("type", "addOutMatrix");
  13. setStyleSheet(
  14. "QWidget { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F1F4FD, stop: 1 #E5E4F6); }"
  15. "QDoubleSpinBox { background: #FFFFFF; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }"
  16. "QSpinBox { background: #FFFFFF; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }"
  17. "QLineEdit { background: #FFFFFF; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }"
  18. "QCheckBox::indicator { width: 20px; height: 20px; }"
  19. "QCheckBox::indicator:unchecked { background-color: #FFFFFF; border-radius: 2px; }"
  20. "QComboBox { background: #FFFFFF; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }"
  21. "QComboBox::drop-down { width: 20px; }"
  22. "QPushButton { background: #D0D0E8; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }" // Button background color
  23. "QPushButton:hover { background-color: #B0B0D8; }" // Lighter color on hover
  24. "QPushButton:pressed { background-color: #A0A0C8; }" // Darker color on press
  25. );
  26. m_manageDB = CManageDB::GetInstance();
  27. if (m_manageDB == nullptr) return;
  28. m_pProduct = m_manageDB->GetCProduct();
  29. if (m_pProduct == nullptr) return;
  30. m_pProgramCViewInterface = ns_module::CViewInterface::GetInstance();
  31. ui.frame->setFrameShape(QFrame::NoFrame); // 移除默认框架
  32. ui.frame->setFixedHeight(2); // 设置固定高度
  33. ui.frame->setStyleSheet("background-color: #C7CAEB;");
  34. //ui.tab->setStyleSheet("background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F1F4FD, stop: 1 #E5E4F6)");
  35. initPage();
  36. connect(ui.pushButtonSave, &QPushButton::clicked, this, [=] {
  37. ParamChangeEvent();
  38. MatrixChangeEvent();
  39. });
  40. connect(ui.pushButtonAddOutMatrix, &QPushButton::clicked, this, [=]() {
  41. PROGRAM_BOND_MATRIX_STRUCT newMatrix;
  42. //排序
  43. std::sort(m_vectBondMatrixs.begin(), m_vectBondMatrixs.end(),
  44. [](const PROGRAM_BOND_MATRIX_STRUCT& a, const PROGRAM_BOND_MATRIX_STRUCT& b) {
  45. return a.BondMatrixId < b.BondMatrixId;
  46. });
  47. //找Id
  48. int newId = 1;
  49. for (const auto& matrix : m_vectBondMatrixs)
  50. {
  51. if (matrix.BondMatrixId == newId)
  52. {
  53. newId++;
  54. }
  55. else if (matrix.BondMatrixId > newId)
  56. {
  57. break;
  58. }
  59. }
  60. newMatrix.BondMatrixId = newId;
  61. newMatrix.BondMatrixRow = 0;
  62. newMatrix.BondMatrixCol = 0;
  63. int newVectorIndex = m_vectBondMatrixs.size();
  64. std::vector<PROGRAM_POINT_MATRIX_STRUCT> newVecSubMatrix;
  65. m_vectBondMatrixs.push_back(newMatrix);
  66. AddOutMatrixPage(newVectorIndex, newMatrix, newVecSubMatrix);
  67. });
  68. //参数
  69. connect(ui.comboBoxDieSource, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](int index) {
  70. if (index == 0)
  71. {
  72. m_curBondInfo.eDieSource = DIE_SOURCE::BY_WAFFLE;
  73. }
  74. else if (index == 1)
  75. {
  76. m_curBondInfo.eDieSource = DIE_SOURCE::BY_WAFER;
  77. }
  78. ParamChangeEvent();
  79. });
  80. connect(ui.checkBoxIsCalib, &QCheckBox::clicked, this, [=](bool isChecked) {
  81. });
  82. connect(ui.spinBoxPickTempID, &SpinBox::editDone, this, [=]() {
  83. m_curBondInfo.iPickPRStrategyId = ui.spinBoxPickTempID->value();
  84. ParamChangeEvent();
  85. });
  86. connect(ui.spinBoxPickNozzleID, &SpinBox::editDone, this, [=]() {
  87. m_curBondInfo.iPickHeadId = ui.spinBoxPickNozzleID->value();
  88. ParamChangeEvent();
  89. });
  90. connect(ui.spinBoxPreBondTemp, &SpinBox::editDone, this, [=]() {
  91. m_curBondInfo.iBondFrontPRStrategyId = ui.spinBoxPreBondTemp->value();
  92. ParamChangeEvent();
  93. });
  94. connect(ui.spinBoxPostBondTemp, &SpinBox::editDone, this, [=]() {
  95. m_curBondInfo.iBondBackPRStrategyId = ui.spinBoxPostBondTemp->value();
  96. ParamChangeEvent();
  97. });
  98. connect(ui.spinBoxBondTemp, &SpinBox::editDone, this, [=]() {
  99. m_curBondInfo.iBondPRStrategyId = ui.spinBoxBondTemp->value();
  100. ParamChangeEvent();
  101. });
  102. connect(ui.spinBoxLookUpTemp, &SpinBox::editDone, this, [=]() {
  103. m_curBondInfo.iLookUpPRStrategyId = ui.spinBoxLookUpTemp->value();
  104. ParamChangeEvent();
  105. });
  106. connect(ui.spinBoxCalibPickTemp, &SpinBox::editDone, this, [=]() {
  107. m_curBondInfo.iCalibPRStrategyId = ui.spinBoxCalibPickTemp->value();
  108. ParamChangeEvent();
  109. });
  110. connect(ui.spinBoxBondNozzleID, &SpinBox::editDone, this, [=]() {
  111. m_curBondInfo.iBondHeadId = ui.spinBoxBondNozzleID->value();
  112. ParamChangeEvent();
  113. });
  114. connect(ui.doubleSpinBoxBondOffsetX, &DoubleSpinBox::editDone, this, [=]() {
  115. m_curBondInfo.stOffset.x = ui.doubleSpinBoxBondOffsetX->value();
  116. ParamChangeEvent();
  117. });
  118. connect(ui.doubleSpinBoxBondOffsetY, &DoubleSpinBox::editDone, this, [=]() {
  119. m_curBondInfo.stOffset.y = ui.doubleSpinBoxBondOffsetY->value();
  120. ParamChangeEvent();
  121. });
  122. connect(ui.doubleSpinBoxBondOffsetAngle, &DoubleSpinBox::editDone, this, [=]() {
  123. m_curBondInfo.stOffset.a = ui.doubleSpinBoxBondOffsetAngle->value();
  124. ParamChangeEvent();
  125. });
  126. connect(ui.comboBoxPickParamType, &QComboBox::currentTextChanged, this, [=]() {
  127. UpdatePagePickParam();
  128. });
  129. connect(ui.checkBoxPickBlockCheck, &QCheckBox::clicked, this, [=](bool isChecked) {
  130. if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
  131. {
  132. m_curWaferPickParam.bCheckBlock = ui.checkBoxPickBlockCheck->isChecked();
  133. }
  134. else if (ui.comboBoxPickParamType->currentIndex() == 1)//晶圆台
  135. {
  136. m_curCalibPickParam.bCheckBlock = ui.checkBoxPickBlockCheck->isChecked();
  137. }
  138. ParamChangeEvent();
  139. });
  140. connect(ui.checkBoxPickLoseCheck, &QCheckBox::clicked, this, [=](bool isChecked) {
  141. if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
  142. {
  143. m_curWaferPickParam.bCheckLose = ui.checkBoxPickLoseCheck->isChecked();
  144. }
  145. else if (ui.comboBoxPickParamType->currentIndex() == 1)//晶圆台
  146. {
  147. m_curCalibPickParam.bCheckLose = ui.checkBoxPickLoseCheck->isChecked();
  148. }
  149. ParamChangeEvent();
  150. });
  151. connect(ui.checkBoxPickFindForceCheck, &QCheckBox::clicked, this, [=](bool isChecked) {
  152. if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
  153. {
  154. m_curWaferPickParam.bFindForce = ui.checkBoxPickFindForceCheck->isChecked();
  155. }
  156. else if (ui.comboBoxPickParamType->currentIndex() == 1)//晶圆台
  157. {
  158. m_curCalibPickParam.bFindForce = ui.checkBoxPickFindForceCheck->isChecked();
  159. }
  160. ParamChangeEvent();
  161. });
  162. connect(ui.doubleSpinBoxPrePickZ, &DoubleSpinBox::editDone, this, [=]() {
  163. if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
  164. {
  165. m_curWaferPickParam.dPreLev = ui.doubleSpinBoxPrePickZ->value();
  166. }
  167. else if (ui.comboBoxPickParamType->currentIndex() == 1)//晶圆台
  168. {
  169. m_curCalibPickParam.dPreLev = ui.doubleSpinBoxPrePickZ->value();
  170. }
  171. ParamChangeEvent();
  172. });
  173. connect(ui.doubleSpinBoxPickForce, &DoubleSpinBox::editDone, this, [=]() {
  174. if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
  175. {
  176. m_curWaferPickParam.dForce = ui.doubleSpinBoxPickForce->value();
  177. }
  178. else if (ui.comboBoxPickParamType->currentIndex() == 1)//晶圆台
  179. {
  180. m_curCalibPickParam.dForce = ui.doubleSpinBoxPickForce->value();
  181. }
  182. ParamChangeEvent();
  183. });
  184. connect(ui.doubleSpinBoxPickPosZ, &DoubleSpinBox::editDone, this, [=]() {
  185. if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
  186. {
  187. m_curWaferPickParam.dWorkLev = ui.doubleSpinBoxPickPosZ->value();
  188. }
  189. else if (ui.comboBoxPickParamType->currentIndex() == 1)//晶圆台
  190. {
  191. m_curCalibPickParam.dWorkLev = ui.doubleSpinBoxPickPosZ->value();
  192. }
  193. ParamChangeEvent();
  194. });
  195. connect(ui.spinBoxPickGrabDelay, &SpinBox::editDone, this, [=]() {
  196. if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
  197. {
  198. m_curWaferPickParam.iGrabDelay = ui.spinBoxPickGrabDelay->value();
  199. }
  200. else if (ui.comboBoxPickParamType->currentIndex() == 1)//晶圆台
  201. {
  202. m_curCalibPickParam.iGrabDelay = ui.spinBoxPickGrabDelay->value();
  203. }
  204. ParamChangeEvent();
  205. });
  206. connect(ui.spinBox_PickDelay, &SpinBox::editDone, this, [=]() {
  207. if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
  208. {
  209. m_curWaferPickParam.iPickOrBondDelay = ui.spinBox_PickDelay->value();
  210. }
  211. else if (ui.comboBoxPickParamType->currentIndex() == 1)//晶圆台
  212. {
  213. m_curCalibPickParam.iPickOrBondDelay = ui.spinBox_PickDelay->value();
  214. }
  215. ParamChangeEvent();
  216. });
  217. connect(ui.spinBoxPickBlockCheckDelay, &SpinBox::editDone, this, [=]() {
  218. if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
  219. {
  220. m_curWaferPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value();
  221. }
  222. else if (ui.comboBoxPickParamType->currentIndex() == 1)//晶圆台
  223. {
  224. m_curCalibPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value();
  225. }
  226. ParamChangeEvent();
  227. });
  228. connect(ui.spinBoxPickVacDelay, &SpinBox::editDone, this, [=]() {
  229. if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
  230. {
  231. m_curWaferPickParam.iVacuumDelay = ui.spinBoxPickVacDelay->value();
  232. }
  233. else if (ui.comboBoxPickParamType->currentIndex() == 1)//晶圆台
  234. {
  235. m_curCalibPickParam.iVacuumDelay = ui.spinBoxPickVacDelay->value();
  236. }
  237. ParamChangeEvent();
  238. });
  239. connect(ui.spinBoxPickBlowDelay, &SpinBox::editDone, this, [=]() {
  240. if (ui.comboBoxPickParamType->currentIndex() == 0)//华夫盒
  241. {
  242. m_curWaferPickParam.iBlowDelay = ui.spinBoxPickBlowDelay->value();
  243. }
  244. else if (ui.comboBoxPickParamType->currentIndex() == 1)//晶圆台
  245. {
  246. m_curCalibPickParam.iBlowDelay = ui.spinBoxPickBlowDelay->value();
  247. }
  248. ParamChangeEvent();
  249. });
  250. connect(ui.comboBoxBondParamType, &QComboBox::currentTextChanged, this, [=]() {
  251. UpdatePageBondParam();
  252. });
  253. connect(ui.checkBoxBondBlockCheck, &QCheckBox::clicked, this, [=](bool isChecked) {
  254. if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
  255. {
  256. m_curCalibPlaceParam.bCheckBlock = ui.checkBoxBondBlockCheck->isChecked();
  257. }
  258. else if (ui.comboBoxBondParamType->currentIndex() == 1)//固晶台固晶
  259. {
  260. m_curBondParam.bCheckBlock = ui.checkBoxBondBlockCheck->isChecked();
  261. }
  262. ParamChangeEvent();
  263. });
  264. connect(ui.checkBoxBondLoseCheck, &QCheckBox::clicked, this, [=](bool isChecked) {
  265. if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
  266. {
  267. m_curCalibPlaceParam.bCheckLose = ui.checkBoxBondLoseCheck->isChecked();
  268. }
  269. else if (ui.comboBoxBondParamType->currentIndex() == 1)//固晶台固晶
  270. {
  271. m_curBondParam.bCheckLose = ui.checkBoxBondLoseCheck->isChecked();
  272. }
  273. ParamChangeEvent();
  274. });
  275. connect(ui.checkBoxBondFindForce, &QCheckBox::clicked, this, [=](bool isChecked) {
  276. if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
  277. {
  278. m_curCalibPlaceParam.bFindForce = ui.checkBoxBondFindForce->isChecked();
  279. }
  280. else if (ui.comboBoxBondParamType->currentIndex() == 1)//固晶台固晶
  281. {
  282. m_curBondParam.bFindForce = ui.checkBoxBondFindForce->isChecked();
  283. }
  284. ParamChangeEvent();
  285. });
  286. connect(ui.doubleSpinBoxPreBondPosZ, &DoubleSpinBox::editDone, this, [=]() {
  287. if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
  288. {
  289. m_curCalibPlaceParam.dPreLev = ui.doubleSpinBoxPreBondPosZ->value();
  290. }
  291. else if (ui.comboBoxBondParamType->currentIndex() == 1)//固晶台固晶
  292. {
  293. m_curBondParam.dPreLev = ui.doubleSpinBoxPreBondPosZ->value();
  294. }
  295. ParamChangeEvent();
  296. });
  297. connect(ui.doubleSpinBoxBondForce, &DoubleSpinBox::editDone, this, [=]() {
  298. if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
  299. {
  300. m_curCalibPlaceParam.dForce = ui.doubleSpinBoxBondForce->value();
  301. }
  302. else if (ui.comboBoxBondParamType->currentIndex() == 1)//固晶台固晶
  303. {
  304. m_curBondParam.dForce = ui.doubleSpinBoxBondForce->value();
  305. }
  306. ParamChangeEvent();
  307. });
  308. connect(ui.doubleSpinBoxBondPosZ, &DoubleSpinBox::editDone, this, [=]() {
  309. if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
  310. {
  311. m_curCalibPlaceParam.dWorkLev = ui.doubleSpinBoxBondPosZ->value();
  312. }
  313. else if (ui.comboBoxBondParamType->currentIndex() == 1)//固晶台固晶
  314. {
  315. m_curBondParam.dWorkLev = ui.doubleSpinBoxBondPosZ->value();
  316. }
  317. ParamChangeEvent();
  318. });
  319. connect(ui.spinBoxBondGrabDelay, &SpinBox::editDone, this, [=]() {
  320. if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
  321. {
  322. m_curCalibPlaceParam.iGrabDelay = ui.spinBoxBondGrabDelay->value();
  323. }
  324. else if (ui.comboBoxBondParamType->currentIndex() == 1)//固晶台固晶
  325. {
  326. m_curBondParam.iGrabDelay = ui.spinBoxBondGrabDelay->value();
  327. }
  328. ParamChangeEvent();
  329. });
  330. connect(ui.spinBoxBondBlockCheckDelay, &SpinBox::editDone, this, [=]() {
  331. if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
  332. {
  333. m_curCalibPlaceParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay->value();
  334. }
  335. else if (ui.comboBoxBondParamType->currentIndex() == 1)//固晶台固晶
  336. {
  337. m_curBondParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay->value();
  338. }
  339. ParamChangeEvent();
  340. });
  341. connect(ui.spinBoxBondDelay, &SpinBox::editDone, this, [=]() {
  342. if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
  343. {
  344. m_curCalibPlaceParam.iPickOrBondDelay = ui.spinBoxBondDelay->value();
  345. }
  346. else if (ui.comboBoxBondParamType->currentIndex() == 1)//固晶台固晶
  347. {
  348. m_curBondParam.iPickOrBondDelay = ui.spinBoxBondDelay->value();
  349. }
  350. ParamChangeEvent();
  351. });
  352. connect(ui.spinBoxBondVacDelay, &SpinBox::editDone, this, [=]() {
  353. if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
  354. {
  355. m_curCalibPlaceParam.iVacuumDelay = ui.spinBoxBondVacDelay->value();
  356. }
  357. else if (ui.comboBoxBondParamType->currentIndex() == 1)//固晶台固晶
  358. {
  359. m_curBondParam.iVacuumDelay = ui.spinBoxBondVacDelay->value();
  360. }
  361. ParamChangeEvent();
  362. });
  363. connect(ui.spinBoxBondBlowDelay, &SpinBox::editDone, this, [=]() {
  364. if (ui.comboBoxBondParamType->currentIndex() == 0)//中转台放晶
  365. {
  366. m_curCalibPlaceParam.iBlowDelay = ui.spinBoxBondBlowDelay->value();
  367. }
  368. else if (ui.comboBoxBondParamType->currentIndex() == 1)//固晶台固晶
  369. {
  370. m_curBondParam.iBlowDelay = ui.spinBoxBondBlowDelay->value();
  371. }
  372. ParamChangeEvent();
  373. });
  374. }
  375. BondMatrixProgramPage::~BondMatrixProgramPage()
  376. {
  377. }
  378. XY_DOUBLE_STRUCT BondMatrixProgramPage::BondGetAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos)
  379. {
  380. /*CAxis* _Axis;
  381. CAxis::AXIS_TYPE eAxisType = _Axis->GetAxisType();*/
  382. if (m_pProgramCViewInterface == nullptr)
  383. {
  384. XY_DOUBLE_STRUCT errorPt = pos; // 可以根据需要返回一个错误状态
  385. // 弹出消息框显示位置
  386. QString positionString = QString("Unable to retrieve axis position for module type: %1").arg(QString::fromStdString(ModuleType));
  387. QMessageBox::information(this, "Axis Position Error", positionString);
  388. return errorPt;
  389. }
  390. m_pProgramCViewInterface->GetViewMotion()->GetAxisPosition(ModuleType, "X", pos.x);
  391. m_pProgramCViewInterface->GetViewMotion()->GetAxisPosition(ModuleType, "Y", pos.y);
  392. return pos;
  393. }
  394. void BondMatrixProgramPage::AddOutMatrixPage(int vectorIndex, PROGRAM_BOND_MATRIX_STRUCT matrixData, std::vector<PROGRAM_POINT_MATRIX_STRUCT> vecSubMatrix)
  395. {
  396. int matrixNum = m_mapSubMatrixControls.size();
  397. int newMatrixID = ++matrixNum;
  398. QVector<QObject*> vecControls;
  399. QWidget* outWidget = new QWidget();
  400. QGridLayout* outMatrixGridLayout = new QGridLayout();
  401. outMatrixGridLayout->setSpacing(4);
  402. outMatrixGridLayout->setObjectName(QString::fromUtf8("Out GridLayout"));
  403. outMatrixGridLayout->setContentsMargins(0, 0, 0, 0); // 设置布局的边距为0
  404. QGridLayout* boxGridLayout = new QGridLayout();
  405. boxGridLayout->setSpacing(4);
  406. boxGridLayout->setObjectName(QString::fromUtf8("Box GridLayout"));
  407. boxGridLayout->setContentsMargins(0, 0, 0, 0); // 设置布局的边距为0
  408. QHBoxLayout* buttonLayout = new QHBoxLayout();
  409. QSpacerItem* item = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
  410. buttonLayout->addSpacerItem(item);
  411. QGroupBox* groupBox = new QGroupBox(outWidget);
  412. groupBox->setLayout(boxGridLayout);
  413. QGridLayout* matrixGridLayout = new QGridLayout();
  414. matrixGridLayout->setSpacing(4);
  415. matrixGridLayout->setObjectName(QString::fromUtf8("matrixGridLayout"));
  416. matrixGridLayout->setContentsMargins(0, 0, 0, 0); // 设置布局的边距为0
  417. //// Add line for separation
  418. //QFrame* line = new QFrame();
  419. //line->setFrameShape(QFrame::NoFrame); // Remove default frame
  420. //line->setFixedHeight(2); // Set fixed height for line
  421. //line->setStyleSheet("background-color: #C7CAEB;");
  422. //outMatrixGridLayout->addWidget(line, 0, 0, 1, 4);
  423. // Add matrix title
  424. QLabel* labelTitle = new QLabel(outWidget);
  425. labelTitle->setObjectName(QString::fromUtf8("labelTitle"));
  426. labelTitle->setText(tr("Bond Matrix ") + QString::number(vectorIndex));
  427. labelTitle->setStyleSheet("color: #6A78FF;height: 30px");
  428. matrixGridLayout->addWidget(labelTitle, 0, 0, 1, 1);
  429. vecControls.push_back(labelTitle);
  430. //// Add Delete Out Matrix button
  431. //QPushButton* buttonDeleteOutMatrix = new QPushButton("Delete Matrix", outWidget);
  432. //outMatrixGridLayout->addWidget(buttonDeleteOutMatrix, 8, 0, 1, 3);
  433. //connect(buttonDeleteOutMatrix, &QPushButton::clicked, this, [=]() {
  434. // m_vectBondMatrixs.erase(m_vectBondMatrixs.begin() + vectorIndex);
  435. // delete outWidget;
  436. // });
  437. // Add "Add Sub Matrix" button
  438. QPushButton* pushButtonAdd = new QPushButton(outWidget);
  439. pushButtonAdd->setObjectName(QString::fromUtf8("button Add"));
  440. pushButtonAdd->setText(tr("Add sub Matrix"));
  441. matrixGridLayout->addWidget(pushButtonAdd, 0, 2, 1, 2);
  442. pushButtonAdd->setProperty("type", "default");
  443. connect(pushButtonAdd, &QPushButton::clicked, this, [=]() {
  444. int newSubMatrixIndex = m_vecSubMatrixs.size();
  445. PROGRAM_POINT_MATRIX_STRUCT subMatrix;
  446. std::sort(m_vecSubMatrixs.begin(), m_vecSubMatrixs.end(),
  447. [](const PROGRAM_POINT_MATRIX_STRUCT& a, const PROGRAM_POINT_MATRIX_STRUCT& b) {
  448. return a.MatrixId < b.MatrixId;
  449. });
  450. //找Id
  451. int newId = 1;
  452. for (const auto& matrix : m_vecSubMatrixs)
  453. {
  454. if (matrix.MatrixId == newId)
  455. {
  456. newId++;
  457. }
  458. else if (matrix.MatrixId > newId)
  459. {
  460. break;
  461. }
  462. }
  463. subMatrix.MatrixId = newId;
  464. subMatrix.strModuleName = "UltraHead";
  465. subMatrix.iModuleId = MODULE_LIST::BondHead;
  466. subMatrix.MatrixRow = 0;
  467. subMatrix.MatrixCol = 0;
  468. m_vecSubMatrixs.push_back(subMatrix);
  469. // Add the submatrix to the bond matrix's VecPointMatrixId
  470. //找大矩阵ID/Index
  471. auto currentIt = m_mapOutWidgetIndex.find(outWidget);
  472. int index = currentIt.value(); //迭代器 erase后currentIt被删除了
  473. m_vectBondMatrixs[index].VecPointMatrixId.push_back(newId);
  474. AddMatrixPage(index, newSubMatrixIndex, subMatrix, outMatrixGridLayout);
  475. });
  476. // Add Delete Out Matrix button
  477. QPushButton* pushButtonDelete = new QPushButton(outWidget);
  478. pushButtonDelete->setObjectName(QString::fromUtf8("button delete"));
  479. pushButtonDelete->setText(tr("Delete"));
  480. matrixGridLayout->addWidget(pushButtonDelete, 0, 1, 1, 1);
  481. connect(pushButtonDelete, &QPushButton::clicked, this, [=]() {
  482. //处理index
  483. auto currentIt = m_mapOutWidgetIndex.find(outWidget);
  484. int index = currentIt.value(); //迭代器 erase后currentIt被删除了
  485. m_mapOutWidgetIndex.erase(currentIt);
  486. for (auto it = m_mapOutWidgetIndex.begin(); it != m_mapOutWidgetIndex.end(); it++)
  487. {
  488. if (it.value() > index)
  489. {
  490. int newIndex = it.value() - 1;
  491. m_mapOutWidgetIndex.insert(it.key(), newIndex);
  492. }
  493. }
  494. //删除缓存数据
  495. m_vectBondMatrixs.erase(m_vectBondMatrixs.begin() + vectorIndex);
  496. //m_mapBondMatrixToSubMatrices.remove(vectorIndex); // Remove mapping between BondMatrix and its SubMatrices
  497. delete outWidget;
  498. });
  499. // Add Row and Column controls
  500. QLabel* labelRow = new QLabel(outWidget);
  501. labelRow->setObjectName(QString::fromUtf8("labelRow"));
  502. labelRow->setText(tr("Row & Cow"));
  503. matrixGridLayout->addWidget(labelRow, 2, 0, 1, 1);
  504. vecControls.push_back(labelRow);
  505. SpinBox* spinBoxRow = new SpinBox(outWidget);
  506. spinBoxRow->setObjectName(QString::fromUtf8("spinBoxRow"));
  507. spinBoxRow->setFixedWidth(100); // Set fixed width to 100
  508. matrixGridLayout->addWidget(spinBoxRow, 2, 1, 1, 1);
  509. vecControls.push_back(spinBoxRow);
  510. /*QLabel* labelCol = new QLabel(outWidget);
  511. labelCol->setObjectName(QString::fromUtf8("labelCol"));
  512. labelCol->setText(tr("Column "));
  513. outMatrixGridLayout->addWidget(labelCol, 3, 0, 1, 1);
  514. vecControls.push_back(labelCol);*/
  515. SpinBox* spinBoxCol = new SpinBox(outWidget);
  516. spinBoxCol->setObjectName(QString::fromUtf8("spinBoxCol"));
  517. spinBoxCol->setFixedWidth(100); // Set fixed width to 100
  518. matrixGridLayout->addWidget(spinBoxCol, 2, 2, 1, 1);
  519. vecControls.push_back(spinBoxCol);
  520. // Add Left Top Position controls
  521. QLabel* labelLeftTop = new QLabel(outWidget);
  522. labelLeftTop->setObjectName(QString::fromUtf8("labelLeftTop"));
  523. labelLeftTop->setText(tr("Left Top Pos "));
  524. matrixGridLayout->addWidget(labelLeftTop, 4, 0, 1, 1);
  525. vecControls.push_back(labelLeftTop);
  526. DoubleSpinBox* doubleSpinBoxLeftTopX = new DoubleSpinBox(outWidget);
  527. doubleSpinBoxLeftTopX->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopX"));
  528. doubleSpinBoxLeftTopX->setFixedWidth(100); // Set fixed width to 100
  529. matrixGridLayout->addWidget(doubleSpinBoxLeftTopX, 4, 1, 1, 1);
  530. vecControls.push_back(doubleSpinBoxLeftTopX);
  531. DoubleSpinBox* doubleSpinBoxLeftTopY = new DoubleSpinBox(outWidget);
  532. doubleSpinBoxLeftTopY->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopY"));
  533. doubleSpinBoxLeftTopY->setFixedWidth(100); // Set fixed width to 100
  534. matrixGridLayout->addWidget(doubleSpinBoxLeftTopY, 4, 2, 1, 1);
  535. vecControls.push_back(doubleSpinBoxLeftTopY);
  536. // Add Get Pos button for Left Top
  537. QPushButton* buttonLeftTop = new QPushButton("Get Pos", this);
  538. buttonLeftTop->setFixedWidth(62); // Set the same width for the button
  539. matrixGridLayout->addWidget(buttonLeftTop, 4, 3, 1, 1); // Position the button next to LeftTopPos
  540. connect(buttonLeftTop, &QPushButton::clicked, this, [=]() {
  541. XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondMatrix", m_vectBondMatrixs[vectorIndex].LeftTopPoint);
  542. doubleSpinBoxLeftTopX->setValue(position.x);
  543. doubleSpinBoxLeftTopY->setValue(position.y);
  544. });
  545. // Add Right Top Position controls
  546. QLabel* labelRightTopPos = new QLabel(outWidget);
  547. labelRightTopPos->setObjectName(QString::fromUtf8("labelRightTopPos"));
  548. labelRightTopPos->setText(tr("Right Top Pos "));
  549. matrixGridLayout->addWidget(labelRightTopPos, 5, 0, 1, 1);
  550. vecControls.push_back(labelRightTopPos);
  551. DoubleSpinBox* doubleSpinBoxRightTopX = new DoubleSpinBox(outWidget);
  552. doubleSpinBoxRightTopX->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopX"));
  553. doubleSpinBoxRightTopX->setFixedWidth(100); // Set fixed width to 100
  554. matrixGridLayout->addWidget(doubleSpinBoxRightTopX, 5, 1, 1, 1);
  555. vecControls.push_back(doubleSpinBoxRightTopX);
  556. DoubleSpinBox* doubleSpinBoxRightTopY = new DoubleSpinBox(outWidget);
  557. doubleSpinBoxRightTopY->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopY"));
  558. doubleSpinBoxRightTopY->setFixedWidth(100); // Set fixed width to 100
  559. matrixGridLayout->addWidget(doubleSpinBoxRightTopY, 5, 2, 1, 1);
  560. vecControls.push_back(doubleSpinBoxRightTopY);
  561. QPushButton* buttonRightTop = new QPushButton("Get Pos", this);
  562. buttonRightTop->setFixedWidth(62); // Set the same width for the button
  563. matrixGridLayout->addWidget(buttonRightTop, 5, 3, 1, 1); // Position the button next to RightTopPos
  564. connect(buttonRightTop, &QPushButton::clicked, this, [=]() {
  565. XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondMatrix", m_vectBondMatrixs[vectorIndex].RightTopPoint);
  566. doubleSpinBoxRightTopX->setValue(position.x);
  567. doubleSpinBoxRightTopY->setValue(position.y);
  568. });
  569. // Add Right Bottom Position controls
  570. QLabel* labelRightButtomPos = new QLabel(outWidget);
  571. labelRightButtomPos->setObjectName(QString::fromUtf8("labelRightButtomPos"));
  572. labelRightButtomPos->setText(tr("Right Buttom pos"));
  573. matrixGridLayout->addWidget(labelRightButtomPos, 6, 0, 1, 1);
  574. vecControls.push_back(labelRightButtomPos);
  575. DoubleSpinBox* doubleSpinBoxRightButtomX = new DoubleSpinBox(outWidget);
  576. doubleSpinBoxRightButtomX->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomX"));
  577. doubleSpinBoxRightButtomX->setFixedWidth(100); // Set fixed width to 100
  578. matrixGridLayout->addWidget(doubleSpinBoxRightButtomX, 6, 1, 1, 1);
  579. vecControls.push_back(doubleSpinBoxRightButtomX);
  580. DoubleSpinBox* doubleSpinBoxRightButtomY = new DoubleSpinBox(outWidget);
  581. doubleSpinBoxRightButtomY->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomY"));
  582. doubleSpinBoxRightButtomY->setFixedWidth(100); // Set fixed width to 100
  583. matrixGridLayout->addWidget(doubleSpinBoxRightButtomY, 6, 2, 1, 1);
  584. vecControls.push_back(doubleSpinBoxRightTopX);
  585. QPushButton* buttonRightButtom = new QPushButton("Get Pos", this);
  586. buttonRightButtom->setFixedWidth(62); // Set the same width for the button
  587. matrixGridLayout->addWidget(buttonRightButtom, 6, 3, 1, 1); // Position the button next to RightBottomPos
  588. connect(buttonRightButtom, &QPushButton::clicked, this, [=]() {
  589. XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondMatrix", m_vectBondMatrixs[vectorIndex].RightBottomPoint);
  590. doubleSpinBoxRightButtomX->setValue(position.x);
  591. doubleSpinBoxRightButtomY->setValue(position.y);
  592. });
  593. // Add No Bond Points line edit
  594. QLabel* labelNoBondPts = new QLabel(outWidget);
  595. labelNoBondPts->setObjectName(QString::fromUtf8("labelNoBondPts"));
  596. labelNoBondPts->setText(tr("No Bond Points"));
  597. matrixGridLayout->addWidget(labelNoBondPts, 7, 0, 1, 1);
  598. vecControls.push_back(labelNoBondPts);
  599. QLineEdit* lineEditNoBondPts = new QLineEdit(outWidget);
  600. lineEditNoBondPts->setObjectName(QString::fromUtf8("lineEditNoBondPts"));
  601. matrixGridLayout->addWidget(lineEditNoBondPts, 7, 1, 1, 3);
  602. vecControls.push_back(lineEditNoBondPts);
  603. lineEditNoBondPts->setReadOnly(true);
  604. lineEditNoBondPts->setCursor(Qt::PointingHandCursor);
  605. lineEditNoBondPts->setProperty("vectorIndex", vectorIndex); // 存储索引
  606. lineEditNoBondPts->setProperty("parentMatrixIndex", -1); // 设置父矩阵的索引
  607. lineEditNoBondPts->installEventFilter(this);
  608. QFrame* line = new QFrame(outWidget);
  609. line->setFrameShape(QFrame::NoFrame); // 移除默认框架
  610. line->setFixedHeight(2); // 设置固定高度
  611. line->setStyleSheet("background-color: #C7CAEB;");
  612. boxGridLayout->addLayout(matrixGridLayout, 2, 0);
  613. boxGridLayout->addWidget(line);
  614. //outMatrixGridLayout->addLayout(buttonLayout, 1, 0);
  615. outMatrixGridLayout->addWidget(groupBox);
  616. outWidget->setLayout(outMatrixGridLayout);
  617. ui.verticalLayout_3->addWidget(outWidget);
  618. ui.verticalLayout_3->setContentsMargins(0, 0, 0, 0); // Adjust margins if necessary
  619. ui.verticalLayout_3->setAlignment(Qt::AlignTop | Qt::AlignLeft); // Align the layout to the top-left
  620. m_mapOutWidgetIndex.insert(outWidget, vectorIndex);
  621. // Add Sub Matrices
  622. for (int j = 0; j < matrixData.VecPointMatrixId.size(); j++)
  623. {
  624. for (int i = 0; i < m_vecSubMatrixs.size(); i++)
  625. {
  626. if (matrixData.VecPointMatrixId[j] == m_vecSubMatrixs[i].MatrixId)
  627. {
  628. AddMatrixPage(j, i, m_vecSubMatrixs[i], outMatrixGridLayout);
  629. }
  630. }
  631. }
  632. /*for (int i = 0; i < vecSubMatrix.size(); i++)
  633. {
  634. AddMatrixPage(i, vecSubMatrix[i], outMatrixGridLayout);
  635. }*/
  636. QSpacerItem* vSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
  637. ui.verticalLayout_3->addItem(vSpacer);
  638. // Add all controls and finalize layout
  639. /*outWidget->setLayout(outMatrixGridLayout);
  640. ui.scrollArea_2->setLayout(outMatrixGridLayout);*/
  641. spinBoxRow->setValue(matrixData.BondMatrixRow);
  642. spinBoxCol->setValue(matrixData.BondMatrixCol);
  643. doubleSpinBoxLeftTopX->setValue(matrixData.LeftTopPoint.x);
  644. doubleSpinBoxLeftTopY->setValue(matrixData.LeftTopPoint.y);
  645. doubleSpinBoxRightTopX->setValue(matrixData.RightTopPoint.x);
  646. doubleSpinBoxRightTopY->setValue(matrixData.RightTopPoint.y);
  647. doubleSpinBoxRightButtomX->setValue(matrixData.RightBottomPoint.x);
  648. doubleSpinBoxRightButtomY->setValue(matrixData.RightBottomPoint.y);
  649. connect(spinBoxRow, &SpinBox::editDone, this, [=]() {
  650. m_vectBondMatrixs[vectorIndex].BondMatrixRow = spinBoxRow->value();
  651. });
  652. connect(spinBoxCol, &SpinBox::editDone, this, [=]() {
  653. m_vectBondMatrixs[vectorIndex].BondMatrixCol = spinBoxCol->value();
  654. });
  655. connect(doubleSpinBoxLeftTopX, &DoubleSpinBox::editDone, this, [=]() {
  656. m_vectBondMatrixs[vectorIndex].LeftTopPoint.x = doubleSpinBoxLeftTopX->value();
  657. });
  658. connect(doubleSpinBoxLeftTopY, &DoubleSpinBox::editDone, this, [=]() {
  659. m_vectBondMatrixs[vectorIndex].LeftTopPoint.y = doubleSpinBoxLeftTopY->value();
  660. });
  661. connect(doubleSpinBoxRightTopX, &DoubleSpinBox::editDone, this, [=]() {
  662. m_vectBondMatrixs[vectorIndex].RightTopPoint.x = doubleSpinBoxRightTopX->value();
  663. });
  664. connect(doubleSpinBoxRightTopY, &DoubleSpinBox::editDone, this, [=]() {
  665. m_vectBondMatrixs[vectorIndex].RightTopPoint.y = doubleSpinBoxRightTopY->value();
  666. });
  667. connect(doubleSpinBoxRightButtomX, &DoubleSpinBox::editDone, this, [=]() {
  668. m_vectBondMatrixs[vectorIndex].RightBottomPoint.x = doubleSpinBoxRightButtomX->value();
  669. });
  670. connect(doubleSpinBoxRightButtomY, &DoubleSpinBox::editDone, this, [=]() {
  671. m_vectBondMatrixs[vectorIndex].RightBottomPoint.y = doubleSpinBoxRightButtomY->value();
  672. });
  673. connect(lineEditNoBondPts, &QLineEdit::textChanged, this, [=]() {
  674. });
  675. }
  676. void BondMatrixProgramPage::AddMatrixPage(int vectorIndex, int subVectorIndex, PROGRAM_POINT_MATRIX_STRUCT subMatrix, QGridLayout* layout)
  677. {
  678. QVector<QObject*> vecControls;
  679. QWidget* subWidget = new QWidget();
  680. QGridLayout* subGridLayout = new QGridLayout(subWidget);
  681. subGridLayout->setSpacing(4);
  682. subGridLayout->setObjectName(QString::fromUtf8("subGridLayout"));
  683. //groupBox->setLayout(subGridLayout);
  684. subGridLayout->setContentsMargins(0, 0, 0, 0); // 设置布局的边距为0
  685. subGridLayout->setAlignment(Qt::AlignCenter);
  686. QLabel* labelTitle = new QLabel(subWidget);
  687. labelTitle->setObjectName(QString::fromUtf8("labelTitle"));
  688. labelTitle->setText(tr("Sub Matrix ") + QString::number(subVectorIndex));
  689. labelTitle->setStyleSheet("color: #808BFF;height: 30px");
  690. subGridLayout->addWidget(labelTitle, 0, 1, 1, 1);
  691. vecControls.push_back(labelTitle);
  692. QPushButton* pushButtonDelete = new QPushButton(subWidget);
  693. pushButtonDelete->setObjectName(QString::fromUtf8("button delete"));
  694. pushButtonDelete->setText(tr("Delete"));
  695. subGridLayout->addWidget(pushButtonDelete, 0, 3, 1, 1);
  696. connect(pushButtonDelete, &QPushButton::clicked, this, [=]() {
  697. //处理index
  698. auto currentIt = m_mapSubWidgetIndex.find(subWidget);
  699. int index = currentIt.value(); //迭代器 erase后currentIt被删除了
  700. m_mapSubWidgetIndex.erase(currentIt);
  701. for (auto it = m_mapSubWidgetIndex.begin(); it != m_mapSubWidgetIndex.end(); ++it)
  702. {
  703. if (it.value() > index)
  704. {
  705. //value() 返回的是副本不是引用
  706. int newIndex = it.value() - 1;
  707. m_mapSubWidgetIndex.insert(it.key(), newIndex);
  708. }
  709. }
  710. // 子矩阵ID
  711. int subMatrixId = m_vecSubMatrixs[index].MatrixId;
  712. //删除缓存
  713. m_vecSubMatrixs.erase(m_vecSubMatrixs.begin() + index);
  714. //删除大矩阵子ID数据(遍历删除)
  715. for (PROGRAM_BOND_MATRIX_STRUCT& matrix : m_vectBondMatrixs)
  716. {
  717. auto it = std::find(matrix.VecPointMatrixId.begin(), matrix.VecPointMatrixId.end(), subMatrixId);
  718. if (it != matrix.VecPointMatrixId.end())
  719. {
  720. matrix.VecPointMatrixId.erase(it);
  721. }
  722. }
  723. delete subWidget;
  724. });
  725. QLabel* labelRow = new QLabel(subWidget);
  726. labelRow->setObjectName(QString::fromUtf8("labelRow"));
  727. labelRow->setText(tr("Row & Cow"));
  728. subGridLayout->addWidget(labelRow, 2, 0, 1, 1);
  729. vecControls.push_back(labelRow);
  730. SpinBox* spinBoxRow = new SpinBox(subWidget);
  731. spinBoxRow->setObjectName(QString::fromUtf8("spinBoxRow"));
  732. subGridLayout->addWidget(spinBoxRow, 2, 1, 1, 1);
  733. vecControls.push_back(spinBoxRow);
  734. /*QLabel* labelCol = new QLabel(subWidget);
  735. labelCol->setObjectName(QString::fromUtf8("labelCol"));
  736. labelCol->setText(tr("Cow "));
  737. subGridLayout->addWidget(labelCol, 3, 0, 1, 1);
  738. vecControls.push_back(labelCol);*/
  739. SpinBox* spinBoxCol = new SpinBox(subWidget);
  740. spinBoxCol->setObjectName(QString::fromUtf8("spinBoxCol"));
  741. subGridLayout->addWidget(spinBoxCol, 2, 2, 1, 1);
  742. vecControls.push_back(spinBoxCol);
  743. QLabel* labelLeftTop = new QLabel(subWidget);
  744. labelLeftTop->setObjectName(QString::fromUtf8("labelLeftTop"));
  745. labelLeftTop->setText(tr("Left Top Pos "));
  746. subGridLayout->addWidget(labelLeftTop, 4, 0, 1, 1);
  747. vecControls.push_back(labelLeftTop);
  748. DoubleSpinBox* doubleSpinBoxLeftTopX = new DoubleSpinBox(subWidget);
  749. doubleSpinBoxLeftTopX->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopX"));
  750. doubleSpinBoxLeftTopX->setFixedWidth(100); // Set fixed width to 100
  751. doubleSpinBoxLeftTopX->setFixedWidth(100); // Set fixed width to 100
  752. subGridLayout->addWidget(doubleSpinBoxLeftTopX, 4, 1, 1, 1);
  753. vecControls.push_back(doubleSpinBoxLeftTopX);
  754. DoubleSpinBox* doubleSpinBoxLeftTopY = new DoubleSpinBox(subWidget);
  755. doubleSpinBoxLeftTopY->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopY"));
  756. doubleSpinBoxLeftTopY->setFixedWidth(100); // Set fixed width to 100
  757. doubleSpinBoxLeftTopY->setFixedWidth(100); // Set fixed width to 100
  758. subGridLayout->addWidget(doubleSpinBoxLeftTopY, 4, 2, 1, 1);
  759. vecControls.push_back(doubleSpinBoxLeftTopY);
  760. QLabel* labelRightTopPos = new QLabel(subWidget);
  761. labelRightTopPos->setObjectName(QString::fromUtf8("labelRightTopPos"));
  762. labelRightTopPos->setText(tr("Right Top Pos "));
  763. subGridLayout->addWidget(labelRightTopPos, 5, 0, 1, 1);
  764. vecControls.push_back(labelRightTopPos);
  765. DoubleSpinBox* doubleSpinBoxRightTopX = new DoubleSpinBox(subWidget);
  766. doubleSpinBoxRightTopX->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopX"));
  767. doubleSpinBoxRightTopX->setFixedWidth(100); // Set fixed width to 100
  768. subGridLayout->addWidget(doubleSpinBoxRightTopX, 5, 1, 1, 1);
  769. vecControls.push_back(doubleSpinBoxRightTopX);
  770. DoubleSpinBox* doubleSpinBoxRightTopY = new DoubleSpinBox(subWidget);
  771. doubleSpinBoxRightTopY->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopY"));
  772. doubleSpinBoxRightTopY->setFixedWidth(100); // Set fixed width to 100
  773. subGridLayout->addWidget(doubleSpinBoxRightTopY, 5, 2, 1, 1);
  774. vecControls.push_back(doubleSpinBoxRightTopY);
  775. QLabel* labelRightButtomPos = new QLabel(subWidget);
  776. labelRightButtomPos->setObjectName(QString::fromUtf8("labelRightButtomPos"));
  777. labelRightButtomPos->setText(tr("Right Buttom pos"));
  778. subGridLayout->addWidget(labelRightButtomPos, 6, 0, 1, 1);
  779. vecControls.push_back(labelRightButtomPos);
  780. DoubleSpinBox* doubleSpinBoxRightButtomX = new DoubleSpinBox(subWidget);
  781. doubleSpinBoxRightButtomX->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomX"));
  782. doubleSpinBoxRightButtomX->setFixedWidth(100); // Set fixed width to 100
  783. subGridLayout->addWidget(doubleSpinBoxRightButtomX, 6, 1, 1, 1);
  784. vecControls.push_back(doubleSpinBoxRightButtomX);
  785. DoubleSpinBox* doubleSpinBoxRightButtomY = new DoubleSpinBox(subWidget);
  786. doubleSpinBoxRightButtomY->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomY"));
  787. doubleSpinBoxRightButtomY->setFixedWidth(100); // Set fixed width to 100
  788. subGridLayout->addWidget(doubleSpinBoxRightButtomY, 6, 2, 1, 1);
  789. vecControls.push_back(doubleSpinBoxRightTopX);
  790. QLabel* labelNoBondPts = new QLabel(subWidget);
  791. labelNoBondPts->setObjectName(QString::fromUtf8("labelNoBondPts"));
  792. labelNoBondPts->setText(tr("No Bond Points"));
  793. subGridLayout->addWidget(labelNoBondPts, 7, 0, 1, 1);
  794. vecControls.push_back(labelNoBondPts);
  795. QLineEdit* lineEditNoBondPts = new QLineEdit(subWidget);
  796. lineEditNoBondPts->setObjectName(QString::fromUtf8("lineEditNoBondPts"));
  797. lineEditNoBondPts->setReadOnly(true);
  798. lineEditNoBondPts->setCursor(Qt::PointingHandCursor);
  799. lineEditNoBondPts->setProperty("vectorIndex", subVectorIndex); // 存储索引
  800. lineEditNoBondPts->setProperty("parentMatrixIndex", vectorIndex); // 设置父矩阵的索引
  801. lineEditNoBondPts->installEventFilter(this);
  802. subGridLayout->addWidget(lineEditNoBondPts, 7, 1, 1, 3);
  803. vecControls.push_back(lineEditNoBondPts);
  804. // Left Top Position X and Y
  805. QPushButton* buttonLeftTop = new QPushButton("Get Pos", subWidget);
  806. buttonLeftTop->setFixedWidth(62); // 设置固定宽度
  807. subGridLayout->addWidget(buttonLeftTop, 4, 3, 1, 1); // 添加按钮到4行3列
  808. connect(buttonLeftTop, &QPushButton::clicked, this, [=]() {
  809. XY_DOUBLE_STRUCT position = BondGetAxisPosition("UltraHead", m_vectBondMatrixs[subVectorIndex].LeftTopPoint);
  810. doubleSpinBoxLeftTopX->setValue(position.x); // 更新 X 轴
  811. doubleSpinBoxLeftTopY->setValue(position.y); // 更新 Y 轴
  812. });
  813. // Right Top Position X and Y
  814. QPushButton* buttonRightTop = new QPushButton("Get Pos", subWidget);
  815. buttonRightTop->setFixedWidth(62); // 设置固定宽度
  816. subGridLayout->addWidget(buttonRightTop, 5, 3, 1, 1); // 添加按钮到5行3列
  817. connect(buttonRightTop, &QPushButton::clicked, this, [=]() {
  818. XY_DOUBLE_STRUCT position = BondGetAxisPosition("UltraHead", m_vectBondMatrixs[subVectorIndex].RightTopPoint);
  819. doubleSpinBoxRightTopX->setValue(position.x); // 更新 X 轴
  820. doubleSpinBoxRightTopY->setValue(position.y); // 更新 Y 轴
  821. });
  822. // Right Bottom Position X and Y
  823. QPushButton* buttonRightButtom = new QPushButton("Get Pos", subWidget);
  824. buttonRightButtom->setFixedWidth(62); // 设置固定宽度
  825. subGridLayout->addWidget(buttonRightButtom, 6, 3, 1, 1); // 添加按钮到6行3列
  826. connect(buttonRightButtom, &QPushButton::clicked, this, [=]() {
  827. XY_DOUBLE_STRUCT position = BondGetAxisPosition("UltraHead", m_vectBondMatrixs[subVectorIndex].RightBottomPoint);
  828. doubleSpinBoxRightButtomX->setValue(position.x); // 更新 X 轴
  829. doubleSpinBoxRightButtomY->setValue(position.y); // 更新 Y 轴
  830. });
  831. //layout->addLayout(subGridLayout, 11, 0);
  832. QFrame* line = new QFrame(subWidget);
  833. line->setFrameShape(QFrame::NoFrame); // 移除默认框架
  834. line->setFixedHeight(2); // 设置固定高度
  835. line->setStyleSheet("background-color: #C7CAEB;");
  836. subGridLayout->addWidget(line, 10, 0, 1, 4);
  837. layout->addWidget(subWidget);
  838. m_mapSubWidgetIndex.insert(subWidget, subVectorIndex);
  839. spinBoxRow->setValue(subMatrix.MatrixRow);
  840. spinBoxCol->setValue(subMatrix.MatrixCol);
  841. doubleSpinBoxLeftTopX->setValue(subMatrix.LeftTopPoint.x);
  842. doubleSpinBoxLeftTopY->setValue(subMatrix.LeftTopPoint.y);
  843. doubleSpinBoxRightTopX->setValue(subMatrix.RightTopPoint.x);
  844. doubleSpinBoxRightTopY->setValue(subMatrix.RightTopPoint.y);
  845. doubleSpinBoxRightButtomX->setValue(subMatrix.RightBottomPoint.x);
  846. doubleSpinBoxRightButtomY->setValue(subMatrix.RightBottomPoint.y);
  847. connect(spinBoxRow, &SpinBox::editDone, this, [=]() {
  848. auto it = m_mapSubWidgetIndex.find(subWidget);
  849. m_vecSubMatrixs[it.value()].MatrixRow = spinBoxRow->value();
  850. });
  851. connect(spinBoxCol, &SpinBox::editDone, this, [=]() {
  852. auto it = m_mapSubWidgetIndex.find(subWidget);
  853. m_vecSubMatrixs[it.value()].MatrixCol = spinBoxCol->value();
  854. });
  855. connect(doubleSpinBoxLeftTopX, &DoubleSpinBox::editDone, this, [=]() {
  856. auto it = m_mapSubWidgetIndex.find(subWidget);
  857. m_vecSubMatrixs[it.value()].LeftTopPoint.x = doubleSpinBoxLeftTopX->value();
  858. });
  859. connect(doubleSpinBoxLeftTopY, &DoubleSpinBox::editDone, this, [=]() {
  860. auto it = m_mapSubWidgetIndex.find(subWidget);
  861. m_vecSubMatrixs[it.value()].LeftTopPoint.y = doubleSpinBoxLeftTopY->value();
  862. });
  863. connect(doubleSpinBoxRightTopX, &DoubleSpinBox::editDone, this, [=]() {
  864. auto it = m_mapSubWidgetIndex.find(subWidget);
  865. m_vecSubMatrixs[it.value()].RightTopPoint.x = doubleSpinBoxRightTopX->value();
  866. });
  867. connect(doubleSpinBoxRightTopY, &DoubleSpinBox::editDone, this, [=]() {
  868. auto it = m_mapSubWidgetIndex.find(subWidget);
  869. m_vecSubMatrixs[it.value()].RightTopPoint.y = doubleSpinBoxRightTopY->value();
  870. });
  871. connect(doubleSpinBoxRightButtomX, &DoubleSpinBox::editDone, this, [=]() {
  872. auto it = m_mapSubWidgetIndex.find(subWidget);
  873. m_vecSubMatrixs[it.value()].RightBottomPoint.x = doubleSpinBoxRightButtomX->value();
  874. });
  875. connect(doubleSpinBoxRightButtomY, &DoubleSpinBox::editDone, this, [=]() {
  876. auto it = m_mapSubWidgetIndex.find(subWidget);
  877. m_vecSubMatrixs[it.value()].RightBottomPoint.y = doubleSpinBoxRightButtomY->value();
  878. });
  879. connect(lineEditNoBondPts, &QLineEdit::textChanged, this, [=]() {
  880. auto it = m_mapSubWidgetIndex.find(subWidget);
  881. });
  882. }
  883. bool BondMatrixProgramPage::eventFilter(QObject* obj, QEvent* event) {
  884. if (event->type() == QEvent::MouseButtonPress)
  885. {
  886. auto* lineEdit = qobject_cast<QLineEdit*>(obj);
  887. if (lineEdit)
  888. {
  889. int index = lineEdit->property("vectorIndex").toInt(); // 当前矩阵索引
  890. int parentIndex = lineEdit->property("parentMatrixIndex").toInt(); // 父矩阵索引
  891. onNoBondPtsClicked(lineEdit, index, parentIndex); // 传递父矩阵索引
  892. return true; // 拦截事件
  893. }
  894. }
  895. return QWidget::eventFilter(obj, event);
  896. }
  897. void BondMatrixProgramPage::onNoBondPtsClicked(QLineEdit* lineEdit, int index, int parentIndex) {
  898. if (parentIndex != -1)
  899. {
  900. // 处理子矩阵的操作
  901. if (index < 0 || index >= m_vecSubMatrixs.size()) return;
  902. const auto& subMatrix = m_vecSubMatrixs[index];
  903. NoBondPtEditDialog dlg(subMatrix.MatrixRow, subMatrix.MatrixCol, subMatrix.VecNoBondPt, this);
  904. if (dlg.exec() == QDialog::Accepted)
  905. {
  906. QVector<XY_LONG_STRUCT> selected = dlg.getSelectedPoints();
  907. m_vecSubMatrixs[index].VecNoBondPt = std::vector<XY_LONG_STRUCT>(selected.begin(), selected.end());
  908. QStringList ptList;
  909. for (const auto& pt : selected)
  910. ptList << QString("(%1,%2)").arg(pt.x).arg(pt.y);
  911. lineEdit->setText(ptList.join(" "));
  912. }
  913. // 这里可以用 parentIndex 来关联父矩阵(即大矩阵)做相应的操作
  914. }
  915. else
  916. {
  917. // 处理大矩阵的操作
  918. if (index < 0 || index >= m_vectBondMatrixs.size()) return;
  919. const auto& bondMatrix = m_vectBondMatrixs[index];
  920. NoBondPtEditDialog dlg(bondMatrix.BondMatrixRow, bondMatrix.BondMatrixCol, bondMatrix.VecNoBondPt, this);
  921. if (dlg.exec() == QDialog::Accepted)
  922. {
  923. QVector<XY_LONG_STRUCT> selected = dlg.getSelectedPoints();
  924. m_vectBondMatrixs[index].VecNoBondPt = std::vector<XY_LONG_STRUCT>(selected.begin(), selected.end());
  925. QStringList ptList;
  926. for (const auto& pt : selected)
  927. ptList << QString("(%1,%2)").arg(pt.x).arg(pt.y);
  928. lineEdit->setText(ptList.join(" "));
  929. }
  930. // 这里也可以用 parentIndex 来关联父矩阵(即大矩阵)做相应的操作
  931. }
  932. }
  933. void BondMatrixProgramPage::AddMatrixParam()
  934. {
  935. }
  936. void BondMatrixProgramPage::UpdatePageParam()
  937. {
  938. int dieSourceIndex = 0;
  939. if (m_curBondInfo.eDieSource == DIE_SOURCE::BY_WAFER)
  940. {
  941. dieSourceIndex = 1;
  942. }
  943. else if (m_curBondInfo.eDieSource == DIE_SOURCE::BY_WAFFLE)
  944. {
  945. dieSourceIndex = 0;
  946. }
  947. ui.comboBoxDieSource->setCurrentIndex(dieSourceIndex);
  948. ui.spinBoxPickTempID->setValue(m_curBondInfo.iPickPRStrategyId);
  949. ui.spinBoxPickNozzleID->setValue(m_curBondInfo.iPickHeadId);
  950. ui.spinBoxPreBondTemp->setValue(m_curBondInfo.iBondFrontPRStrategyId);
  951. ui.spinBoxPostBondTemp->setValue(m_curBondInfo.iBondBackPRStrategyId);
  952. ui.spinBoxBondTemp->setValue(m_curBondInfo.iBondPRStrategyId);
  953. ui.spinBoxLookUpTemp->setValue(m_curBondInfo.iLookUpPRStrategyId);
  954. ui.spinBoxCalibPickTemp->setValue(m_curBondInfo.iCalibPRStrategyId);
  955. ui.doubleSpinBoxBondOffsetX->setValue(m_curBondInfo.stOffset.x);
  956. ui.doubleSpinBoxBondOffsetY->setValue(m_curBondInfo.stOffset.y);
  957. ui.doubleSpinBoxBondOffsetAngle->setValue(m_curBondInfo.stOffset.a);
  958. UpdatePagePickParam();
  959. UpdatePageBondParam();
  960. }
  961. void BondMatrixProgramPage::ParamChangeEvent()
  962. {
  963. m_manageDB->GetCProduct()->SetBondInfoData(m_curBondInfo.iInfoId, m_curBondInfo);
  964. m_manageDB->GetCProduct()->SetBondParam(m_curWaferPickParam.iId, m_curWaferPickParam);
  965. m_manageDB->GetCProduct()->SetBondParam(m_curCalibPlaceParam.iId, m_curCalibPlaceParam);
  966. m_manageDB->GetCProduct()->SetBondParam(m_curCalibPickParam.iId, m_curCalibPickParam);
  967. m_manageDB->GetCProduct()->SetBondParam(m_curBondParam.iId, m_curBondParam);
  968. CProduct* _Product = m_manageDB->GetCProduct();
  969. }
  970. void BondMatrixProgramPage::MatrixChangeEvent()
  971. {
  972. m_manageDB->GetCProduct()->SetAllBondMatrix(m_vectBondMatrixs, true);
  973. m_manageDB->GetCProduct()->SetAllPointMatrix(m_vecSubMatrixs, true);
  974. /*for (PROGRAM_BOND_MATRIX_STRUCT& bondMatrix : m_vectBondMatrixs)
  975. {
  976. m_manageDB->GetCProduct()->SetBondMatrix(bondMatrix.BondMatrixId, bondMatrix);
  977. }*/
  978. /*for (PROGRAM_POINT_MATRIX_STRUCT& pointMatrix : m_vecSubMatrixs)
  979. {
  980. m_manageDB->GetCProduct()->SetPointMatrix(pointMatrix.MatrixId, pointMatrix);
  981. }*/
  982. CProduct* _Product = m_manageDB->GetCProduct();
  983. }
  984. void BondMatrixProgramPage::UpdatePagePickParam()
  985. {
  986. //"取晶头取晶"
  987. if (ui.comboBoxPickParamType->currentIndex() == 0)
  988. {
  989. ui.checkBoxPickBlockCheck->setChecked(m_curWaferPickParam.bCheckBlock);
  990. ui.checkBoxPickLoseCheck->setChecked(m_curWaferPickParam.bCheckLose);
  991. ui.checkBoxPickFindForceCheck->setChecked(m_curWaferPickParam.bFindForce);
  992. ui.doubleSpinBoxPrePickZ->setValue(m_curWaferPickParam.dPreLev);
  993. ui.doubleSpinBoxPickForce->setValue(m_curWaferPickParam.dForce);
  994. ui.doubleSpinBoxPickPosZ->setValue(m_curWaferPickParam.dWorkLev);
  995. ui.spinBoxPickGrabDelay->setValue(m_curWaferPickParam.iGrabDelay);
  996. ui.spinBox_PickDelay->setValue(m_curWaferPickParam.iPickOrBondDelay);
  997. ui.spinBoxPickBlockCheckDelay->setValue(m_curWaferPickParam.iBlockOrLoseDelay);
  998. ui.spinBoxPickVacDelay->setValue(m_curWaferPickParam.iVacuumDelay);
  999. ui.spinBoxPickBlowDelay->setValue(m_curWaferPickParam.iBlowDelay);
  1000. }
  1001. //"中转台取晶"
  1002. else if (ui.comboBoxPickParamType->currentIndex() == 1)
  1003. {
  1004. ui.checkBoxPickBlockCheck->setChecked(m_curCalibPickParam.bCheckBlock);
  1005. ui.checkBoxPickLoseCheck->setChecked(m_curCalibPickParam.bCheckLose);
  1006. ui.checkBoxPickFindForceCheck->setChecked(m_curCalibPickParam.bFindForce);
  1007. ui.doubleSpinBoxPrePickZ->setValue(m_curCalibPickParam.dPreLev);
  1008. ui.doubleSpinBoxPickForce->setValue(m_curCalibPickParam.dForce);
  1009. ui.doubleSpinBoxPickPosZ->setValue(m_curCalibPickParam.dWorkLev);
  1010. ui.spinBoxPickGrabDelay->setValue(m_curCalibPickParam.iGrabDelay);
  1011. ui.spinBox_PickDelay->setValue(m_curCalibPickParam.iPickOrBondDelay);
  1012. ui.spinBoxPickBlockCheckDelay->setValue(m_curCalibPickParam.iBlockOrLoseDelay);
  1013. ui.spinBoxPickVacDelay->setValue(m_curCalibPickParam.iVacuumDelay);
  1014. ui.spinBoxPickBlowDelay->setValue(m_curCalibPickParam.iBlowDelay);
  1015. }
  1016. }
  1017. void BondMatrixProgramPage::UpdatePageBondParam()
  1018. {
  1019. //"中转台放晶"
  1020. if (ui.comboBoxBondParamType->currentIndex() == 0)
  1021. {
  1022. ui.checkBoxBondBlockCheck->setChecked(m_curCalibPlaceParam.bCheckBlock);
  1023. ui.checkBoxBondLoseCheck->setChecked(m_curCalibPlaceParam.bCheckLose);
  1024. ui.checkBoxBondFindForce->setChecked(m_curCalibPlaceParam.bFindForce);
  1025. ui.doubleSpinBoxPreBondPosZ->setValue(m_curCalibPlaceParam.dPreLev);
  1026. ui.doubleSpinBoxBondForce->setValue(m_curCalibPlaceParam.dForce);
  1027. ui.doubleSpinBoxBondPosZ->setValue(m_curCalibPlaceParam.dWorkLev);
  1028. ui.spinBoxBondGrabDelay->setValue(m_curCalibPlaceParam.iGrabDelay);
  1029. ui.spinBoxBondDelay->setValue(m_curCalibPlaceParam.iPickOrBondDelay);
  1030. ui.spinBoxBondBlockCheckDelay->setValue(m_curCalibPlaceParam.iBlockOrLoseDelay);
  1031. ui.spinBoxBondVacDelay->setValue(m_curCalibPlaceParam.iVacuumDelay);
  1032. ui.spinBoxBondBlowDelay->setValue(m_curCalibPlaceParam.iBlowDelay);
  1033. }
  1034. //"固晶台固晶"
  1035. else if (ui.comboBoxBondParamType->currentIndex() == 1)
  1036. {
  1037. ui.checkBoxBondBlockCheck->setChecked(m_curBondParam.bCheckBlock);
  1038. ui.checkBoxBondLoseCheck->setChecked(m_curBondParam.bCheckLose);
  1039. ui.checkBoxBondFindForce->setChecked(m_curBondParam.bFindForce);
  1040. ui.doubleSpinBoxPreBondPosZ->setValue(m_curBondParam.dPreLev);
  1041. ui.doubleSpinBoxBondForce->setValue(m_curBondParam.dForce);
  1042. ui.doubleSpinBoxBondPosZ->setValue(m_curBondParam.dWorkLev);
  1043. ui.spinBoxBondGrabDelay->setValue(m_curBondParam.iGrabDelay);
  1044. ui.spinBoxBondDelay->setValue(m_curBondParam.iPickOrBondDelay);
  1045. ui.spinBoxBondBlockCheckDelay->setValue(m_curBondParam.iBlockOrLoseDelay);
  1046. ui.spinBoxBondVacDelay->setValue(m_curBondParam.iVacuumDelay);
  1047. ui.spinBoxBondBlowDelay->setValue(m_curBondParam.iBlowDelay);
  1048. }
  1049. }
  1050. void BondMatrixProgramPage::initPage()
  1051. {
  1052. if (m_manageDB == nullptr)
  1053. {
  1054. return;
  1055. }
  1056. //从后端获取数据
  1057. m_vectBondMatrixs = m_manageDB->GetCProduct()->GetBondMatrix();
  1058. m_manageDB->GetCProduct()->GetAllPointMatrix(m_vecSubMatrixs);
  1059. if (m_vectBondMatrixs.size() == 0)
  1060. {
  1061. return;
  1062. }
  1063. //for (int i = 0; i < m_vectBondMatrixs.size(); i++)
  1064. //{
  1065. // for (int j = 0; j < m_vectBondMatrixs[i].VecPointMatrixId.size(); j++)
  1066. // {
  1067. // PROGRAM_POINT_MATRIX_STRUCT subMatrix;
  1068. // m_manageDB->GetCProduct()->GetPointMatrix(m_vectBondMatrixs[i].VecPointMatrixId[j], subMatrix);
  1069. // m_vecSubMatrixs.push_back(subMatrix);
  1070. // //AddMatrixPage(i, j, subMatrix);
  1071. // }
  1072. // AddOutMatrixPage(i, m_vectBondMatrixs[i], m_vecSubMatrixs);
  1073. //}
  1074. for (int i = 0; i < m_vectBondMatrixs.size(); i++)
  1075. {
  1076. AddOutMatrixPage(i, m_vectBondMatrixs[i], m_vecSubMatrixs);
  1077. }
  1078. //for (int i = 0; i < m_vectBondMatrixs[0].VecPointMatrixId.size(); ++i)
  1079. //{
  1080. // PROGRAM_POINT_MATRIX_STRUCT subMatrix;
  1081. // m_manageDB->GetCProduct()->GetPointMatrix(m_vectBondMatrixs[0].VecPointMatrixId[i], subMatrix);
  1082. // m_vecSubMatrixs.push_back(subMatrix);
  1083. //}
  1084. //m_manageDB->GetCProduct()->GetDieMatrix(m_vectBondMatrixs[0].VecPointMatrixId[0], m_vecSubMatrixs);
  1085. //显示矩阵数据
  1086. /*ui.spinBoxRow->setValue(m_vectBondMatrixs[0].BondMatrixRow);
  1087. ui.spinBoxCol->setValue(m_vectBondMatrixs[0].BondMatrixCol);
  1088. ui.doubleSpinBoxLeftTopX->setValue(m_vectBondMatrixs[0].LeftTopPoint.x);
  1089. ui.doubleSpinBoxLeftTopY->setValue(m_vectBondMatrixs[0].LeftTopPoint.y);
  1090. ui.doubleSpinBoxRightTopX->setValue(m_vectBondMatrixs[0].RightTopPoint.x);
  1091. ui.doubleSpinBoxRightTopY->setValue(m_vectBondMatrixs[0].RightTopPoint.y);
  1092. ui.doubleSpinBoxRightButtomX->setValue(m_vectBondMatrixs[0].RightBottomPoint.x);
  1093. ui.doubleSpinBoxRightButtomY->setValue(m_vectBondMatrixs[0].RightBottomPoint.y);
  1094. QString noBondPts = "";
  1095. bool firstTime = false;
  1096. for (XY_LONG_STRUCT& pt : m_vectBondMatrixs[0].VecNoBondPt)
  1097. {
  1098. if (firstTime)
  1099. {
  1100. noBondPts += "(" + QString::number(pt.x) + "," + QString::number(pt.y) + ")";
  1101. firstTime = true;
  1102. }
  1103. noBondPts += ";(" + QString::number(pt.x) + "," + QString::number(pt.y) + ")";
  1104. }
  1105. ui.lineEditNoBondPts->setText(noBondPts);*/
  1106. //显示子矩阵及数据
  1107. //for (PROGRAM_POINT_MATRIX_STRUCT& subMatrix : m_vecSubMatrixs)
  1108. //{
  1109. // AddMatrixPage(subMatrix);
  1110. //}
  1111. //从后端获取参数, 一套数据
  1112. CResources* pResources = CResources::GetInstance();
  1113. if (pResources == nullptr)
  1114. {
  1115. return;
  1116. }
  1117. CBondMatrix* pBondMatrix = pResources->GetBondMatrix();
  1118. if (pBondMatrix == nullptr)
  1119. {
  1120. return;
  1121. }
  1122. //pBondMatrix->GetPintInfoByIndex(0, m_curPointInfo);
  1123. m_manageDB->GetCProduct()->GetBondInfoData(m_vectBondMatrixs[0].BondInfoId, m_curBondInfo);
  1124. m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iPickParamId, m_curWaferPickParam);
  1125. m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iCalibBondParamId, m_curCalibPlaceParam);
  1126. m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iCalibPickParamId, m_curCalibPickParam);
  1127. m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iBondParamId, m_curBondParam);
  1128. //显示界面参数
  1129. UpdatePageParam();
  1130. }