BondMatrixProgramPage.cpp 192 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676
  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. #include <QtCore/qelapsedtimer.h>
  8. //#include <Module/Module/TipMatrix.cpp>
  9. //#include <Module/Module/Resources/database/CProduct.h>
  10. inline void safeSetComboBoxIndex(QComboBox* combo, int value)
  11. {
  12. combo->blockSignals(true);
  13. int idx = combo->findData(value);
  14. if (idx >= 0) {
  15. combo->setCurrentIndex(idx);
  16. }
  17. else {
  18. // 如果没找到值,保持不变或不设置任何值
  19. combo->setCurrentIndex(-1); // 明确不设置为第一个
  20. }
  21. combo->blockSignals(false);
  22. }
  23. BondMatrixProgramPage::BondMatrixProgramPage(QWidget* parent) :
  24. QWidget(parent)
  25. {
  26. QElapsedTimer timer;
  27. timer.start();
  28. ui.setupUi(this);
  29. qint64 elapsedTime = timer.elapsed();
  30. timer.start();
  31. ui.pushButtonSave->setProperty("type", "save");
  32. ui.pushButtonAddOutMatrix->setProperty("type", "addOutMatrix");
  33. ui.pushButtonSaveParaAs->setProperty("type", "saveParaAs");
  34. ui.pushButtonSavePara->setProperty("type", "savePara");
  35. elapsedTime = timer.elapsed();
  36. timer.start();
  37. setStyleSheet(
  38. "QWidget { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F1F4FD, stop: 1 #E5E4F6); }"
  39. "QDoubleSpinBox { background: #FFFFFF; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }"
  40. "QSpinBox { background: #FFFFFF; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }"
  41. "QLineEdit { background: #FFFFFF; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }"
  42. "QCheckBox::indicator { width: 20px; height: 20px; }"
  43. "QCheckBox::indicator:unchecked { background-color: #FFFFFF; border-radius: 2px; }"
  44. "QComboBox { background: #FFFFFF; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }"
  45. "QComboBox::drop-down { width: 20px; }"
  46. "QPushButton { background: #D0D0E8; border: 1px solid #BABBDC; border-radius: 6px; padding: 2px 5px; }" // Button background color
  47. "QPushButton:hover { background-color: #B0B0D8; }" // Lighter color on hover
  48. "QPushButton:pressed { background-color: #A0A0C8; }" // Darker color on press
  49. );
  50. elapsedTime = timer.elapsed();
  51. timer.start();
  52. ui.frame->setFrameShape(QFrame::NoFrame); // 移除默认框架
  53. ui.frame->setFixedHeight(2); // 设置固定高度
  54. ui.frame->setStyleSheet("background-color: #C7CAEB;");
  55. //ui.tab->setStyleSheet("background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F1F4FD, stop: 1 #E5E4F6)");
  56. elapsedTime = timer.elapsed();
  57. timer.start();
  58. initPage();
  59. elapsedTime = timer.elapsed();
  60. timer.start();
  61. connect(ui.pushButtonSave, &QPushButton::clicked, this, [=] {
  62. MatrixChangeEvent();
  63. CBondMatrix* pBondMatrix = CResources::GetInstance()->GetBondMatrix();
  64. pBondMatrix->LoadMatrix(BOND_DIR::OrderAndS);
  65. });
  66. connect(ui.pushButtonAddOutMatrix, &QPushButton::clicked, this, [=]() {
  67. PROGRAM_BOND_MATRIX_STRUCT newMatrix;
  68. //排序
  69. std::sort(m_vectBondMatrixs.begin(), m_vectBondMatrixs.end(),
  70. [](const PROGRAM_BOND_MATRIX_STRUCT& a, const PROGRAM_BOND_MATRIX_STRUCT& b) {
  71. return a.BondMatrixId < b.BondMatrixId;
  72. });
  73. int newBondMatrixID = 0;
  74. UINT maxID = 0;
  75. // 查找最大 MatrixId
  76. for (PROGRAM_BOND_MATRIX_STRUCT& bondMatrix : m_vectBondMatrixs)
  77. {
  78. if (bondMatrix.BondMatrixId > maxID)
  79. {
  80. maxID = bondMatrix.BondMatrixId;
  81. }
  82. }
  83. newBondMatrixID = ++maxID;
  84. while (std::any_of(m_vectBondMatrixs.begin(), m_vectBondMatrixs.end(),
  85. [newBondMatrixID](const PROGRAM_BOND_MATRIX_STRUCT& bondMatrix) {
  86. return bondMatrix.BondMatrixId == newBondMatrixID;
  87. }))
  88. {
  89. newBondMatrixID++; // 如果生成的 ID 已经存在,递增直到找到唯一的 ID
  90. }
  91. newMatrix.BondMatrixId = newBondMatrixID;
  92. newMatrix.BondMatrixRow = 0;
  93. newMatrix.BondMatrixCol = 0;
  94. newMatrix.strModuleName = "BondHead";
  95. newMatrix.iModuleId = MODULE_LIST::BondHead;
  96. int newVectorIndex = m_vectBondMatrixs.size();
  97. newMatrix.BondInfoId = 1;
  98. //std::vector<PROGRAM_POINT_MATRIX_STRUCT> newVecSubMatrix;
  99. m_vectBondMatrixs.push_back(newMatrix);
  100. AddOutMatrixPage(newVectorIndex, newMatrix, m_vecSubMatrixs);
  101. //AddOutMatrixPage(0, m_vectBondMatrixs[0], m_vecSubMatrixs);
  102. ui.comboBoxCurrentMatrix->clear();
  103. for (int i = 0; i < m_vectBondMatrixs.size(); i++)
  104. {
  105. // 显示 矩阵编号
  106. int _bondMatrixId = m_vectBondMatrixs[i].BondMatrixId;
  107. QString itemText = QString::number(_bondMatrixId);
  108. // 将 矩阵编号 添加到下拉框
  109. ui.comboBoxCurrentMatrix->addItem(itemText,_bondMatrixId);
  110. }
  111. ShowCurrentMatrix(m_vectBondMatrixs[m_vectBondMatrixs.size()-1].BondMatrixId);
  112. });
  113. connect(ui.pushButtonSavePara, &QPushButton::clicked, this, [=] {
  114. //MatrixChangeEvent();
  115. ParamChangeEvent();
  116. CBondMatrix* pBondMatrix = CResources::GetInstance()->GetBondMatrix();
  117. pBondMatrix->LoadMatrix(BOND_DIR::OrderAndS);
  118. });
  119. //BondInfo SaveAs
  120. connect(ui.pushButtonSaveParaAs, &QPushButton::clicked, this, [=] {
  121. BondInfoParamSaveAsEvent();
  122. CBondMatrix* pBondMatrix = CResources::GetInstance()->GetBondMatrix();
  123. pBondMatrix->LoadMatrix(BOND_DIR::OrderAndS);
  124. });
  125. //BondInfo Delete
  126. connect(ui.pushButtonDeleteParam, &QPushButton::clicked, this, &BondMatrixProgramPage::onPushButtonDeleteParamClicked);
  127. // Param Delete
  128. connect(ui.pushButtonDeletePick1, &QPushButton::clicked, this, [this]() {
  129. onPushButtonDeleteClicked(ui.pushButtonDeletePick1, ui.comboBoxCurrentPara_Pick1);
  130. restorePick1DefaultStyles();
  131. });
  132. connect(ui.pushButtonDeletePick2, &QPushButton::clicked, this, [this]() {
  133. onPushButtonDeleteClicked(ui.pushButtonDeletePick2, ui.comboBoxCurrentPara_Pick2);
  134. restorePick2DefaultStyles();
  135. });
  136. connect(ui.pushButtonDeletePlace1, &QPushButton::clicked, this, [this]() {
  137. onPushButtonDeleteClicked(ui.pushButtonDeletePlace1, ui.comboBoxCurrentPara_Place1);
  138. restorePlace1DefaultStyles();
  139. });
  140. connect(ui.pushButtonDeletePlace2, &QPushButton::clicked, this, [this]() {
  141. onPushButtonDeleteClicked(ui.pushButtonDeletePlace2, ui.comboBoxCurrentPara_Place2);
  142. restorePlccle2DefaultStyles();
  143. });
  144. //Param SaveAs
  145. // 取晶头取晶
  146. connect(ui.pushButtonSaveAsPick1, &QPushButton::clicked, this, [=]() {
  147. ParamSaveAsEvent(m_curWaferPickParam);
  148. restorePick1DefaultStyles();
  149. });
  150. // 中转台取晶
  151. connect(ui.pushButtonSaveAsPick2, &QPushButton::clicked, this, [=]() {
  152. ParamSaveAsEvent(m_curCalibPickParam);
  153. restorePick2DefaultStyles();
  154. });
  155. // 中转台固晶
  156. connect(ui.pushButtonSaveAsPlace1, &QPushButton::clicked, this, [=]() {
  157. ParamSaveAsEvent(m_curCalibPlaceParam);
  158. restorePlace1DefaultStyles();
  159. });
  160. // 固晶台固晶
  161. connect(ui.pushButtonSaveAsPlace2, &QPushButton::clicked, this, [=]() {
  162. ParamSaveAsEvent(m_curBondParam);
  163. restorePlccle2DefaultStyles();
  164. });
  165. connect(ui.comboBoxCurrentMatrix, SIGNAL(currentIndexChanged(int)), this, SLOT(onComboBoxCurrentMatrixChanged(int)));
  166. connect(ui.comboBoxCurrentPara, SIGNAL(currentIndexChanged(int)), this, SLOT(onComboBoxIndexChangedForParam(int)));
  167. ui.comboBoxCurrentPara->installEventFilter(this);
  168. ui.comboBoxDieSource->installEventFilter(this);
  169. ui.comboBoxPickNozzleID->installEventFilter(this);
  170. ui.comboBoxPostBondTemp->installEventFilter(this);
  171. ui.comboBoxPickTempID->installEventFilter(this);
  172. ui.comboBoxPreBondTemp->installEventFilter(this);
  173. ui.comboBoxBondTemp->installEventFilter(this);
  174. ui.comboBoxLookUpTemp->installEventFilter(this);
  175. ui.comboBoxCalibPickTemp->installEventFilter(this);
  176. ui.comboBoxPcbAlnPRStrategyId->installEventFilter(this);
  177. ui.comboBoxCurrentPara_Pick1->installEventFilter(this);
  178. ui.comboBoxCurrentPara_Pick2->installEventFilter(this);
  179. ui.comboBoxCurrentPara_Place1->installEventFilter(this);
  180. ui.comboBoxCurrentPara_Place2->installEventFilter(this);
  181. ui.comboBoxBondNozzleID->installEventFilter(this);
  182. //参数
  183. // 处理 ComboBox 选择的 "Die Source"
  184. connect(ui.comboBoxDieSource, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](int index) {
  185. if (index == 0) {
  186. m_curBondInfo.eDieSource = DIE_SOURCE::BY_WAFFLE;
  187. }
  188. else if (index == 1) {
  189. m_curBondInfo.eDieSource = DIE_SOURCE::BY_WAFER;
  190. }
  191. // 更新样式
  192. if (m_curBondInfo.eDieSource == m_tempBondInfo.eDieSource)
  193. ui.comboBoxDieSource->setStyleSheet(""); // 恢复默认样式
  194. else
  195. ui.comboBoxDieSource->setStyleSheet("color: red;"); // 字体颜色变红
  196. });
  197. // 是否中转
  198. connect(ui.checkBoxIsCalib, &QCheckBox::clicked, this, [=](bool isChecked) {
  199. m_curBondInfo.bTransferPREnable = isChecked;
  200. // 更新样式
  201. if (isChecked == m_tempBondInfo.bTransferPREnable)
  202. ui.checkBoxIsCalib->setStyleSheet(""); // 恢复默认样式
  203. else
  204. ui.checkBoxIsCalib->setStyleSheet("color: red;"); // 字体颜色变红
  205. });
  206. // 是否逐个固晶对点
  207. connect(ui.checkBoxIsAllBondAln, &QCheckBox::clicked, this, [=](bool isChecked) {
  208. m_curBondInfo.bAllBondAlnEnable = isChecked;
  209. // 更新样式
  210. if (isChecked == m_tempBondInfo.bAllBondAlnEnable)
  211. ui.checkBoxIsAllBondAln->setStyleSheet(""); // 恢复默认样式
  212. else
  213. ui.checkBoxIsAllBondAln->setStyleSheet("color: red;"); // 字体颜色变红
  214. });
  215. // 是否 PCB对点
  216. connect(ui.checkBoxIsPcbAln, &QCheckBox::clicked, this, [=](bool isChecked) {
  217. m_curBondInfo.bPcbAlnEnable = isChecked;
  218. // 更新样式
  219. if (isChecked == m_tempBondInfo.bPcbAlnEnable)
  220. ui.checkBoxIsPcbAln->setStyleSheet(""); // 恢复默认样式
  221. else
  222. ui.checkBoxIsPcbAln->setStyleSheet("color: red;"); // 字体颜色变红
  223. });
  224. // 处理 "Die Height" 的变化
  225. connect(ui.spinBoxDieHeight, &DoubleSpinBox::editDone, this, [=]() {
  226. m_curBondInfo.dDieHeight = ui.spinBoxDieHeight->value();
  227. // 更新样式
  228. if (m_curBondInfo.dDieHeight == m_tempBondInfo.dDieHeight)
  229. ui.spinBoxDieHeight->setStyleSheet(""); // 恢复默认样式
  230. else
  231. ui.spinBoxDieHeight->setStyleSheet("color: red;"); // 字体颜色变红
  232. });
  233. // 处理 "Pick Nozzle ID" 的变化
  234. connect(ui.comboBoxPickNozzleID, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  235. if (m_isComBoxUpdating) {
  236. return;
  237. }
  238. m_curBondInfo.iPickHeadId = ui.comboBoxPickNozzleID->currentData().toInt();
  239. // 更新样式
  240. if (m_curBondInfo.iPickHeadId == m_tempBondInfo.iPickHeadId)
  241. ui.comboBoxPickNozzleID->setStyleSheet(""); // 恢复默认样式
  242. else
  243. ui.comboBoxPickNozzleID->setStyleSheet("color: red;"); // 字体颜色变红
  244. });
  245. // 处理 "Post Bond Temp" 的变化
  246. connect(ui.comboBoxPostBondTemp, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  247. if (m_isComBoxUpdating) {
  248. return;
  249. }
  250. m_curBondInfo.iBondBackPRStrategyId = ui.comboBoxPostBondTemp->currentData().toInt();
  251. // 更新样式
  252. if (m_curBondInfo.iBondBackPRStrategyId == m_tempBondInfo.iBondBackPRStrategyId)
  253. ui.comboBoxPostBondTemp->setStyleSheet(""); // 恢复默认样式
  254. else
  255. ui.comboBoxPostBondTemp->setStyleSheet("color: red;"); // 字体颜色变红
  256. });
  257. // 处理 "Pick Temp ID" 的变化
  258. connect(ui.comboBoxPickTempID, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  259. if (m_isComBoxUpdating) {
  260. return;
  261. }
  262. m_curBondInfo.iPickPRStrategyId = ui.comboBoxPickTempID->currentData().toInt();
  263. // 更新样式
  264. if (m_curBondInfo.iPickPRStrategyId == m_tempBondInfo.iPickPRStrategyId)
  265. ui.comboBoxPickTempID->setStyleSheet(""); // 恢复默认样式
  266. else
  267. ui.comboBoxPickTempID->setStyleSheet("color: red;"); // 字体颜色变红
  268. });
  269. // 处理 "Pre Bond Temp" 的变化
  270. connect(ui.comboBoxPreBondTemp, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  271. if (m_isComBoxUpdating) {
  272. return;
  273. }
  274. m_curBondInfo.iBondFrontPRStrategyId = ui.comboBoxPreBondTemp->currentData().toInt();
  275. // 更新样式
  276. if (m_curBondInfo.iBondFrontPRStrategyId == m_tempBondInfo.iBondFrontPRStrategyId)
  277. ui.comboBoxPreBondTemp->setStyleSheet(""); // 恢复默认样式
  278. else
  279. ui.comboBoxPreBondTemp->setStyleSheet("color: red;"); // 字体颜色变红
  280. });
  281. // 处理 "Bond Temp" 的变化
  282. connect(ui.comboBoxBondTemp, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  283. if (m_isComBoxUpdating) {
  284. return;
  285. }
  286. m_curBondInfo.iBondAlnPRStrategyId = ui.comboBoxBondTemp->currentData().toInt();
  287. // 更新样式
  288. if (m_curBondInfo.iBondAlnPRStrategyId == m_tempBondInfo.iBondAlnPRStrategyId)
  289. ui.comboBoxBondTemp->setStyleSheet(""); // 恢复默认样式
  290. else
  291. ui.comboBoxBondTemp->setStyleSheet("color: red;"); // 字体颜色变红
  292. });
  293. // 处理 "Look Up Temp" 的变化
  294. connect(ui.comboBoxLookUpTemp, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  295. if (m_isComBoxUpdating) {
  296. return;
  297. }
  298. m_curBondInfo.iLookUpPRStrategyId = ui.comboBoxLookUpTemp->currentData().toInt();
  299. // 更新样式
  300. if (m_curBondInfo.iLookUpPRStrategyId == m_tempBondInfo.iLookUpPRStrategyId)
  301. ui.comboBoxLookUpTemp->setStyleSheet(""); // 恢复默认样式
  302. else
  303. ui.comboBoxLookUpTemp->setStyleSheet("color: red;"); // 字体颜色变红
  304. });
  305. // 处理 "Calib Pick Temp" 的变化
  306. connect(ui.comboBoxCalibPickTemp, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  307. if (m_isComBoxUpdating) {
  308. return;
  309. }
  310. m_curBondInfo.iCalibPRStrategyId = ui.comboBoxCalibPickTemp->currentData().toInt();
  311. // 更新样式
  312. if (m_curBondInfo.iCalibPRStrategyId == m_tempBondInfo.iCalibPRStrategyId)
  313. ui.comboBoxCalibPickTemp->setStyleSheet(""); // 恢复默认样式
  314. else
  315. ui.comboBoxCalibPickTemp->setStyleSheet("color: red;"); // 字体颜色变红
  316. });
  317. // 处理 "PcbAlnPRStrategyId" 的变化
  318. connect(ui.comboBoxPcbAlnPRStrategyId, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  319. if (m_isComBoxUpdating) {
  320. return;
  321. }
  322. m_curBondInfo.iPcbAlnPRStrategyId = ui.comboBoxPcbAlnPRStrategyId->currentData().toInt();
  323. // 更新样式
  324. if (m_curBondInfo.iPcbAlnPRStrategyId == m_tempBondInfo.iPcbAlnPRStrategyId)
  325. ui.comboBoxPcbAlnPRStrategyId->setStyleSheet(""); // 恢复默认样式
  326. else
  327. ui.comboBoxPcbAlnPRStrategyId->setStyleSheet("color: red;"); // 字体颜色变红
  328. });
  329. //取/固晶参数集修改
  330. connect(ui.comboBoxCurrentPara_Pick1, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  331. if (m_isComBoxUpdating) {
  332. return;
  333. }
  334. m_curBondInfo.iPickParamId = ui.comboBoxCurrentPara_Pick1->currentData().toInt();
  335. if (m_curBondInfo.iPickParamId == m_curBondInfo.iCalibPickParamId) {
  336. m_curWaferPickParam = m_curCalibPickParam;
  337. }
  338. else if (m_curBondInfo.iPickParamId == m_curBondInfo.iCalibBondParamId) {
  339. m_curWaferPickParam = m_curCalibPlaceParam;
  340. }
  341. else if (m_curBondInfo.iPickParamId == m_curBondInfo.iBondParamId) {
  342. m_curWaferPickParam = m_curBondParam;
  343. }
  344. else {
  345. m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iPickParamId, m_curWaferPickParam);
  346. }
  347. //m_tempWaferPickParam = m_curWaferPickParam;
  348. UpdatePagePick1Param();
  349. // 更新样式
  350. if (m_curBondInfo.iPickParamId == m_tempBondInfo.iPickParamId)
  351. ui.comboBoxCurrentPara_Pick1->setStyleSheet(""); // 恢复默认样式
  352. else
  353. ui.comboBoxCurrentPara_Pick1->setStyleSheet("color: red;"); // 字体颜色变红
  354. });
  355. connect(ui.comboBoxCurrentPara_Pick2, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  356. if (m_isComBoxUpdating) {
  357. return;
  358. }
  359. m_curBondInfo.iCalibPickParamId = ui.comboBoxCurrentPara_Pick2->currentData().toInt();
  360. // 根据其他的Pick参数进行判断
  361. if (m_curBondInfo.iCalibPickParamId == m_curBondInfo.iPickParamId) {
  362. m_curCalibPickParam = m_curWaferPickParam;
  363. }
  364. else if (m_curBondInfo.iCalibPickParamId == m_curBondInfo.iCalibBondParamId) {
  365. m_curCalibPickParam = m_curCalibPlaceParam;
  366. }
  367. else if (m_curBondInfo.iCalibPickParamId == m_curBondInfo.iBondParamId) {
  368. m_curCalibPickParam = m_curBondParam;
  369. }
  370. else {
  371. m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iCalibPickParamId, m_curCalibPickParam);
  372. }
  373. //UpdatePagePickPlaceParam();
  374. //m_tempCalibPickParam = m_curCalibPickParam;
  375. UpdatePagePick2Param();
  376. // 更新样式
  377. if (m_curBondInfo.iCalibPickParamId == m_tempBondInfo.iCalibPickParamId)
  378. ui.comboBoxCurrentPara_Pick2->setStyleSheet(""); // 恢复默认样式
  379. else
  380. ui.comboBoxCurrentPara_Pick2->setStyleSheet("color: red;"); // 字体颜色变红
  381. });
  382. connect(ui.comboBoxCurrentPara_Place1, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  383. if (m_isComBoxUpdating) {
  384. return;
  385. }
  386. m_curBondInfo.iCalibBondParamId = ui.comboBoxCurrentPara_Place1->currentData().toInt();
  387. // 根据其他的Pick参数进行判断
  388. if (m_curBondInfo.iCalibBondParamId == m_curBondInfo.iPickParamId) {
  389. m_curCalibPlaceParam = m_curWaferPickParam;
  390. }
  391. else if (m_curBondInfo.iCalibBondParamId == m_curBondInfo.iCalibPickParamId) {
  392. m_curCalibPlaceParam = m_curCalibPickParam;
  393. }
  394. else if (m_curBondInfo.iCalibBondParamId == m_curBondInfo.iBondParamId) {
  395. m_curCalibPlaceParam = m_curBondParam;
  396. }
  397. else {
  398. m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iCalibBondParamId, m_curCalibPlaceParam);
  399. }
  400. //UpdatePagePickPlaceParam();
  401. //m_tempCalibPlaceParam = m_curCalibPlaceParam;
  402. UpdatePageBond1Param();
  403. // 更新样式
  404. if (m_curBondInfo.iCalibBondParamId == m_tempBondInfo.iCalibBondParamId)
  405. ui.comboBoxCurrentPara_Place1->setStyleSheet(""); // 恢复默认样式
  406. else
  407. ui.comboBoxCurrentPara_Place1->setStyleSheet("color: red;"); // 字体颜色变红
  408. });
  409. connect(ui.comboBoxCurrentPara_Place2, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  410. if (m_isComBoxUpdating) {
  411. return;
  412. }
  413. m_curBondInfo.iBondParamId = ui.comboBoxCurrentPara_Place2->currentData().toInt();
  414. if (m_curBondInfo.iBondParamId == m_curBondInfo.iPickParamId) {
  415. m_curBondParam = m_curWaferPickParam;
  416. }
  417. else if (m_curBondInfo.iBondParamId == m_curBondInfo.iCalibPickParamId) {
  418. m_curBondParam = m_curCalibPickParam;
  419. }
  420. else if (m_curBondInfo.iBondParamId == m_curBondInfo.iCalibBondParamId) {
  421. m_curBondParam = m_curCalibPlaceParam;
  422. }
  423. else {
  424. m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iBondParamId, m_curBondParam);
  425. }
  426. //UpdatePagePickPlaceParam();
  427. //m_tempBondParam = m_curBondParam;
  428. UpdatePageBond2Param();
  429. // 更新样式
  430. if (m_curBondInfo.iBondParamId == m_tempBondInfo.iBondParamId)
  431. ui.comboBoxCurrentPara_Place2->setStyleSheet(""); // 恢复默认样式
  432. else
  433. ui.comboBoxCurrentPara_Place2->setStyleSheet("color: red;"); // 字体颜色变红
  434. });
  435. // Connect Modify&Create buttons to slots
  436. connect(ui.SetParamPickTemp, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamPickTempClicked);
  437. connect(ui.SetParamPreBond, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamPreBondClicked);
  438. connect(ui.SetParamPostBond, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamPostBondClicked);
  439. connect(ui.SetParamBond, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamBondClicked);
  440. connect(ui.SetParamLookUp, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamLookUpClicked);
  441. connect(ui.SetParamCalibPick, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamCalibPickClicked);
  442. connect(ui.SetParamPcbAlnPRStrategy, &QPushButton::clicked, this, &BondMatrixProgramPage::onSetParamPcbAlnPRStrategyClicked);
  443. connect(ui.CreatParamPickTemp, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreateParamPickTempClicked);
  444. connect(ui.CreatParamPreBond, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreateParamPreBondClicked);
  445. connect(ui.CreatParamPostBond, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreateParamPostBondClicked);
  446. connect(ui.CreatParamBond, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreateParamBondClicked);
  447. connect(ui.CreatParamLookUp, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreateParamLookUpClicked);
  448. connect(ui.CreatParamCalibPick, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreateParamCalibPickClicked);
  449. connect(ui.CreatParamPcbAlnPRStrategy, &QPushButton::clicked, this, &BondMatrixProgramPage::onCreatParamPcbAlnPRStrategyClicked);
  450. // 处理 "Bond Nozzle ID" 的变化
  451. connect(ui.comboBoxBondNozzleID, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [=](int index) {
  452. if (m_isComBoxUpdating) {
  453. return;
  454. }
  455. m_curBondInfo.iBondHeadId = ui.comboBoxBondNozzleID->currentData().toInt();
  456. // 更新样式
  457. if (m_curBondInfo.iBondHeadId == m_tempBondInfo.iBondHeadId)
  458. ui.comboBoxBondNozzleID->setStyleSheet(""); // 恢复默认样式
  459. else
  460. ui.comboBoxBondNozzleID->setStyleSheet("color: red;"); // 字体颜色变红
  461. });
  462. // 处理 "Bond Offset X" 的变化
  463. connect(ui.doubleSpinBoxBondOffsetX, &DoubleSpinBox::editDone, this, [=]() {
  464. m_curBondInfo.stOffset.x = ui.doubleSpinBoxBondOffsetX->value();
  465. // 更新样式
  466. if (m_curBondInfo.stOffset.x == m_tempBondInfo.stOffset.x)
  467. ui.doubleSpinBoxBondOffsetX->setStyleSheet(""); // 恢复默认样式
  468. else
  469. ui.doubleSpinBoxBondOffsetX->setStyleSheet("color: red;"); // 字体颜色变红
  470. });
  471. // 处理 "Bond Offset Y" 的变化
  472. connect(ui.doubleSpinBoxBondOffsetY, &DoubleSpinBox::editDone, this, [=]() {
  473. m_curBondInfo.stOffset.y = ui.doubleSpinBoxBondOffsetY->value();
  474. // 更新样式
  475. if (m_curBondInfo.stOffset.y == m_tempBondInfo.stOffset.y)
  476. ui.doubleSpinBoxBondOffsetY->setStyleSheet(""); // 恢复默认样式
  477. else
  478. ui.doubleSpinBoxBondOffsetY->setStyleSheet("color: red;"); // 字体颜色变红
  479. });
  480. // 处理 "Bond Offset Angle" 的变化
  481. connect(ui.doubleSpinBoxBondOffsetAngle, &DoubleSpinBox::editDone, this, [=]() {
  482. m_curBondInfo.stOffset.a = ui.doubleSpinBoxBondOffsetAngle->value();
  483. // 更新样式
  484. if (m_curBondInfo.stOffset.a == m_tempBondInfo.stOffset.a)
  485. ui.doubleSpinBoxBondOffsetAngle->setStyleSheet(""); // 恢复默认样式
  486. else
  487. ui.doubleSpinBoxBondOffsetAngle->setStyleSheet("color: red;"); // 字体颜色变红
  488. });
  489. // 初始化取晶控件连接
  490. connectWaferPickControls();
  491. connectCalibPickControls();
  492. // 初始化放晶控件连接
  493. connectCalibPlaceControls();
  494. connectBondControls();
  495. elapsedTime = timer.elapsed();
  496. }
  497. BondMatrixProgramPage::~BondMatrixProgramPage()
  498. {
  499. }
  500. // 判断是否可以删除的函数
  501. bool BondMatrixProgramPage::canDeleteBondInfo(int selectedBondInfoId)
  502. {
  503. // 遍历数据矩阵,检查是否有任何一个矩阵引用了这个ID
  504. for (const auto& matrix : m_vectBondMatrixs) {
  505. if (matrix.BondInfoId == selectedBondInfoId) {
  506. return false; // 如果有引用,不能删除
  507. }
  508. }
  509. return true; // 如果没有引用,允许删除
  510. }
  511. void BondMatrixProgramPage::onPushButtonDeleteParamClicked()
  512. {
  513. // 获取当前选中的ID
  514. int selectedId = ui.comboBoxCurrentPara->currentData().toInt();
  515. // 遍历数据矩阵,检查是否有任何一个矩阵引用了这个ID
  516. bool canDelete = canDeleteBondInfo(selectedId);
  517. // 根据是否能删除来决定删除操作
  518. if (canDelete) {
  519. // 执行删除操作:删除 m_vecBondInfoData 中对应的元素
  520. for (int i = 0; i < m_vecBondInfoData.size(); ++i) {
  521. if (selectedId == m_vecBondInfoData[i].iInfoId) {
  522. m_vecBondInfoData.erase(m_vecBondInfoData.begin() + i); // 从数据中删除
  523. break; // 删除成功后退出循环
  524. }
  525. }
  526. m_manageDB->GetCProduct()->DeleteBondInfoData(selectedId);
  527. // 更新 comboBox:从 comboBox 中移除对应的项
  528. for (int i = 0; i < ui.comboBoxCurrentPara->count(); ++i) {
  529. if (ui.comboBoxCurrentPara->itemData(i).toInt() == selectedId) {
  530. ui.comboBoxCurrentPara->removeItem(i); // 从下拉框中移除
  531. break;
  532. }
  533. }
  534. }
  535. else {
  536. // 提示用户该ID被引用,不能删除
  537. QMessageBox::warning(this, "警告", "该参数ID已被引用,无法删除!");
  538. }
  539. int iMatrix = ui.comboBoxCurrentMatrix->currentData().toInt();
  540. int iInfoId = -1;
  541. for (const auto& matrix : m_vectBondMatrixs) {
  542. if (matrix.BondMatrixId == iMatrix) {
  543. iInfoId = matrix.BondInfoId;
  544. break;
  545. }
  546. }
  547. ui.comboBoxCurrentPara->setCurrentIndex(ui.comboBoxCurrentPara->findData(iInfoId)); // 设置默认项
  548. // 动态更新删除按钮的状态
  549. canDelete = canDeleteBondInfo(iInfoId);
  550. updateDeleteButtonStatus(canDelete, ui.pushButtonDeleteParam);
  551. updateFourParamDeleteButtonStatus();
  552. }
  553. //判断使用次数:0没有被使用,1自己使用,>=1 多个使用
  554. int BondMatrixProgramPage::canDeleteParameter(int selectedId)
  555. {
  556. int referenceCount = 0;
  557. // 遍历 m_vecBondInfoData,检查是否有任何一个元素引用了 selectedId
  558. for (const auto& bondInfo : m_vecBondInfoData) {
  559. if (bondInfo.iPickParamId == selectedId) {
  560. //return false; // 如果有引用,不能删除
  561. referenceCount++;
  562. }
  563. if (bondInfo.iCalibPickParamId == selectedId) {
  564. //return false; // 如果有引用,不能删除
  565. referenceCount++;
  566. }
  567. if (bondInfo.iCalibBondParamId == selectedId) {
  568. //return false; // 如果有引用,不能删除
  569. referenceCount++;
  570. }
  571. if (bondInfo.iBondParamId == selectedId) {
  572. //return false; // 如果有引用,不能删除
  573. referenceCount++;
  574. }
  575. }
  576. return referenceCount;// <= 1;如果<=1则说明只有自己或者没有引用,则可以删除
  577. }
  578. bool BondMatrixProgramPage::deleteParameter(QPushButton* deleteButton, int selectedId)
  579. {
  580. // 判断是否可以删除
  581. int canDelete = canDeleteParameter(selectedId);
  582. if (canDelete <= 1) {
  583. m_manageDB->GetCProduct()->DeleteBondParam(selectedId);
  584. m_vecBondInfoData = m_manageDB->GetCProduct()->GetAllBondInfoData();
  585. for (auto it = m_vecParam.begin(); it != m_vecParam.end(); ++it)
  586. {
  587. if (it->iId == selectedId)
  588. {
  589. m_vecParam.erase(it);
  590. break;
  591. }
  592. }
  593. m_isComBoxUpdating = true;
  594. // 从所有comboBox中移除对应项
  595. for (int i = 0; i < ui.comboBoxCurrentPara_Pick1->count(); ++i) {
  596. if (ui.comboBoxCurrentPara_Pick1->itemData(i).toInt() == selectedId) {
  597. ui.comboBoxCurrentPara_Pick1->removeItem(i);
  598. break;
  599. }
  600. }
  601. for (int i = 0; i < ui.comboBoxCurrentPara_Pick2->count(); ++i) {
  602. if (ui.comboBoxCurrentPara_Pick2->itemData(i).toInt() == selectedId) {
  603. ui.comboBoxCurrentPara_Pick2->removeItem(i);
  604. break;
  605. }
  606. }
  607. for (int i = 0; i < ui.comboBoxCurrentPara_Place1->count(); ++i) {
  608. if (ui.comboBoxCurrentPara_Place1->itemData(i).toInt() == selectedId) {
  609. ui.comboBoxCurrentPara_Place1->removeItem(i);
  610. break;
  611. }
  612. }
  613. for (int i = 0; i < ui.comboBoxCurrentPara_Place2->count(); ++i) {
  614. if (ui.comboBoxCurrentPara_Place2->itemData(i).toInt() == selectedId) {
  615. ui.comboBoxCurrentPara_Place2->removeItem(i);
  616. break;
  617. }
  618. }
  619. m_isComBoxUpdating = false;
  620. return true;
  621. }
  622. else {
  623. //QMessageBox::warning(this, "警告", "该参数ID已被引用,无法删除!");
  624. return false;
  625. }
  626. }
  627. //// 对应按钮按下时的槽函数:暂时弃用
  628. //void BondMatrixProgramPage::on_pushButtonDeletePick1_clicked(QPushButton* deleteButton, QComboBox* comboBox)
  629. //{
  630. // // 获取 Pick1 下拉框的选中项ID
  631. // int selectedId = ui.comboBoxCurrentPara_Pick1->currentData().toInt();
  632. // deleteParameter(deleteButton, selectedId); // 调用删除函数
  633. //}
  634. //
  635. //void BondMatrixProgramPage::on_pushButtonDeletePick2_clicked(QPushButton* deleteButton, QComboBox* comboBox)
  636. //{
  637. // // 获取 Pick2 下拉框的选中项ID
  638. // int selectedId = ui.comboBoxCurrentPara_Pick2->currentData().toInt();
  639. // deleteParameter(deleteButton, selectedId); // 调用删除函数
  640. //}
  641. //
  642. //void BondMatrixProgramPage::on_pushButtonDeletePlace1_clicked(QPushButton* deleteButton, QComboBox* comboBox)
  643. //{
  644. // // 获取 Place1 下拉框的选中项ID
  645. // int selectedId = ui.comboBoxCurrentPara_Place1->currentData().toInt();
  646. // deleteParameter(deleteButton, selectedId); // 调用删除函数
  647. //}
  648. //
  649. //void BondMatrixProgramPage::on_pushButtonDeletePlace2_clicked(QPushButton* deleteButton, QComboBox* comboBox)
  650. //{
  651. // // 获取 Place2 下拉框的选中项ID
  652. // int selectedId = ui.comboBoxCurrentPara_Place2->currentData().toInt();
  653. // deleteParameter(deleteButton, selectedId); // 调用删除函数
  654. //}
  655. // 通用的删除槽函数
  656. void BondMatrixProgramPage::onPushButtonDeleteClicked(QPushButton* deleteButton, QComboBox* comboBox)
  657. {
  658. // 获取选中的 ID
  659. int selectedId = comboBox->currentData().toInt();
  660. // 调用删除函数
  661. if (!deleteParameter(deleteButton, selectedId)) {
  662. return;
  663. }
  664. int canDelete = canDeleteParameter(selectedId);
  665. if (canDelete == 1) //此参数机只有当前参数引用
  666. {
  667. // 删除成功后设置 comboBox 为第一个选项,若没有选项则 设置为空:一般不会为空
  668. if (comboBox->count() > 0) {
  669. comboBox->setCurrentIndex(0);
  670. }
  671. else {
  672. comboBox->setCurrentIndex(-1);
  673. }
  674. }
  675. else if (canDelete == 0)//此参数机没有任何引用
  676. {
  677. // 判断 deleteButton 是哪个按钮,执行不同的操作
  678. if (deleteButton == ui.pushButtonDeletePick1) {
  679. safeSetComboBoxIndex(ui.comboBoxCurrentPara_Pick1, m_tempBondInfo.iPickParamId);
  680. }
  681. else if (deleteButton == ui.pushButtonDeletePick2) {
  682. safeSetComboBoxIndex(ui.comboBoxCurrentPara_Pick2, m_tempBondInfo.iCalibPickParamId);
  683. }
  684. else if (deleteButton == ui.pushButtonDeletePlace1) {
  685. safeSetComboBoxIndex(ui.comboBoxCurrentPara_Place1, m_tempBondInfo.iCalibBondParamId);
  686. }
  687. else if (deleteButton == ui.pushButtonDeletePlace2) {
  688. safeSetComboBoxIndex(ui.comboBoxCurrentPara_Place2, m_tempBondInfo.iBondParamId);
  689. }
  690. }
  691. else {
  692. return;
  693. }
  694. selectedId = comboBox->currentData().toInt();
  695. canDelete = canDeleteParameter(selectedId);
  696. updateDeleteButtonStatus(canDelete <= 1, deleteButton);
  697. }
  698. void BondMatrixProgramPage::updateFourParamDeleteButtonStatus()
  699. {
  700. // 处理 Pick1 的删除按钮
  701. int selectedIdPick1 = ui.comboBoxCurrentPara_Pick1->currentData().toInt();
  702. bool canDeletePick1 = canDeleteParameter(selectedIdPick1) <= 1;
  703. updateDeleteButtonStatus(canDeletePick1, ui.pushButtonDeletePick1);
  704. // 处理 Pick2 的删除按钮
  705. int selectedIdPick2 = ui.comboBoxCurrentPara_Pick2->currentData().toInt();
  706. bool canDeletePick2 = canDeleteParameter(selectedIdPick2) <= 1;
  707. updateDeleteButtonStatus(canDeletePick2, ui.pushButtonDeletePick2);
  708. // 处理 Place1 的删除按钮
  709. int selectedIdPlace1 = ui.comboBoxCurrentPara_Place1->currentData().toInt();
  710. bool canDeletePlace1 = canDeleteParameter(selectedIdPlace1) <= 1;
  711. updateDeleteButtonStatus(canDeletePlace1, ui.pushButtonDeletePlace1);
  712. // 处理 Place2 的删除按钮
  713. int selectedIdPlace2 = ui.comboBoxCurrentPara_Place2->currentData().toInt();
  714. bool canDeletePlace2 = canDeleteParameter(selectedIdPlace2) <= 1;
  715. updateDeleteButtonStatus(canDeletePlace2, ui.pushButtonDeletePlace2);
  716. }
  717. void BondMatrixProgramPage::updateDeleteButtonStatus(bool canDelete, QPushButton* deleteButton)
  718. {
  719. deleteButton->setEnabled(canDelete);
  720. if (canDelete) {
  721. deleteButton->setStyleSheet(""); // 使用默认样式
  722. }
  723. else {
  724. // 更浅的灰色背景 + 深色文字,提升对比度
  725. deleteButton->setStyleSheet("background-color: #d3d3d3; color: #333333;");
  726. }
  727. }
  728. // 同步相同 iId 的参数
  729. void BondMatrixProgramPage::syncParamWithSameId(ns_db::PICKBOND_PARAM_STRUCT& currentParam, ns_db::PICKBOND_PARAM_STRUCT& targetParam, QWidget* targetWidget)
  730. {
  731. if (currentParam.iId == targetParam.iId) {
  732. targetParam = currentParam; // 同步参数值
  733. if (auto checkBox = qobject_cast<QCheckBox*>(targetWidget)) {
  734. checkBox->setChecked(targetParam.bCheckBlock);
  735. }
  736. if (auto doubleSpinBox = qobject_cast<QDoubleSpinBox*>(targetWidget)) {
  737. if (targetWidget == ui.doubleSpinBoxPrePickZ || targetWidget == ui.doubleSpinBoxPickForce || targetWidget == ui.doubleSpinBoxPickPosZ) {
  738. doubleSpinBox->setValue(targetParam.dPreLevOffset);
  739. }
  740. }
  741. if (auto spinBox = qobject_cast<QSpinBox*>(targetWidget)) {
  742. spinBox->setValue(targetParam.iGrabDelay);
  743. }
  744. }
  745. }
  746. // 取晶头取晶参数连接
  747. void BondMatrixProgramPage::connectWaferPickControls()
  748. {
  749. connect(ui.checkBoxPickBlockCheck, &QCheckBox::clicked, this, [=](bool isChecked) {
  750. m_curWaferPickParam.bCheckBlock = ui.checkBoxPickBlockCheck->isChecked();
  751. if (m_curWaferPickParam.bCheckBlock == m_tempWaferPickParam.bCheckBlock) {
  752. ui.checkBoxPickBlockCheck->setStyleSheet(""); // 恢复默认样式
  753. }
  754. else {
  755. ui.checkBoxPickBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红
  756. }
  757. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  758. m_curCalibPickParam.bCheckBlock = ui.checkBoxPickBlockCheck->isChecked();
  759. ui.checkBoxPickBlockCheck_2->setChecked(m_curCalibPickParam.bCheckBlock);
  760. if (m_curCalibPickParam.bCheckBlock == m_tempCalibPickParam.bCheckBlock) {
  761. ui.checkBoxPickBlockCheck_2->setStyleSheet(""); // 恢复默认样式
  762. }
  763. else {
  764. ui.checkBoxPickBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  765. }
  766. }
  767. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  768. m_curCalibPlaceParam.bCheckBlock = ui.checkBoxPickBlockCheck->isChecked();
  769. ui.checkBoxBondBlockCheck->setChecked(m_curCalibPlaceParam.bCheckBlock);
  770. if (m_curCalibPlaceParam.bCheckBlock == m_tempCalibPlaceParam.bCheckBlock) {
  771. ui.checkBoxBondBlockCheck->setStyleSheet(""); // 恢复默认样式
  772. }
  773. else {
  774. ui.checkBoxBondBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红
  775. }
  776. }
  777. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  778. m_curBondParam.bCheckBlock = ui.checkBoxPickBlockCheck->isChecked();
  779. ui.checkBoxBondBlockCheck_2->setChecked(m_curBondParam.bCheckBlock);
  780. if (m_curBondParam.bCheckBlock == m_tempBondParam.bCheckBlock) {
  781. ui.checkBoxBondBlockCheck_2->setStyleSheet(""); // 恢复默认样式
  782. }
  783. else {
  784. ui.checkBoxBondBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  785. }
  786. }
  787. });
  788. connect(ui.checkBoxPickLoseCheck, &QCheckBox::clicked, this, [=](bool isChecked) {
  789. m_curWaferPickParam.bCheckLose = ui.checkBoxPickLoseCheck->isChecked();
  790. if (m_curWaferPickParam.bCheckLose == m_tempWaferPickParam.bCheckLose) {
  791. ui.checkBoxPickLoseCheck->setStyleSheet(""); // 恢复默认样式
  792. }
  793. else {
  794. ui.checkBoxPickLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红
  795. }
  796. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  797. m_curCalibPickParam.bCheckLose = ui.checkBoxPickLoseCheck->isChecked();
  798. ui.checkBoxPickLoseCheck_2->setChecked(m_curCalibPickParam.bCheckLose);
  799. if (m_curCalibPickParam.bCheckLose == m_tempCalibPickParam.bCheckLose) {
  800. ui.checkBoxPickLoseCheck_2->setStyleSheet(""); // 恢复默认样式
  801. }
  802. else {
  803. ui.checkBoxPickLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  804. }
  805. }
  806. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  807. m_curCalibPlaceParam.bCheckLose = ui.checkBoxPickLoseCheck->isChecked();
  808. ui.checkBoxBondLoseCheck->setChecked(m_curCalibPlaceParam.bCheckLose);
  809. if (m_curCalibPlaceParam.bCheckLose == m_tempCalibPlaceParam.bCheckLose) {
  810. ui.checkBoxBondLoseCheck->setStyleSheet(""); // 恢复默认样式
  811. }
  812. else {
  813. ui.checkBoxBondLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红
  814. }
  815. }
  816. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  817. m_curBondParam.bCheckLose = ui.checkBoxPickLoseCheck->isChecked();
  818. ui.checkBoxBondLoseCheck_2->setChecked(m_curBondParam.bCheckLose);
  819. if (m_curBondParam.bCheckLose == m_tempBondParam.bCheckLose) {
  820. ui.checkBoxBondLoseCheck_2->setStyleSheet(""); // 恢复默认样式
  821. }
  822. else {
  823. ui.checkBoxBondLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  824. }
  825. }
  826. });
  827. connect(ui.checkBoxPickFindForceCheck, &QCheckBox::clicked, this, [=](bool isChecked) {
  828. m_curWaferPickParam.bFindForce = ui.checkBoxPickFindForceCheck->isChecked();
  829. if (m_curWaferPickParam.bFindForce == m_tempWaferPickParam.bFindForce) {
  830. ui.checkBoxPickFindForceCheck->setStyleSheet(""); // 恢复默认样式
  831. }
  832. else {
  833. ui.checkBoxPickFindForceCheck->setStyleSheet("color: red;"); // 字体颜色变红
  834. }
  835. ui.doubleSpinBoxPickPosZ->setEnabled(!isChecked);
  836. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  837. m_curCalibPickParam.bFindForce = ui.checkBoxPickFindForceCheck->isChecked();
  838. ui.checkBoxPickFindForceCheck_2->setChecked(m_curCalibPickParam.bFindForce);
  839. if (m_curCalibPickParam.bFindForce == m_tempCalibPickParam.bFindForce) {
  840. ui.checkBoxPickFindForceCheck_2->setStyleSheet(""); // 恢复默认样式
  841. }
  842. else {
  843. ui.checkBoxPickFindForceCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  844. }
  845. ui.doubleSpinBoxPickPosZ_2->setEnabled(!isChecked);
  846. }
  847. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  848. m_curCalibPlaceParam.bFindForce = ui.checkBoxPickFindForceCheck->isChecked();
  849. ui.checkBoxBondFindForce->setChecked(m_curCalibPlaceParam.bFindForce);
  850. if (m_curCalibPlaceParam.bFindForce == m_tempCalibPlaceParam.bFindForce) {
  851. ui.checkBoxBondFindForce->setStyleSheet(""); // 恢复默认样式
  852. }
  853. else {
  854. ui.checkBoxBondFindForce->setStyleSheet("color: red;"); // 字体颜色变红
  855. }
  856. ui.doubleSpinBoxBondPosZ->setEnabled(!isChecked);
  857. }
  858. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  859. m_curBondParam.bFindForce = ui.checkBoxPickFindForceCheck->isChecked();
  860. ui.checkBoxBondFindForce_2->setChecked(m_curBondParam.bFindForce);
  861. if (m_curBondParam.bFindForce == m_tempBondParam.bFindForce) {
  862. ui.checkBoxBondFindForce_2->setStyleSheet(""); // 恢复默认样式
  863. }
  864. else {
  865. ui.checkBoxBondFindForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  866. }
  867. ui.doubleSpinBoxBondPosZ_2->setEnabled(!isChecked);
  868. }
  869. });
  870. connect(ui.doubleSpinBoxPrePickZ, &DoubleSpinBox::editDone, this, [=]() {
  871. m_curWaferPickParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ->value();
  872. // 颜色变红显示变化
  873. if (m_curWaferPickParam.dPreLevOffset == m_tempWaferPickParam.dPreLevOffset)
  874. ui.doubleSpinBoxPrePickZ->setStyleSheet(""); // 恢复默认样式
  875. else
  876. ui.doubleSpinBoxPrePickZ->setStyleSheet("color: red;"); // 字体颜色变红
  877. // 如果有同步需求,添加类似的代码
  878. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  879. m_curCalibPickParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ->value();
  880. ui.doubleSpinBoxPrePickZ_2->setValue(m_curCalibPickParam.dPreLevOffset);
  881. if (m_curCalibPickParam.dPreLevOffset == m_tempCalibPickParam.dPreLevOffset)
  882. ui.doubleSpinBoxPrePickZ_2->setStyleSheet(""); // 恢复默认样式
  883. else
  884. ui.doubleSpinBoxPrePickZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  885. }
  886. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  887. m_curCalibPlaceParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ->value();
  888. ui.doubleSpinBoxPreBondPosZ->setValue(m_curCalibPlaceParam.dPreLevOffset);
  889. if (m_curCalibPlaceParam.dPreLevOffset == m_tempCalibPlaceParam.dPreLevOffset)
  890. ui.doubleSpinBoxPreBondPosZ->setStyleSheet(""); // 恢复默认样式
  891. else
  892. ui.doubleSpinBoxPreBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  893. }
  894. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  895. m_curBondParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ->value();
  896. ui.doubleSpinBoxPreBondPosZ_2->setValue(m_curBondParam.dPreLevOffset);
  897. if (m_curBondParam.dPreLevOffset == m_tempBondParam.dPreLevOffset)
  898. ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet(""); // 恢复默认样式
  899. else
  900. ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  901. }
  902. });
  903. connect(ui.doubleSpinBoxPickForce, &DoubleSpinBox::editDone, this, [=]() {
  904. m_curWaferPickParam.dForce = ui.doubleSpinBoxPickForce->value();
  905. // 颜色变红显示变化
  906. if (m_curWaferPickParam.dForce == m_tempWaferPickParam.dForce)
  907. ui.doubleSpinBoxPickForce->setStyleSheet(""); // 恢复默认样式
  908. else
  909. ui.doubleSpinBoxPickForce->setStyleSheet("color: red;"); // 字体颜色变红
  910. // 如果有同步需求,添加类似的代码
  911. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  912. m_curCalibPickParam.dForce = ui.doubleSpinBoxPickForce->value();
  913. ui.doubleSpinBoxPickForce_2->setValue(m_curCalibPickParam.dForce);
  914. if (m_curCalibPickParam.dForce == m_tempCalibPickParam.dForce)
  915. ui.doubleSpinBoxPickForce_2->setStyleSheet(""); // 恢复默认样式
  916. else
  917. ui.doubleSpinBoxPickForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  918. }
  919. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  920. m_curCalibPlaceParam.dForce = ui.doubleSpinBoxPickForce->value();
  921. ui.doubleSpinBoxBondForce->setValue(m_curCalibPlaceParam.dForce);
  922. if (m_curCalibPlaceParam.dForce == m_tempCalibPlaceParam.dForce)
  923. ui.doubleSpinBoxBondForce->setStyleSheet(""); // 恢复默认样式
  924. else
  925. ui.doubleSpinBoxBondForce->setStyleSheet("color: red;"); // 字体颜色变红
  926. }
  927. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  928. m_curBondParam.dForce = ui.doubleSpinBoxPickForce->value();
  929. ui.doubleSpinBoxBondForce_2->setValue(m_curBondParam.dForce);
  930. if (m_curBondParam.dForce == m_tempBondParam.dForce)
  931. ui.doubleSpinBoxBondForce_2->setStyleSheet(""); // 恢复默认样式
  932. else
  933. ui.doubleSpinBoxBondForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  934. }
  935. });
  936. connect(ui.doubleSpinBoxPickPosZ, &DoubleSpinBox::editDone, this, [=]() {
  937. m_curWaferPickParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ->value();
  938. // 颜色变红显示变化
  939. if (m_curWaferPickParam.dWorkLevOffset == m_tempWaferPickParam.dWorkLevOffset)
  940. ui.doubleSpinBoxPickPosZ->setStyleSheet(""); // 恢复默认样式
  941. else
  942. ui.doubleSpinBoxPickPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  943. // 如果有同步需求,添加类似的代码
  944. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  945. m_curCalibPickParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ->value();
  946. ui.doubleSpinBoxPickPosZ_2->setValue(m_curCalibPickParam.dWorkLevOffset);
  947. if (m_curCalibPickParam.dWorkLevOffset == m_tempCalibPickParam.dWorkLevOffset)
  948. ui.doubleSpinBoxPickPosZ_2->setStyleSheet(""); // 恢复默认样式
  949. else
  950. ui.doubleSpinBoxPickPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  951. }
  952. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  953. m_curCalibPlaceParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ->value();
  954. ui.doubleSpinBoxBondPosZ->setValue(m_curCalibPlaceParam.dWorkLevOffset);
  955. if (m_curCalibPlaceParam.dWorkLevOffset == m_tempCalibPlaceParam.dWorkLevOffset)
  956. ui.doubleSpinBoxBondPosZ->setStyleSheet(""); // 恢复默认样式
  957. else
  958. ui.doubleSpinBoxBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  959. }
  960. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  961. m_curBondParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ->value();
  962. ui.doubleSpinBoxBondPosZ_2->setValue(m_curBondParam.dWorkLevOffset);
  963. if (m_curBondParam.dWorkLevOffset == m_tempBondParam.dWorkLevOffset)
  964. ui.doubleSpinBoxBondPosZ_2->setStyleSheet(""); // 恢复默认样式
  965. else
  966. ui.doubleSpinBoxBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  967. }
  968. });
  969. connect(ui.spinBoxPickGrabDelay, &SpinBox::editDone, this, [=]() {
  970. m_curWaferPickParam.iGrabDelay = ui.spinBoxPickGrabDelay->value();
  971. // 颜色变红显示变化
  972. if (m_curWaferPickParam.iGrabDelay == m_tempWaferPickParam.iGrabDelay)
  973. ui.spinBoxPickGrabDelay->setStyleSheet(""); // 恢复默认样式
  974. else
  975. ui.spinBoxPickGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红
  976. // 如果有同步需求,添加类似的代码
  977. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  978. m_curCalibPickParam.iGrabDelay = ui.spinBoxPickGrabDelay->value();
  979. ui.spinBoxPickGrabDelay_2->setValue(m_curCalibPickParam.iGrabDelay);
  980. if (m_curCalibPickParam.iGrabDelay == m_tempCalibPickParam.iGrabDelay)
  981. ui.spinBoxPickGrabDelay_2->setStyleSheet(""); // 恢复默认样式
  982. else
  983. ui.spinBoxPickGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  984. }
  985. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  986. m_curCalibPlaceParam.iGrabDelay = ui.spinBoxPickGrabDelay->value();
  987. ui.spinBoxBondGrabDelay->setValue(m_curCalibPlaceParam.iGrabDelay);
  988. if (m_curCalibPlaceParam.iGrabDelay == m_tempCalibPlaceParam.iGrabDelay)
  989. ui.spinBoxBondGrabDelay->setStyleSheet(""); // 恢复默认样式
  990. else
  991. ui.spinBoxBondGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红
  992. }
  993. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  994. m_curBondParam.iGrabDelay = ui.spinBoxPickGrabDelay->value();
  995. ui.spinBoxBondGrabDelay_2->setValue(m_curBondParam.iGrabDelay);
  996. if (m_curBondParam.iGrabDelay == m_tempBondParam.iGrabDelay)
  997. ui.spinBoxBondGrabDelay_2->setStyleSheet(""); // 恢复默认样式
  998. else
  999. ui.spinBoxBondGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1000. }
  1001. });
  1002. connect(ui.spinBoxPickDelay, &SpinBox::editDone, this, [=]() {
  1003. m_curWaferPickParam.iPickOrBondDelay = ui.spinBoxPickDelay->value();
  1004. // 颜色变红显示变化
  1005. if (m_curWaferPickParam.iPickOrBondDelay == m_tempWaferPickParam.iPickOrBondDelay)
  1006. ui.spinBoxPickDelay->setStyleSheet(""); // 恢复默认样式
  1007. else
  1008. ui.spinBoxPickDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1009. // 如果有同步需求,添加类似的代码
  1010. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1011. m_curCalibPickParam.iPickOrBondDelay = ui.spinBoxPickDelay->value();
  1012. ui.spinBoxPickDelay_2->setValue(m_curCalibPickParam.iPickOrBondDelay);
  1013. if (m_curCalibPickParam.iPickOrBondDelay == m_tempCalibPickParam.iPickOrBondDelay)
  1014. ui.spinBoxPickDelay_2->setStyleSheet(""); // 恢复默认样式
  1015. else
  1016. ui.spinBoxPickDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1017. }
  1018. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1019. m_curCalibPlaceParam.iPickOrBondDelay = ui.spinBoxPickDelay->value();
  1020. ui.spinBoxBondDelay->setValue(m_curCalibPlaceParam.iPickOrBondDelay);
  1021. if (m_curCalibPlaceParam.iPickOrBondDelay == m_tempCalibPlaceParam.iPickOrBondDelay)
  1022. ui.spinBoxBondDelay->setStyleSheet(""); // 恢复默认样式
  1023. else
  1024. ui.spinBoxBondDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1025. }
  1026. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1027. m_curBondParam.iPickOrBondDelay = ui.spinBoxPickDelay->value();
  1028. ui.spinBoxBondDelay_2->setValue(m_curBondParam.iPickOrBondDelay);
  1029. if (m_curBondParam.iPickOrBondDelay == m_tempBondParam.iPickOrBondDelay)
  1030. ui.spinBoxBondDelay_2->setStyleSheet(""); // 恢复默认样式
  1031. else
  1032. ui.spinBoxBondDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1033. }
  1034. });
  1035. connect(ui.spinBoxPickBlockCheckDelay, &SpinBox::editDone, this, [=]() {
  1036. m_curWaferPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value();
  1037. // 颜色变红显示变化
  1038. if (m_curWaferPickParam.iBlockOrLoseDelay == m_tempWaferPickParam.iBlockOrLoseDelay)
  1039. ui.spinBoxPickBlockCheckDelay->setStyleSheet(""); // 恢复默认样式
  1040. else
  1041. ui.spinBoxPickBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1042. // 如果有同步需求,添加类似的代码
  1043. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1044. m_curCalibPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value();
  1045. ui.spinBoxPickBlockCheckDelay_2->setValue(m_curCalibPickParam.iBlockOrLoseDelay);
  1046. if (m_curCalibPickParam.iBlockOrLoseDelay == m_tempCalibPickParam.iBlockOrLoseDelay)
  1047. ui.spinBoxPickBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式
  1048. else
  1049. ui.spinBoxPickBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1050. }
  1051. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1052. m_curCalibPlaceParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value();
  1053. ui.spinBoxBondBlockCheckDelay->setValue(m_curCalibPlaceParam.iBlockOrLoseDelay);
  1054. if (m_curCalibPlaceParam.iBlockOrLoseDelay == m_tempCalibPlaceParam.iBlockOrLoseDelay)
  1055. ui.spinBoxBondBlockCheckDelay->setStyleSheet(""); // 恢复默认样式
  1056. else
  1057. ui.spinBoxBondBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1058. }
  1059. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1060. m_curBondParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value();
  1061. ui.spinBoxBondBlockCheckDelay_2->setValue(m_curBondParam.iBlockOrLoseDelay);
  1062. if (m_curBondParam.iBlockOrLoseDelay == m_tempBondParam.iBlockOrLoseDelay)
  1063. ui.spinBoxBondBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式
  1064. else
  1065. ui.spinBoxBondBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1066. }
  1067. });
  1068. connect(ui.spinBoxPickVacDelay, &SpinBox::editDone, this, [=]() {
  1069. m_curWaferPickParam.iVacuumDelay = ui.spinBoxPickVacDelay->value();
  1070. // 颜色变红显示变化
  1071. if (m_curWaferPickParam.iVacuumDelay == m_tempWaferPickParam.iVacuumDelay)
  1072. ui.spinBoxPickVacDelay->setStyleSheet(""); // 恢复默认样式
  1073. else
  1074. ui.spinBoxPickVacDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1075. // 如果有同步需求,添加类似的代码
  1076. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1077. m_curCalibPickParam.iVacuumDelay = ui.spinBoxPickVacDelay->value();
  1078. ui.spinBoxPickVacDelay_2->setValue(m_curCalibPickParam.iVacuumDelay);
  1079. if (m_curCalibPickParam.iVacuumDelay == m_tempCalibPickParam.iVacuumDelay)
  1080. ui.spinBoxPickVacDelay_2->setStyleSheet(""); // 恢复默认样式
  1081. else
  1082. ui.spinBoxPickVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1083. }
  1084. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1085. m_curCalibPlaceParam.iVacuumDelay = ui.spinBoxPickVacDelay->value();
  1086. ui.spinBoxBondVacDelay->setValue(m_curCalibPlaceParam.iVacuumDelay);
  1087. if (m_curCalibPlaceParam.iVacuumDelay == m_tempCalibPlaceParam.iVacuumDelay)
  1088. ui.spinBoxBondVacDelay->setStyleSheet(""); // 恢复默认样式
  1089. else
  1090. ui.spinBoxBondVacDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1091. }
  1092. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1093. m_curBondParam.iVacuumDelay = ui.spinBoxPickVacDelay->value();
  1094. ui.spinBoxBondVacDelay_2->setValue(m_curBondParam.iVacuumDelay);
  1095. if (m_curBondParam.iVacuumDelay == m_tempBondParam.iVacuumDelay)
  1096. ui.spinBoxBondVacDelay_2->setStyleSheet(""); // 恢复默认样式
  1097. else
  1098. ui.spinBoxBondVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1099. }
  1100. });
  1101. connect(ui.spinBoxPickBlowDelay, &SpinBox::editDone, this, [=]() {
  1102. m_curWaferPickParam.iBlowDelay = ui.spinBoxPickBlowDelay->value();
  1103. // 颜色变红显示变化
  1104. if (m_curWaferPickParam.iBlowDelay == m_tempWaferPickParam.iBlowDelay)
  1105. ui.spinBoxPickBlowDelay->setStyleSheet(""); // 恢复默认样式
  1106. else
  1107. ui.spinBoxPickBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1108. // 如果有同步需求,添加类似的代码
  1109. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1110. m_curCalibPickParam.iBlowDelay = ui.spinBoxPickBlowDelay->value();
  1111. ui.spinBoxPickBlowDelay_2->setValue(m_curCalibPickParam.iBlowDelay);
  1112. if (m_curCalibPickParam.iBlowDelay == m_tempCalibPickParam.iBlowDelay)
  1113. ui.spinBoxPickBlowDelay_2->setStyleSheet(""); // 恢复默认样式
  1114. else
  1115. ui.spinBoxPickBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1116. }
  1117. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1118. m_curCalibPlaceParam.iBlowDelay = ui.spinBoxPickBlowDelay->value();
  1119. ui.spinBoxBondBlowDelay->setValue(m_curCalibPlaceParam.iBlowDelay);
  1120. if (m_curCalibPlaceParam.iBlowDelay == m_tempCalibPlaceParam.iBlowDelay)
  1121. ui.spinBoxBondBlowDelay->setStyleSheet(""); // 恢复默认样式
  1122. else
  1123. ui.spinBoxBondBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1124. }
  1125. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1126. m_curBondParam.iBlowDelay = ui.spinBoxPickBlowDelay->value();
  1127. ui.spinBoxBondBlowDelay_2->setValue(m_curBondParam.iBlowDelay);
  1128. if (m_curBondParam.iBlowDelay == m_tempBondParam.iBlowDelay)
  1129. ui.spinBoxBondBlowDelay_2->setStyleSheet(""); // 恢复默认样式
  1130. else
  1131. ui.spinBoxBondBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1132. }
  1133. });
  1134. }
  1135. // 晶圆台取晶连接控件
  1136. void BondMatrixProgramPage::connectCalibPickControls()
  1137. {
  1138. connect(ui.checkBoxPickBlockCheck_2, &QCheckBox::clicked, this, [=](bool isChecked) {
  1139. m_curCalibPickParam.bCheckBlock = isChecked;
  1140. // 颜色变红显示变化
  1141. if (m_curCalibPickParam.bCheckBlock == m_tempCalibPickParam.bCheckBlock)
  1142. ui.checkBoxPickBlockCheck_2->setStyleSheet(""); // 恢复默认样式
  1143. else
  1144. ui.checkBoxPickBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  1145. // 同步其他控件
  1146. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1147. m_curWaferPickParam.bCheckBlock = isChecked;
  1148. ui.checkBoxPickBlockCheck->setChecked(m_curWaferPickParam.bCheckBlock);
  1149. if (m_curWaferPickParam.bCheckBlock == m_tempWaferPickParam.bCheckBlock)
  1150. ui.checkBoxPickBlockCheck->setStyleSheet(""); // 恢复默认样式
  1151. else
  1152. ui.checkBoxPickBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红
  1153. }
  1154. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1155. m_curCalibPlaceParam.bCheckBlock = isChecked;
  1156. ui.checkBoxBondBlockCheck->setChecked(m_curCalibPlaceParam.bCheckBlock);
  1157. if (m_curCalibPlaceParam.bCheckBlock == m_tempCalibPlaceParam.bCheckBlock)
  1158. ui.checkBoxBondBlockCheck->setStyleSheet(""); // 恢复默认样式
  1159. else
  1160. ui.checkBoxBondBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红
  1161. }
  1162. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1163. m_curBondParam.bCheckBlock = isChecked;
  1164. ui.checkBoxBondBlockCheck_2->setChecked(m_curBondParam.bCheckBlock);
  1165. if (m_curBondParam.bCheckBlock == m_tempBondParam.bCheckBlock)
  1166. ui.checkBoxBondBlockCheck_2->setStyleSheet(""); // 恢复默认样式
  1167. else
  1168. ui.checkBoxBondBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  1169. }
  1170. });
  1171. connect(ui.checkBoxPickLoseCheck_2, &QCheckBox::clicked, this, [=](bool isChecked) {
  1172. m_curCalibPickParam.bCheckLose = isChecked;
  1173. // 颜色变红显示变化
  1174. if (m_curCalibPickParam.bCheckLose == m_tempCalibPickParam.bCheckLose)
  1175. ui.checkBoxPickLoseCheck_2->setStyleSheet(""); // 恢复默认样式
  1176. else
  1177. ui.checkBoxPickLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  1178. // 同步其他控件
  1179. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1180. m_curWaferPickParam.bCheckLose = isChecked;
  1181. ui.checkBoxPickLoseCheck->setChecked(m_curWaferPickParam.bCheckLose);
  1182. if (m_curWaferPickParam.bCheckLose == m_tempWaferPickParam.bCheckLose)
  1183. ui.checkBoxPickLoseCheck->setStyleSheet(""); // 恢复默认样式
  1184. else
  1185. ui.checkBoxPickLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红
  1186. }
  1187. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1188. m_curCalibPlaceParam.bCheckLose = isChecked;
  1189. ui.checkBoxBondLoseCheck->setChecked(m_curCalibPlaceParam.bCheckLose);
  1190. if (m_curCalibPlaceParam.bCheckLose == m_tempCalibPlaceParam.bCheckLose)
  1191. ui.checkBoxBondLoseCheck->setStyleSheet(""); // 恢复默认样式
  1192. else
  1193. ui.checkBoxBondLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红
  1194. }
  1195. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1196. m_curBondParam.bCheckLose = isChecked;
  1197. ui.checkBoxBondLoseCheck_2->setChecked(m_curBondParam.bCheckLose);
  1198. if (m_curBondParam.bCheckLose == m_tempBondParam.bCheckLose)
  1199. ui.checkBoxBondLoseCheck_2->setStyleSheet(""); // 恢复默认样式
  1200. else
  1201. ui.checkBoxBondLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  1202. }
  1203. });
  1204. connect(ui.checkBoxPickFindForceCheck_2, &QCheckBox::clicked, this, [=](bool isChecked) {
  1205. m_curCalibPickParam.bFindForce = isChecked;
  1206. ui.doubleSpinBoxPickPosZ_2->setEnabled(!isChecked);
  1207. // 颜色变红显示变化
  1208. if (m_curCalibPickParam.bFindForce == m_tempCalibPickParam.bFindForce)
  1209. ui.checkBoxPickFindForceCheck_2->setStyleSheet(""); // 恢复默认样式
  1210. else
  1211. ui.checkBoxPickFindForceCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  1212. // 同步其他控件并处理样式
  1213. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1214. m_curWaferPickParam.bFindForce = isChecked;
  1215. ui.checkBoxPickFindForceCheck->setChecked(m_curWaferPickParam.bFindForce);
  1216. if (m_curWaferPickParam.bFindForce == m_tempWaferPickParam.bFindForce)
  1217. ui.checkBoxPickFindForceCheck->setStyleSheet(""); // 恢复默认样式
  1218. else
  1219. ui.checkBoxPickFindForceCheck->setStyleSheet("color: red;"); // 字体颜色变红
  1220. ui.doubleSpinBoxPickPosZ->setEnabled(!isChecked);
  1221. }
  1222. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1223. m_curCalibPlaceParam.bFindForce = isChecked;
  1224. ui.checkBoxBondFindForce->setChecked(m_curCalibPlaceParam.bFindForce);
  1225. if (m_curCalibPlaceParam.bFindForce == m_tempCalibPlaceParam.bFindForce)
  1226. ui.checkBoxBondFindForce->setStyleSheet(""); // 恢复默认样式
  1227. else
  1228. ui.checkBoxBondFindForce->setStyleSheet("color: red;"); // 字体颜色变红
  1229. ui.doubleSpinBoxBondPosZ->setEnabled(!isChecked);
  1230. }
  1231. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1232. m_curBondParam.bFindForce = isChecked;
  1233. ui.checkBoxBondFindForce_2->setChecked(m_curBondParam.bFindForce);
  1234. if (m_curBondParam.bFindForce == m_tempBondParam.bFindForce)
  1235. ui.checkBoxBondFindForce_2->setStyleSheet(""); // 恢复默认样式
  1236. else
  1237. ui.checkBoxBondFindForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  1238. ui.doubleSpinBoxBondPosZ_2->setEnabled(!isChecked);
  1239. }
  1240. });
  1241. connect(ui.doubleSpinBoxPrePickZ_2, &DoubleSpinBox::editDone, this, [=]() {
  1242. m_curCalibPickParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ_2->value();
  1243. // 颜色变红显示变化
  1244. if (m_curCalibPickParam.dPreLevOffset == m_tempCalibPickParam.dPreLevOffset)
  1245. ui.doubleSpinBoxPrePickZ_2->setStyleSheet(""); // 恢复默认样式
  1246. else
  1247. ui.doubleSpinBoxPrePickZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  1248. // 同步其他控件并处理样式
  1249. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1250. m_curWaferPickParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ_2->value();
  1251. ui.doubleSpinBoxPrePickZ->setValue(m_curWaferPickParam.dPreLevOffset);
  1252. if (m_curWaferPickParam.dPreLevOffset == m_tempWaferPickParam.dPreLevOffset)
  1253. ui.doubleSpinBoxPrePickZ->setStyleSheet(""); // 恢复默认样式
  1254. else
  1255. ui.doubleSpinBoxPrePickZ->setStyleSheet("color: red;"); // 字体颜色变红
  1256. }
  1257. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1258. m_curCalibPlaceParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ_2->value();
  1259. ui.doubleSpinBoxPreBondPosZ->setValue(m_curCalibPlaceParam.dPreLevOffset);
  1260. if (m_curCalibPlaceParam.dPreLevOffset == m_tempCalibPlaceParam.dPreLevOffset)
  1261. ui.doubleSpinBoxPreBondPosZ->setStyleSheet(""); // 恢复默认样式
  1262. else
  1263. ui.doubleSpinBoxPreBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  1264. }
  1265. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1266. m_curBondParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ_2->value();
  1267. ui.doubleSpinBoxPreBondPosZ_2->setValue(m_curBondParam.dPreLevOffset);
  1268. if (m_curBondParam.dPreLevOffset == m_tempBondParam.dPreLevOffset)
  1269. ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet(""); // 恢复默认样式
  1270. else
  1271. ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  1272. }
  1273. });
  1274. connect(ui.doubleSpinBoxPickForce_2, &DoubleSpinBox::editDone, this, [=]() {
  1275. m_curCalibPickParam.dForce = ui.doubleSpinBoxPickForce_2->value();
  1276. // 颜色变红显示变化
  1277. if (m_curCalibPickParam.dForce == m_tempCalibPickParam.dForce)
  1278. ui.doubleSpinBoxPickForce_2->setStyleSheet(""); // 恢复默认样式
  1279. else
  1280. ui.doubleSpinBoxPickForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  1281. // 同步其他控件并处理样式
  1282. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1283. m_curWaferPickParam.dForce = ui.doubleSpinBoxPickForce_2->value();
  1284. ui.doubleSpinBoxPickForce->setValue(m_curWaferPickParam.dForce);
  1285. if (m_curWaferPickParam.dForce == m_tempWaferPickParam.dForce)
  1286. ui.doubleSpinBoxPickForce->setStyleSheet(""); // 恢复默认样式
  1287. else
  1288. ui.doubleSpinBoxPickForce->setStyleSheet("color: red;"); // 字体颜色变红
  1289. }
  1290. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1291. m_curCalibPlaceParam.dForce = ui.doubleSpinBoxPickForce_2->value();
  1292. ui.doubleSpinBoxBondForce->setValue(m_curCalibPlaceParam.dForce);
  1293. if (m_curCalibPlaceParam.dForce == m_tempCalibPlaceParam.dForce)
  1294. ui.doubleSpinBoxBondForce->setStyleSheet(""); // 恢复默认样式
  1295. else
  1296. ui.doubleSpinBoxBondForce->setStyleSheet("color: red;"); // 字体颜色变红
  1297. }
  1298. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1299. m_curBondParam.dForce = ui.doubleSpinBoxPickForce_2->value();
  1300. ui.doubleSpinBoxBondForce_2->setValue(m_curBondParam.dForce);
  1301. if (m_curBondParam.dForce == m_tempBondParam.dForce)
  1302. ui.doubleSpinBoxBondForce_2->setStyleSheet(""); // 恢复默认样式
  1303. else
  1304. ui.doubleSpinBoxBondForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  1305. }
  1306. });
  1307. connect(ui.doubleSpinBoxPickPosZ_2, &DoubleSpinBox::editDone, this, [=]() {
  1308. m_curCalibPickParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ_2->value();
  1309. // 颜色变红显示变化
  1310. if (m_curCalibPickParam.dWorkLevOffset == m_tempCalibPickParam.dWorkLevOffset)
  1311. ui.doubleSpinBoxPickPosZ_2->setStyleSheet(""); // 恢复默认样式
  1312. else
  1313. ui.doubleSpinBoxPickPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  1314. // 同步其他控件并处理样式
  1315. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1316. m_curWaferPickParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ_2->value();
  1317. ui.doubleSpinBoxPickPosZ->setValue(m_curWaferPickParam.dWorkLevOffset);
  1318. if (m_curWaferPickParam.dWorkLevOffset == m_tempWaferPickParam.dWorkLevOffset)
  1319. ui.doubleSpinBoxPickPosZ->setStyleSheet(""); // 恢复默认样式
  1320. else
  1321. ui.doubleSpinBoxPickPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  1322. }
  1323. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1324. m_curCalibPlaceParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ_2->value();
  1325. ui.doubleSpinBoxBondPosZ->setValue(m_curCalibPlaceParam.dWorkLevOffset);
  1326. if (m_curCalibPlaceParam.dWorkLevOffset == m_tempCalibPlaceParam.dWorkLevOffset)
  1327. ui.doubleSpinBoxBondPosZ->setStyleSheet(""); // 恢复默认样式
  1328. else
  1329. ui.doubleSpinBoxBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  1330. }
  1331. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1332. m_curBondParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ_2->value();
  1333. ui.doubleSpinBoxBondPosZ_2->setValue(m_curBondParam.dWorkLevOffset);
  1334. if (m_curBondParam.dWorkLevOffset == m_tempBondParam.dWorkLevOffset)
  1335. ui.doubleSpinBoxBondPosZ_2->setStyleSheet(""); // 恢复默认样式
  1336. else
  1337. ui.doubleSpinBoxBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  1338. }
  1339. });
  1340. connect(ui.spinBoxPickGrabDelay_2, &SpinBox::editDone, this, [=]() {
  1341. m_curCalibPickParam.iGrabDelay = ui.spinBoxPickGrabDelay_2->value();
  1342. // 颜色变红显示变化
  1343. if (m_curCalibPickParam.iGrabDelay == m_tempCalibPickParam.iGrabDelay)
  1344. ui.spinBoxPickGrabDelay_2->setStyleSheet(""); // 恢复默认样式
  1345. else
  1346. ui.spinBoxPickGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1347. // 同步其他控件并处理样式
  1348. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1349. m_curWaferPickParam.iGrabDelay = ui.spinBoxPickGrabDelay_2->value();
  1350. ui.spinBoxPickGrabDelay->setValue(m_curWaferPickParam.iGrabDelay);
  1351. if (m_curWaferPickParam.iGrabDelay == m_tempWaferPickParam.iGrabDelay)
  1352. ui.spinBoxPickGrabDelay->setStyleSheet(""); // 恢复默认样式
  1353. else
  1354. ui.spinBoxPickGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1355. }
  1356. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1357. m_curCalibPlaceParam.iGrabDelay = ui.spinBoxPickGrabDelay_2->value();
  1358. ui.spinBoxBondGrabDelay->setValue(m_curCalibPlaceParam.iGrabDelay);
  1359. if (m_curCalibPlaceParam.iGrabDelay == m_tempCalibPlaceParam.iGrabDelay)
  1360. ui.spinBoxBondGrabDelay->setStyleSheet(""); // 恢复默认样式
  1361. else
  1362. ui.spinBoxBondGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1363. }
  1364. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1365. m_curBondParam.iGrabDelay = ui.spinBoxPickGrabDelay_2->value();
  1366. ui.spinBoxBondGrabDelay_2->setValue(m_curBondParam.iGrabDelay);
  1367. if (m_curBondParam.iGrabDelay == m_tempBondParam.iGrabDelay)
  1368. ui.spinBoxBondGrabDelay_2->setStyleSheet(""); // 恢复默认样式
  1369. else
  1370. ui.spinBoxBondGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1371. }
  1372. });
  1373. connect(ui.spinBoxPickDelay_2, &SpinBox::editDone, this, [=]() {
  1374. m_curCalibPickParam.iPickOrBondDelay = ui.spinBoxPickDelay_2->value();
  1375. // 颜色变红显示变化
  1376. if (m_curCalibPickParam.iPickOrBondDelay == m_tempCalibPickParam.iPickOrBondDelay)
  1377. ui.spinBoxPickDelay_2->setStyleSheet(""); // 恢复默认样式
  1378. else
  1379. ui.spinBoxPickDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1380. // 同步其他控件并处理样式
  1381. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1382. m_curWaferPickParam.iPickOrBondDelay = ui.spinBoxPickDelay_2->value();
  1383. ui.spinBoxPickDelay->setValue(m_curWaferPickParam.iPickOrBondDelay);
  1384. if (m_curWaferPickParam.iPickOrBondDelay == m_tempWaferPickParam.iPickOrBondDelay)
  1385. ui.spinBoxPickDelay->setStyleSheet(""); // 恢复默认样式
  1386. else
  1387. ui.spinBoxPickDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1388. }
  1389. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1390. m_curCalibPlaceParam.iPickOrBondDelay = ui.spinBoxPickDelay_2->value();
  1391. ui.spinBoxBondDelay->setValue(m_curCalibPlaceParam.iPickOrBondDelay);
  1392. if (m_curCalibPlaceParam.iPickOrBondDelay == m_tempCalibPlaceParam.iPickOrBondDelay)
  1393. ui.spinBoxBondDelay->setStyleSheet(""); // 恢复默认样式
  1394. else
  1395. ui.spinBoxBondDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1396. }
  1397. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1398. m_curBondParam.iPickOrBondDelay = ui.spinBoxPickDelay_2->value();
  1399. ui.spinBoxBondDelay_2->setValue(m_curBondParam.iPickOrBondDelay);
  1400. if (m_curBondParam.iPickOrBondDelay == m_tempBondParam.iPickOrBondDelay)
  1401. ui.spinBoxBondDelay_2->setStyleSheet(""); // 恢复默认样式
  1402. else
  1403. ui.spinBoxBondDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1404. }
  1405. });
  1406. connect(ui.spinBoxPickBlockCheckDelay_2, &SpinBox::editDone, this, [=]() {
  1407. m_curCalibPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay_2->value();
  1408. // 颜色变红显示变化
  1409. if (m_curCalibPickParam.iBlockOrLoseDelay == m_tempCalibPickParam.iBlockOrLoseDelay)
  1410. ui.spinBoxPickBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式
  1411. else
  1412. ui.spinBoxPickBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1413. // 同步其他控件并处理样式
  1414. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1415. m_curWaferPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay_2->value();
  1416. ui.spinBoxPickBlockCheckDelay->setValue(m_curWaferPickParam.iBlockOrLoseDelay);
  1417. if (m_curWaferPickParam.iBlockOrLoseDelay == m_tempWaferPickParam.iBlockOrLoseDelay)
  1418. ui.spinBoxPickBlockCheckDelay->setStyleSheet(""); // 恢复默认样式
  1419. else
  1420. ui.spinBoxPickBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1421. }
  1422. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1423. m_curCalibPlaceParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay_2->value();
  1424. ui.spinBoxBondBlockCheckDelay->setValue(m_curCalibPlaceParam.iBlockOrLoseDelay);
  1425. if (m_curCalibPlaceParam.iBlockOrLoseDelay == m_tempCalibPlaceParam.iBlockOrLoseDelay)
  1426. ui.spinBoxBondBlockCheckDelay->setStyleSheet(""); // 恢复默认样式
  1427. else
  1428. ui.spinBoxBondBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1429. }
  1430. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1431. m_curBondParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay_2->value();
  1432. ui.spinBoxBondBlockCheckDelay_2->setValue(m_curBondParam.iBlockOrLoseDelay);
  1433. if (m_curBondParam.iBlockOrLoseDelay == m_tempBondParam.iBlockOrLoseDelay)
  1434. ui.spinBoxBondBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式
  1435. else
  1436. ui.spinBoxBondBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1437. }
  1438. });
  1439. connect(ui.spinBoxPickVacDelay_2, &SpinBox::editDone, this, [=]() {
  1440. m_curCalibPickParam.iVacuumDelay = ui.spinBoxPickVacDelay_2->value();
  1441. // 颜色变红显示变化
  1442. if (m_curCalibPickParam.iVacuumDelay == m_tempCalibPickParam.iVacuumDelay)
  1443. ui.spinBoxPickVacDelay_2->setStyleSheet(""); // 恢复默认样式
  1444. else
  1445. ui.spinBoxPickVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1446. // 同步其他控件并处理样式
  1447. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1448. m_curWaferPickParam.iVacuumDelay = ui.spinBoxPickVacDelay_2->value();
  1449. ui.spinBoxPickVacDelay->setValue(m_curWaferPickParam.iVacuumDelay);
  1450. if (m_curWaferPickParam.iVacuumDelay == m_tempWaferPickParam.iVacuumDelay)
  1451. ui.spinBoxPickVacDelay->setStyleSheet(""); // 恢复默认样式
  1452. else
  1453. ui.spinBoxPickVacDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1454. }
  1455. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1456. m_curCalibPlaceParam.iVacuumDelay = ui.spinBoxPickVacDelay_2->value();
  1457. ui.spinBoxBondVacDelay->setValue(m_curCalibPlaceParam.iVacuumDelay);
  1458. if (m_curCalibPlaceParam.iVacuumDelay == m_tempCalibPlaceParam.iVacuumDelay)
  1459. ui.spinBoxBondVacDelay->setStyleSheet(""); // 恢复默认样式
  1460. else
  1461. ui.spinBoxBondVacDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1462. }
  1463. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1464. m_curBondParam.iVacuumDelay = ui.spinBoxPickVacDelay_2->value();
  1465. ui.spinBoxBondVacDelay_2->setValue(m_curBondParam.iVacuumDelay);
  1466. if (m_curBondParam.iVacuumDelay == m_tempBondParam.iVacuumDelay)
  1467. ui.spinBoxBondVacDelay_2->setStyleSheet(""); // 恢复默认样式
  1468. else
  1469. ui.spinBoxBondVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1470. }
  1471. });
  1472. connect(ui.spinBoxPickBlowDelay_2, &SpinBox::editDone, this, [=]() {
  1473. m_curCalibPickParam.iBlowDelay = ui.spinBoxPickBlowDelay_2->value();
  1474. // 颜色变红显示变化
  1475. if (m_curCalibPickParam.iBlowDelay == m_tempCalibPickParam.iBlowDelay)
  1476. ui.spinBoxPickBlowDelay_2->setStyleSheet(""); // 恢复默认样式
  1477. else
  1478. ui.spinBoxPickBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1479. // 同步其他控件并处理样式
  1480. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1481. m_curWaferPickParam.iBlowDelay = ui.spinBoxPickBlowDelay_2->value();
  1482. ui.spinBoxPickBlowDelay->setValue(m_curWaferPickParam.iBlowDelay);
  1483. if (m_curWaferPickParam.iBlowDelay == m_tempWaferPickParam.iBlowDelay)
  1484. ui.spinBoxPickBlowDelay->setStyleSheet(""); // 恢复默认样式
  1485. else
  1486. ui.spinBoxPickBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1487. }
  1488. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1489. m_curCalibPlaceParam.iBlowDelay = ui.spinBoxPickBlowDelay_2->value();
  1490. ui.spinBoxBondBlowDelay->setValue(m_curCalibPlaceParam.iBlowDelay);
  1491. if (m_curCalibPlaceParam.iBlowDelay == m_tempCalibPlaceParam.iBlowDelay)
  1492. ui.spinBoxBondBlowDelay->setStyleSheet(""); // 恢复默认样式
  1493. else
  1494. ui.spinBoxBondBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1495. }
  1496. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1497. m_curBondParam.iBlowDelay = ui.spinBoxPickBlowDelay_2->value();
  1498. ui.spinBoxBondBlowDelay_2->setValue(m_curBondParam.iBlowDelay);
  1499. if (m_curBondParam.iBlowDelay == m_tempBondParam.iBlowDelay)
  1500. ui.spinBoxBondBlowDelay_2->setStyleSheet(""); // 恢复默认样式
  1501. else
  1502. ui.spinBoxBondBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1503. }
  1504. });
  1505. }
  1506. // 连接 "中转台固晶" 控件
  1507. void BondMatrixProgramPage::connectCalibPlaceControls()
  1508. {
  1509. connect(ui.checkBoxBondBlockCheck, &QCheckBox::clicked, this, &BondMatrixProgramPage::onCheckBoxBondBlockCheckClicked);
  1510. connect(ui.checkBoxBondLoseCheck, &QCheckBox::clicked, this, &BondMatrixProgramPage::onCheckBoxBondLoseCheckClicked);
  1511. connect(ui.checkBoxBondFindForce, &QCheckBox::clicked, this, &BondMatrixProgramPage::onCheckBoxBondFindForceClicked);
  1512. connect(ui.doubleSpinBoxPreBondPosZ, &QDoubleSpinBox::editingFinished, this, &BondMatrixProgramPage::onDoubleSpinBoxPreBondPosZEditingFinished);
  1513. connect(ui.doubleSpinBoxBondForce, &QDoubleSpinBox::editingFinished, this, &BondMatrixProgramPage::onDoubleSpinBoxBondForceEditingFinished);
  1514. connect(ui.doubleSpinBoxBondPosZ, &QDoubleSpinBox::editingFinished, this, &BondMatrixProgramPage::onDoubleSpinBoxBondPosZEditingFinished);
  1515. connect(ui.spinBoxBondGrabDelay, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondGrabDelayEditingFinished);
  1516. connect(ui.spinBoxBondBlockCheckDelay, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondBlockCheckDelayEditingFinished);
  1517. connect(ui.spinBoxBondDelay, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondDelayEditingFinished);
  1518. connect(ui.spinBoxBondVacDelay, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondVacDelayEditingFinished);
  1519. connect(ui.spinBoxBondBlowDelay, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondBlowDelayEditingFinished);
  1520. }
  1521. // 连接 "固晶台固晶" 控件
  1522. void BondMatrixProgramPage::connectBondControls()
  1523. {
  1524. connect(ui.checkBoxBondBlockCheck_2, &QCheckBox::clicked, this, &BondMatrixProgramPage::onCheckBoxBondBlockCheck_2Clicked);
  1525. connect(ui.checkBoxBondLoseCheck_2, &QCheckBox::clicked, this, &BondMatrixProgramPage::onCheckBoxBondLoseCheck_2Clicked);
  1526. connect(ui.checkBoxBondFindForce_2, &QCheckBox::clicked, this, &BondMatrixProgramPage::onCheckBoxBondFindForce_2Clicked);
  1527. connect(ui.doubleSpinBoxPreBondPosZ_2, &QDoubleSpinBox::editingFinished, this, &BondMatrixProgramPage::onDoubleSpinBoxPreBondPosZ_2EditingFinished);
  1528. connect(ui.doubleSpinBoxBondForce_2, &QDoubleSpinBox::editingFinished, this, &BondMatrixProgramPage::onDoubleSpinBoxBondForce_2EditingFinished);
  1529. connect(ui.doubleSpinBoxBondPosZ_2, &QDoubleSpinBox::editingFinished, this, &BondMatrixProgramPage::onDoubleSpinBoxBondPosZ_2EditingFinished);
  1530. connect(ui.spinBoxBondGrabDelay_2, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondGrabDelay_2EditingFinished);
  1531. connect(ui.spinBoxBondBlockCheckDelay_2, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondBlockCheckDelay_2EditingFinished);
  1532. connect(ui.spinBoxBondDelay_2, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondDelay_2EditingFinished);
  1533. connect(ui.spinBoxBondVacDelay_2, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondVacDelay_2EditingFinished);
  1534. connect(ui.spinBoxBondBlowDelay_2, &QSpinBox::editingFinished, this, &BondMatrixProgramPage::onSpinBoxBondBlowDelay_2EditingFinished);
  1535. }
  1536. //ModifyTemplate
  1537. void BondMatrixProgramPage::onSetParamPickTempClicked()
  1538. {
  1539. int iTemplateId = ui.comboBoxPickTempID->currentData().toInt();
  1540. m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId);
  1541. }
  1542. void BondMatrixProgramPage::onSetParamPreBondClicked()
  1543. {
  1544. int iTemplateId = ui.comboBoxPreBondTemp->currentData().toInt();
  1545. m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId);
  1546. }
  1547. void BondMatrixProgramPage::onSetParamPostBondClicked()
  1548. {
  1549. int iTemplateId = ui.comboBoxPostBondTemp->currentData().toInt();
  1550. m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId);
  1551. }
  1552. void BondMatrixProgramPage::onSetParamBondClicked()
  1553. {
  1554. int iTemplateId = ui.comboBoxBondTemp->currentData().toInt();
  1555. m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId);
  1556. }
  1557. void BondMatrixProgramPage::onSetParamLookUpClicked()
  1558. {
  1559. int iTemplateId = ui.comboBoxLookUpTemp->currentData().toInt();
  1560. m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId);
  1561. }
  1562. void BondMatrixProgramPage::onSetParamCalibPickClicked()
  1563. {
  1564. int iTemplateId = ui.comboBoxCalibPickTemp->currentData().toInt();
  1565. m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId);
  1566. }
  1567. void BondMatrixProgramPage::onSetParamPcbAlnPRStrategyClicked()
  1568. {
  1569. int iTemplateId = ui.comboBoxPcbAlnPRStrategyId->currentData().toInt();
  1570. m_pProgramCViewInterface->GetViewMatrix()->ModifyBondMatrixTemplate(iTemplateId);
  1571. }
  1572. //CreateParam:目前都是一样的,如后续没有个性化的差异可以只用一个函数即可
  1573. void BondMatrixProgramPage::onCreateParamPickTempClicked()
  1574. {
  1575. UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt();
  1576. m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_WAFER_PICK, iBondInfoId);
  1577. UpdateShowBondInfoData(iBondInfoId);
  1578. }
  1579. void BondMatrixProgramPage::onCreateParamPreBondClicked()
  1580. {
  1581. UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt();
  1582. m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_BONDFRONT, iBondInfoId);
  1583. UpdateShowBondInfoData(iBondInfoId);
  1584. }
  1585. void BondMatrixProgramPage::onCreateParamPostBondClicked()
  1586. {
  1587. UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt();
  1588. m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_BONDBACK, iBondInfoId);
  1589. UpdateShowBondInfoData(iBondInfoId);
  1590. }
  1591. void BondMatrixProgramPage::onCreateParamBondClicked()
  1592. {
  1593. UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt();
  1594. m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_WORKTABLE_BOND, iBondInfoId);
  1595. UpdateShowBondInfoData(iBondInfoId);
  1596. }
  1597. void BondMatrixProgramPage::onCreateParamLookUpClicked()
  1598. {
  1599. UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt();
  1600. m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_LOOKUP, iBondInfoId);
  1601. UpdateShowBondInfoData(iBondInfoId);
  1602. }
  1603. void BondMatrixProgramPage::onCreateParamCalibPickClicked()
  1604. {
  1605. UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt();
  1606. m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_TRANSFER_PICK, iBondInfoId);
  1607. UpdateShowBondInfoData(iBondInfoId);
  1608. }
  1609. void BondMatrixProgramPage::onCreatParamPcbAlnPRStrategyClicked()
  1610. {
  1611. UINT iBondInfoId = ui.comboBoxCurrentPara->currentData().toUInt();
  1612. m_pProgramCViewInterface->GetViewMatrix()->CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE::TEMPLATE_WORKTABLE_BOND_ALN, iBondInfoId);
  1613. UpdateShowBondInfoData(iBondInfoId);
  1614. }
  1615. // 为华夫盒连接控件:优化使用
  1616. void BondMatrixProgramPage::onCheckBoxPickBlockCheckClicked(bool isChecked)
  1617. {
  1618. m_curWaferPickParam.bCheckBlock = isChecked;
  1619. }
  1620. void BondMatrixProgramPage::onCheckBoxPickLoseCheckClicked(bool isChecked)
  1621. {
  1622. m_curWaferPickParam.bCheckLose = isChecked;
  1623. }
  1624. void BondMatrixProgramPage::onCheckBoxPickFindForceCheckClicked(bool isChecked)
  1625. {
  1626. m_curWaferPickParam.bFindForce = isChecked;
  1627. }
  1628. void BondMatrixProgramPage::onDoubleSpinBoxPrePickZEditingFinished()
  1629. {
  1630. m_curWaferPickParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ->value();
  1631. }
  1632. void BondMatrixProgramPage::onDoubleSpinBoxPickForceEditingFinished()
  1633. {
  1634. m_curWaferPickParam.dForce = ui.doubleSpinBoxPickForce->value();
  1635. }
  1636. void BondMatrixProgramPage::onDoubleSpinBoxPickPosZEditingFinished()
  1637. {
  1638. m_curWaferPickParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ->value();
  1639. }
  1640. void BondMatrixProgramPage::onSpinBoxPickGrabDelayEditingFinished()
  1641. {
  1642. m_curWaferPickParam.iGrabDelay = ui.spinBoxPickGrabDelay->value();
  1643. }
  1644. void BondMatrixProgramPage::onSpinBoxPickDelayEditingFinished()
  1645. {
  1646. m_curWaferPickParam.iPickOrBondDelay = ui.spinBoxPickDelay->value();
  1647. }
  1648. void BondMatrixProgramPage::onSpinBoxPickBlockCheckDelayEditingFinished()
  1649. {
  1650. m_curWaferPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay->value();
  1651. }
  1652. void BondMatrixProgramPage::onSpinBoxPickVacDelayEditingFinished()
  1653. {
  1654. m_curWaferPickParam.iVacuumDelay = ui.spinBoxPickVacDelay->value();
  1655. }
  1656. void BondMatrixProgramPage::onSpinBoxPickBlowDelayEditingFinished()
  1657. {
  1658. m_curWaferPickParam.iBlowDelay = ui.spinBoxPickBlowDelay->value();
  1659. }
  1660. // 中转台取晶槽函数实现:优化使用
  1661. void BondMatrixProgramPage::onCheckBoxPickBlockCheck_2Clicked(bool isChecked)
  1662. {
  1663. m_curCalibPickParam.bCheckBlock = isChecked;
  1664. }
  1665. void BondMatrixProgramPage::onCheckBoxPickLoseCheck_2Clicked(bool isChecked)
  1666. {
  1667. m_curCalibPickParam.bCheckLose = isChecked;
  1668. }
  1669. void BondMatrixProgramPage::onCheckBoxPickFindForceCheck_2Clicked(bool isChecked)
  1670. {
  1671. m_curCalibPickParam.bFindForce = isChecked;
  1672. }
  1673. void BondMatrixProgramPage::onDoubleSpinBoxPrePickZ_2EditingFinished()
  1674. {
  1675. m_curCalibPickParam.dPreLevOffset = ui.doubleSpinBoxPrePickZ_2->value();
  1676. }
  1677. void BondMatrixProgramPage::onDoubleSpinBoxPickForce_2EditingFinished()
  1678. {
  1679. m_curCalibPickParam.dForce = ui.doubleSpinBoxPickForce_2->value();
  1680. }
  1681. void BondMatrixProgramPage::onDoubleSpinBoxPickPosZ_2EditingFinished()
  1682. {
  1683. m_curCalibPickParam.dWorkLevOffset = ui.doubleSpinBoxPickPosZ_2->value();
  1684. }
  1685. void BondMatrixProgramPage::onSpinBoxPickGrabDelay_2EditingFinished()
  1686. {
  1687. m_curCalibPickParam.iGrabDelay = ui.spinBoxPickGrabDelay_2->value();
  1688. }
  1689. void BondMatrixProgramPage::onSpinBoxPickDelay_2EditingFinished()
  1690. {
  1691. m_curCalibPickParam.iPickOrBondDelay = ui.spinBoxPickDelay_2->value();
  1692. }
  1693. void BondMatrixProgramPage::onSpinBoxPickBlockCheckDelay_2EditingFinished()
  1694. {
  1695. m_curCalibPickParam.iBlockOrLoseDelay = ui.spinBoxPickBlockCheckDelay_2->value();
  1696. }
  1697. void BondMatrixProgramPage::onSpinBoxPickVacDelay_2EditingFinished()
  1698. {
  1699. m_curCalibPickParam.iVacuumDelay = ui.spinBoxPickVacDelay_2->value();
  1700. }
  1701. void BondMatrixProgramPage::onSpinBoxPickBlowDelay_2EditingFinished()
  1702. {
  1703. m_curCalibPickParam.iBlowDelay = ui.spinBoxPickBlowDelay_2->value();
  1704. }
  1705. // 处理 "中转台放晶" 控件的槽函数
  1706. void BondMatrixProgramPage::onCheckBoxBondBlockCheckClicked(bool isChecked)
  1707. {
  1708. m_curCalibPlaceParam.bCheckBlock = isChecked;
  1709. // 更新样式
  1710. if (m_curCalibPlaceParam.bCheckBlock == m_tempCalibPlaceParam.bCheckBlock)
  1711. ui.checkBoxBondBlockCheck->setStyleSheet(""); // 恢复默认样式
  1712. else
  1713. ui.checkBoxBondBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红
  1714. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1715. m_curWaferPickParam.bCheckBlock = isChecked;
  1716. ui.checkBoxPickBlockCheck->setChecked(m_curWaferPickParam.bCheckBlock);
  1717. // 更新样式
  1718. if (m_curWaferPickParam.bCheckBlock == m_tempWaferPickParam.bCheckBlock)
  1719. ui.checkBoxPickBlockCheck->setStyleSheet(""); // 恢复默认样式
  1720. else
  1721. ui.checkBoxPickBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红
  1722. }
  1723. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1724. m_curCalibPickParam.bCheckBlock = isChecked;
  1725. ui.checkBoxPickBlockCheck_2->setChecked(m_curCalibPickParam.bCheckBlock);
  1726. // 更新样式
  1727. if (m_curCalibPickParam.bCheckBlock == m_tempCalibPickParam.bCheckBlock)
  1728. ui.checkBoxPickBlockCheck_2->setStyleSheet(""); // 恢复默认样式
  1729. else
  1730. ui.checkBoxPickBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  1731. }
  1732. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1733. m_curBondParam.bCheckBlock = isChecked;
  1734. ui.checkBoxBondBlockCheck_2->setChecked(m_curBondParam.bCheckBlock);
  1735. // 更新样式
  1736. if (m_curBondParam.bCheckBlock == m_tempBondParam.bCheckBlock)
  1737. ui.checkBoxBondBlockCheck_2->setStyleSheet(""); // 恢复默认样式
  1738. else
  1739. ui.checkBoxBondBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  1740. }
  1741. }
  1742. void BondMatrixProgramPage::onCheckBoxBondLoseCheckClicked(bool isChecked)
  1743. {
  1744. m_curCalibPlaceParam.bCheckLose = isChecked;
  1745. // 更新样式
  1746. if (m_curCalibPlaceParam.bCheckLose == m_tempCalibPlaceParam.bCheckLose)
  1747. ui.checkBoxBondLoseCheck->setStyleSheet(""); // 恢复默认样式
  1748. else
  1749. ui.checkBoxBondLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红
  1750. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1751. m_curWaferPickParam.bCheckLose = isChecked;
  1752. ui.checkBoxPickLoseCheck->setChecked(m_curWaferPickParam.bCheckLose);
  1753. // 更新样式
  1754. if (m_curWaferPickParam.bCheckLose == m_tempWaferPickParam.bCheckLose)
  1755. ui.checkBoxPickLoseCheck->setStyleSheet(""); // 恢复默认样式
  1756. else
  1757. ui.checkBoxPickLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红
  1758. }
  1759. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1760. m_curCalibPickParam.bCheckLose = isChecked;
  1761. ui.checkBoxPickLoseCheck_2->setChecked(m_curCalibPickParam.bCheckLose);
  1762. // 更新样式
  1763. if (m_curCalibPickParam.bCheckLose == m_tempCalibPickParam.bCheckLose)
  1764. ui.checkBoxPickLoseCheck_2->setStyleSheet(""); // 恢复默认样式
  1765. else
  1766. ui.checkBoxPickLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  1767. }
  1768. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1769. m_curBondParam.bCheckLose = isChecked;
  1770. ui.checkBoxBondLoseCheck_2->setChecked(m_curBondParam.bCheckLose);
  1771. // 更新样式
  1772. if (m_curBondParam.bCheckLose == m_tempBondParam.bCheckLose)
  1773. ui.checkBoxBondLoseCheck_2->setStyleSheet(""); // 恢复默认样式
  1774. else
  1775. ui.checkBoxBondLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  1776. }
  1777. }
  1778. void BondMatrixProgramPage::onCheckBoxBondFindForceClicked(bool isChecked)
  1779. {
  1780. m_curCalibPlaceParam.bFindForce = isChecked;
  1781. ui.doubleSpinBoxBondPosZ->setEnabled(!isChecked);
  1782. // 更新样式
  1783. if (m_curCalibPlaceParam.bFindForce == m_tempCalibPlaceParam.bFindForce)
  1784. ui.checkBoxBondFindForce->setStyleSheet(""); // 恢复默认样式
  1785. else
  1786. ui.checkBoxBondFindForce->setStyleSheet("color: red;"); // 字体颜色变红
  1787. // 同步其他控件并处理样式
  1788. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1789. m_curWaferPickParam.bFindForce = isChecked;
  1790. ui.checkBoxPickFindForceCheck->setChecked(m_curWaferPickParam.bFindForce);
  1791. // 更新样式
  1792. if (m_curWaferPickParam.bFindForce == m_tempWaferPickParam.bFindForce)
  1793. ui.checkBoxPickFindForceCheck->setStyleSheet(""); // 恢复默认样式
  1794. else
  1795. ui.checkBoxPickFindForceCheck->setStyleSheet("color: red;"); // 字体颜色变红
  1796. ui.doubleSpinBoxPickPosZ->setEnabled(!isChecked);
  1797. }
  1798. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1799. m_curCalibPickParam.bFindForce = isChecked;
  1800. ui.checkBoxPickFindForceCheck_2->setChecked(m_curCalibPickParam.bFindForce);
  1801. // 更新样式
  1802. if (m_curCalibPickParam.bFindForce == m_tempCalibPickParam.bFindForce)
  1803. ui.checkBoxPickFindForceCheck_2->setStyleSheet(""); // 恢复默认样式
  1804. else
  1805. ui.checkBoxPickFindForceCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  1806. ui.doubleSpinBoxPickPosZ_2->setEnabled(!isChecked);
  1807. }
  1808. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1809. m_curBondParam.bFindForce = isChecked;
  1810. ui.checkBoxBondFindForce_2->setChecked(m_curBondParam.bFindForce);
  1811. // 更新样式
  1812. if (m_curBondParam.bFindForce == m_tempBondParam.bFindForce)
  1813. ui.checkBoxBondFindForce_2->setStyleSheet(""); // 恢复默认样式
  1814. else
  1815. ui.checkBoxBondFindForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  1816. ui.doubleSpinBoxBondPosZ_2->setEnabled(!isChecked);
  1817. }
  1818. }
  1819. void BondMatrixProgramPage::onDoubleSpinBoxPreBondPosZEditingFinished()
  1820. {
  1821. m_curCalibPlaceParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ->value();
  1822. // 更新样式
  1823. if (m_curCalibPlaceParam.dPreLevOffset == m_tempCalibPlaceParam.dPreLevOffset)
  1824. ui.doubleSpinBoxPreBondPosZ->setStyleSheet(""); // 恢复默认样式
  1825. else
  1826. ui.doubleSpinBoxPreBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  1827. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1828. m_curWaferPickParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ->value();
  1829. ui.doubleSpinBoxPrePickZ->setValue(m_curWaferPickParam.dPreLevOffset);
  1830. // 更新样式
  1831. if (m_curWaferPickParam.dPreLevOffset == m_tempWaferPickParam.dPreLevOffset)
  1832. ui.doubleSpinBoxPrePickZ->setStyleSheet(""); // 恢复默认样式
  1833. else
  1834. ui.doubleSpinBoxPrePickZ->setStyleSheet("color: red;"); // 字体颜色变红
  1835. }
  1836. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1837. m_curCalibPickParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ->value();
  1838. ui.doubleSpinBoxPrePickZ_2->setValue(m_curCalibPickParam.dPreLevOffset);
  1839. // 更新样式
  1840. if (m_curCalibPickParam.dPreLevOffset == m_tempCalibPickParam.dPreLevOffset)
  1841. ui.doubleSpinBoxPrePickZ_2->setStyleSheet(""); // 恢复默认样式
  1842. else
  1843. ui.doubleSpinBoxPrePickZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  1844. }
  1845. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1846. m_curBondParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ->value();
  1847. ui.doubleSpinBoxPreBondPosZ_2->setValue(m_curBondParam.dPreLevOffset);
  1848. // 更新样式
  1849. if (m_curBondParam.dPreLevOffset == m_tempBondParam.dPreLevOffset)
  1850. ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet(""); // 恢复默认样式
  1851. else
  1852. ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  1853. }
  1854. }
  1855. void BondMatrixProgramPage::onDoubleSpinBoxBondForceEditingFinished()
  1856. {
  1857. m_curCalibPlaceParam.dForce = ui.doubleSpinBoxBondForce->value();
  1858. // 更新样式
  1859. if (m_curCalibPlaceParam.dForce == m_tempCalibPlaceParam.dForce)
  1860. ui.doubleSpinBoxBondForce->setStyleSheet(""); // 恢复默认样式
  1861. else
  1862. ui.doubleSpinBoxBondForce->setStyleSheet("color: red;"); // 字体颜色变红
  1863. // 同步其他控件并处理样式
  1864. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1865. m_curWaferPickParam.dForce = ui.doubleSpinBoxBondForce->value();
  1866. ui.doubleSpinBoxPickForce->setValue(m_curWaferPickParam.dForce);
  1867. // 更新样式
  1868. if (m_curWaferPickParam.dForce == m_tempWaferPickParam.dForce)
  1869. ui.doubleSpinBoxPickForce->setStyleSheet(""); // 恢复默认样式
  1870. else
  1871. ui.doubleSpinBoxPickForce->setStyleSheet("color: red;"); // 字体颜色变红
  1872. }
  1873. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1874. m_curCalibPickParam.dForce = ui.doubleSpinBoxBondForce->value();
  1875. ui.doubleSpinBoxPickForce_2->setValue(m_curCalibPickParam.dForce);
  1876. // 更新样式
  1877. if (m_curCalibPickParam.dForce == m_tempCalibPickParam.dForce)
  1878. ui.doubleSpinBoxPickForce_2->setStyleSheet(""); // 恢复默认样式
  1879. else
  1880. ui.doubleSpinBoxPickForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  1881. }
  1882. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1883. m_curBondParam.dForce = ui.doubleSpinBoxBondForce->value();
  1884. ui.doubleSpinBoxBondForce_2->setValue(m_curBondParam.dForce);
  1885. // 更新样式
  1886. if (m_curBondParam.dForce == m_tempBondParam.dForce)
  1887. ui.doubleSpinBoxBondForce_2->setStyleSheet(""); // 恢复默认样式
  1888. else
  1889. ui.doubleSpinBoxBondForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  1890. }
  1891. }
  1892. void BondMatrixProgramPage::onDoubleSpinBoxBondPosZEditingFinished()
  1893. {
  1894. m_curCalibPlaceParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ->value();
  1895. // 更新样式
  1896. if (m_curCalibPlaceParam.dWorkLevOffset == m_tempCalibPlaceParam.dWorkLevOffset)
  1897. ui.doubleSpinBoxBondPosZ->setStyleSheet(""); // 恢复默认样式
  1898. else
  1899. ui.doubleSpinBoxBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  1900. // 同步其他控件并处理样式
  1901. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1902. m_curWaferPickParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ->value();
  1903. ui.doubleSpinBoxPickPosZ->setValue(m_curWaferPickParam.dWorkLevOffset);
  1904. // 更新样式
  1905. if (m_curWaferPickParam.dWorkLevOffset == m_tempWaferPickParam.dWorkLevOffset)
  1906. ui.doubleSpinBoxPickPosZ->setStyleSheet(""); // 恢复默认样式
  1907. else
  1908. ui.doubleSpinBoxPickPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  1909. }
  1910. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1911. m_curCalibPickParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ->value();
  1912. ui.doubleSpinBoxPickPosZ_2->setValue(m_curCalibPickParam.dWorkLevOffset);
  1913. // 更新样式
  1914. if (m_curCalibPickParam.dWorkLevOffset == m_tempCalibPickParam.dWorkLevOffset)
  1915. ui.doubleSpinBoxPickPosZ_2->setStyleSheet(""); // 恢复默认样式
  1916. else
  1917. ui.doubleSpinBoxPickPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  1918. }
  1919. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1920. m_curBondParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ->value();
  1921. ui.doubleSpinBoxBondPosZ_2->setValue(m_curBondParam.dWorkLevOffset);
  1922. // 更新样式
  1923. if (m_curBondParam.dWorkLevOffset == m_tempBondParam.dWorkLevOffset)
  1924. ui.doubleSpinBoxBondPosZ_2->setStyleSheet(""); // 恢复默认样式
  1925. else
  1926. ui.doubleSpinBoxBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  1927. }
  1928. }
  1929. void BondMatrixProgramPage::onSpinBoxBondGrabDelayEditingFinished()
  1930. {
  1931. m_curCalibPlaceParam.iGrabDelay = ui.spinBoxBondGrabDelay->value();
  1932. // 更新样式
  1933. if (m_curCalibPlaceParam.iGrabDelay == m_tempCalibPlaceParam.iGrabDelay)
  1934. ui.spinBoxBondGrabDelay->setStyleSheet(""); // 恢复默认样式
  1935. else
  1936. ui.spinBoxBondGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1937. // 同步其他控件并处理样式
  1938. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1939. m_curWaferPickParam.iGrabDelay = ui.spinBoxBondGrabDelay->value();
  1940. ui.spinBoxPickGrabDelay->setValue(m_curWaferPickParam.iGrabDelay);
  1941. // 更新样式
  1942. if (m_curWaferPickParam.iGrabDelay == m_tempWaferPickParam.iGrabDelay)
  1943. ui.spinBoxPickGrabDelay->setStyleSheet(""); // 恢复默认样式
  1944. else
  1945. ui.spinBoxPickGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1946. }
  1947. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1948. m_curCalibPickParam.iGrabDelay = ui.spinBoxBondGrabDelay->value();
  1949. ui.spinBoxPickGrabDelay_2->setValue(m_curCalibPickParam.iGrabDelay);
  1950. // 更新样式
  1951. if (m_curCalibPickParam.iGrabDelay == m_tempCalibPickParam.iGrabDelay)
  1952. ui.spinBoxPickGrabDelay_2->setStyleSheet(""); // 恢复默认样式
  1953. else
  1954. ui.spinBoxPickGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1955. }
  1956. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1957. m_curBondParam.iGrabDelay = ui.spinBoxBondGrabDelay->value();
  1958. ui.spinBoxBondGrabDelay_2->setValue(m_curBondParam.iGrabDelay);
  1959. // 更新样式
  1960. if (m_curBondParam.iGrabDelay == m_tempBondParam.iGrabDelay)
  1961. ui.spinBoxBondGrabDelay_2->setStyleSheet(""); // 恢复默认样式
  1962. else
  1963. ui.spinBoxBondGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1964. }
  1965. }
  1966. void BondMatrixProgramPage::onSpinBoxBondBlockCheckDelayEditingFinished()
  1967. {
  1968. m_curCalibPlaceParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay->value();
  1969. // 更新样式
  1970. if (m_curCalibPlaceParam.iBlockOrLoseDelay == m_tempCalibPlaceParam.iBlockOrLoseDelay)
  1971. ui.spinBoxBondBlockCheckDelay->setStyleSheet(""); // 恢复默认样式
  1972. else
  1973. ui.spinBoxBondBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1974. // 同步其他控件并处理样式
  1975. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  1976. m_curWaferPickParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay->value();
  1977. ui.spinBoxPickBlockCheckDelay->setValue(m_curWaferPickParam.iBlockOrLoseDelay);
  1978. // 更新样式
  1979. if (m_curWaferPickParam.iBlockOrLoseDelay == m_tempWaferPickParam.iBlockOrLoseDelay)
  1980. ui.spinBoxPickBlockCheckDelay->setStyleSheet(""); // 恢复默认样式
  1981. else
  1982. ui.spinBoxPickBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红
  1983. }
  1984. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  1985. m_curCalibPickParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay->value();
  1986. ui.spinBoxPickBlockCheckDelay_2->setValue(m_curCalibPickParam.iBlockOrLoseDelay);
  1987. // 更新样式
  1988. if (m_curCalibPickParam.iBlockOrLoseDelay == m_tempCalibPickParam.iBlockOrLoseDelay)
  1989. ui.spinBoxPickBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式
  1990. else
  1991. ui.spinBoxPickBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  1992. }
  1993. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  1994. m_curBondParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay->value();
  1995. ui.spinBoxBondBlockCheckDelay_2->setValue(m_curBondParam.iBlockOrLoseDelay);
  1996. // 更新样式
  1997. if (m_curBondParam.iBlockOrLoseDelay == m_tempBondParam.iBlockOrLoseDelay)
  1998. ui.spinBoxBondBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式
  1999. else
  2000. ui.spinBoxBondBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2001. }
  2002. }
  2003. void BondMatrixProgramPage::onSpinBoxBondDelayEditingFinished()
  2004. {
  2005. m_curCalibPlaceParam.iPickOrBondDelay = ui.spinBoxBondDelay->value();
  2006. // 更新样式
  2007. if (m_curCalibPlaceParam.iPickOrBondDelay == m_tempCalibPlaceParam.iPickOrBondDelay)
  2008. ui.spinBoxBondDelay->setStyleSheet(""); // 恢复默认样式
  2009. else
  2010. ui.spinBoxBondDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2011. // 同步其他控件并处理样式
  2012. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  2013. m_curWaferPickParam.iPickOrBondDelay = ui.spinBoxBondDelay->value();
  2014. ui.spinBoxPickDelay->setValue(m_curWaferPickParam.iPickOrBondDelay);
  2015. // 更新样式
  2016. if (m_curWaferPickParam.iPickOrBondDelay == m_tempWaferPickParam.iPickOrBondDelay)
  2017. ui.spinBoxPickDelay->setStyleSheet(""); // 恢复默认样式
  2018. else
  2019. ui.spinBoxPickDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2020. }
  2021. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  2022. m_curCalibPickParam.iPickOrBondDelay = ui.spinBoxBondDelay->value();
  2023. ui.spinBoxPickDelay_2->setValue(m_curCalibPickParam.iPickOrBondDelay);
  2024. // 更新样式
  2025. if (m_curCalibPickParam.iPickOrBondDelay == m_tempCalibPickParam.iPickOrBondDelay)
  2026. ui.spinBoxPickDelay_2->setStyleSheet(""); // 恢复默认样式
  2027. else
  2028. ui.spinBoxPickDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2029. }
  2030. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2031. m_curBondParam.iPickOrBondDelay = ui.spinBoxBondDelay->value();
  2032. ui.spinBoxBondDelay_2->setValue(m_curBondParam.iPickOrBondDelay);
  2033. // 更新样式
  2034. if (m_curBondParam.iPickOrBondDelay == m_tempBondParam.iPickOrBondDelay)
  2035. ui.spinBoxBondDelay_2->setStyleSheet(""); // 恢复默认样式
  2036. else
  2037. ui.spinBoxBondDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2038. }
  2039. }
  2040. void BondMatrixProgramPage::onSpinBoxBondVacDelayEditingFinished()
  2041. {
  2042. m_curCalibPlaceParam.iVacuumDelay = ui.spinBoxBondVacDelay->value();
  2043. // 更新样式
  2044. if (m_curCalibPlaceParam.iVacuumDelay == m_tempCalibPlaceParam.iVacuumDelay)
  2045. ui.spinBoxBondVacDelay->setStyleSheet(""); // 恢复默认样式
  2046. else
  2047. ui.spinBoxBondVacDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2048. // 同步其他控件并处理样式
  2049. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  2050. m_curWaferPickParam.iVacuumDelay = ui.spinBoxBondVacDelay->value();
  2051. ui.spinBoxPickVacDelay->setValue(m_curWaferPickParam.iVacuumDelay);
  2052. // 更新样式
  2053. if (m_curWaferPickParam.iVacuumDelay == m_tempWaferPickParam.iVacuumDelay)
  2054. ui.spinBoxPickVacDelay->setStyleSheet(""); // 恢复默认样式
  2055. else
  2056. ui.spinBoxPickVacDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2057. }
  2058. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  2059. m_curCalibPickParam.iVacuumDelay = ui.spinBoxBondVacDelay->value();
  2060. ui.spinBoxPickVacDelay_2->setValue(m_curCalibPickParam.iVacuumDelay);
  2061. // 更新样式
  2062. if (m_curCalibPickParam.iVacuumDelay == m_tempCalibPickParam.iVacuumDelay)
  2063. ui.spinBoxPickVacDelay_2->setStyleSheet(""); // 恢复默认样式
  2064. else
  2065. ui.spinBoxPickVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2066. }
  2067. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2068. m_curBondParam.iVacuumDelay = ui.spinBoxBondVacDelay->value();
  2069. ui.spinBoxBondVacDelay_2->setValue(m_curBondParam.iVacuumDelay);
  2070. // 更新样式
  2071. if (m_curBondParam.iVacuumDelay == m_tempBondParam.iVacuumDelay)
  2072. ui.spinBoxBondVacDelay_2->setStyleSheet(""); // 恢复默认样式
  2073. else
  2074. ui.spinBoxBondVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2075. }
  2076. }
  2077. void BondMatrixProgramPage::onSpinBoxBondBlowDelayEditingFinished()
  2078. {
  2079. m_curCalibPlaceParam.iBlowDelay = ui.spinBoxBondBlowDelay->value();
  2080. // 更新样式
  2081. if (m_curCalibPlaceParam.iBlowDelay == m_tempCalibPlaceParam.iBlowDelay)
  2082. ui.spinBoxBondBlowDelay->setStyleSheet(""); // 恢复默认样式
  2083. else
  2084. ui.spinBoxBondBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2085. // 同步其他控件并处理样式
  2086. if (m_curCalibPlaceParam.iId == m_curWaferPickParam.iId) {
  2087. m_curWaferPickParam.iBlowDelay = ui.spinBoxBondBlowDelay->value();
  2088. ui.spinBoxPickBlowDelay->setValue(m_curWaferPickParam.iBlowDelay);
  2089. // 更新样式
  2090. if (m_curWaferPickParam.iBlowDelay == m_tempWaferPickParam.iBlowDelay)
  2091. ui.spinBoxPickBlowDelay->setStyleSheet(""); // 恢复默认样式
  2092. else
  2093. ui.spinBoxPickBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2094. }
  2095. if (m_curCalibPickParam.iId == m_curWaferPickParam.iId) {
  2096. m_curCalibPickParam.iBlowDelay = ui.spinBoxBondBlowDelay->value();
  2097. ui.spinBoxPickBlowDelay_2->setValue(m_curCalibPickParam.iBlowDelay);
  2098. // 更新样式
  2099. if (m_curCalibPickParam.iBlowDelay == m_tempCalibPickParam.iBlowDelay)
  2100. ui.spinBoxPickBlowDelay_2->setStyleSheet(""); // 恢复默认样式
  2101. else
  2102. ui.spinBoxPickBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2103. }
  2104. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2105. m_curBondParam.iBlowDelay = ui.spinBoxBondBlowDelay->value();
  2106. ui.spinBoxBondBlowDelay_2->setValue(m_curBondParam.iBlowDelay);
  2107. // 更新样式
  2108. if (m_curBondParam.iBlowDelay == m_tempBondParam.iBlowDelay)
  2109. ui.spinBoxBondBlowDelay_2->setStyleSheet(""); // 恢复默认样式
  2110. else
  2111. ui.spinBoxBondBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2112. }
  2113. }
  2114. // 处理 "固晶台固晶" 控件的槽函数
  2115. void BondMatrixProgramPage::onCheckBoxBondBlockCheck_2Clicked(bool isChecked)
  2116. {
  2117. m_curBondParam.bCheckBlock = isChecked;
  2118. // 更新样式
  2119. if (m_curBondParam.bCheckBlock == m_tempBondParam.bCheckBlock)
  2120. ui.checkBoxBondBlockCheck_2->setStyleSheet(""); // 恢复默认样式
  2121. else
  2122. ui.checkBoxBondBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  2123. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2124. m_curWaferPickParam.bCheckBlock = isChecked;
  2125. ui.checkBoxPickBlockCheck->setChecked(m_curWaferPickParam.bCheckBlock);
  2126. // 更新样式
  2127. if (m_curWaferPickParam.bCheckBlock == m_tempWaferPickParam.bCheckBlock)
  2128. ui.checkBoxPickBlockCheck->setStyleSheet(""); // 恢复默认样式
  2129. else
  2130. ui.checkBoxPickBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红
  2131. }
  2132. if (m_curCalibPickParam.iId == m_curBondParam.iId) {
  2133. m_curCalibPickParam.bCheckBlock = isChecked;
  2134. ui.checkBoxPickBlockCheck_2->setChecked(m_curCalibPickParam.bCheckBlock);
  2135. // 更新样式
  2136. if (m_curCalibPickParam.bCheckBlock == m_tempCalibPickParam.bCheckBlock)
  2137. ui.checkBoxPickBlockCheck_2->setStyleSheet(""); // 恢复默认样式
  2138. else
  2139. ui.checkBoxPickBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  2140. }
  2141. if (m_curCalibPlaceParam.iId == m_curBondParam.iId) {
  2142. m_curCalibPlaceParam.bCheckBlock = isChecked;
  2143. ui.checkBoxBondBlockCheck->setChecked(m_curCalibPlaceParam.bCheckBlock);
  2144. // 更新样式
  2145. if (m_curCalibPlaceParam.bCheckBlock == m_tempCalibPlaceParam.bCheckBlock)
  2146. ui.checkBoxBondBlockCheck->setStyleSheet(""); // 恢复默认样式
  2147. else
  2148. ui.checkBoxBondBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红
  2149. }
  2150. }
  2151. void BondMatrixProgramPage::onCheckBoxBondLoseCheck_2Clicked(bool isChecked)
  2152. {
  2153. m_curBondParam.bCheckLose = isChecked;
  2154. // 更新样式
  2155. if (m_curBondParam.bCheckLose == m_tempBondParam.bCheckLose)
  2156. ui.checkBoxBondLoseCheck_2->setStyleSheet(""); // 恢复默认样式
  2157. else
  2158. ui.checkBoxBondLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  2159. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2160. m_curWaferPickParam.bCheckLose = isChecked;
  2161. ui.checkBoxPickLoseCheck->setChecked(m_curWaferPickParam.bCheckLose);
  2162. // 更新样式
  2163. if (m_curWaferPickParam.bCheckLose == m_tempWaferPickParam.bCheckLose)
  2164. ui.checkBoxPickLoseCheck->setStyleSheet(""); // 恢复默认样式
  2165. else
  2166. ui.checkBoxPickLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红
  2167. }
  2168. if (m_curCalibPickParam.iId == m_curBondParam.iId) {
  2169. m_curCalibPickParam.bCheckLose = isChecked;
  2170. ui.checkBoxPickLoseCheck_2->setChecked(m_curCalibPickParam.bCheckLose);
  2171. // 更新样式
  2172. if (m_curCalibPickParam.bCheckLose == m_tempCalibPickParam.bCheckLose)
  2173. ui.checkBoxPickLoseCheck_2->setStyleSheet(""); // 恢复默认样式
  2174. else
  2175. ui.checkBoxPickLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  2176. }
  2177. if (m_curCalibPlaceParam.iId == m_curBondParam.iId) {
  2178. m_curCalibPlaceParam.bCheckLose = isChecked;
  2179. ui.checkBoxBondLoseCheck->setChecked(m_curCalibPlaceParam.bCheckLose);
  2180. // 更新样式
  2181. if (m_curCalibPlaceParam.bCheckLose == m_tempCalibPlaceParam.bCheckLose)
  2182. ui.checkBoxBondLoseCheck->setStyleSheet(""); // 恢复默认样式
  2183. else
  2184. ui.checkBoxBondLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红
  2185. }
  2186. }
  2187. void BondMatrixProgramPage::onCheckBoxBondFindForce_2Clicked(bool isChecked)
  2188. {
  2189. m_curBondParam.bFindForce = isChecked;
  2190. ui.doubleSpinBoxBondPosZ_2->setEnabled(!isChecked);
  2191. // 更新样式
  2192. if (m_curBondParam.bFindForce == m_tempBondParam.bFindForce)
  2193. ui.checkBoxBondFindForce_2->setStyleSheet(""); // 恢复默认样式
  2194. else
  2195. ui.checkBoxBondFindForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  2196. // 同步其他控件并处理样式
  2197. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2198. m_curWaferPickParam.bFindForce = isChecked;
  2199. ui.checkBoxPickFindForceCheck->setChecked(m_curWaferPickParam.bFindForce);
  2200. // 更新样式
  2201. if (m_curWaferPickParam.bFindForce == m_tempWaferPickParam.bFindForce)
  2202. ui.checkBoxPickFindForceCheck->setStyleSheet(""); // 恢复默认样式
  2203. else
  2204. ui.checkBoxPickFindForceCheck->setStyleSheet("color: red;"); // 字体颜色变红
  2205. ui.doubleSpinBoxPickPosZ->setEnabled(!isChecked);
  2206. }
  2207. if (m_curCalibPickParam.iId == m_curBondParam.iId) {
  2208. m_curCalibPickParam.bFindForce = isChecked;
  2209. ui.checkBoxPickFindForceCheck_2->setChecked(m_curCalibPickParam.bFindForce);
  2210. // 更新样式
  2211. if (m_curCalibPickParam.bFindForce == m_tempCalibPickParam.bFindForce)
  2212. ui.checkBoxPickFindForceCheck_2->setStyleSheet(""); // 恢复默认样式
  2213. else
  2214. ui.checkBoxPickFindForceCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  2215. ui.doubleSpinBoxPickPosZ_2->setEnabled(!isChecked);
  2216. }
  2217. if (m_curCalibPlaceParam.iId == m_curBondParam.iId) {
  2218. m_curCalibPlaceParam.bFindForce = isChecked;
  2219. ui.checkBoxBondFindForce->setChecked(m_curCalibPlaceParam.bFindForce);
  2220. // 更新样式
  2221. if (m_curCalibPlaceParam.bFindForce == m_tempCalibPlaceParam.bFindForce)
  2222. ui.checkBoxBondFindForce->setStyleSheet(""); // 恢复默认样式
  2223. else
  2224. ui.checkBoxBondFindForce->setStyleSheet("color: red;"); // 字体颜色变红
  2225. ui.doubleSpinBoxBondPosZ->setEnabled(!isChecked);
  2226. }
  2227. }
  2228. void BondMatrixProgramPage::onDoubleSpinBoxPreBondPosZ_2EditingFinished()
  2229. {
  2230. m_curBondParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ_2->value();
  2231. // 更新样式
  2232. if (m_curBondParam.dPreLevOffset == m_tempBondParam.dPreLevOffset)
  2233. ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet(""); // 恢复默认样式
  2234. else
  2235. ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  2236. // 同步其他控件并处理样式
  2237. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2238. m_curWaferPickParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ_2->value();
  2239. ui.doubleSpinBoxPrePickZ->setValue(m_curWaferPickParam.dPreLevOffset);
  2240. // 更新样式
  2241. if (m_curWaferPickParam.dPreLevOffset == m_tempWaferPickParam.dPreLevOffset)
  2242. ui.doubleSpinBoxPrePickZ->setStyleSheet(""); // 恢复默认样式
  2243. else
  2244. ui.doubleSpinBoxPrePickZ->setStyleSheet("color: red;"); // 字体颜色变红
  2245. }
  2246. if (m_curCalibPickParam.iId == m_curBondParam.iId) {
  2247. m_curCalibPickParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ_2->value();
  2248. ui.doubleSpinBoxPrePickZ_2->setValue(m_curCalibPickParam.dPreLevOffset);
  2249. // 更新样式
  2250. if (m_curCalibPickParam.dPreLevOffset == m_tempCalibPickParam.dPreLevOffset)
  2251. ui.doubleSpinBoxPrePickZ_2->setStyleSheet(""); // 恢复默认样式
  2252. else
  2253. ui.doubleSpinBoxPrePickZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  2254. }
  2255. if (m_curCalibPlaceParam.iId == m_curBondParam.iId) {
  2256. m_curCalibPlaceParam.dPreLevOffset = ui.doubleSpinBoxPreBondPosZ_2->value();
  2257. ui.doubleSpinBoxPreBondPosZ->setValue(m_curCalibPlaceParam.dPreLevOffset);
  2258. // 更新样式
  2259. if (m_curCalibPlaceParam.dPreLevOffset == m_tempCalibPlaceParam.dPreLevOffset)
  2260. ui.doubleSpinBoxPreBondPosZ->setStyleSheet(""); // 恢复默认样式
  2261. else
  2262. ui.doubleSpinBoxPreBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  2263. }
  2264. }
  2265. void BondMatrixProgramPage::onDoubleSpinBoxBondForce_2EditingFinished()
  2266. {
  2267. m_curBondParam.dForce = ui.doubleSpinBoxBondForce_2->value();
  2268. // 更新样式
  2269. if (m_curBondParam.dForce == m_tempBondParam.dForce)
  2270. ui.doubleSpinBoxBondForce_2->setStyleSheet(""); // 恢复默认样式
  2271. else
  2272. ui.doubleSpinBoxBondForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  2273. // 同步其他控件并处理样式
  2274. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2275. m_curWaferPickParam.dForce = ui.doubleSpinBoxBondForce_2->value();
  2276. ui.doubleSpinBoxPickForce->setValue(m_curWaferPickParam.dForce);
  2277. // 更新样式
  2278. if (m_curWaferPickParam.dForce == m_tempWaferPickParam.dForce)
  2279. ui.doubleSpinBoxPickForce->setStyleSheet(""); // 恢复默认样式
  2280. else
  2281. ui.doubleSpinBoxPickForce->setStyleSheet("color: red;"); // 字体颜色变红
  2282. }
  2283. if (m_curCalibPickParam.iId == m_curBondParam.iId) {
  2284. m_curCalibPickParam.dForce = ui.doubleSpinBoxBondForce_2->value();
  2285. ui.doubleSpinBoxPickForce_2->setValue(m_curCalibPickParam.dForce);
  2286. // 更新样式
  2287. if (m_curCalibPickParam.dForce == m_tempCalibPickParam.dForce)
  2288. ui.doubleSpinBoxPickForce_2->setStyleSheet(""); // 恢复默认样式
  2289. else
  2290. ui.doubleSpinBoxPickForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  2291. }
  2292. if (m_curCalibPlaceParam.iId == m_curBondParam.iId) {
  2293. m_curCalibPlaceParam.dForce = ui.doubleSpinBoxBondForce_2->value();
  2294. ui.doubleSpinBoxBondForce->setValue(m_curCalibPlaceParam.dForce);
  2295. // 更新样式
  2296. if (m_curCalibPlaceParam.dForce == m_tempCalibPlaceParam.dForce)
  2297. ui.doubleSpinBoxBondForce->setStyleSheet(""); // 恢复默认样式
  2298. else
  2299. ui.doubleSpinBoxBondForce->setStyleSheet("color: red;"); // 字体颜色变红
  2300. }
  2301. }
  2302. void BondMatrixProgramPage::onDoubleSpinBoxBondPosZ_2EditingFinished()
  2303. {
  2304. m_curBondParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ_2->value();
  2305. // 更新样式
  2306. if (m_curBondParam.dWorkLevOffset == m_tempBondParam.dWorkLevOffset)
  2307. ui.doubleSpinBoxBondPosZ_2->setStyleSheet(""); // 恢复默认样式
  2308. else
  2309. ui.doubleSpinBoxBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  2310. // 同步其他控件并处理样式
  2311. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2312. m_curWaferPickParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ_2->value();
  2313. ui.doubleSpinBoxPickPosZ->setValue(m_curWaferPickParam.dWorkLevOffset);
  2314. // 更新样式
  2315. if (m_curWaferPickParam.dWorkLevOffset == m_tempWaferPickParam.dWorkLevOffset)
  2316. ui.doubleSpinBoxPickPosZ->setStyleSheet(""); // 恢复默认样式
  2317. else
  2318. ui.doubleSpinBoxPickPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  2319. }
  2320. if (m_curCalibPickParam.iId == m_curBondParam.iId) {
  2321. m_curCalibPickParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ_2->value();
  2322. ui.doubleSpinBoxPickPosZ_2->setValue(m_curCalibPickParam.dWorkLevOffset);
  2323. // 更新样式
  2324. if (m_curCalibPickParam.dWorkLevOffset == m_tempCalibPickParam.dWorkLevOffset)
  2325. ui.doubleSpinBoxPickPosZ_2->setStyleSheet(""); // 恢复默认样式
  2326. else
  2327. ui.doubleSpinBoxPickPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  2328. }
  2329. if (m_curCalibPlaceParam.iId == m_curBondParam.iId) {
  2330. m_curCalibPlaceParam.dWorkLevOffset = ui.doubleSpinBoxBondPosZ_2->value();
  2331. ui.doubleSpinBoxBondPosZ->setValue(m_curCalibPlaceParam.dWorkLevOffset);
  2332. // 更新样式
  2333. if (m_curCalibPlaceParam.dWorkLevOffset == m_tempCalibPlaceParam.dWorkLevOffset)
  2334. ui.doubleSpinBoxBondPosZ->setStyleSheet(""); // 恢复默认样式
  2335. else
  2336. ui.doubleSpinBoxBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  2337. }
  2338. }
  2339. void BondMatrixProgramPage::onSpinBoxBondGrabDelay_2EditingFinished()
  2340. {
  2341. m_curBondParam.iGrabDelay = ui.spinBoxBondGrabDelay_2->value();
  2342. // 更新样式
  2343. if (m_curBondParam.iGrabDelay == m_tempBondParam.iGrabDelay)
  2344. ui.spinBoxBondGrabDelay_2->setStyleSheet(""); // 恢复默认样式
  2345. else
  2346. ui.spinBoxBondGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2347. // 同步其他控件并处理样式
  2348. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2349. m_curWaferPickParam.iGrabDelay = ui.spinBoxBondGrabDelay_2->value();
  2350. ui.spinBoxPickGrabDelay->setValue(m_curWaferPickParam.iGrabDelay);
  2351. // 更新样式
  2352. if (m_curWaferPickParam.iGrabDelay == m_tempWaferPickParam.iGrabDelay)
  2353. ui.spinBoxPickGrabDelay->setStyleSheet(""); // 恢复默认样式
  2354. else
  2355. ui.spinBoxPickGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2356. }
  2357. if (m_curCalibPickParam.iId == m_curBondParam.iId) {
  2358. m_curCalibPickParam.iGrabDelay = ui.spinBoxBondGrabDelay_2->value();
  2359. ui.spinBoxPickGrabDelay_2->setValue(m_curCalibPickParam.iGrabDelay);
  2360. // 更新样式
  2361. if (m_curCalibPickParam.iGrabDelay == m_tempCalibPickParam.iGrabDelay)
  2362. ui.spinBoxPickGrabDelay_2->setStyleSheet(""); // 恢复默认样式
  2363. else
  2364. ui.spinBoxPickGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2365. }
  2366. if (m_curCalibPlaceParam.iId == m_curBondParam.iId) {
  2367. m_curCalibPlaceParam.iGrabDelay = ui.spinBoxBondGrabDelay_2->value();
  2368. ui.spinBoxBondGrabDelay->setValue(m_curCalibPlaceParam.iGrabDelay);
  2369. // 更新样式
  2370. if (m_curCalibPlaceParam.iGrabDelay == m_tempCalibPlaceParam.iGrabDelay)
  2371. ui.spinBoxBondGrabDelay->setStyleSheet(""); // 恢复默认样式
  2372. else
  2373. ui.spinBoxBondGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2374. }
  2375. }
  2376. void BondMatrixProgramPage::onSpinBoxBondBlockCheckDelay_2EditingFinished()
  2377. {
  2378. m_curBondParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay_2->value();
  2379. // 更新样式
  2380. if (m_curBondParam.iBlockOrLoseDelay == m_tempBondParam.iBlockOrLoseDelay)
  2381. ui.spinBoxBondBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式
  2382. else
  2383. ui.spinBoxBondBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2384. // 同步其他控件并处理样式
  2385. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2386. m_curWaferPickParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay_2->value();
  2387. ui.spinBoxPickBlockCheckDelay->setValue(m_curWaferPickParam.iBlockOrLoseDelay);
  2388. // 更新样式
  2389. if (m_curWaferPickParam.iBlockOrLoseDelay == m_tempWaferPickParam.iBlockOrLoseDelay)
  2390. ui.spinBoxPickBlockCheckDelay->setStyleSheet(""); // 恢复默认样式
  2391. else
  2392. ui.spinBoxPickBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2393. }
  2394. if (m_curCalibPickParam.iId == m_curBondParam.iId) {
  2395. m_curCalibPickParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay_2->value();
  2396. ui.spinBoxPickBlockCheckDelay_2->setValue(m_curCalibPickParam.iBlockOrLoseDelay);
  2397. // 更新样式
  2398. if (m_curCalibPickParam.iBlockOrLoseDelay == m_tempCalibPickParam.iBlockOrLoseDelay)
  2399. ui.spinBoxPickBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式
  2400. else
  2401. ui.spinBoxPickBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2402. }
  2403. if (m_curCalibPlaceParam.iId == m_curBondParam.iId) {
  2404. m_curCalibPlaceParam.iBlockOrLoseDelay = ui.spinBoxBondBlockCheckDelay_2->value();
  2405. ui.spinBoxBondBlockCheckDelay->setValue(m_curCalibPlaceParam.iBlockOrLoseDelay);
  2406. // 更新样式
  2407. if (m_curCalibPlaceParam.iBlockOrLoseDelay == m_tempCalibPlaceParam.iBlockOrLoseDelay)
  2408. ui.spinBoxBondBlockCheckDelay->setStyleSheet(""); // 恢复默认样式
  2409. else
  2410. ui.spinBoxBondBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2411. }
  2412. }
  2413. void BondMatrixProgramPage::onSpinBoxBondDelay_2EditingFinished()
  2414. {
  2415. m_curBondParam.iPickOrBondDelay = ui.spinBoxBondDelay_2->value();
  2416. // 更新样式
  2417. if (m_curBondParam.iPickOrBondDelay == m_tempBondParam.iPickOrBondDelay)
  2418. ui.spinBoxBondDelay_2->setStyleSheet(""); // 恢复默认样式
  2419. else
  2420. ui.spinBoxBondDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2421. // 同步其他控件并处理样式
  2422. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2423. m_curWaferPickParam.iPickOrBondDelay = ui.spinBoxBondDelay_2->value();
  2424. ui.spinBoxPickDelay->setValue(m_curWaferPickParam.iPickOrBondDelay);
  2425. // 更新样式
  2426. if (m_curWaferPickParam.iPickOrBondDelay == m_tempWaferPickParam.iPickOrBondDelay)
  2427. ui.spinBoxPickDelay->setStyleSheet(""); // 恢复默认样式
  2428. else
  2429. ui.spinBoxPickDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2430. }
  2431. if (m_curCalibPickParam.iId == m_curBondParam.iId) {
  2432. m_curCalibPickParam.iPickOrBondDelay = ui.spinBoxBondDelay_2->value();
  2433. ui.spinBoxPickDelay_2->setValue(m_curCalibPickParam.iPickOrBondDelay);
  2434. // 更新样式
  2435. if (m_curCalibPickParam.iPickOrBondDelay == m_tempCalibPickParam.iPickOrBondDelay)
  2436. ui.spinBoxPickDelay_2->setStyleSheet(""); // 恢复默认样式
  2437. else
  2438. ui.spinBoxPickDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2439. }
  2440. if (m_curCalibPlaceParam.iId == m_curBondParam.iId) {
  2441. m_curCalibPlaceParam.iPickOrBondDelay = ui.spinBoxBondDelay_2->value();
  2442. ui.spinBoxBondDelay->setValue(m_curCalibPlaceParam.iPickOrBondDelay);
  2443. // 更新样式
  2444. if (m_curCalibPlaceParam.iPickOrBondDelay == m_tempCalibPlaceParam.iPickOrBondDelay)
  2445. ui.spinBoxBondDelay->setStyleSheet(""); // 恢复默认样式
  2446. else
  2447. ui.spinBoxBondDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2448. }
  2449. }
  2450. void BondMatrixProgramPage::onSpinBoxBondVacDelay_2EditingFinished()
  2451. {
  2452. m_curBondParam.iVacuumDelay = ui.spinBoxBondVacDelay_2->value();
  2453. // 更新样式
  2454. if (m_curBondParam.iVacuumDelay == m_tempBondParam.iVacuumDelay)
  2455. ui.spinBoxBondVacDelay_2->setStyleSheet(""); // 恢复默认样式
  2456. else
  2457. ui.spinBoxBondVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2458. // 同步其他控件并处理样式
  2459. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2460. m_curWaferPickParam.iVacuumDelay = ui.spinBoxBondVacDelay_2->value();
  2461. ui.spinBoxPickVacDelay->setValue(m_curWaferPickParam.iVacuumDelay);
  2462. // 更新样式
  2463. if (m_curWaferPickParam.iVacuumDelay == m_tempWaferPickParam.iVacuumDelay)
  2464. ui.spinBoxPickVacDelay->setStyleSheet(""); // 恢复默认样式
  2465. else
  2466. ui.spinBoxPickVacDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2467. }
  2468. if (m_curCalibPickParam.iId == m_curBondParam.iId) {
  2469. m_curCalibPickParam.iVacuumDelay = ui.spinBoxBondVacDelay_2->value();
  2470. ui.spinBoxPickVacDelay_2->setValue(m_curCalibPickParam.iVacuumDelay);
  2471. // 更新样式
  2472. if (m_curCalibPickParam.iVacuumDelay == m_tempCalibPickParam.iVacuumDelay)
  2473. ui.spinBoxPickVacDelay_2->setStyleSheet(""); // 恢复默认样式
  2474. else
  2475. ui.spinBoxPickVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2476. }
  2477. if (m_curCalibPlaceParam.iId == m_curBondParam.iId) {
  2478. m_curCalibPlaceParam.iVacuumDelay = ui.spinBoxBondVacDelay_2->value();
  2479. ui.spinBoxBondVacDelay->setValue(m_curCalibPlaceParam.iVacuumDelay);
  2480. // 更新样式
  2481. if (m_curCalibPlaceParam.iVacuumDelay == m_tempCalibPlaceParam.iVacuumDelay)
  2482. ui.spinBoxBondVacDelay->setStyleSheet(""); // 恢复默认样式
  2483. else
  2484. ui.spinBoxBondVacDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2485. }
  2486. }
  2487. void BondMatrixProgramPage::onSpinBoxBondBlowDelay_2EditingFinished()
  2488. {
  2489. m_curBondParam.iBlowDelay = ui.spinBoxBondBlowDelay_2->value();
  2490. // 更新样式
  2491. if (m_curBondParam.iBlowDelay == m_tempBondParam.iBlowDelay)
  2492. ui.spinBoxBondBlowDelay_2->setStyleSheet(""); // 恢复默认样式
  2493. else
  2494. ui.spinBoxBondBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2495. // 同步其他控件并处理样式
  2496. if (m_curBondParam.iId == m_curWaferPickParam.iId) {
  2497. m_curWaferPickParam.iBlowDelay = ui.spinBoxBondBlowDelay_2->value();
  2498. ui.spinBoxPickBlowDelay->setValue(m_curWaferPickParam.iBlowDelay);
  2499. // 更新样式
  2500. if (m_curWaferPickParam.iBlowDelay == m_tempWaferPickParam.iBlowDelay)
  2501. ui.spinBoxPickBlowDelay->setStyleSheet(""); // 恢复默认样式
  2502. else
  2503. ui.spinBoxPickBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2504. }
  2505. if (m_curCalibPickParam.iId == m_curBondParam.iId) {
  2506. m_curCalibPickParam.iBlowDelay = ui.spinBoxBondBlowDelay_2->value();
  2507. ui.spinBoxPickBlowDelay_2->setValue(m_curCalibPickParam.iBlowDelay);
  2508. // 更新样式
  2509. if (m_curCalibPickParam.iBlowDelay == m_tempCalibPickParam.iBlowDelay)
  2510. ui.spinBoxPickBlowDelay_2->setStyleSheet(""); // 恢复默认样式
  2511. else
  2512. ui.spinBoxPickBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  2513. }
  2514. if (m_curCalibPlaceParam.iId == m_curBondParam.iId) {
  2515. m_curCalibPlaceParam.iBlowDelay = ui.spinBoxBondBlowDelay_2->value();
  2516. ui.spinBoxBondBlowDelay->setValue(m_curCalibPlaceParam.iBlowDelay);
  2517. // 更新样式
  2518. if (m_curCalibPlaceParam.iBlowDelay == m_tempCalibPlaceParam.iBlowDelay)
  2519. ui.spinBoxBondBlowDelay->setStyleSheet(""); // 恢复默认样式
  2520. else
  2521. ui.spinBoxBondBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红
  2522. }
  2523. }
  2524. XY_DOUBLE_STRUCT BondMatrixProgramPage::BondGetAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos)
  2525. {
  2526. /*CAxis* _Axis;
  2527. CAxis::AXIS_TYPE eAxisType = _Axis->GetAxisType();*/
  2528. if (m_pProgramCViewInterface == nullptr)
  2529. {
  2530. XY_DOUBLE_STRUCT errorPt = pos; // 可以根据需要返回一个错误状态
  2531. // 弹出消息框显示位置
  2532. QString positionString = QString("Unable to retrieve axis position for module type: %1").arg(QString::fromStdString(ModuleType));
  2533. QMessageBox::information(this, "Axis Position Error", positionString);
  2534. return errorPt;
  2535. }
  2536. m_pProgramCViewInterface->GetViewMotion()->GetAxisPosition(ModuleType, "X", pos.x);
  2537. m_pProgramCViewInterface->GetViewMotion()->GetAxisPosition(ModuleType, "Y", pos.y);
  2538. return pos;
  2539. }
  2540. XY_DOUBLE_STRUCT BondMatrixProgramPage::BondMoveToXYAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos)
  2541. {
  2542. if (m_pProgramCViewInterface == nullptr)
  2543. {
  2544. XY_DOUBLE_STRUCT errorPt = pos; // 可以根据需要返回一个错误状态
  2545. // 弹出消息框显示位置
  2546. QString positionString = QString("Unable to retrieve axis position for module type: %1").arg(QString::fromStdString(ModuleType));
  2547. QMessageBox::information(this, "Axis Position Error", positionString);
  2548. return errorPt;
  2549. }
  2550. m_pProgramCViewInterface->GetViewMotion()->ModuleMoveTo(ModuleType, "X", pos.x);
  2551. m_pProgramCViewInterface->GetViewMotion()->ModuleMoveTo(ModuleType, "Y", pos.y);
  2552. return pos;
  2553. }
  2554. void BondMatrixProgramPage::AddOutMatrixPage(int vectorIndex, PROGRAM_BOND_MATRIX_STRUCT matrixData, std::vector<PROGRAM_POINT_MATRIX_STRUCT> vecSubMatrix)
  2555. {
  2556. int matrixNum = m_mapSubMatrixControls.size();
  2557. int newMatrixID = ++matrixNum;
  2558. QVector<QObject*> vecControls;
  2559. QWidget* outWidget = new QWidget();
  2560. QGridLayout* outMatrixGridLayout = new QGridLayout();
  2561. outMatrixGridLayout->setSpacing(4);
  2562. outMatrixGridLayout->setObjectName(QString::fromUtf8("Out GridLayout"));
  2563. outMatrixGridLayout->setContentsMargins(0, 0, 0, 0); // 设置布局的边距为0
  2564. QGridLayout* boxGridLayout = new QGridLayout();
  2565. boxGridLayout->setSpacing(4);
  2566. boxGridLayout->setObjectName(QString::fromUtf8("Box GridLayout"));
  2567. boxGridLayout->setContentsMargins(0, 0, 0, 0); // 设置布局的边距为0
  2568. QHBoxLayout* buttonLayout = new QHBoxLayout();
  2569. QSpacerItem* item = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
  2570. buttonLayout->addSpacerItem(item);
  2571. QGroupBox* groupBox = new QGroupBox(outWidget);
  2572. groupBox->setLayout(boxGridLayout);
  2573. QGridLayout* matrixGridLayout = new QGridLayout();
  2574. matrixGridLayout->setSpacing(4);
  2575. matrixGridLayout->setObjectName(QString::fromUtf8("matrixGridLayout"));
  2576. matrixGridLayout->setContentsMargins(0, 0, 0, 0); // 设置布局的边距为0
  2577. // Add matrix title
  2578. QLabel* labelTitle = new QLabel(outWidget);
  2579. labelTitle->setObjectName(QString::fromUtf8("labelTitle"));
  2580. labelTitle->setText(tr("Bond Matrix ") + QString::number(vectorIndex+1));
  2581. labelTitle->setStyleSheet("color: #6A78FF;height: 30px");
  2582. matrixGridLayout->addWidget(labelTitle, 0, 0, 1, 1);
  2583. vecControls.push_back(labelTitle);
  2584. // Add "Add Sub Matrix" button
  2585. QPushButton* pushButtonAdd = new QPushButton(outWidget);
  2586. pushButtonAdd->setObjectName(QString::fromUtf8("button Add"));
  2587. pushButtonAdd->setText(tr("Add sub Matrix"));
  2588. matrixGridLayout->addWidget(pushButtonAdd, 0, 2, 1, 3);
  2589. pushButtonAdd->setProperty("type", "default");
  2590. connect(pushButtonAdd, &QPushButton::clicked, this, [=]() {
  2591. int newSubMatrixIndex = m_vecSubMatrixs.size();
  2592. PROGRAM_POINT_MATRIX_STRUCT subMatrix;
  2593. std::sort(m_vecSubMatrixs.begin(), m_vecSubMatrixs.end(),
  2594. [](const PROGRAM_POINT_MATRIX_STRUCT& a, const PROGRAM_POINT_MATRIX_STRUCT& b) {
  2595. return a.MatrixId < b.MatrixId;
  2596. });
  2597. int newSubMatrixID = 0;
  2598. UINT maxID = 0;
  2599. // 查找最大 MatrixId
  2600. for (PROGRAM_POINT_MATRIX_STRUCT& subMatrix : m_vecSubMatrixs)
  2601. {
  2602. if (subMatrix.MatrixId > maxID)
  2603. {
  2604. maxID = subMatrix.MatrixId;
  2605. }
  2606. }
  2607. newSubMatrixID = ++maxID;
  2608. while (std::any_of(m_vecSubMatrixs.begin(), m_vecSubMatrixs.end(),
  2609. [newSubMatrixID](const PROGRAM_POINT_MATRIX_STRUCT& subMatrix) {
  2610. return subMatrix.MatrixId == newSubMatrixID;
  2611. }))
  2612. {
  2613. newSubMatrixID++; // 如果生成的 ID 已经存在,递增直到找到唯一的 ID
  2614. }
  2615. subMatrix.MatrixId = newSubMatrixID;
  2616. subMatrix.strModuleName = "BondHead";
  2617. subMatrix.iModuleId = MODULE_LIST::BondHead;
  2618. subMatrix.MatrixRow = 0;
  2619. subMatrix.MatrixCol = 0;
  2620. m_vecSubMatrixs.push_back(subMatrix);
  2621. // Add the submatrix to the bond matrix's VecPointMatrixId
  2622. //找大矩阵ID/Index
  2623. auto currentIt = m_mapOutWidgetIndex.find(outWidget);
  2624. int bondMatrixId = currentIt.value(); //迭代器 erase后currentIt被删除了
  2625. //m_vectBondMatrixs[index].VecPointMatrixId.push_back(newSubMatrixID);
  2626. // 遍历 m_vectBondMatrixs 找到对应的矩阵
  2627. for (size_t i = 0; i < m_vectBondMatrixs.size(); ++i) {
  2628. if (m_vectBondMatrixs[i].BondMatrixId == bondMatrixId) {
  2629. // 找到对应的矩阵,添加新的子矩阵 ID
  2630. m_vectBondMatrixs[i].VecPointMatrixId.push_back(newSubMatrixID);
  2631. break; // 找到后退出循环
  2632. }
  2633. }
  2634. AddMatrixPage(bondMatrixId, newSubMatrixIndex, subMatrix, outMatrixGridLayout);
  2635. });
  2636. // Add Delete Out Matrix button
  2637. QPushButton* pushButtonDelete = new QPushButton(outWidget);
  2638. pushButtonDelete->setObjectName(QString::fromUtf8("button delete"));
  2639. pushButtonDelete->setText(tr("Delete"));
  2640. matrixGridLayout->addWidget(pushButtonDelete, 0, 1, 1, 1);
  2641. connect(pushButtonDelete, &QPushButton::clicked, this, [=]() {
  2642. //处理index
  2643. auto currentIt = m_mapOutWidgetIndex.find(outWidget);
  2644. int index = currentIt.value(); //迭代器 erase后currentIt被删除了
  2645. m_mapOutWidgetIndex.erase(currentIt);
  2646. delete outWidget;
  2647. ui.comboBoxCurrentMatrix->clear();
  2648. for (int i = 0; i < m_vectBondMatrixs.size(); i++)
  2649. {
  2650. int bondMatrixId = m_vectBondMatrixs[i].BondMatrixId;
  2651. // 显示 矩阵编号
  2652. QString itemText = QString::number(bondMatrixId);
  2653. if (bondMatrixId == index) {
  2654. //删除缓存数据
  2655. m_vectBondMatrixs.erase(m_vectBondMatrixs.begin() + i);
  2656. continue;
  2657. }
  2658. // 将 矩阵编号 添加到下拉框
  2659. ui.comboBoxCurrentMatrix->addItem(itemText, bondMatrixId);
  2660. }
  2661. if (!m_vectBondMatrixs.empty()) {
  2662. ShowCurrentMatrix(m_vectBondMatrixs[0].BondMatrixId);
  2663. }
  2664. });
  2665. // Add Row and Column controls
  2666. QLabel* labelRow = new QLabel(outWidget);
  2667. labelRow->setObjectName(QString::fromUtf8("labelRow"));
  2668. labelRow->setText(tr("Row & Cow"));
  2669. matrixGridLayout->addWidget(labelRow, 2, 0, 1, 1);
  2670. vecControls.push_back(labelRow);
  2671. SpinBox* spinBoxRow = new SpinBox(outWidget);
  2672. spinBoxRow->setObjectName(QString::fromUtf8("spinBoxRow"));
  2673. spinBoxRow->setFixedWidth(95); // Set fixed width to 95
  2674. matrixGridLayout->addWidget(spinBoxRow, 2, 1, 1, 1);
  2675. vecControls.push_back(spinBoxRow);
  2676. SpinBox* spinBoxCol = new SpinBox(outWidget);
  2677. spinBoxCol->setObjectName(QString::fromUtf8("spinBoxCol"));
  2678. spinBoxCol->setFixedWidth(95); // Set fixed width to 95
  2679. matrixGridLayout->addWidget(spinBoxCol, 2, 2, 1, 1);
  2680. vecControls.push_back(spinBoxCol);
  2681. // Add Left Top Position controls
  2682. QLabel* labelLeftTop = new QLabel(outWidget);
  2683. labelLeftTop->setObjectName(QString::fromUtf8("labelLeftTop"));
  2684. labelLeftTop->setText(tr("Left Top Pos "));
  2685. matrixGridLayout->addWidget(labelLeftTop, 4, 0, 1, 1);
  2686. vecControls.push_back(labelLeftTop);
  2687. DoubleSpinBox* doubleSpinBoxLeftTopX = new DoubleSpinBox(outWidget);
  2688. doubleSpinBoxLeftTopX->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopX"));
  2689. doubleSpinBoxLeftTopX->setFixedWidth(95); // Set fixed width to 95
  2690. matrixGridLayout->addWidget(doubleSpinBoxLeftTopX, 4, 1, 1, 1);
  2691. vecControls.push_back(doubleSpinBoxLeftTopX);
  2692. DoubleSpinBox* doubleSpinBoxLeftTopY = new DoubleSpinBox(outWidget);
  2693. doubleSpinBoxLeftTopY->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopY"));
  2694. doubleSpinBoxLeftTopY->setFixedWidth(95); // Set fixed width to 95
  2695. matrixGridLayout->addWidget(doubleSpinBoxLeftTopY, 4, 2, 1, 1);
  2696. vecControls.push_back(doubleSpinBoxLeftTopY);
  2697. // Add GP button for Left Top
  2698. QPushButton* buttonLeftTop = new QPushButton("GP", this);
  2699. buttonLeftTop->setFixedWidth(31); // Set the same width for the button
  2700. matrixGridLayout->addWidget(buttonLeftTop, 4, 3, 1, 1); // Position the button next to LeftTopPos
  2701. connect(buttonLeftTop, &QPushButton::clicked, this, [=]() {
  2702. XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondHead", m_vectBondMatrixs[vectorIndex].LeftTopPoint);
  2703. doubleSpinBoxLeftTopX->setValue(position.x);
  2704. doubleSpinBoxLeftTopY->setValue(position.y);
  2705. });
  2706. QPushButton* buttonMoveToLeftTop = new QPushButton("MT", this);
  2707. buttonMoveToLeftTop->setFixedWidth(31); // Set the same width for the button
  2708. matrixGridLayout->addWidget(buttonMoveToLeftTop, 4, 4, 1, 1); // Position the button next to LeftTopPos
  2709. connect(buttonMoveToLeftTop, &QPushButton::clicked, this, [=]() {
  2710. XY_DOUBLE_STRUCT position = BondMoveToXYAxisPosition("BondHead", m_vectBondMatrixs[vectorIndex].LeftTopPoint);
  2711. });
  2712. // Add Right Top Position controls
  2713. QLabel* labelRightTopPos = new QLabel(outWidget);
  2714. labelRightTopPos->setObjectName(QString::fromUtf8("labelRightTopPos"));
  2715. labelRightTopPos->setText(tr("Right Top Pos "));
  2716. matrixGridLayout->addWidget(labelRightTopPos, 5, 0, 1, 1);
  2717. vecControls.push_back(labelRightTopPos);
  2718. DoubleSpinBox* doubleSpinBoxRightTopX = new DoubleSpinBox(outWidget);
  2719. doubleSpinBoxRightTopX->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopX"));
  2720. doubleSpinBoxRightTopX->setFixedWidth(95); // Set fixed width to 95
  2721. matrixGridLayout->addWidget(doubleSpinBoxRightTopX, 5, 1, 1, 1);
  2722. vecControls.push_back(doubleSpinBoxRightTopX);
  2723. DoubleSpinBox* doubleSpinBoxRightTopY = new DoubleSpinBox(outWidget);
  2724. doubleSpinBoxRightTopY->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopY"));
  2725. doubleSpinBoxRightTopY->setFixedWidth(95); // Set fixed width to 95
  2726. matrixGridLayout->addWidget(doubleSpinBoxRightTopY, 5, 2, 1, 1);
  2727. vecControls.push_back(doubleSpinBoxRightTopY);
  2728. QPushButton* buttonRightTop = new QPushButton("GP", this);
  2729. buttonRightTop->setFixedWidth(31); // Set the same width for the button
  2730. matrixGridLayout->addWidget(buttonRightTop, 5, 3, 1, 1); // Position the button next to RightTopPos
  2731. connect(buttonRightTop, &QPushButton::clicked, this, [=]() {
  2732. XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondHead", m_vectBondMatrixs[vectorIndex].RightTopPoint);
  2733. doubleSpinBoxRightTopX->setValue(position.x);
  2734. doubleSpinBoxRightTopY->setValue(position.y);
  2735. });
  2736. QPushButton* buttonMoveToRightTop = new QPushButton("MT", this);
  2737. buttonMoveToRightTop->setFixedWidth(31);
  2738. matrixGridLayout->addWidget(buttonMoveToRightTop, 5, 4, 1, 1);
  2739. connect(buttonMoveToRightTop, &QPushButton::clicked, this, [=]() {
  2740. XY_DOUBLE_STRUCT position = BondMoveToXYAxisPosition("BondHead", m_vectBondMatrixs[vectorIndex].RightTopPoint);
  2741. });
  2742. // Add Right Bottom Position controls
  2743. QLabel* labelRightButtomPos = new QLabel(outWidget);
  2744. labelRightButtomPos->setObjectName(QString::fromUtf8("labelRightButtomPos"));
  2745. labelRightButtomPos->setText(tr("Right Buttom pos"));
  2746. matrixGridLayout->addWidget(labelRightButtomPos, 6, 0, 1, 1);
  2747. vecControls.push_back(labelRightButtomPos);
  2748. DoubleSpinBox* doubleSpinBoxRightButtomX = new DoubleSpinBox(outWidget);
  2749. doubleSpinBoxRightButtomX->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomX"));
  2750. doubleSpinBoxRightButtomX->setFixedWidth(95); // Set fixed width to 95
  2751. matrixGridLayout->addWidget(doubleSpinBoxRightButtomX, 6, 1, 1, 1);
  2752. vecControls.push_back(doubleSpinBoxRightButtomX);
  2753. DoubleSpinBox* doubleSpinBoxRightButtomY = new DoubleSpinBox(outWidget);
  2754. doubleSpinBoxRightButtomY->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomY"));
  2755. doubleSpinBoxRightButtomY->setFixedWidth(95); // Set fixed width to 95
  2756. matrixGridLayout->addWidget(doubleSpinBoxRightButtomY, 6, 2, 1, 1);
  2757. vecControls.push_back(doubleSpinBoxRightTopX);
  2758. QPushButton* buttonRightButtom = new QPushButton("GP", this);
  2759. buttonRightButtom->setFixedWidth(31); // Set the same width for the button
  2760. matrixGridLayout->addWidget(buttonRightButtom, 6, 3, 1, 1); // Position the button next to RightBottomPos
  2761. connect(buttonRightButtom, &QPushButton::clicked, this, [=]() {
  2762. XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondHead", m_vectBondMatrixs[vectorIndex].RightBottomPoint);
  2763. doubleSpinBoxRightButtomX->setValue(position.x);
  2764. doubleSpinBoxRightButtomY->setValue(position.y);
  2765. });
  2766. QPushButton* buttonMoveToRightButtom = new QPushButton("MT", this);
  2767. buttonMoveToRightButtom->setFixedWidth(31);
  2768. matrixGridLayout->addWidget(buttonMoveToRightButtom, 6, 4, 1, 1);
  2769. connect(buttonMoveToRightButtom, &QPushButton::clicked, this, [=]() {
  2770. XY_DOUBLE_STRUCT position = BondMoveToXYAxisPosition("BondHead", m_vectBondMatrixs[vectorIndex].RightBottomPoint);
  2771. });
  2772. // Add No Bond Points line edit
  2773. QLabel* labelNoBondPts = new QLabel(outWidget);
  2774. labelNoBondPts->setObjectName(QString::fromUtf8("labelNoBondPts"));
  2775. labelNoBondPts->setText(tr("No Bond Points"));
  2776. matrixGridLayout->addWidget(labelNoBondPts, 7, 0, 1, 1);
  2777. vecControls.push_back(labelNoBondPts);
  2778. QLineEdit* lineEditNoBondPts = new QLineEdit(outWidget);
  2779. lineEditNoBondPts->setObjectName(QString::fromUtf8("lineEditNoBondPts"));
  2780. matrixGridLayout->addWidget(lineEditNoBondPts, 7, 1, 1, 4);
  2781. vecControls.push_back(lineEditNoBondPts);
  2782. lineEditNoBondPts->setReadOnly(true);
  2783. lineEditNoBondPts->setCursor(Qt::PointingHandCursor);
  2784. lineEditNoBondPts->setProperty("vectorIndex", vectorIndex); // 存储索引
  2785. lineEditNoBondPts->setProperty("parentMatrixIndex", -1); // 设置父矩阵的索引
  2786. lineEditNoBondPts->installEventFilter(this);
  2787. QStringList ptList;
  2788. for (const auto& pt : m_vectBondMatrixs[vectorIndex].VecNoBondPt)
  2789. ptList << QString("(%1,%2)").arg(pt.x).arg(pt.y);
  2790. lineEditNoBondPts->setText(ptList.join(" "));
  2791. // Paragram line edit
  2792. QLabel* labelParagram = new QLabel(outWidget);
  2793. labelParagram->setObjectName(QString::fromUtf8("labelParagram"));
  2794. labelParagram->setText(tr("ParagramSet"));
  2795. matrixGridLayout->addWidget(labelParagram, 8, 0, 1, 1);
  2796. vecControls.push_back(labelParagram);
  2797. QComboBox* comboBoxParagramSet = new QComboBox(outWidget);
  2798. comboBoxParagramSet->setObjectName(QString::fromUtf8("comboBoxParagramSet"));
  2799. m_mapParagramSetComboBox.insert(comboBoxParagramSet, matrixData.BondMatrixId);
  2800. // 添加选项到下拉框并关联 iInfoId
  2801. for (const auto& bondMatrix : m_vecBondInfoData) {
  2802. // 将 iInfoId 作为显示项添加到下拉框
  2803. QString itemText = QString::number(bondMatrix.iInfoId); // 显示编号 iInfoId
  2804. // 添加项并使用 setData 存储 iInfoId 作为附加数据
  2805. comboBoxParagramSet->addItem(itemText, bondMatrix.iInfoId);
  2806. }
  2807. comboBoxParagramSet->setCurrentIndex(comboBoxParagramSet->findData(matrixData.BondInfoId)); // 设置默认项
  2808. ui.comboBoxCurrentPara->setCurrentIndex(ui.comboBoxCurrentPara->findData(matrixData.BondInfoId)); // 设置默认项
  2809. // 将下拉框添加到布局中
  2810. matrixGridLayout->addWidget(comboBoxParagramSet, 8, 1, 1, 1);
  2811. // 将控件保存到 vecControls 中
  2812. vecControls.push_back(comboBoxParagramSet);
  2813. // 连接 QComboBox 的信号和槽
  2814. connect(comboBoxParagramSet, SIGNAL(currentIndexChanged(int)), this, SLOT(onComboBoxIndexChangedForMatrixParam(int)));
  2815. comboBoxParagramSet->installEventFilter(this);
  2816. //QPushButton* buttonParagram = new QPushButton("ShowParagram", this);
  2817. ////buttonParagram->setFixedWidth(31); // Set the same width for the button
  2818. //matrixGridLayout->addWidget(buttonParagram, 8, 2, 1, 2); // Position the button next to RightBottomPos
  2819. //connect(buttonParagram, &QPushButton::clicked, this, [=]() {
  2820. // UpdateShowBondInfoData(m_vectBondMatrixs[vectorIndex].BondInfoId);
  2821. // });
  2822. QFrame* line = new QFrame(outWidget);
  2823. line->setFrameShape(QFrame::NoFrame); // 移除默认框架
  2824. line->setFixedHeight(2); // 设置固定高度
  2825. line->setStyleSheet("background-color: #C7CAEB;");
  2826. boxGridLayout->addLayout(matrixGridLayout, 2, 0);
  2827. boxGridLayout->addWidget(line);
  2828. //outMatrixGridLayout->addLayout(buttonLayout, 1, 0);
  2829. outMatrixGridLayout->addWidget(groupBox);
  2830. outWidget->setLayout(outMatrixGridLayout);
  2831. ui.verticalLayout_3->addWidget(outWidget);
  2832. ui.verticalLayout_3->setContentsMargins(0, 0, 0, 0); // Adjust margins if necessary
  2833. ui.verticalLayout_3->setAlignment(Qt::AlignTop | Qt::AlignLeft); // Align the layout to the top-left
  2834. m_mapOutWidgetIndex.insert(outWidget, matrixData.BondMatrixId);
  2835. // Add Sub Matrices
  2836. for (int j = 0; j < matrixData.VecPointMatrixId.size(); j++)
  2837. {
  2838. for (int i = 0; i < m_vecSubMatrixs.size(); i++)
  2839. {
  2840. if (matrixData.VecPointMatrixId[j] == m_vecSubMatrixs[i].MatrixId)
  2841. {
  2842. AddMatrixPage(j, i, m_vecSubMatrixs[i], outMatrixGridLayout);
  2843. }
  2844. }
  2845. }
  2846. // Add all controls and finalize layout
  2847. /*outWidget->setLayout(outMatrixGridLayout);
  2848. ui.scrollArea_2->setLayout(outMatrixGridLayout);*/
  2849. spinBoxRow->setValue(matrixData.BondMatrixRow);
  2850. spinBoxCol->setValue(matrixData.BondMatrixCol);
  2851. doubleSpinBoxLeftTopX->setValue(matrixData.LeftTopPoint.x);
  2852. doubleSpinBoxLeftTopY->setValue(matrixData.LeftTopPoint.y);
  2853. doubleSpinBoxRightTopX->setValue(matrixData.RightTopPoint.x);
  2854. doubleSpinBoxRightTopY->setValue(matrixData.RightTopPoint.y);
  2855. doubleSpinBoxRightButtomX->setValue(matrixData.RightBottomPoint.x);
  2856. doubleSpinBoxRightButtomY->setValue(matrixData.RightBottomPoint.y);
  2857. connect(spinBoxRow, &SpinBox::editDone, this, [=]() {
  2858. m_vectBondMatrixs[vectorIndex].BondMatrixRow = spinBoxRow->value();
  2859. });
  2860. connect(spinBoxCol, &SpinBox::editDone, this, [=]() {
  2861. m_vectBondMatrixs[vectorIndex].BondMatrixCol = spinBoxCol->value();
  2862. });
  2863. connect(doubleSpinBoxLeftTopX, &DoubleSpinBox::editDone, this, [=]() {
  2864. m_vectBondMatrixs[vectorIndex].LeftTopPoint.x = doubleSpinBoxLeftTopX->value();
  2865. });
  2866. connect(doubleSpinBoxLeftTopY, &DoubleSpinBox::editDone, this, [=]() {
  2867. m_vectBondMatrixs[vectorIndex].LeftTopPoint.y = doubleSpinBoxLeftTopY->value();
  2868. });
  2869. connect(doubleSpinBoxRightTopX, &DoubleSpinBox::editDone, this, [=]() {
  2870. m_vectBondMatrixs[vectorIndex].RightTopPoint.x = doubleSpinBoxRightTopX->value();
  2871. });
  2872. connect(doubleSpinBoxRightTopY, &DoubleSpinBox::editDone, this, [=]() {
  2873. m_vectBondMatrixs[vectorIndex].RightTopPoint.y = doubleSpinBoxRightTopY->value();
  2874. });
  2875. connect(doubleSpinBoxRightButtomX, &DoubleSpinBox::editDone, this, [=]() {
  2876. m_vectBondMatrixs[vectorIndex].RightBottomPoint.x = doubleSpinBoxRightButtomX->value();
  2877. });
  2878. connect(doubleSpinBoxRightButtomY, &DoubleSpinBox::editDone, this, [=]() {
  2879. m_vectBondMatrixs[vectorIndex].RightBottomPoint.y = doubleSpinBoxRightButtomY->value();
  2880. });
  2881. connect(lineEditNoBondPts, &QLineEdit::textChanged, this, [=]() {
  2882. });
  2883. }
  2884. void BondMatrixProgramPage::onComboBoxPopupBondInfo(QComboBox* comboBox) {
  2885. if (!comboBox) {
  2886. return;
  2887. }
  2888. int currentIndex = comboBox->currentIndex(); // 获取当前选中的索引
  2889. QVariant currentData = comboBox->currentData(); // 获取当前选中的附加数据(例如 iInfoId)
  2890. // 清空下拉框中的所有项
  2891. comboBox->clear();
  2892. // 重新填充下拉框选项,并更新 QMap 中的绑定关系
  2893. for (const auto& bondMatrix : m_vecBondInfoData) {
  2894. // 显示编号 iInfoId
  2895. QString itemText = QString::number(bondMatrix.iInfoId);
  2896. // 将 iInfoId 添加到下拉框
  2897. comboBox->addItem(itemText, bondMatrix.iInfoId);
  2898. }
  2899. // 恢复原来的选中项
  2900. if (currentData.isValid()) {
  2901. // 通过 currentData 恢复选中项
  2902. int index = comboBox->findData(currentData);
  2903. if (index >= 0) {
  2904. comboBox->setCurrentIndex(index); // 设置当前选中项
  2905. }
  2906. }
  2907. //UINT iInfoId = currentData.toUInt(); // 将 currentData 转换为 UINT
  2908. //UpdateShowBondInfoData(iInfoId);
  2909. }
  2910. void BondMatrixProgramPage::ShowCurrentMatrix(int bondMatrixId)
  2911. {
  2912. // 遍历 comboBox 中的项,找到与 bondMatrixId 匹配的项的索引
  2913. int index = -1;
  2914. for (int i = 0; i < ui.comboBoxCurrentMatrix->count(); ++i) {
  2915. if (ui.comboBoxCurrentMatrix->itemData(i).toInt() == bondMatrixId) {
  2916. index = i; // 找到对应的索引
  2917. break;
  2918. }
  2919. }
  2920. // 如果找到了对应的索引,则设置为当前选中的项
  2921. if (index != -1) {
  2922. ui.comboBoxCurrentMatrix->setCurrentIndex(index);
  2923. }
  2924. // 清空布局内容并隐藏之前的控件
  2925. QLayoutItem* item;
  2926. while ((item = ui.verticalLayout_3->takeAt(0)) != nullptr) {
  2927. QWidget* widget = item->widget();
  2928. if (widget) {
  2929. widget->hide(); // 隐藏控件,而不是删除它
  2930. }
  2931. delete item; // 删除布局项
  2932. }
  2933. // 查找对应矩阵的控件
  2934. QWidget* outWidget = nullptr;
  2935. // 遍历 m_mapOutWidgetIndex 查找对应的 QWidget
  2936. for (auto it = m_mapOutWidgetIndex.begin(); it != m_mapOutWidgetIndex.end(); ++it) {
  2937. if (it.value() == bondMatrixId) { // 找到对应的矩阵索引
  2938. outWidget = it.key(); // 获取对应的 QWidget
  2939. break;
  2940. }
  2941. }
  2942. // 找到并添加 outWidget
  2943. if (outWidget && ui.verticalLayout_3->indexOf(outWidget) == -1) {
  2944. ui.verticalLayout_3->addWidget(outWidget);
  2945. outWidget->show(); // 显示控件
  2946. }
  2947. // 最后加 back 一个 vSpacer
  2948. ui.verticalLayout_3->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding));
  2949. int selectedBondInfoId = -1;
  2950. for (int i = 0; i < m_vectBondMatrixs.size(); ++i) {
  2951. if (m_vectBondMatrixs[i].BondMatrixId == bondMatrixId) {
  2952. selectedBondInfoId = m_vectBondMatrixs[i].BondInfoId;
  2953. break;
  2954. }
  2955. }
  2956. UpdateShowBondInfoData(selectedBondInfoId);
  2957. }
  2958. void BondMatrixProgramPage::onComboBoxCurrentMatrixChanged(int index)
  2959. {
  2960. // 判断 index 是否有效
  2961. if (index < 0 || index >= ui.comboBoxCurrentMatrix->count())
  2962. return;
  2963. // 获取当前选项的 bondMatrixId
  2964. int bondMatrixId = ui.comboBoxCurrentMatrix->itemData(index).toInt();
  2965. ShowCurrentMatrix(bondMatrixId); // 调用 ShowCurrentMatrix 更新显示
  2966. }
  2967. //void BondMatrixProgramPage::ShowCurrentMatrix(int bondMatrixId)
  2968. //{
  2969. // // 遍历 comboBox 中的项,找到与 bondMatrixId 匹配的项的索引
  2970. // int index = -1;
  2971. // for (int i = 0; i < ui.comboBoxCurrentMatrix->count(); ++i) {
  2972. // if (ui.comboBoxCurrentMatrix->itemData(i).toInt() == bondMatrixId) {
  2973. // index = i; // 找到对应的索引
  2974. // break;
  2975. // }
  2976. // }
  2977. //
  2978. // // 如果找到了对应的索引,则设置为当前选中的项
  2979. // if (index != -1) {
  2980. // ui.comboBoxCurrentMatrix->setCurrentIndex(index);
  2981. // }
  2982. //
  2983. // // 清光布局内容
  2984. // QLayoutItem* item;
  2985. // while ((item = ui.verticalLayout_3->takeAt(0)) != nullptr) {
  2986. // QWidget* widget = item->widget();
  2987. // if (widget) {
  2988. // widget->setParent(nullptr);
  2989. // }
  2990. // delete item;
  2991. // }
  2992. //
  2993. // // 查找对应矩阵的控件
  2994. // QWidget* outWidget = nullptr;
  2995. //
  2996. // // 遍历 m_mapOutWidgetIndex 查找对应的 QWidget
  2997. // for (auto it = m_mapOutWidgetIndex.begin(); it != m_mapOutWidgetIndex.end(); ++it) {
  2998. // if (it.value() == bondMatrixId) { // 找到对应的矩阵索引
  2999. // outWidget = it.key(); // 获取对应的 QWidget
  3000. // break;
  3001. // }
  3002. // }
  3003. //
  3004. // // 找到并添加 outWidget
  3005. // if (outWidget && ui.verticalLayout_3->indexOf(outWidget) == -1) {
  3006. // ui.verticalLayout_3->addWidget(outWidget);
  3007. // }
  3008. //
  3009. // // 最后加 back 一个 vSpacer
  3010. // ui.verticalLayout_3->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding));
  3011. //}
  3012. //
  3013. //void BondMatrixProgramPage::onComboBoxCurrentMatrixChanged(int index)
  3014. //{
  3015. // // 判断index有效
  3016. // if (index < 0 || index >= ui.comboBoxCurrentMatrix->count())
  3017. // return;
  3018. //
  3019. // // 获取当前选项的 bondMatrixId
  3020. // int bondMatrixId = ui.comboBoxCurrentMatrix->itemData(index).toInt();
  3021. // ShowCurrentMatrix(bondMatrixId);
  3022. //}
  3023. void BondMatrixProgramPage::onComboBoxIndexChangedForMatrixParam(int index) {
  3024. // 获取当前选中的 QComboBox
  3025. QComboBox* comboBox = qobject_cast<QComboBox*>(sender());
  3026. if (!comboBox) {
  3027. return;
  3028. }
  3029. // 获取当前选中的 BondInfoId
  3030. UINT selectedBondInfoId = comboBox->currentData().toUInt();
  3031. // 获取当前 QComboBox 对应的 matrixId
  3032. int matrixId = m_mapParagramSetComboBox.value(comboBox, -1); // 从 QMap 中获取 vectorIndex
  3033. if (matrixId > 0) {
  3034. // 更新 m_vectBondMatrixs[vectorIndex].BondInfoId
  3035. for (int i = 0; i < m_vectBondMatrixs.size(); i++) {
  3036. if (m_vectBondMatrixs[i].BondMatrixId == matrixId) {
  3037. m_vectBondMatrixs[i].BondInfoId = selectedBondInfoId;
  3038. break;
  3039. }
  3040. }
  3041. }
  3042. // 调用 UpdateShowBondInfoData 更新数据
  3043. UpdateShowBondInfoData(selectedBondInfoId);
  3044. }
  3045. void BondMatrixProgramPage::onComboBoxIndexChangedForParam(int index) {
  3046. // 获取当前选中的 QComboBox
  3047. QComboBox* comboBox = qobject_cast<QComboBox*>(sender());
  3048. if (!comboBox) {
  3049. return;
  3050. }
  3051. // 获取当前选中的 BondInfoId
  3052. UINT selectedBondInfoId = comboBox->currentData().toUInt();
  3053. // 调用 UpdateShowBondInfoData 更新数据
  3054. UpdateShowBondInfoData(selectedBondInfoId);
  3055. }
  3056. void BondMatrixProgramPage::AddMatrixPage(int vectorIndex, int subVectorIndex, PROGRAM_POINT_MATRIX_STRUCT subMatrix, QGridLayout* layout)
  3057. {
  3058. QVector<QObject*> vecControls;
  3059. QWidget* subWidget = new QWidget();
  3060. QGridLayout* subGridLayout = new QGridLayout(subWidget);
  3061. subGridLayout->setSpacing(4);
  3062. subGridLayout->setObjectName(QString::fromUtf8("subGridLayout"));
  3063. //groupBox->setLayout(subGridLayout);
  3064. subGridLayout->setContentsMargins(0, 0, 0, 0); // 设置布局的边距为0
  3065. subGridLayout->setAlignment(Qt::AlignCenter);
  3066. QLabel* labelTitle = new QLabel(subWidget);
  3067. labelTitle->setObjectName(QString::fromUtf8("labelTitle"));
  3068. labelTitle->setText(tr("Sub Matrix ") + QString::number(subVectorIndex));
  3069. labelTitle->setStyleSheet("color: #808BFF;height: 30px");
  3070. subGridLayout->addWidget(labelTitle, 0, 1, 1, 1);
  3071. vecControls.push_back(labelTitle);
  3072. QPushButton* pushButtonDelete = new QPushButton(subWidget);
  3073. pushButtonDelete->setObjectName(QString::fromUtf8("button delete"));
  3074. pushButtonDelete->setText(tr("Delete"));
  3075. subGridLayout->addWidget(pushButtonDelete, 0, 3, 1, 2);
  3076. connect(pushButtonDelete, &QPushButton::clicked, this, [=]() {
  3077. //处理index
  3078. auto currentIt = m_mapSubWidgetIndex.find(subWidget);
  3079. int index = currentIt.value(); //迭代器 erase后currentIt被删除了
  3080. m_mapSubWidgetIndex.erase(currentIt);
  3081. for (auto it = m_mapSubWidgetIndex.begin(); it != m_mapSubWidgetIndex.end(); ++it)
  3082. {
  3083. if (it.value() > index)
  3084. {
  3085. //value() 返回的是副本不是引用
  3086. int newIndex = it.value() - 1;
  3087. m_mapSubWidgetIndex.insert(it.key(), newIndex);
  3088. }
  3089. }
  3090. // 子矩阵ID
  3091. int subMatrixId = m_vecSubMatrixs[index].MatrixId;
  3092. //删除缓存
  3093. m_vecSubMatrixs.erase(m_vecSubMatrixs.begin() + index);
  3094. //删除大矩阵子ID数据(遍历删除)
  3095. for (PROGRAM_BOND_MATRIX_STRUCT& matrix : m_vectBondMatrixs)
  3096. {
  3097. auto it = std::find(matrix.VecPointMatrixId.begin(), matrix.VecPointMatrixId.end(), subMatrixId);
  3098. if (it != matrix.VecPointMatrixId.end())
  3099. {
  3100. matrix.VecPointMatrixId.erase(it);
  3101. }
  3102. }
  3103. delete subWidget;
  3104. });
  3105. QLabel* labelRow = new QLabel(subWidget);
  3106. labelRow->setObjectName(QString::fromUtf8("labelRow"));
  3107. labelRow->setText(tr("Row & Cow"));
  3108. subGridLayout->addWidget(labelRow, 2, 0, 1, 1);
  3109. vecControls.push_back(labelRow);
  3110. SpinBox* spinBoxRow = new SpinBox(subWidget);
  3111. spinBoxRow->setObjectName(QString::fromUtf8("spinBoxRow"));
  3112. subGridLayout->addWidget(spinBoxRow, 2, 1, 1, 1);
  3113. vecControls.push_back(spinBoxRow);
  3114. /*QLabel* labelCol = new QLabel(subWidget);
  3115. labelCol->setObjectName(QString::fromUtf8("labelCol"));
  3116. labelCol->setText(tr("Cow "));
  3117. subGridLayout->addWidget(labelCol, 3, 0, 1, 1);
  3118. vecControls.push_back(labelCol);*/
  3119. SpinBox* spinBoxCol = new SpinBox(subWidget);
  3120. spinBoxCol->setObjectName(QString::fromUtf8("spinBoxCol"));
  3121. subGridLayout->addWidget(spinBoxCol, 2, 2, 1, 1);
  3122. vecControls.push_back(spinBoxCol);
  3123. QLabel* labelLeftTop = new QLabel(subWidget);
  3124. labelLeftTop->setObjectName(QString::fromUtf8("labelLeftTop"));
  3125. labelLeftTop->setText(tr("Left Top Pos "));
  3126. subGridLayout->addWidget(labelLeftTop, 4, 0, 1, 1);
  3127. vecControls.push_back(labelLeftTop);
  3128. DoubleSpinBox* doubleSpinBoxLeftTopX = new DoubleSpinBox(subWidget);
  3129. doubleSpinBoxLeftTopX->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopX"));
  3130. doubleSpinBoxLeftTopX->setFixedWidth(95); // Set fixed width to 95
  3131. doubleSpinBoxLeftTopX->setFixedWidth(95); // Set fixed width to 95
  3132. subGridLayout->addWidget(doubleSpinBoxLeftTopX, 4, 1, 1, 1);
  3133. vecControls.push_back(doubleSpinBoxLeftTopX);
  3134. DoubleSpinBox* doubleSpinBoxLeftTopY = new DoubleSpinBox(subWidget);
  3135. doubleSpinBoxLeftTopY->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopY"));
  3136. doubleSpinBoxLeftTopY->setFixedWidth(95); // Set fixed width to 95
  3137. subGridLayout->addWidget(doubleSpinBoxLeftTopY, 4, 2, 1, 1);
  3138. vecControls.push_back(doubleSpinBoxLeftTopY);
  3139. QLabel* labelRightTopPos = new QLabel(subWidget);
  3140. labelRightTopPos->setObjectName(QString::fromUtf8("labelRightTopPos"));
  3141. labelRightTopPos->setText(tr("Right Top Pos "));
  3142. subGridLayout->addWidget(labelRightTopPos, 5, 0, 1, 1);
  3143. vecControls.push_back(labelRightTopPos);
  3144. DoubleSpinBox* doubleSpinBoxRightTopX = new DoubleSpinBox(subWidget);
  3145. doubleSpinBoxRightTopX->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopX"));
  3146. doubleSpinBoxRightTopX->setFixedWidth(95); // Set fixed width to 95
  3147. subGridLayout->addWidget(doubleSpinBoxRightTopX, 5, 1, 1, 1);
  3148. vecControls.push_back(doubleSpinBoxRightTopX);
  3149. DoubleSpinBox* doubleSpinBoxRightTopY = new DoubleSpinBox(subWidget);
  3150. doubleSpinBoxRightTopY->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopY"));
  3151. doubleSpinBoxRightTopY->setFixedWidth(95); // Set fixed width to 95
  3152. subGridLayout->addWidget(doubleSpinBoxRightTopY, 5, 2, 1, 1);
  3153. vecControls.push_back(doubleSpinBoxRightTopY);
  3154. QLabel* labelRightButtomPos = new QLabel(subWidget);
  3155. labelRightButtomPos->setObjectName(QString::fromUtf8("labelRightButtomPos"));
  3156. labelRightButtomPos->setText(tr("Right Buttom pos"));
  3157. subGridLayout->addWidget(labelRightButtomPos, 6, 0, 1, 1);
  3158. vecControls.push_back(labelRightButtomPos);
  3159. DoubleSpinBox* doubleSpinBoxRightButtomX = new DoubleSpinBox(subWidget);
  3160. doubleSpinBoxRightButtomX->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomX"));
  3161. doubleSpinBoxRightButtomX->setFixedWidth(95); // Set fixed width to 95
  3162. subGridLayout->addWidget(doubleSpinBoxRightButtomX, 6, 1, 1, 1);
  3163. vecControls.push_back(doubleSpinBoxRightButtomX);
  3164. DoubleSpinBox* doubleSpinBoxRightButtomY = new DoubleSpinBox(subWidget);
  3165. doubleSpinBoxRightButtomY->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomY"));
  3166. doubleSpinBoxRightButtomY->setFixedWidth(95); // Set fixed width to 95
  3167. subGridLayout->addWidget(doubleSpinBoxRightButtomY, 6, 2, 1, 1);
  3168. vecControls.push_back(doubleSpinBoxRightTopX);
  3169. QLabel* labelNoBondPts = new QLabel(subWidget);
  3170. labelNoBondPts->setObjectName(QString::fromUtf8("labelNoBondPts"));
  3171. labelNoBondPts->setText(tr("No Bond Points"));
  3172. subGridLayout->addWidget(labelNoBondPts, 7, 0, 1, 1);
  3173. vecControls.push_back(labelNoBondPts);
  3174. QLineEdit* lineEditNoBondPts = new QLineEdit(subWidget);
  3175. lineEditNoBondPts->setObjectName(QString::fromUtf8("lineEditNoBondPts"));
  3176. lineEditNoBondPts->setReadOnly(true);
  3177. lineEditNoBondPts->setCursor(Qt::PointingHandCursor);
  3178. lineEditNoBondPts->setProperty("vectorIndex", subVectorIndex); // 存储索引
  3179. lineEditNoBondPts->setProperty("parentMatrixIndex", vectorIndex); // 设置父矩阵的索引
  3180. lineEditNoBondPts->installEventFilter(this);
  3181. QStringList ptList;
  3182. for (const auto& pt : m_vecSubMatrixs[subVectorIndex].VecNoBondPt)
  3183. ptList << QString("(%1,%2)").arg(pt.x).arg(pt.y);
  3184. lineEditNoBondPts->setText(ptList.join(" "));
  3185. subGridLayout->addWidget(lineEditNoBondPts, 7, 1, 1, 3);
  3186. vecControls.push_back(lineEditNoBondPts);
  3187. // Left Top Position X and Y
  3188. QPushButton* buttonLeftTop = new QPushButton("GP", subWidget);
  3189. buttonLeftTop->setFixedWidth(31); // 设置固定宽度
  3190. subGridLayout->addWidget(buttonLeftTop, 4, 3, 1, 1); // 添加按钮到4行3列
  3191. connect(buttonLeftTop, &QPushButton::clicked, this, [=]() {
  3192. XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondHead", m_vecSubMatrixs[subVectorIndex].LeftTopPoint);
  3193. doubleSpinBoxLeftTopX->setValue(position.x); // 更新 X 轴
  3194. doubleSpinBoxLeftTopY->setValue(position.y); // 更新 Y 轴
  3195. });
  3196. QPushButton* buttonMoveToLeftTop = new QPushButton("MT", subWidget);
  3197. buttonMoveToLeftTop->setFixedWidth(31); // 设置固定宽度
  3198. subGridLayout->addWidget(buttonMoveToLeftTop, 4, 4, 1, 1); // 添加按钮到4行3列
  3199. connect(buttonMoveToLeftTop, &QPushButton::clicked, this, [=]() {
  3200. XY_DOUBLE_STRUCT position = BondMoveToXYAxisPosition("BondHead", m_vecSubMatrixs[subVectorIndex].LeftTopPoint);
  3201. });
  3202. // Right Top Position X and Y
  3203. QPushButton* buttonRightTop = new QPushButton("GP", subWidget);
  3204. buttonRightTop->setFixedWidth(31); // 设置固定宽度
  3205. subGridLayout->addWidget(buttonRightTop, 5, 3, 1, 1); // 添加按钮到5行3列
  3206. connect(buttonRightTop, &QPushButton::clicked, this, [=]() {
  3207. XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondHead", m_vecSubMatrixs[subVectorIndex].RightTopPoint);
  3208. doubleSpinBoxRightTopX->setValue(position.x); // 更新 X 轴
  3209. doubleSpinBoxRightTopY->setValue(position.y); // 更新 Y 轴
  3210. });
  3211. QPushButton* buttonMoveToRightTop = new QPushButton("MT", subWidget);
  3212. buttonMoveToRightTop->setFixedWidth(31); // 设置固定宽度
  3213. subGridLayout->addWidget(buttonMoveToRightTop, 5, 4, 1, 1); // 添加按钮到4行3列
  3214. connect(buttonMoveToRightTop, &QPushButton::clicked, this, [=]() {
  3215. XY_DOUBLE_STRUCT position = BondMoveToXYAxisPosition("BondHead", m_vecSubMatrixs[subVectorIndex].RightTopPoint);
  3216. });
  3217. // Right Bottom Position X and Y
  3218. QPushButton* buttonRightButtom = new QPushButton("GP", subWidget);
  3219. buttonRightButtom->setFixedWidth(31); // 设置固定宽度
  3220. subGridLayout->addWidget(buttonRightButtom, 6, 3, 1, 1); // 添加按钮到6行3列
  3221. connect(buttonRightButtom, &QPushButton::clicked, this, [=]() {
  3222. XY_DOUBLE_STRUCT position = BondGetAxisPosition("BondHead", m_vecSubMatrixs[subVectorIndex].RightBottomPoint);
  3223. doubleSpinBoxRightButtomX->setValue(position.x); // 更新 X 轴
  3224. doubleSpinBoxRightButtomY->setValue(position.y); // 更新 Y 轴
  3225. });
  3226. QPushButton* buttonMoveToRightButtom = new QPushButton("MT", subWidget);
  3227. buttonMoveToRightButtom->setFixedWidth(31); // 设置固定宽度
  3228. subGridLayout->addWidget(buttonMoveToRightButtom, 6, 4, 1, 1); // 添加按钮到4行3列
  3229. connect(buttonMoveToRightButtom, &QPushButton::clicked, this, [=]() {
  3230. XY_DOUBLE_STRUCT position = BondMoveToXYAxisPosition("BondHead", m_vecSubMatrixs[subVectorIndex].RightBottomPoint);
  3231. });
  3232. //layout->addLayout(subGridLayout, 11, 0);
  3233. QFrame* line = new QFrame(subWidget);
  3234. line->setFrameShape(QFrame::NoFrame); // 移除默认框架
  3235. line->setFixedHeight(2); // 设置固定高度
  3236. line->setStyleSheet("background-color: #C7CAEB;");
  3237. subGridLayout->addWidget(line, 10, 0, 1, 4);
  3238. layout->addWidget(subWidget);
  3239. m_mapSubWidgetIndex.insert(subWidget, subVectorIndex);
  3240. spinBoxRow->setValue(subMatrix.MatrixRow);
  3241. spinBoxCol->setValue(subMatrix.MatrixCol);
  3242. doubleSpinBoxLeftTopX->setValue(subMatrix.LeftTopPoint.x);
  3243. doubleSpinBoxLeftTopY->setValue(subMatrix.LeftTopPoint.y);
  3244. doubleSpinBoxRightTopX->setValue(subMatrix.RightTopPoint.x);
  3245. doubleSpinBoxRightTopY->setValue(subMatrix.RightTopPoint.y);
  3246. doubleSpinBoxRightButtomX->setValue(subMatrix.RightBottomPoint.x);
  3247. doubleSpinBoxRightButtomY->setValue(subMatrix.RightBottomPoint.y);
  3248. connect(spinBoxRow, &SpinBox::editDone, this, [=]() {
  3249. auto it = m_mapSubWidgetIndex.find(subWidget);
  3250. m_vecSubMatrixs[it.value()].MatrixRow = spinBoxRow->value();
  3251. });
  3252. connect(spinBoxCol, &SpinBox::editDone, this, [=]() {
  3253. auto it = m_mapSubWidgetIndex.find(subWidget);
  3254. m_vecSubMatrixs[it.value()].MatrixCol = spinBoxCol->value();
  3255. });
  3256. connect(doubleSpinBoxLeftTopX, &DoubleSpinBox::editDone, this, [=]() {
  3257. auto it = m_mapSubWidgetIndex.find(subWidget);
  3258. m_vecSubMatrixs[it.value()].LeftTopPoint.x = doubleSpinBoxLeftTopX->value();
  3259. });
  3260. connect(doubleSpinBoxLeftTopY, &DoubleSpinBox::editDone, this, [=]() {
  3261. auto it = m_mapSubWidgetIndex.find(subWidget);
  3262. m_vecSubMatrixs[it.value()].LeftTopPoint.y = doubleSpinBoxLeftTopY->value();
  3263. });
  3264. connect(doubleSpinBoxRightTopX, &DoubleSpinBox::editDone, this, [=]() {
  3265. auto it = m_mapSubWidgetIndex.find(subWidget);
  3266. m_vecSubMatrixs[it.value()].RightTopPoint.x = doubleSpinBoxRightTopX->value();
  3267. });
  3268. connect(doubleSpinBoxRightTopY, &DoubleSpinBox::editDone, this, [=]() {
  3269. auto it = m_mapSubWidgetIndex.find(subWidget);
  3270. m_vecSubMatrixs[it.value()].RightTopPoint.y = doubleSpinBoxRightTopY->value();
  3271. });
  3272. connect(doubleSpinBoxRightButtomX, &DoubleSpinBox::editDone, this, [=]() {
  3273. auto it = m_mapSubWidgetIndex.find(subWidget);
  3274. m_vecSubMatrixs[it.value()].RightBottomPoint.x = doubleSpinBoxRightButtomX->value();
  3275. });
  3276. connect(doubleSpinBoxRightButtomY, &DoubleSpinBox::editDone, this, [=]() {
  3277. auto it = m_mapSubWidgetIndex.find(subWidget);
  3278. m_vecSubMatrixs[it.value()].RightBottomPoint.y = doubleSpinBoxRightButtomY->value();
  3279. });
  3280. connect(lineEditNoBondPts, &QLineEdit::textChanged, this, [=]() {
  3281. auto it = m_mapSubWidgetIndex.find(subWidget);
  3282. });
  3283. }
  3284. bool BondMatrixProgramPage::eventFilter(QObject* obj, QEvent* event) {
  3285. // 捕获鼠标点击事件(QEvent::MouseButtonPress)
  3286. if (event->type() == QEvent::MouseButtonPress) {
  3287. // 处理 QComboBox 的点击事件
  3288. auto* comboBox = qobject_cast<QComboBox*>(obj);
  3289. if (comboBox) {
  3290. // 当BondInfo 的 QComboBox 被点击时执行 onComboBoxPopupBondInfo()
  3291. if (comboBox == ui.comboBoxCurrentPara || comboBox->objectName() == QString::fromUtf8("comboBoxParagramSet")) {
  3292. onComboBoxPopupBondInfo(comboBox);
  3293. return false; // 拦截事件,防止进一步传播
  3294. }
  3295. //其他组件单独控制
  3296. }
  3297. // 处理 QLineEdit 的点击事件
  3298. auto* lineEdit = qobject_cast<QLineEdit*>(obj);
  3299. if (lineEdit) {
  3300. // lineEditNoBondPts 点击事件
  3301. if (lineEdit->objectName() == QString::fromUtf8("lineEditNoBondPts")) {
  3302. int index = lineEdit->property("vectorIndex").toInt(); // 当前矩阵索引
  3303. int parentIndex = lineEdit->property("parentMatrixIndex").toInt(); // 父矩阵索引
  3304. onNoBondPtsClicked(lineEdit, index, parentIndex); // 传递父矩阵索引
  3305. return true; // 拦截事件
  3306. }
  3307. //其他组件点击事件
  3308. }
  3309. }
  3310. // 捕获鼠标滚轮事件(QEvent::Wheel)
  3311. if (event->type() == QEvent::Wheel) {
  3312. auto* comboBox = qobject_cast<QComboBox*>(obj);
  3313. if (comboBox) {
  3314. // 阻止滚轮事件,不让它改变选中的项
  3315. return true; // 阻止滚轮事件的传播
  3316. }
  3317. }
  3318. return QWidget::eventFilter(obj, event);
  3319. }
  3320. void BondMatrixProgramPage::onNoBondPtsClicked(QLineEdit* lineEdit, int index, int parentIndex) {
  3321. if (parentIndex != -1)
  3322. {
  3323. // 处理子矩阵的操作
  3324. if (index < 0 || index >= m_vecSubMatrixs.size()) return;
  3325. const auto& subMatrix = m_vecSubMatrixs[index];
  3326. NoBondPtEditDialog dlg(subMatrix.MatrixRow, subMatrix.MatrixCol, subMatrix.VecNoBondPt, this);
  3327. if (dlg.exec() == QDialog::Accepted)
  3328. {
  3329. QVector<XY_LONG_STRUCT> selected = dlg.getSelectedPoints();
  3330. m_vecSubMatrixs[index].VecNoBondPt = std::vector<XY_LONG_STRUCT>(selected.begin(), selected.end());
  3331. QStringList ptList;
  3332. for (const auto& pt : selected)
  3333. ptList << QString("(%1,%2)").arg(pt.x).arg(pt.y);
  3334. lineEdit->setText(ptList.join(" "));
  3335. }
  3336. // 这里可以用 parentIndex 来关联父矩阵(即大矩阵)做相应的操作
  3337. }
  3338. else
  3339. {
  3340. // 处理大矩阵的操作
  3341. if (index < 0 || index >= m_vectBondMatrixs.size()) return;
  3342. const auto& bondMatrix = m_vectBondMatrixs[index];
  3343. NoBondPtEditDialog dlg(bondMatrix.BondMatrixRow, bondMatrix.BondMatrixCol, bondMatrix.VecNoBondPt, this);
  3344. if (dlg.exec() == QDialog::Accepted)
  3345. {
  3346. QVector<XY_LONG_STRUCT> selected = dlg.getSelectedPoints();
  3347. m_vectBondMatrixs[index].VecNoBondPt = std::vector<XY_LONG_STRUCT>(selected.begin(), selected.end());
  3348. QStringList ptList;
  3349. for (const auto& pt : selected)
  3350. ptList << QString("(%1,%2)").arg(pt.x).arg(pt.y);
  3351. lineEdit->setText(ptList.join(" "));
  3352. }
  3353. // 这里也可以用 parentIndex 来关联父矩阵(即大矩阵)做相应的操作
  3354. }
  3355. }
  3356. void BondMatrixProgramPage::AddMatrixParam()
  3357. {
  3358. }
  3359. void BondMatrixProgramPage::UpdatePageParam()
  3360. {
  3361. int dieSourceIndex = 0;
  3362. if (m_curBondInfo.eDieSource == DIE_SOURCE::BY_WAFER)
  3363. {
  3364. dieSourceIndex = 1;
  3365. }
  3366. else if (m_curBondInfo.eDieSource == DIE_SOURCE::BY_WAFFLE)
  3367. {
  3368. dieSourceIndex = 0;
  3369. }
  3370. ui.comboBoxDieSource->setCurrentIndex(dieSourceIndex);
  3371. ui.checkBoxIsCalib ->setChecked(m_curBondInfo.bTransferPREnable);
  3372. ui.checkBoxIsAllBondAln->setChecked(m_curBondInfo.bAllBondAlnEnable);
  3373. ui.checkBoxIsPcbAln->setChecked(m_curBondInfo.bPcbAlnEnable);
  3374. //ui.spinBoxPickNozzleID->setValue(m_curBondInfo.iPickHeadId);
  3375. ui.spinBoxDieHeight->setValue(m_curBondInfo.dDieHeight);
  3376. m_isComBoxUpdating = true;
  3377. // 初始化 并设置默认选项
  3378. // 吸嘴
  3379. ui.comboBoxPickNozzleID->clear();
  3380. ui.comboBoxBondNozzleID->clear();
  3381. // 固后
  3382. ui.comboBoxPostBondTemp->clear();
  3383. // 模板
  3384. ui.comboBoxPickTempID->clear();
  3385. ui.comboBoxPreBondTemp->clear();
  3386. ui.comboBoxBondTemp->clear();
  3387. ui.comboBoxLookUpTemp->clear();
  3388. ui.comboBoxCalibPickTemp->clear();
  3389. ui.comboBoxPcbAlnPRStrategyId->clear();
  3390. //吸嘴Combox填充
  3391. for (const auto& nozzleData : m_vecNozzles) {
  3392. ui.comboBoxPickNozzleID->addItem(QString::number(nozzleData), nozzleData); // 设置数据
  3393. ui.comboBoxBondNozzleID->addItem(QString::number(nozzleData), nozzleData); // 设置数据
  3394. }
  3395. //模板ComBox填充
  3396. for (const auto& templateData : m_vecPrTemplate) {
  3397. ui.comboBoxPickTempID->addItem(QString::number(templateData.iTemplateId), templateData.iTemplateId);
  3398. ui.comboBoxPreBondTemp->addItem(QString::number(templateData.iTemplateId), templateData.iTemplateId);
  3399. ui.comboBoxBondTemp->addItem(QString::number(templateData.iTemplateId), templateData.iTemplateId);
  3400. ui.comboBoxLookUpTemp->addItem(QString::number(templateData.iTemplateId), templateData.iTemplateId);
  3401. ui.comboBoxCalibPickTemp->addItem(QString::number(templateData.iTemplateId), templateData.iTemplateId);
  3402. ui.comboBoxPcbAlnPRStrategyId->addItem(QString::number(templateData.iTemplateId), templateData.iTemplateId);
  3403. }
  3404. for (const auto& strategy : m_vecPrStrategy) {
  3405. ui.comboBoxPickTempID->addItem(QString::number(strategy.iStrategyId), strategy.iStrategyId);
  3406. ui.comboBoxPreBondTemp->addItem(QString::number(strategy.iStrategyId), strategy.iStrategyId);
  3407. ui.comboBoxBondTemp->addItem(QString::number(strategy.iStrategyId), strategy.iStrategyId);
  3408. ui.comboBoxLookUpTemp->addItem(QString::number(strategy.iStrategyId), strategy.iStrategyId);
  3409. ui.comboBoxCalibPickTemp->addItem(QString::number(strategy.iStrategyId), strategy.iStrategyId);
  3410. ui.comboBoxPcbAlnPRStrategyId->addItem(QString::number(strategy.iStrategyId), strategy.iStrategyId);
  3411. }
  3412. // 固后Combox填充
  3413. for (const auto& bondInspData : m_vecPrBondInsp) {
  3414. ui.comboBoxPostBondTemp->addItem(QString::number(bondInspData.iID), bondInspData.iID); // 设置数据
  3415. }
  3416. m_isComBoxUpdating = false;
  3417. // 吸嘴
  3418. safeSetComboBoxIndex(ui.comboBoxPickNozzleID, m_curBondInfo.iPickHeadId);
  3419. safeSetComboBoxIndex(ui.comboBoxBondNozzleID, m_curBondInfo.iBondHeadId);
  3420. // --- PostBondTemp ---
  3421. //ui.comboBoxPostBondTemp->addItem(QString::number(m_curBondInfo.iBondBackPRStrategyId), m_curBondInfo.iBondBackPRStrategyId); // 设置数据
  3422. //int index3 = ui.comboBoxPostBondTemp->findData(m_curBondInfo.iBondBackPRStrategyId);
  3423. //ui.comboBoxPostBondTemp->setCurrentIndex(ui.comboBoxPostBondTemp->findData(m_curBondInfo.iBondBackPRStrategyId)); // 设置默认项
  3424. safeSetComboBoxIndex(ui.comboBoxPostBondTemp, m_curBondInfo.iBondBackPRStrategyId);
  3425. // --- PickTempID ---
  3426. safeSetComboBoxIndex(ui.comboBoxPickTempID, m_curBondInfo.iPickPRStrategyId);
  3427. // --- PreBondTemp ---
  3428. safeSetComboBoxIndex(ui.comboBoxPreBondTemp, m_curBondInfo.iBondFrontPRStrategyId);
  3429. // --- BondTemp ---
  3430. safeSetComboBoxIndex(ui.comboBoxBondTemp, m_curBondInfo.iBondAlnPRStrategyId);
  3431. // --- LookUpTemp ---
  3432. safeSetComboBoxIndex(ui.comboBoxLookUpTemp, m_curBondInfo.iLookUpPRStrategyId);
  3433. // --- CalibPickTemp ---
  3434. safeSetComboBoxIndex(ui.comboBoxCalibPickTemp, m_curBondInfo.iCalibPRStrategyId);
  3435. // --- PcbAlnPRStrategy ---
  3436. safeSetComboBoxIndex(ui.comboBoxPcbAlnPRStrategyId, m_curBondInfo.iPcbAlnPRStrategyId);
  3437. ui.doubleSpinBoxBondOffsetX->setValue(m_curBondInfo.stOffset.x);
  3438. ui.doubleSpinBoxBondOffsetY->setValue(m_curBondInfo.stOffset.y);
  3439. ui.doubleSpinBoxBondOffsetAngle->setValue(m_curBondInfo.stOffset.a);
  3440. UpdatePagePickPlaceParam();
  3441. restoreBondInfoDefaultStyles();
  3442. }
  3443. void BondMatrixProgramPage::restoreBondInfoDefaultStyles() {
  3444. // BondInfo恢复控件的默认样式
  3445. ui.comboBoxDieSource->setStyleSheet("");
  3446. ui.checkBoxIsCalib->setStyleSheet("");
  3447. ui.checkBoxIsAllBondAln->setStyleSheet("");
  3448. ui.checkBoxIsPcbAln->setStyleSheet("");
  3449. ui.spinBoxDieHeight->setStyleSheet("");
  3450. ui.comboBoxPickNozzleID->setStyleSheet("");
  3451. ui.comboBoxPostBondTemp->setStyleSheet("");
  3452. ui.comboBoxPickTempID->setStyleSheet("");
  3453. ui.comboBoxPreBondTemp->setStyleSheet("");
  3454. ui.comboBoxBondTemp->setStyleSheet("");
  3455. ui.comboBoxLookUpTemp->setStyleSheet("");
  3456. ui.comboBoxCalibPickTemp->setStyleSheet("");
  3457. ui.comboBoxPcbAlnPRStrategyId->setStyleSheet("");
  3458. ui.comboBoxCurrentPara_Pick1->setStyleSheet("");
  3459. ui.comboBoxCurrentPara_Pick2->setStyleSheet("");
  3460. ui.comboBoxCurrentPara_Place1->setStyleSheet("");
  3461. ui.comboBoxCurrentPara_Place2->setStyleSheet("");
  3462. ui.comboBoxBondNozzleID->setStyleSheet("");
  3463. ui.doubleSpinBoxBondOffsetX->setStyleSheet("");
  3464. ui.doubleSpinBoxBondOffsetY->setStyleSheet("");
  3465. ui.doubleSpinBoxBondOffsetAngle->setStyleSheet("");
  3466. ui.comboBoxPostBondTemp->setStyleSheet("");
  3467. ui.comboBoxPickTempID->setStyleSheet("");
  3468. ui.comboBoxPreBondTemp->setStyleSheet("");
  3469. ui.comboBoxBondTemp->setStyleSheet("");
  3470. ui.comboBoxLookUpTemp->setStyleSheet("");
  3471. ui.comboBoxCalibPickTemp->setStyleSheet("");
  3472. ui.comboBoxPcbAlnPRStrategyId->setStyleSheet("");
  3473. ui.comboBoxCurrentPara_Pick1->setStyleSheet("");
  3474. ui.comboBoxCurrentPara_Pick2->setStyleSheet("");
  3475. ui.comboBoxCurrentPara_Place1->setStyleSheet("");
  3476. ui.comboBoxCurrentPara_Place2->setStyleSheet("");
  3477. restorePick1DefaultStyles();
  3478. restorePick2DefaultStyles();
  3479. restorePlace1DefaultStyles();
  3480. restorePlccle2DefaultStyles();
  3481. }
  3482. void BondMatrixProgramPage::restorePick1DefaultStyles() {
  3483. // 取/固晶恢复控件的原始样式
  3484. ui.checkBoxPickBlockCheck->setStyleSheet(""); // 恢复原样式
  3485. ui.checkBoxPickBlockCheck_2->setStyleSheet("");
  3486. ui.checkBoxBondBlockCheck->setStyleSheet("");
  3487. ui.checkBoxBondBlockCheck_2->setStyleSheet("");
  3488. ui.checkBoxPickLoseCheck->setStyleSheet("");
  3489. ui.checkBoxPickLoseCheck_2->setStyleSheet("");
  3490. ui.checkBoxBondLoseCheck->setStyleSheet("");
  3491. ui.checkBoxBondLoseCheck_2->setStyleSheet("");
  3492. ui.checkBoxPickFindForceCheck->setStyleSheet("");
  3493. ui.checkBoxPickFindForceCheck_2->setStyleSheet("");
  3494. ui.checkBoxBondFindForce->setStyleSheet("");
  3495. ui.checkBoxBondFindForce_2->setStyleSheet("");
  3496. ui.doubleSpinBoxPrePickZ->setStyleSheet("");
  3497. ui.doubleSpinBoxPickForce->setStyleSheet("");
  3498. ui.doubleSpinBoxPickPosZ->setStyleSheet("");
  3499. ui.spinBoxPickGrabDelay->setStyleSheet("");
  3500. ui.spinBoxPickDelay->setStyleSheet("");
  3501. ui.spinBoxPickBlockCheckDelay->setStyleSheet("");
  3502. ui.spinBoxPickVacDelay->setStyleSheet("");
  3503. ui.spinBoxPickBlowDelay->setStyleSheet("");
  3504. }
  3505. void BondMatrixProgramPage::restorePick2DefaultStyles() {
  3506. // 恢复中转台取晶相关控件样式
  3507. ui.checkBoxPickBlockCheck_2->setStyleSheet("");
  3508. ui.checkBoxPickLoseCheck_2->setStyleSheet("");
  3509. ui.checkBoxPickFindForceCheck_2->setStyleSheet("");
  3510. ui.doubleSpinBoxPrePickZ_2->setStyleSheet("");
  3511. ui.doubleSpinBoxPickForce_2->setStyleSheet("");
  3512. ui.doubleSpinBoxPickPosZ_2->setStyleSheet("");
  3513. ui.spinBoxPickGrabDelay_2->setStyleSheet("");
  3514. ui.spinBoxPickDelay_2->setStyleSheet("");
  3515. ui.spinBoxPickBlockCheckDelay_2->setStyleSheet("");
  3516. ui.spinBoxPickVacDelay_2->setStyleSheet("");
  3517. ui.spinBoxPickBlowDelay_2->setStyleSheet("");
  3518. }
  3519. void BondMatrixProgramPage::restorePlace1DefaultStyles() {
  3520. // 恢复中转台放晶相关控件样式
  3521. ui.checkBoxBondBlockCheck->setStyleSheet("");
  3522. ui.checkBoxBondLoseCheck->setStyleSheet("");
  3523. ui.checkBoxBondFindForce->setStyleSheet("");
  3524. ui.doubleSpinBoxPreBondPosZ->setStyleSheet("");
  3525. ui.doubleSpinBoxBondForce->setStyleSheet("");
  3526. ui.doubleSpinBoxBondPosZ->setStyleSheet("");
  3527. ui.spinBoxBondGrabDelay->setStyleSheet("");
  3528. ui.spinBoxBondDelay->setStyleSheet("");
  3529. ui.spinBoxBondBlockCheckDelay->setStyleSheet("");
  3530. ui.spinBoxBondVacDelay->setStyleSheet("");
  3531. ui.spinBoxBondBlowDelay->setStyleSheet("");
  3532. }
  3533. void BondMatrixProgramPage::restorePlccle2DefaultStyles() {
  3534. // 恢复固晶台固晶相关控件样式
  3535. ui.checkBoxBondBlockCheck_2->setStyleSheet("");
  3536. ui.checkBoxBondLoseCheck_2->setStyleSheet("");
  3537. ui.checkBoxBondFindForce_2->setStyleSheet("");
  3538. ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet("");
  3539. ui.doubleSpinBoxBondForce_2->setStyleSheet("");
  3540. ui.doubleSpinBoxBondPosZ_2->setStyleSheet("");
  3541. ui.spinBoxBondGrabDelay_2->setStyleSheet("");
  3542. ui.spinBoxBondDelay_2->setStyleSheet("");
  3543. ui.spinBoxBondBlockCheckDelay_2->setStyleSheet("");
  3544. ui.spinBoxBondVacDelay_2->setStyleSheet("");
  3545. ui.spinBoxBondBlowDelay_2->setStyleSheet("");
  3546. }
  3547. void BondMatrixProgramPage::UpdatePagePickPlaceParam()
  3548. {
  3549. m_isComBoxUpdating = true;
  3550. ui.comboBoxCurrentPara_Pick1->clear();
  3551. ui.comboBoxCurrentPara_Pick2->clear();
  3552. ui.comboBoxCurrentPara_Place1->clear();
  3553. ui.comboBoxCurrentPara_Pick2->clear();
  3554. //取/固晶参数
  3555. for (const auto& param : m_vecParam) {
  3556. ui.comboBoxCurrentPara_Pick1->addItem(QString::number(param.iId), param.iId);
  3557. ui.comboBoxCurrentPara_Pick2->addItem(QString::number(param.iId), param.iId);
  3558. ui.comboBoxCurrentPara_Place1->addItem(QString::number(param.iId), param.iId);
  3559. ui.comboBoxCurrentPara_Place2->addItem(QString::number(param.iId), param.iId);
  3560. }
  3561. m_isComBoxUpdating = false;
  3562. // --- 取晶头取晶 ---
  3563. safeSetComboBoxIndex(ui.comboBoxCurrentPara_Pick1, m_curBondInfo.iPickParamId);
  3564. // --- 中转台取晶 ---
  3565. safeSetComboBoxIndex(ui.comboBoxCurrentPara_Pick2, m_curBondInfo.iCalibPickParamId);
  3566. // --- 中转台固晶 ---
  3567. safeSetComboBoxIndex(ui.comboBoxCurrentPara_Place1, m_curBondInfo.iCalibBondParamId);
  3568. // --- 固晶台固晶 ---
  3569. safeSetComboBoxIndex(ui.comboBoxCurrentPara_Place2, m_curBondInfo.iBondParamId);
  3570. //m_tempWaferPickParam = m_curWaferPickParam;
  3571. //m_tempCalibPlaceParam = m_curCalibPlaceParam;
  3572. //m_tempCalibPickParam = m_curCalibPickParam;
  3573. //m_tempBondParam = m_curBondParam;
  3574. UpdatePagePick1Param();
  3575. UpdatePagePick2Param();
  3576. UpdatePageBond1Param();
  3577. UpdatePageBond2Param();
  3578. updateFourParamDeleteButtonStatus();
  3579. }
  3580. //取/固晶参数另存为
  3581. int BondMatrixProgramPage::ParamSaveAsEvent(ns_db::PICKBOND_PARAM_STRUCT &m_curToSaveAsParam)
  3582. {
  3583. int iToSaveAsParamId;
  3584. m_manageDB->GetCProduct()->AddBondParam(m_curToSaveAsParam, iToSaveAsParamId);
  3585. // 判断传入的是哪一个参数,并相应修改m_curBondInfo中的ID
  3586. if (&m_curToSaveAsParam == &m_curWaferPickParam)
  3587. {
  3588. m_curBondInfo.iPickParamId = iToSaveAsParamId;
  3589. }
  3590. else if (&m_curToSaveAsParam == &m_curCalibPlaceParam)
  3591. {
  3592. m_curBondInfo.iCalibBondParamId = iToSaveAsParamId;
  3593. }
  3594. else if (&m_curToSaveAsParam == &m_curCalibPickParam)
  3595. {
  3596. m_curBondInfo.iCalibPickParamId = iToSaveAsParamId;
  3597. }
  3598. else if (&m_curToSaveAsParam == &m_curBondParam)
  3599. {
  3600. m_curBondInfo.iBondParamId = iToSaveAsParamId;
  3601. }
  3602. m_manageDB->GetCProduct()->GetBondParam(iToSaveAsParamId, m_curToSaveAsParam);
  3603. m_vecParam.push_back(m_curToSaveAsParam);// = m_manageDB->GetCProduct()->GetAllBondInfoData();
  3604. // 填充 QComboBox
  3605. UpdatePagePickPlaceParam();
  3606. return iToSaveAsParamId;
  3607. }
  3608. //BondInfo另存为
  3609. int BondMatrixProgramPage::BondInfoParamSaveAsEvent()
  3610. {
  3611. //int iWaferPickParamId,iCalibPlaceParamId,iCalibPickParamId,iBondParamId;
  3612. //m_manageDB->GetCProduct()->AddBondParam(m_curWaferPickParam, iWaferPickParamId); //SetBondParam(m_curWaferPickParam.iId, m_curWaferPickParam);
  3613. //m_manageDB->GetCProduct()->AddBondParam(m_curCalibPlaceParam, iCalibPlaceParamId);
  3614. //m_manageDB->GetCProduct()->AddBondParam(m_curCalibPickParam, iCalibPickParamId);
  3615. //m_manageDB->GetCProduct()->AddBondParam(m_curBondParam, iBondParamId);
  3616. int iInfoId;
  3617. m_manageDB->GetCProduct()->AddBondInfoData(m_curBondInfo, iInfoId);
  3618. ns_db::BOND_INFO_STRUCT newBondInfo;
  3619. m_manageDB->GetCProduct()->GetBondInfoData(iInfoId, newBondInfo);
  3620. m_vecBondInfoData.push_back(newBondInfo);// = m_manageDB->GetCProduct()->GetAllBondInfoData();
  3621. // 填充 QComboBox
  3622. ui.comboBoxCurrentPara->clear();
  3623. for (const auto& bondMatrix : m_vecBondInfoData) {
  3624. QString itemText = QString::number(bondMatrix.iInfoId);
  3625. ui.comboBoxCurrentPara->addItem(itemText, bondMatrix.iInfoId);
  3626. }
  3627. ui.comboBoxCurrentPara->setCurrentIndex(ui.comboBoxCurrentPara->findData(iInfoId)); // 设置默认项
  3628. updateDeleteButtonStatus(canDeleteBondInfo(iInfoId), ui.pushButtonDeleteParam);
  3629. updateFourParamDeleteButtonStatus();
  3630. return iInfoId;
  3631. }
  3632. void BondMatrixProgramPage::ParamChangeEvent()
  3633. {
  3634. m_manageDB->GetCProduct()->SetBondInfoData(m_curBondInfo.iInfoId, m_curBondInfo);
  3635. m_manageDB->GetCProduct()->SetBondParam(m_curWaferPickParam.iId, m_curWaferPickParam);
  3636. m_manageDB->GetCProduct()->SetBondParam(m_curCalibPlaceParam.iId, m_curCalibPlaceParam);
  3637. m_manageDB->GetCProduct()->SetBondParam(m_curCalibPickParam.iId, m_curCalibPickParam);
  3638. m_manageDB->GetCProduct()->SetBondParam(m_curBondParam.iId, m_curBondParam);
  3639. m_tempWaferPickParam = m_curWaferPickParam;
  3640. m_tempCalibPlaceParam = m_curCalibPlaceParam;
  3641. m_tempCalibPickParam = m_curCalibPickParam;
  3642. m_tempBondParam = m_curBondParam;
  3643. m_vecBondInfoData = m_manageDB->GetCProduct()->GetAllBondInfoData();
  3644. m_tempBondInfo = m_curBondInfo;
  3645. updateFourParamDeleteButtonStatus();
  3646. CProduct* _Product = m_manageDB->GetCProduct();
  3647. UpdatePageParam();
  3648. }
  3649. void BondMatrixProgramPage::MatrixChangeEvent()
  3650. {
  3651. //TODO:此处可能有问题,可改成后端更新,没有相应ID则添加的形式
  3652. m_manageDB->GetCProduct()->SetAllBondMatrix(m_vectBondMatrixs, true);
  3653. m_manageDB->GetCProduct()->SetAllPointMatrix(m_vecSubMatrixs, true);
  3654. /*for (PROGRAM_BOND_MATRIX_STRUCT& bondMatrix : m_vectBondMatrixs)
  3655. {
  3656. m_manageDB->GetCProduct()->SetBondMatrix(bondMatrix.BondMatrixId, bondMatrix);
  3657. }*/
  3658. /*for (PROGRAM_POINT_MATRIX_STRUCT& pointMatrix : m_vecSubMatrixs)
  3659. {
  3660. m_manageDB->GetCProduct()->SetPointMatrix(pointMatrix.MatrixId, pointMatrix);
  3661. }*/
  3662. CProduct* _Product = m_manageDB->GetCProduct();
  3663. }
  3664. void BondMatrixProgramPage::UpdatePagePick1Param()
  3665. {
  3666. //"取晶头取晶"
  3667. {
  3668. ui.checkBoxPickBlockCheck->setChecked(m_curWaferPickParam.bCheckBlock);
  3669. ui.checkBoxPickLoseCheck->setChecked(m_curWaferPickParam.bCheckLose);
  3670. ui.checkBoxPickFindForceCheck->setChecked(m_curWaferPickParam.bFindForce);
  3671. ui.doubleSpinBoxPrePickZ->setValue(m_curWaferPickParam.dPreLevOffset);
  3672. ui.doubleSpinBoxPickForce->setValue(m_curWaferPickParam.dForce);
  3673. ui.doubleSpinBoxPickPosZ->setValue(m_curWaferPickParam.dWorkLevOffset);
  3674. ui.spinBoxPickGrabDelay->setValue(m_curWaferPickParam.iGrabDelay);
  3675. ui.spinBoxPickDelay->setValue(m_curWaferPickParam.iPickOrBondDelay);
  3676. ui.spinBoxPickBlockCheckDelay->setValue(m_curWaferPickParam.iBlockOrLoseDelay);
  3677. ui.spinBoxPickVacDelay->setValue(m_curWaferPickParam.iVacuumDelay);
  3678. ui.spinBoxPickBlowDelay->setValue(m_curWaferPickParam.iBlowDelay);
  3679. //ui.doubleSpinBoxPrePickZ->setEnabled(!ui.checkBoxPickFindForceCheck->isChecked());
  3680. ui.doubleSpinBoxPickPosZ->setEnabled(!ui.checkBoxPickFindForceCheck->isChecked());
  3681. }
  3682. // 更新样式
  3683. if (m_curWaferPickParam.bCheckBlock == m_tempWaferPickParam.bCheckBlock)
  3684. ui.checkBoxPickLoseCheck->setStyleSheet(""); // 恢复默认样式
  3685. else
  3686. ui.checkBoxPickLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红
  3687. if (m_curWaferPickParam.bCheckLose == m_tempWaferPickParam.bCheckLose)
  3688. ui.checkBoxPickLoseCheck->setStyleSheet(""); // 恢复默认样式
  3689. else
  3690. ui.checkBoxPickLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红
  3691. if (m_curWaferPickParam.bFindForce == m_tempWaferPickParam.bFindForce)
  3692. ui.checkBoxPickFindForceCheck->setStyleSheet(""); // 恢复默认样式
  3693. else
  3694. ui.checkBoxPickFindForceCheck->setStyleSheet("color: red;"); // 字体颜色变红
  3695. if (m_curWaferPickParam.dPreLevOffset == m_tempWaferPickParam.dPreLevOffset)
  3696. ui.doubleSpinBoxPrePickZ->setStyleSheet(""); // 恢复默认样式
  3697. else
  3698. ui.doubleSpinBoxPrePickZ->setStyleSheet("color: red;"); // 字体颜色变红
  3699. if (m_curWaferPickParam.dForce == m_tempWaferPickParam.dForce)
  3700. ui.doubleSpinBoxPickForce->setStyleSheet(""); // 恢复默认样式
  3701. else
  3702. ui.doubleSpinBoxPickForce->setStyleSheet("color: red;"); // 字体颜色变红
  3703. if (m_curWaferPickParam.dWorkLevOffset == m_tempWaferPickParam.dWorkLevOffset)
  3704. ui.doubleSpinBoxPickPosZ->setStyleSheet(""); // 恢复默认样式
  3705. else
  3706. ui.doubleSpinBoxPickPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  3707. if (m_curWaferPickParam.iGrabDelay == m_tempWaferPickParam.iGrabDelay)
  3708. ui.spinBoxPickGrabDelay->setStyleSheet(""); // 恢复默认样式
  3709. else
  3710. ui.spinBoxPickGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红
  3711. if (m_curWaferPickParam.iPickOrBondDelay == m_tempWaferPickParam.iPickOrBondDelay)
  3712. ui.spinBoxPickDelay->setStyleSheet(""); // 恢复默认样式
  3713. else
  3714. ui.spinBoxPickDelay->setStyleSheet("color: red;"); // 字体颜色变红
  3715. if (m_curWaferPickParam.iBlockOrLoseDelay == m_tempWaferPickParam.iBlockOrLoseDelay)
  3716. ui.spinBoxPickBlockCheckDelay->setStyleSheet(""); // 恢复默认样式
  3717. else
  3718. ui.spinBoxPickBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红
  3719. if (m_curWaferPickParam.iVacuumDelay == m_tempWaferPickParam.iVacuumDelay)
  3720. ui.spinBoxPickVacDelay->setStyleSheet(""); // 恢复默认样式
  3721. else
  3722. ui.spinBoxPickVacDelay->setStyleSheet("color: red;"); // 字体颜色变红
  3723. if (m_curWaferPickParam.iBlowDelay == m_tempWaferPickParam.iBlowDelay)
  3724. ui.spinBoxPickBlowDelay->setStyleSheet(""); // 恢复默认样式
  3725. else
  3726. ui.spinBoxPickBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红
  3727. }
  3728. void BondMatrixProgramPage::UpdatePagePick2Param()
  3729. {
  3730. //"中转台取晶"
  3731. {
  3732. ui.checkBoxPickBlockCheck_2->setChecked(m_curCalibPickParam.bCheckBlock);
  3733. ui.checkBoxPickLoseCheck_2->setChecked(m_curCalibPickParam.bCheckLose);
  3734. ui.checkBoxPickFindForceCheck_2->setChecked(m_curCalibPickParam.bFindForce);
  3735. ui.doubleSpinBoxPrePickZ_2->setValue(m_curCalibPickParam.dPreLevOffset);
  3736. ui.doubleSpinBoxPickForce_2->setValue(m_curCalibPickParam.dForce);
  3737. ui.doubleSpinBoxPickPosZ_2->setValue(m_curCalibPickParam.dWorkLevOffset);
  3738. ui.spinBoxPickGrabDelay_2->setValue(m_curCalibPickParam.iGrabDelay);
  3739. ui.spinBoxPickDelay_2->setValue(m_curCalibPickParam.iPickOrBondDelay);
  3740. ui.spinBoxPickBlockCheckDelay_2->setValue(m_curCalibPickParam.iBlockOrLoseDelay);
  3741. ui.spinBoxPickVacDelay_2->setValue(m_curCalibPickParam.iVacuumDelay);
  3742. ui.spinBoxPickBlowDelay_2->setValue(m_curCalibPickParam.iBlowDelay);
  3743. //ui.doubleSpinBoxPrePickZ_2->setEnabled(!ui.checkBoxPickFindForceCheck_2->isChecked());
  3744. ui.doubleSpinBoxPickPosZ_2->setEnabled(!ui.checkBoxPickFindForceCheck_2->isChecked());
  3745. }
  3746. // 判断复选框并更新样式
  3747. if (m_curCalibPickParam.bCheckBlock == m_tempCalibPickParam.bCheckBlock)
  3748. ui.checkBoxPickBlockCheck_2->setStyleSheet(""); // 恢复默认样式
  3749. else
  3750. ui.checkBoxPickBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  3751. if (m_curCalibPickParam.bCheckLose == m_tempCalibPickParam.bCheckLose)
  3752. ui.checkBoxPickLoseCheck_2->setStyleSheet(""); // 恢复默认样式
  3753. else
  3754. ui.checkBoxPickLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  3755. if (m_curCalibPickParam.bFindForce == m_tempCalibPickParam.bFindForce)
  3756. ui.checkBoxPickFindForceCheck_2->setStyleSheet(""); // 恢复默认样式
  3757. else
  3758. ui.checkBoxPickFindForceCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  3759. // 判断 DoubleSpinBox 控件并更新样式
  3760. if (m_curCalibPickParam.dPreLevOffset == m_tempCalibPickParam.dPreLevOffset)
  3761. ui.doubleSpinBoxPrePickZ_2->setStyleSheet(""); // 恢复默认样式
  3762. else
  3763. ui.doubleSpinBoxPrePickZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  3764. if (m_curCalibPickParam.dForce == m_tempCalibPickParam.dForce)
  3765. ui.doubleSpinBoxPickForce_2->setStyleSheet(""); // 恢复默认样式
  3766. else
  3767. ui.doubleSpinBoxPickForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  3768. if (m_curCalibPickParam.dWorkLevOffset == m_tempCalibPickParam.dWorkLevOffset)
  3769. ui.doubleSpinBoxPickPosZ_2->setStyleSheet(""); // 恢复默认样式
  3770. else
  3771. ui.doubleSpinBoxPickPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  3772. // 判断 SpinBox 控件并更新样式
  3773. if (m_curCalibPickParam.iGrabDelay == m_tempCalibPickParam.iGrabDelay)
  3774. ui.spinBoxPickGrabDelay_2->setStyleSheet(""); // 恢复默认样式
  3775. else
  3776. ui.spinBoxPickGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  3777. if (m_curCalibPickParam.iPickOrBondDelay == m_tempCalibPickParam.iPickOrBondDelay)
  3778. ui.spinBoxPickDelay_2->setStyleSheet(""); // 恢复默认样式
  3779. else
  3780. ui.spinBoxPickDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  3781. if (m_curCalibPickParam.iBlockOrLoseDelay == m_tempCalibPickParam.iBlockOrLoseDelay)
  3782. ui.spinBoxPickBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式
  3783. else
  3784. ui.spinBoxPickBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  3785. if (m_curCalibPickParam.iVacuumDelay == m_tempCalibPickParam.iVacuumDelay)
  3786. ui.spinBoxPickVacDelay_2->setStyleSheet(""); // 恢复默认样式
  3787. else
  3788. ui.spinBoxPickVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  3789. if (m_curCalibPickParam.iBlowDelay == m_tempCalibPickParam.iBlowDelay)
  3790. ui.spinBoxPickBlowDelay_2->setStyleSheet(""); // 恢复默认样式
  3791. else
  3792. ui.spinBoxPickBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  3793. }
  3794. void BondMatrixProgramPage::UpdatePageBond1Param()
  3795. {
  3796. //"中转台放晶"
  3797. {
  3798. ui.checkBoxBondBlockCheck->setChecked(m_curCalibPlaceParam.bCheckBlock);
  3799. ui.checkBoxBondLoseCheck->setChecked(m_curCalibPlaceParam.bCheckLose);
  3800. ui.checkBoxBondFindForce->setChecked(m_curCalibPlaceParam.bFindForce);
  3801. ui.doubleSpinBoxPreBondPosZ->setValue(m_curCalibPlaceParam.dPreLevOffset);
  3802. ui.doubleSpinBoxBondForce->setValue(m_curCalibPlaceParam.dForce);
  3803. ui.doubleSpinBoxBondPosZ->setValue(m_curCalibPlaceParam.dWorkLevOffset);
  3804. ui.spinBoxBondGrabDelay->setValue(m_curCalibPlaceParam.iGrabDelay);
  3805. ui.spinBoxBondDelay->setValue(m_curCalibPlaceParam.iPickOrBondDelay);
  3806. ui.spinBoxBondBlockCheckDelay->setValue(m_curCalibPlaceParam.iBlockOrLoseDelay);
  3807. ui.spinBoxBondVacDelay->setValue(m_curCalibPlaceParam.iVacuumDelay);
  3808. ui.spinBoxBondBlowDelay->setValue(m_curCalibPlaceParam.iBlowDelay);
  3809. ui.doubleSpinBoxPreBondPosZ->setEnabled(!ui.checkBoxBondFindForce->isChecked());
  3810. ui.doubleSpinBoxBondPosZ->setEnabled(!ui.checkBoxBondFindForce->isChecked());
  3811. }
  3812. // 样式判断:根据条件更新样式
  3813. if (m_curCalibPlaceParam.bCheckBlock == m_tempCalibPlaceParam.bCheckBlock)
  3814. ui.checkBoxBondBlockCheck->setStyleSheet(""); // 恢复默认样式
  3815. else
  3816. ui.checkBoxBondBlockCheck->setStyleSheet("color: red;"); // 字体颜色变红
  3817. if (m_curCalibPlaceParam.bCheckLose == m_tempCalibPlaceParam.bCheckLose)
  3818. ui.checkBoxBondLoseCheck->setStyleSheet(""); // 恢复默认样式
  3819. else
  3820. ui.checkBoxBondLoseCheck->setStyleSheet("color: red;"); // 字体颜色变红
  3821. if (m_curCalibPlaceParam.bFindForce == m_tempCalibPlaceParam.bFindForce)
  3822. ui.checkBoxBondFindForce->setStyleSheet(""); // 恢复默认样式
  3823. else
  3824. ui.checkBoxBondFindForce->setStyleSheet("color: red;"); // 字体颜色变红
  3825. // DoubleSpinBox 样式判断
  3826. if (m_curCalibPlaceParam.dPreLevOffset == m_tempCalibPlaceParam.dPreLevOffset)
  3827. ui.doubleSpinBoxPreBondPosZ->setStyleSheet(""); // 恢复默认样式
  3828. else
  3829. ui.doubleSpinBoxPreBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  3830. if (m_curCalibPlaceParam.dForce == m_tempCalibPlaceParam.dForce)
  3831. ui.doubleSpinBoxBondForce->setStyleSheet(""); // 恢复默认样式
  3832. else
  3833. ui.doubleSpinBoxBondForce->setStyleSheet("color: red;"); // 字体颜色变红
  3834. if (m_curCalibPlaceParam.dWorkLevOffset == m_tempCalibPlaceParam.dWorkLevOffset)
  3835. ui.doubleSpinBoxBondPosZ->setStyleSheet(""); // 恢复默认样式
  3836. else
  3837. ui.doubleSpinBoxBondPosZ->setStyleSheet("color: red;"); // 字体颜色变红
  3838. // SpinBox 样式判断
  3839. if (m_curCalibPlaceParam.iGrabDelay == m_tempCalibPlaceParam.iGrabDelay)
  3840. ui.spinBoxBondGrabDelay->setStyleSheet(""); // 恢复默认样式
  3841. else
  3842. ui.spinBoxBondGrabDelay->setStyleSheet("color: red;"); // 字体颜色变红
  3843. if (m_curCalibPlaceParam.iPickOrBondDelay == m_tempCalibPlaceParam.iPickOrBondDelay)
  3844. ui.spinBoxBondDelay->setStyleSheet(""); // 恢复默认样式
  3845. else
  3846. ui.spinBoxBondDelay->setStyleSheet("color: red;"); // 字体颜色变红
  3847. if (m_curCalibPlaceParam.iBlockOrLoseDelay == m_tempCalibPlaceParam.iBlockOrLoseDelay)
  3848. ui.spinBoxBondBlockCheckDelay->setStyleSheet(""); // 恢复默认样式
  3849. else
  3850. ui.spinBoxBondBlockCheckDelay->setStyleSheet("color: red;"); // 字体颜色变红
  3851. if (m_curCalibPlaceParam.iVacuumDelay == m_tempCalibPlaceParam.iVacuumDelay)
  3852. ui.spinBoxBondVacDelay->setStyleSheet(""); // 恢复默认样式
  3853. else
  3854. ui.spinBoxBondVacDelay->setStyleSheet("color: red;"); // 字体颜色变红
  3855. if (m_curCalibPlaceParam.iBlowDelay == m_tempCalibPlaceParam.iBlowDelay)
  3856. ui.spinBoxBondBlowDelay->setStyleSheet(""); // 恢复默认样式
  3857. else
  3858. ui.spinBoxBondBlowDelay->setStyleSheet("color: red;"); // 字体颜色变红
  3859. }
  3860. void BondMatrixProgramPage::UpdatePageBond2Param()
  3861. {
  3862. //"固晶台固晶"
  3863. {
  3864. ui.checkBoxBondBlockCheck_2->setChecked(m_curBondParam.bCheckBlock);
  3865. ui.checkBoxBondLoseCheck_2->setChecked(m_curBondParam.bCheckLose);
  3866. ui.checkBoxBondFindForce_2->setChecked(m_curBondParam.bFindForce);
  3867. ui.doubleSpinBoxPreBondPosZ_2->setValue(m_curBondParam.dPreLevOffset);
  3868. ui.doubleSpinBoxBondForce_2->setValue(m_curBondParam.dForce);
  3869. ui.doubleSpinBoxBondPosZ_2->setValue(m_curBondParam.dWorkLevOffset);
  3870. ui.spinBoxBondGrabDelay_2->setValue(m_curBondParam.iGrabDelay);
  3871. ui.spinBoxBondDelay_2->setValue(m_curBondParam.iPickOrBondDelay);
  3872. ui.spinBoxBondBlockCheckDelay_2->setValue(m_curBondParam.iBlockOrLoseDelay);
  3873. ui.spinBoxBondVacDelay_2->setValue(m_curBondParam.iVacuumDelay);
  3874. ui.spinBoxBondBlowDelay_2->setValue(m_curBondParam.iBlowDelay);
  3875. //ui.doubleSpinBoxPreBondPosZ_2->setEnabled(!ui.checkBoxBondFindForce_2->isChecked());
  3876. ui.doubleSpinBoxBondPosZ_2->setEnabled(!ui.checkBoxBondFindForce_2->isChecked());
  3877. }
  3878. // 更新样式:根据条件判断改变样式
  3879. if (m_curBondParam.bCheckBlock == m_tempBondParam.bCheckBlock)
  3880. ui.checkBoxBondBlockCheck_2->setStyleSheet(""); // 恢复默认样式
  3881. else
  3882. ui.checkBoxBondBlockCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  3883. if (m_curBondParam.bCheckLose == m_tempBondParam.bCheckLose)
  3884. ui.checkBoxBondLoseCheck_2->setStyleSheet(""); // 恢复默认样式
  3885. else
  3886. ui.checkBoxBondLoseCheck_2->setStyleSheet("color: red;"); // 字体颜色变红
  3887. if (m_curBondParam.bFindForce == m_tempBondParam.bFindForce)
  3888. ui.checkBoxBondFindForce_2->setStyleSheet(""); // 恢复默认样式
  3889. else
  3890. ui.checkBoxBondFindForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  3891. // 判断 DoubleSpinBox 样式
  3892. if (m_curBondParam.dPreLevOffset == m_tempBondParam.dPreLevOffset)
  3893. ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet(""); // 恢复默认样式
  3894. else
  3895. ui.doubleSpinBoxPreBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  3896. if (m_curBondParam.dForce == m_tempBondParam.dForce)
  3897. ui.doubleSpinBoxBondForce_2->setStyleSheet(""); // 恢复默认样式
  3898. else
  3899. ui.doubleSpinBoxBondForce_2->setStyleSheet("color: red;"); // 字体颜色变红
  3900. if (m_curBondParam.dWorkLevOffset == m_tempBondParam.dWorkLevOffset)
  3901. ui.doubleSpinBoxBondPosZ_2->setStyleSheet(""); // 恢复默认样式
  3902. else
  3903. ui.doubleSpinBoxBondPosZ_2->setStyleSheet("color: red;"); // 字体颜色变红
  3904. // 判断 SpinBox 样式
  3905. if (m_curBondParam.iGrabDelay == m_tempBondParam.iGrabDelay)
  3906. ui.spinBoxBondGrabDelay_2->setStyleSheet(""); // 恢复默认样式
  3907. else
  3908. ui.spinBoxBondGrabDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  3909. if (m_curBondParam.iPickOrBondDelay == m_tempBondParam.iPickOrBondDelay)
  3910. ui.spinBoxBondDelay_2->setStyleSheet(""); // 恢复默认样式
  3911. else
  3912. ui.spinBoxBondDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  3913. if (m_curBondParam.iBlockOrLoseDelay == m_tempBondParam.iBlockOrLoseDelay)
  3914. ui.spinBoxBondBlockCheckDelay_2->setStyleSheet(""); // 恢复默认样式
  3915. else
  3916. ui.spinBoxBondBlockCheckDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  3917. if (m_curBondParam.iVacuumDelay == m_tempBondParam.iVacuumDelay)
  3918. ui.spinBoxBondVacDelay_2->setStyleSheet(""); // 恢复默认样式
  3919. else
  3920. ui.spinBoxBondVacDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  3921. if (m_curBondParam.iBlowDelay == m_tempBondParam.iBlowDelay)
  3922. ui.spinBoxBondBlowDelay_2->setStyleSheet(""); // 恢复默认样式
  3923. else
  3924. ui.spinBoxBondBlowDelay_2->setStyleSheet("color: red;"); // 字体颜色变红
  3925. }
  3926. void BondMatrixProgramPage::initPage()
  3927. {
  3928. m_manageDB = CManageDB::GetInstance();
  3929. //if (m_manageDB == nullptr) return;
  3930. m_pProduct = m_manageDB->GetCProduct();
  3931. //if (m_pProduct == nullptr) return;
  3932. m_TipMatrix = ns_mat::TipMatrix::GetInstance();
  3933. m_pProgramCViewInterface = ns_module::CViewInterface::GetInstance();
  3934. //从后端获取数据
  3935. m_vectBondMatrixs = m_manageDB->GetCProduct()->GetBondMatrix();
  3936. m_manageDB->GetCProduct()->GetAllPointMatrix(m_vecSubMatrixs);
  3937. m_vecBondInfoData = m_manageDB->GetCProduct()->GetAllBondInfoData();
  3938. //if (m_vectBondMatrixs.size() == 0) return;
  3939. //for (int i = 0; i < m_vectBondMatrixs.size(); i++)
  3940. //{
  3941. // for (int j = 0; j < m_vectBondMatrixs[i].VecPointMatrixId.size(); j++)
  3942. // {
  3943. // PROGRAM_POINT_MATRIX_STRUCT subMatrix;
  3944. // m_manageDB->GetCProduct()->GetPointMatrix(m_vectBondMatrixs[i].VecPointMatrixId[j], subMatrix);
  3945. // m_vecSubMatrixs.push_back(subMatrix);
  3946. // //AddMatrixPage(i, j, subMatrix);
  3947. // }
  3948. // AddOutMatrixPage(i, m_vectBondMatrixs[i], m_vecSubMatrixs);
  3949. //}
  3950. for (int i = 0; i < m_vectBondMatrixs.size(); i++)
  3951. {
  3952. AddOutMatrixPage(i, m_vectBondMatrixs[i], m_vecSubMatrixs);
  3953. }
  3954. //for (int i = 0; i < m_vectBondMatrixs[0].VecPointMatrixId.size(); ++i)
  3955. //{
  3956. // PROGRAM_POINT_MATRIX_STRUCT subMatrix;
  3957. // m_manageDB->GetCProduct()->GetPointMatrix(m_vectBondMatrixs[0].VecPointMatrixId[i], subMatrix);
  3958. // m_vecSubMatrixs.push_back(subMatrix);
  3959. //}
  3960. //m_manageDB->GetCProduct()->GetDieMatrix(m_vectBondMatrixs[0].VecPointMatrixId[0], m_vecSubMatrixs);
  3961. ////显示矩阵数据
  3962. //ui.spinBoxRow->setValue(m_vectBondMatrixs[0].BondMatrixRow);
  3963. //ui.spinBoxCol->setValue(m_vectBondMatrixs[0].BondMatrixCol);
  3964. //ui.doubleSpinBoxLeftTopX->setValue(m_vectBondMatrixs[0].LeftTopPoint.x);
  3965. //ui.doubleSpinBoxLeftTopY->setValue(m_vectBondMatrixs[0].LeftTopPoint.y);
  3966. //ui.doubleSpinBoxRightTopX->setValue(m_vectBondMatrixs[0].RightTopPoint.x);
  3967. //ui.doubleSpinBoxRightTopY->setValue(m_vectBondMatrixs[0].RightTopPoint.y);
  3968. //ui.doubleSpinBoxRightButtomX->setValue(m_vectBondMatrixs[0].RightBottomPoint.x);
  3969. //ui.doubleSpinBoxRightButtomY->setValue(m_vectBondMatrixs[0].RightBottomPoint.y);
  3970. //QString noBondPts = "";
  3971. //bool firstTime = false;
  3972. //for (XY_LONG_STRUCT& pt : m_vectBondMatrixs[0].VecNoBondPt)
  3973. //{
  3974. // if (firstTime)
  3975. // {
  3976. // noBondPts += "(" + QString::number(pt.x) + "," + QString::number(pt.y) + ")";
  3977. // firstTime = true;
  3978. // }
  3979. // noBondPts += ";(" + QString::number(pt.x) + "," + QString::number(pt.y) + ")";
  3980. //}
  3981. //ui.lineEditNoBondPts->setText(noBondPts);
  3982. ////显示子矩阵及数据
  3983. //for (PROGRAM_POINT_MATRIX_STRUCT& subMatrix : m_vecSubMatrixs)
  3984. //{
  3985. // AddMatrixPage(subMatrix);
  3986. //}
  3987. //从后端获取参数, 一套数据
  3988. CResources* pResources = CResources::GetInstance();
  3989. //if (pResources == nullptr) return;
  3990. CBondMatrix* pBondMatrix = pResources->GetBondMatrix();
  3991. //if (pBondMatrix == nullptr) return;
  3992. //AddOutMatrixPage(0, m_vectBondMatrixs[0], m_vecSubMatrixs);
  3993. ui.comboBoxCurrentMatrix->clear();
  3994. for (int i = 0; i < m_vectBondMatrixs.size(); i++)
  3995. {
  3996. // 显示 矩阵编号
  3997. int _bondMatrixId = m_vectBondMatrixs[i].BondMatrixId;
  3998. QString itemText = QString::number(_bondMatrixId);
  3999. // 将 矩阵编号 添加到下拉框
  4000. ui.comboBoxCurrentMatrix->addItem(itemText,_bondMatrixId);
  4001. }
  4002. if (!m_vectBondMatrixs.empty()) {
  4003. ShowCurrentMatrix(m_vectBondMatrixs[0].BondMatrixId);
  4004. }
  4005. // 清空下拉框中的所有项
  4006. ui.comboBoxCurrentPara->clear();
  4007. // 重新填充下拉框选项,并更新 QMap 中的绑定关系
  4008. for (const auto& bondMatrix : m_vecBondInfoData) {
  4009. // 显示编号 iInfoId
  4010. QString itemText = QString::number(bondMatrix.iInfoId);
  4011. // 将 iInfoId 添加到下拉框
  4012. ui.comboBoxCurrentPara->addItem(itemText, bondMatrix.iInfoId);
  4013. }
  4014. UpdateShowBondInfoData(m_vectBondMatrixs[0].BondInfoId);
  4015. }
  4016. void BondMatrixProgramPage::UpdateShowBondInfoData(UINT iInfoId) {
  4017. if (iInfoId <= 0)return;
  4018. //pBondMatrix->GetPintInfoByIndex(0, m_curPointInfo);
  4019. m_manageDB->GetCProduct()->GetBondInfoData(iInfoId, m_curBondInfo);
  4020. m_tempBondInfo = m_curBondInfo;
  4021. m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iPickParamId, m_curWaferPickParam);
  4022. m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iCalibBondParamId, m_curCalibPlaceParam);
  4023. m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iCalibPickParamId, m_curCalibPickParam);
  4024. m_manageDB->GetCProduct()->GetBondParam(m_curBondInfo.iBondParamId, m_curBondParam);
  4025. m_vecParam = m_manageDB->GetCProduct()->GetAllBondParamData();
  4026. m_tempWaferPickParam = m_curWaferPickParam;
  4027. m_tempCalibPlaceParam = m_curCalibPlaceParam;
  4028. m_tempCalibPickParam = m_curCalibPickParam;
  4029. m_tempBondParam = m_curBondParam;
  4030. m_vecPrTemplate = m_manageDB->GetCProduct()->GetPrTemplate();
  4031. m_vecPrStrategy = m_manageDB->GetCProduct()->GetPrStrategy();
  4032. m_vecPrBondInsp = m_manageDB->GetCProduct()->GetPrBondInsp();
  4033. m_TipMatrix->GetAllNozzleIndex(m_vecNozzles);
  4034. ui.comboBoxCurrentPara->setCurrentIndex(ui.comboBoxCurrentPara->findData(iInfoId)); // 设置默认项
  4035. updateDeleteButtonStatus(canDeleteBondInfo(iInfoId), ui.pushButtonDeleteParam);
  4036. updateFourParamDeleteButtonStatus();
  4037. //显示界面参数
  4038. UpdatePageParam();
  4039. }