您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 其它文档 > Laker-TCL-进阶训练教材
LakerAdvanceTCLTrainingAgenda如何寫一個有效率的LakerTCLutility好用的TCLcommands存取Lakerdatabase如何建立P-DeviceUDD與TCL的結合實例解說圖形化界面(GUI)的製作技巧連結TCL/TK利用IPC溝通Laker與外部程式TCLdebugTool-TclPro(proDebug)如何寫一個有效率的LakerTCLutility弄清楚DB架構盡量使用DBTCLcommands•LakerAPcommand會多花時間處理顯示的問題,所以效率較差多查看LakerTCLcommandreference,使用有效率的LakerTCLcommand•假設有100萬個Figures要殺掉,你會怎麼做?善用dbTraverse,不要搜尋太大區域,以免回傳的IDlist太大利用proDebug幫你除錯如何寫一個有效率的LakerTCLutilityQ:假設有100萬個Figures要殺掉,你會怎麼做?A:在TCL裡面run一百萬次的迴圈即使是不做事,也是要花不少時間,所以改用dbUDDDelete會比用dbDelete快。foreachitem$objList{dbDelete–obj$item}dbUDDDelete–figs$objList./TCL/del1.tcl./TCL/del2.tcl好用的LakerTCLcommands取得目前開啟的cell的cellviewID•setcvId[lakerGetWndCellViewId]SelectScheme•取得目前選到的物件的ID:lakerGetSelSet•將物件ID設成lakerAP選到的物件:lakerSetSelSet-figsActiveLayer•取得目前的ActiveLayerID:lakerGetCurLayerId•將LayerID轉成LayerName與LayerPurpose:•dbGetLayerNameByLayerId-layer$layerId•dbGetPurposeNameByLayerId-layer$layerId•設定目前的ActiveLayer:lakerSetActiveLayer-layerNamelayerName[-purposepurpose]提供互動式的輸入•lakerEnterPoint,lakerEnterBox,lakerEnterLine,lakerEnterPolygon,lakerEnterPath取得目前滑鼠座標•lakerGetCurPos好用的LakerTCLcommands顯示在Xtermputs“ThisistheMessage”顯示在MainWindowlakerMessage“ThisistheMessage”顯示在新的視窗lakerMsgForm-nameformName-textThisisthe\nMessage“•利用TK好用的LakerTCLcommandsprocdialog{}{gtDisplayAppDBox-namedemo\-dboxBannerTitle\-dialogTypeInformationDialog\-dboxTextThisisthe\nMessage\-buttonLayoutOKCancel\-location{200200}\-callback{putsyoupressOK}}dialog./TCL/dialog.tcl好用的LakerTCLcommands如果你想要直接使用opencell的form來選cell,可以用lakerGetLibCell•lakerGetLibCell[-initLibinitLibName-initCellinitCellName]][-canNew0|1]好用的LakerTCLcommandslakerGetClipboardCV•PastecommandwillgetallClipboarddata.•Youcouldrefinetherealizeddatainthiscellview.•Pleasedon’tSaveandClosethiscellviewId.•Argument-purge•1:Clearallclipboaddata•0:keepthecurrentclipboarddataproccopy2Cell{}{setcvId[lakerGetWndCellViewId]setlibName[dbGet-obj$cvId-attrLibName]setpoint[lakerEnterPolygon]lakerYankObj-point$point-refPoint(0.0,0.0)setclipCV[lakerGetClipboardCV-purge0]dbCopyCV-cellclipboard_cell-libLAB-cv$clipCV-overWrite1}copy2Cell./TCL/copy2Cell.tcl好用的LakerTCLcommandslakerPasteObjProvidethesearguments200909after.•-guiMode1LetuserrealizedatainGUImode.•-oneExecute1Onlypasteonetime.•-stack1Changeitsrotatingbehavior好用的LakerTCLcommands•-procedureItwillcallbacktothisspecifiedTCLprocedurewhenitfinishedoraborted.•-clientDataCallbackfunctionclientdataproccopyAndPaste{}{setcvId[lakerGetWndCellViewId]setlibName[dbGet-obj$cvId-attrLibName]setpoint[lakerEnterPolygon]lakerYankObj-point$pointlakerPasteObj-guiMode1-oneExecute0}copyAndPaste./TCL/copyAndPaste.tclLAB1–LakerTCLcommand目的:練習LakerTCLcommand的使用。需求:讓使用者可以用lakerEnterBox畫出一個方塊,並和目前選到的圖形做Merge,再將結果設成選取的物件。步驟:•用lakerEnterBox讓使用者畫出方塊,並得到方塊座標•取得目前的activelayer然後根據方塊座標畫一個rectangle•加選這個rectangle,然後執行Merge用到的lakerTCLcommands•lakerEnterBox,lakerCreateRect,lakerGetCurLayerId,dbGetLayerNameByLayerId,dbGetPurposeNameByLayerId,lakerIncreaseSel,lakerMergeObj進階改寫:將它改成可以連續執行,直到按ESC為止LABprocessstepsLogin:studentPassword:studenttarATCLcdLakerTCLAdvance_Lablaker&OpenLAB-lab1好用的DBTCLcommands抓出或設定物件的內容•dbGet,dbSet搜尋物件的好工具•dbTraverse,dbGetTrueOverlaps•兩者有何不同?•要找出下層物件的位置•-attachBBox,-attachPoint好用的DBTCLcommandsQ:dbTraverse,dbGetTrueOverlaps兩者有何不同?A:就本圖的例子,dbTraverse得到的是A與B,但dbGetTrueOverlaps得到的只有B。dbTraverse是找出那些物件的BBox與指定的區域有重疊./TCL/dbTraverse_1.tcldbTraverseExampleStudy我想要把Hierarchy下面數層所有的Text複製到最上層來,想想看如何利用dbTraverse來完成?dbTraverseExampleStudyprocliftTextOnTop{hLevel}{setcv[lakerGetWndCellViewId]setalist[dbTraverse-cv$cv-shapeOnly1-startLevel1\-stopLevel$hLevel-attachPoint1]foreachshape$alist{setshapeId[lindex$shape0]if{[dbGet-obj$shapeId-attrType]==Label}{setlayer[dbGet-obj$shapeId-attrLayer]setpurpose[dbGet-obj$shapeId-attrPurpose]setpoint[lindex$shape1]settext[dbGet-obj$shapeId-attrText]setheight[dbGet-obj$shapeId-attrHeight]setorient[dbGet-obj$shapeId-attrOrient]setjustify[dbGet-obj$shapeId-attrJustify]setfont[dbGet-obj$shapeId-attrFont]dbCreateLabel-cv$cv-layer$layer-purpose$purpose\-point$point-text[lindex$text0]-height$height\-orient$orient-justify$justify-font$font}}lakerRedraw}./TCL/liftTextOnTop.tcl好用的DBTCLcommandsdbUDDxxx•一次殺掉很多物件•dbUDDDelete-figsfigList•將某個cell填滿於特定物件所在的區域•dbUDDFill-figsfigList-liblibraryName-cellcellName\[-viewviewName][-fillInObjfigId|figIdList]-colSpacecolSpace-rowSpacerowSpace\[-leftEncleftEnc][-rightEncrightEnc][-topEnctopEnc]\[-bottomEncbottomEnc][-methodcontact|guardring]\[-justifyjusification][-magnimanification]\[-orientorientation]dbUDDFillExampleStudyprocfill{}{setobjList[lakerGetSelSet]dbUDDFill-figs$objList-libLAB-cellcont-colSpace0.4-rowSpace0.4}fill./TCL/dbUDDFill.tcl好用的DBTCLcommandsBooleanOperation•dbSizing:Expandorshrinkeachsideofthespecifiedobjects•dbSizing-sizesizeValue-figsfigures[-layerlayer][-purposepurpose][-deloldobj0|1][-truncatefloatValue][-convert0|1][-keepOrthogonal0|1][-absolute0|1]•dbLayerGen:ChangetheshapesoftwospecificlayersorfiguresbyusingBooleanoperation.•dbLayerGen-opbooleanOperation-dstdstCVID(-lplayerName[p
本文标题:Laker-TCL-进阶训练教材
链接地址:https://www.777doc.com/doc-4602545 .html