BondMatrixProgramPage.cpp 212 KB

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