@windypro-rourou/dsh-eda 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/capabilities.js +3 -2
- package/lib/client.js +33 -0
- package/lib/index.js +89 -2
- package/package.json +10 -1
- package/skill/INDEX.md +10 -8
- package/skill/README.md +125 -0
- package/skill/README.zh-Hans.md +125 -0
- package/skill/SKILL.md +746 -746
- package/skill/format/index.md +152 -152
- package/skill/format/pcb/3d.md +166 -166
- package/skill/format/pcb/attr.md +63 -63
- package/skill/format/pcb/common.md +306 -306
- package/skill/format/pcb/component.md +132 -132
- package/skill/format/pcb/dimension.md +58 -58
- package/skill/format/pcb/index.md +17 -17
- package/skill/format/pcb/obj.md +43 -43
- package/skill/format/pcb/pad_via.md +151 -151
- package/skill/format/pcb/panel.md +64 -64
- package/skill/format/pcb/partition.md +43 -43
- package/skill/format/pcb/primitive.md +196 -196
- package/skill/format/pcb/rule.md +71 -71
- package/skill/format/pcb/shape.md +441 -441
- package/skill/format/pcb/text.md +62 -62
- package/skill/format/project/blob.md +30 -30
- package/skill/format/project/common.md +42 -42
- package/skill/format/project/group.md +62 -62
- package/skill/format/project/index.md +12 -12
- package/skill/format/project/instance.md +32 -32
- package/skill/format/project/meta.md +189 -189
- package/skill/format/project/variant.md +30 -30
- package/skill/format/schematic/attr.md +41 -41
- package/skill/format/schematic/common.md +47 -47
- package/skill/format/schematic/component.md +91 -91
- package/skill/format/schematic/index.md +14 -14
- package/skill/format/schematic/obj.md +41 -41
- package/skill/format/schematic/pin.md +59 -59
- package/skill/format/schematic/shape.md +231 -231
- package/skill/format/schematic/structure.md +53 -53
- package/skill/format/schematic/table.md +109 -109
- package/skill/format/schematic/text.md +47 -47
- package/skill/format/schematic/wire.md +132 -132
- package/skill/guide/ancillary-projects/easyeda-api-sdk.md +1 -0
- package/skill/guide/ancillary-projects/pro-api-types.md +5 -5
- package/skill/guide/ancillary-projects.md +10 -10
- package/skill/guide/cli.md +1510 -0
- package/skill/guide/error-handling.md +38 -38
- package/skill/guide/extension-json.md +135 -135
- package/skill/guide/extensions-marketplace.md +61 -61
- package/skill/guide/how-to-start.md +316 -301
- package/skill/guide/i18n.md +57 -57
- package/skill/guide/index.md +7 -7
- package/skill/guide/inline-frame.md +20 -20
- package/skill/guide/invoke-apis.md +81 -81
- package/skill/guide/stability.md +37 -37
- package/skill/references/_index.md +471 -398
- package/skill/references/_quick-reference.md +3103 -3028
- package/skill/references/classes/DMT_Board.md +537 -533
- package/skill/references/classes/DMT_EditorControl.md +1736 -1736
- package/skill/references/classes/DMT_Event.md +356 -356
- package/skill/references/classes/DMT_Folder.md +775 -775
- package/skill/references/classes/DMT_Panel.md +531 -531
- package/skill/references/classes/DMT_Pcb.md +579 -575
- package/skill/references/classes/DMT_Project.md +734 -573
- package/skill/references/classes/DMT_Schematic.md +1482 -1477
- package/skill/references/classes/DMT_SelectControl.md +96 -96
- package/skill/references/classes/DMT_Team.md +172 -172
- package/skill/references/classes/DMT_Workspace.md +198 -198
- package/skill/references/classes/EDA.md +1001 -961
- package/skill/references/classes/IPCB_ComplexPolygon.md +299 -299
- package/skill/references/classes/IPCB_Polygon.md +175 -175
- package/skill/references/classes/IPCB_PrimitiveArc.md +1901 -1901
- package/skill/references/classes/IPCB_PrimitiveAttribute.md +2993 -2993
- package/skill/references/classes/IPCB_PrimitiveComponent.md +2624 -2627
- package/skill/references/classes/IPCB_PrimitiveComponentPad.md +410 -410
- package/skill/references/classes/IPCB_PrimitiveDimension.md +1419 -1419
- package/skill/references/classes/IPCB_PrimitiveFill.md +1325 -1325
- package/skill/references/classes/IPCB_PrimitiveImage.md +1461 -1461
- package/skill/references/classes/IPCB_PrimitiveLine.md +1639 -1639
- package/skill/references/classes/IPCB_PrimitiveObject.md +1700 -1700
- package/skill/references/classes/IPCB_PrimitivePad.md +3155 -3155
- package/skill/references/classes/IPCB_PrimitivePolyline.md +1193 -1193
- package/skill/references/classes/IPCB_PrimitivePour.md +1858 -1858
- package/skill/references/classes/IPCB_PrimitivePoured.md +556 -556
- package/skill/references/classes/IPCB_PrimitiveRegion.md +1332 -1332
- package/skill/references/classes/IPCB_PrimitiveString.md +2315 -2315
- package/skill/references/classes/IPCB_PrimitiveVia.md +1588 -1588
- package/skill/references/classes/ISCH_PrimitiveArc.md +1676 -1676
- package/skill/references/classes/ISCH_PrimitiveAttribute.md +2541 -2541
- package/skill/references/classes/ISCH_PrimitiveBus.md +973 -973
- package/skill/references/classes/ISCH_PrimitiveCbbSymbolComponent.md +260 -260
- package/skill/references/classes/ISCH_PrimitiveCircle.md +1392 -1392
- package/skill/references/classes/ISCH_PrimitiveComponent.md +2910 -2913
- package/skill/references/classes/ISCH_PrimitiveComponentPin.md +155 -155
- package/skill/references/classes/ISCH_PrimitiveObject.md +960 -960
- package/skill/references/classes/ISCH_PrimitivePin.md +2402 -2402
- package/skill/references/classes/ISCH_PrimitivePolygon.md +1028 -1028
- package/skill/references/classes/ISCH_PrimitiveRectangle.md +1777 -1777
- package/skill/references/classes/ISCH_PrimitiveText.md +1771 -1771
- package/skill/references/classes/ISCH_PrimitiveWire.md +973 -973
- package/skill/references/classes/LIB_3DModel.md +782 -780
- package/skill/references/classes/LIB_Cbb.md +957 -957
- package/skill/references/classes/LIB_Classification.md +969 -965
- package/skill/references/classes/LIB_Device.md +1222 -1221
- package/skill/references/classes/LIB_Footprint.md +1298 -1153
- package/skill/references/classes/LIB_LibrariesList.md +361 -329
- package/skill/references/classes/LIB_PanelLibrary.md +855 -855
- package/skill/references/classes/LIB_SelectControl.md +89 -89
- package/skill/references/classes/LIB_SimulationModel.md +807 -821
- package/skill/references/classes/LIB_Symbol.md +1341 -1195
- package/skill/references/classes/PCB_Document.md +1770 -1754
- package/skill/references/classes/PCB_Drc.md +3379 -3375
- package/skill/references/classes/PCB_Event.md +1166 -1081
- package/skill/references/classes/PCB_ImageTool.md +363 -0
- package/skill/references/classes/PCB_Layer.md +1915 -1911
- package/skill/references/classes/PCB_ManufactureData.md +2968 -2968
- package/skill/references/classes/PCB_MathPolygon.md +916 -785
- package/skill/references/classes/PCB_Net.md +1128 -1128
- package/skill/references/classes/PCB_Primitive.md +217 -217
- package/skill/references/classes/PCB_PrimitiveArc.md +820 -894
- package/skill/references/classes/PCB_PrimitiveAttribute.md +635 -717
- package/skill/references/classes/PCB_PrimitiveComponent.md +1050 -1050
- package/skill/references/classes/PCB_PrimitiveDimension.md +789 -833
- package/skill/references/classes/PCB_PrimitiveFill.md +783 -861
- package/skill/references/classes/PCB_PrimitiveImage.md +803 -875
- package/skill/references/classes/PCB_PrimitiveLine.md +787 -858
- package/skill/references/classes/PCB_PrimitiveObject.md +796 -800
- package/skill/references/classes/PCB_PrimitivePad.md +947 -944
- package/skill/references/classes/PCB_PrimitivePolyline.md +744 -819
- package/skill/references/classes/PCB_PrimitivePour.md +808 -845
- package/skill/references/classes/PCB_PrimitivePoured.md +363 -363
- package/skill/references/classes/PCB_PrimitiveRegion.md +765 -799
- package/skill/references/classes/PCB_PrimitiveString.md +828 -910
- package/skill/references/classes/PCB_PrimitiveVia.md +761 -765
- package/skill/references/classes/PCB_RayTracerEngine.md +603 -263
- package/skill/references/classes/PCB_SelectControl.md +495 -495
- package/skill/references/classes/PCB_Tool.md +9 -0
- package/skill/references/classes/PNL_Document.md +83 -83
- package/skill/references/classes/SCH_Document.md +797 -809
- package/skill/references/classes/SCH_Drc.md +246 -242
- package/skill/references/classes/SCH_Event.md +583 -583
- package/skill/references/classes/SCH_ManufactureData.md +1209 -1205
- package/skill/references/classes/SCH_Net.md +200 -200
- package/skill/references/classes/SCH_Netlist.md +191 -191
- package/skill/references/classes/SCH_Primitive.md +337 -337
- package/skill/references/classes/SCH_PrimitiveArc.md +686 -692
- package/skill/references/classes/SCH_PrimitiveAttribute.md +579 -590
- package/skill/references/classes/SCH_PrimitiveBus.md +618 -624
- package/skill/references/classes/SCH_PrimitiveCircle.md +667 -683
- package/skill/references/classes/SCH_PrimitiveComponent.md +2256 -2240
- package/skill/references/classes/SCH_PrimitiveObject.md +666 -666
- package/skill/references/classes/SCH_PrimitivePin.md +737 -754
- package/skill/references/classes/SCH_PrimitivePolygon.md +621 -627
- package/skill/references/classes/SCH_PrimitiveRectangle.md +715 -731
- package/skill/references/classes/SCH_PrimitiveText.md +736 -746
- package/skill/references/classes/SCH_PrimitiveWire.md +701 -703
- package/skill/references/classes/SCH_SelectControl.md +520 -520
- package/skill/references/classes/SCH_SimulationEngine.md +133 -133
- package/skill/references/classes/SCH_Utils.md +121 -121
- package/skill/references/classes/SYS_ClientUrl.md +173 -173
- package/skill/references/classes/SYS_Dialog.md +825 -825
- package/skill/references/classes/SYS_Environment.md +640 -502
- package/skill/references/classes/SYS_ExternalApi.md +246 -0
- package/skill/references/classes/SYS_FileManager.md +1664 -1686
- package/skill/references/classes/SYS_FileSystem.md +1366 -1171
- package/skill/references/classes/SYS_FontManager.md +224 -224
- package/skill/references/classes/SYS_FormatConversion.md +349 -349
- package/skill/references/classes/SYS_HeaderMenu.md +480 -479
- package/skill/references/classes/SYS_Help.md +141 -0
- package/skill/references/classes/SYS_I18n.md +861 -861
- package/skill/references/classes/SYS_IFrame.md +541 -535
- package/skill/references/classes/SYS_LoadingAndProgressBar.md +246 -246
- package/skill/references/classes/SYS_Log.md +422 -424
- package/skill/references/classes/SYS_Math.md +1565 -1565
- package/skill/references/classes/SYS_Message.md +363 -363
- package/skill/references/classes/SYS_MessageBox.md +285 -285
- package/skill/references/classes/SYS_MessageBus.md +1618 -1618
- package/skill/references/classes/SYS_PanelControl.md +696 -696
- package/skill/references/classes/SYS_RightClickMenu.md +175 -175
- package/skill/references/classes/SYS_Setting.md +134 -85
- package/skill/references/classes/SYS_ShortcutKey.md +623 -623
- package/skill/references/classes/SYS_Storage.md +484 -484
- package/skill/references/classes/SYS_Timer.md +447 -447
- package/skill/references/classes/SYS_ToastMessage.md +194 -194
- package/skill/references/classes/SYS_Tool.md +317 -241
- package/skill/references/classes/SYS_Unit.md +594 -594
- package/skill/references/classes/SYS_WebSocket.md +401 -401
- package/skill/references/classes/SYS_Window.md +849 -850
- package/skill/references/enums/EDMT_EditorDocumentType.md +324 -278
- package/skill/references/enums/EDMT_EditorSplitScreenDirection.md +51 -47
- package/skill/references/enums/EDMT_EditorTabEventType.md +68 -62
- package/skill/references/enums/EDMT_IndicatorMarkerType.md +90 -80
- package/skill/references/enums/EDMT_ItemType.md +181 -157
- package/skill/references/enums/EDMT_ProjectCollaborationMode.md +51 -47
- package/skill/references/enums/EDMT_ProjectFileFormat.md +60 -0
- package/skill/references/enums/EDMT_ProjectReadyState.md +82 -0
- package/skill/references/enums/ELIB_DeviceJlcLibraryCategory.md +51 -47
- package/skill/references/enums/ELIB_LibraryType.md +129 -113
- package/skill/references/enums/ELIB_PreviewType.md +77 -69
- package/skill/references/enums/ELIB_SimulationModelType.md +51 -47
- package/skill/references/enums/ELIB_SymbolType.md +142 -124
- package/skill/references/enums/EPCB_AutoRoutingCornerStyle.md +51 -47
- package/skill/references/enums/EPCB_AutoRoutingExistingPrimitiveMode.md +51 -47
- package/skill/references/enums/EPCB_AutoRoutingOptimization.md +51 -47
- package/skill/references/enums/EPCB_DocumentCanvasUpdateCalculationActiveStatus.md +51 -47
- package/skill/references/enums/EPCB_DocumentRatlineCalculatingActiveStatus.md +55 -51
- package/skill/references/enums/EPCB_InactiveLayerDisplayMode.md +64 -58
- package/skill/references/enums/EPCB_LayerColorConfiguration.md +90 -80
- package/skill/references/enums/EPCB_LayerId.md +1169 -881
- package/skill/references/enums/EPCB_LayerStatus.md +64 -58
- package/skill/references/enums/EPCB_LayerType.md +129 -113
- package/skill/references/enums/EPCB_MouseEventType.md +64 -58
- package/skill/references/enums/EPCB_NetEventType.md +64 -58
- package/skill/references/enums/EPCB_PcbPlateType.md +51 -47
- package/skill/references/enums/EPCB_PdfOutputMethod.md +64 -58
- package/skill/references/enums/EPCB_PrimitiveArcInteractiveMode.md +51 -47
- package/skill/references/enums/EPCB_PrimitiveDimensionType.md +64 -58
- package/skill/references/enums/EPCB_PrimitiveEventType.md +64 -58
- package/skill/references/enums/EPCB_PrimitiveFillMode.md +68 -62
- package/skill/references/enums/EPCB_PrimitivePadHeatWeldingConnectionMethod.md +64 -58
- package/skill/references/enums/EPCB_PrimitivePadHoleType.md +64 -58
- package/skill/references/enums/EPCB_PrimitivePadShapeType.md +90 -80
- package/skill/references/enums/EPCB_PrimitivePadType.md +64 -58
- package/skill/references/enums/EPCB_PrimitivePourFillMethod.md +64 -58
- package/skill/references/enums/EPCB_PrimitiveRegionRuleType.md +107 -95
- package/skill/references/enums/EPCB_PrimitiveStringAlignMode.md +142 -124
- package/skill/references/enums/EPCB_PrimitiveType.md +233 -201
- package/skill/references/enums/EPCB_PrimitiveViaType.md +64 -58
- package/skill/references/enums/ESCH_DynamicSimulationEnginePullEventType.md +116 -102
- package/skill/references/enums/ESCH_DynamicSimulationEnginePushEventType.md +90 -80
- package/skill/references/enums/ESCH_ExportDocumentFileType.md +64 -58
- package/skill/references/enums/ESCH_MouseEventType.md +51 -47
- package/skill/references/enums/ESCH_PrimitiveComponentType.md +142 -124
- package/skill/references/enums/ESCH_PrimitiveEventType.md +77 -69
- package/skill/references/enums/ESCH_PrimitiveFillStyle.md +129 -113
- package/skill/references/enums/ESCH_PrimitiveLineType.md +77 -69
- package/skill/references/enums/ESCH_PrimitivePinShape.md +77 -69
- package/skill/references/enums/ESCH_PrimitivePinType.md +168 -146
- package/skill/references/enums/ESCH_PrimitiveTextAlignMode.md +142 -124
- package/skill/references/enums/ESCH_PrimitiveType.md +207 -179
- package/skill/references/enums/ESCH_SimulationNetlistType.md +38 -36
- package/skill/references/enums/ESCH_SpiceSimulationEnginePullEventType.md +51 -47
- package/skill/references/enums/ESCH_SpiceSimulationEnginePushEventType.md +77 -69
- package/skill/references/enums/ESYS_BottomPanelTab.md +94 -80
- package/skill/references/enums/ESYS_HeaderMenuEnvironment.md +181 -157
- package/skill/references/enums/ESYS_ImportProjectBoardOutlineSource.md +55 -51
- package/skill/references/enums/ESYS_ImportProjectImportOption.md +64 -58
- package/skill/references/enums/ESYS_ImportProjectSchematicObjectStyle.md +51 -47
- package/skill/references/enums/ESYS_ImportProjectViaSolderMaskExpansion.md +55 -51
- package/skill/references/enums/ESYS_JobState.md +95 -0
- package/skill/references/enums/ESYS_LeftPanelTab.md +94 -80
- package/skill/references/enums/ESYS_LogType.md +77 -102
- package/skill/references/enums/ESYS_NetlistType.md +129 -113
- package/skill/references/enums/ESYS_PanelPosition.md +69 -0
- package/skill/references/enums/ESYS_PanelTab.md +368 -0
- package/skill/references/enums/ESYS_RightPanelTab.md +237 -201
- package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorRange.md +220 -190
- package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorScene.md +103 -91
- package/skill/references/enums/ESYS_StartPageQuickStartItem.md +237 -205
- package/skill/references/enums/ESYS_Theme.md +51 -47
- package/skill/references/enums/ESYS_ToastMessageType.md +90 -80
- package/skill/references/enums/ESYS_Unit.md +116 -102
- package/skill/references/enums/ESYS_WindowEventType.md +64 -47
- package/skill/references/enums/ESYS_WindowOpenTarget.md +51 -47
- package/skill/references/enums/NetportDeviceName.md +146 -146
- package/skill/references/enums/SchToolBarDeviceName.md +278 -278
- package/skill/references/interfaces/BoardProps.md +169 -169
- package/skill/references/interfaces/BorderConfig.md +109 -0
- package/skill/references/interfaces/ButtonProps.md +196 -169
- package/skill/references/interfaces/CellClickInfo.md +142 -0
- package/skill/references/interfaces/CellCoord.md +88 -0
- package/skill/references/interfaces/CheckBoxProps.md +223 -196
- package/skill/references/interfaces/CheckChangeDetail.md +88 -0
- package/skill/references/interfaces/CheckboxEditConfig.md +159 -0
- package/skill/references/interfaces/ClipboardCellData.md +142 -0
- package/skill/references/interfaces/ClipboardConfig.md +115 -0
- package/skill/references/interfaces/ColorPickerProps.md +169 -0
- package/skill/references/interfaces/ColumnDef.md +605 -0
- package/skill/references/interfaces/ColumnEditTrigger.md +57 -0
- package/skill/references/interfaces/ColumnGroupDef.md +192 -0
- package/skill/references/interfaces/ColumnResizeConfig.md +142 -0
- package/skill/references/interfaces/ComponentPropsMap.md +517 -448
- package/skill/references/interfaces/CustomHeaderConfig.md +169 -0
- package/skill/references/interfaces/DialogProps.md +385 -385
- package/skill/references/interfaces/DragSortConfig.md +115 -0
- package/skill/references/interfaces/EditingConfig.md +196 -0
- package/skill/references/interfaces/FilteringConfig.md +250 -0
- package/skill/references/interfaces/FixedColumnConfig.md +88 -0
- package/skill/references/interfaces/FlexItemProps.md +116 -116
- package/skill/references/interfaces/FlexProps.md +224 -224
- package/skill/references/interfaces/GridItemProps.md +143 -143
- package/skill/references/interfaces/GridProps.md +143 -143
- package/skill/references/interfaces/IDMT_BoardItem.md +171 -171
- package/skill/references/interfaces/IDMT_BriefProjectItem.md +171 -171
- package/skill/references/interfaces/IDMT_EditorDocumentItem.md +169 -169
- package/skill/references/interfaces/IDMT_EditorSplitScreenItem.md +173 -173
- package/skill/references/interfaces/IDMT_EditorTabItem.md +169 -169
- package/skill/references/interfaces/IDMT_FolderItem.md +225 -225
- package/skill/references/interfaces/IDMT_IndicatorMarkerShape.md +393 -393
- package/skill/references/interfaces/IDMT_PanelItem.md +144 -144
- package/skill/references/interfaces/IDMT_PcbItem.md +171 -171
- package/skill/references/interfaces/IDMT_ProjectItem.md +143 -143
- package/skill/references/interfaces/IDMT_SchematicItem.md +225 -225
- package/skill/references/interfaces/IDMT_SchematicPageItem.md +198 -198
- package/skill/references/interfaces/IDMT_TeamItem.md +144 -144
- package/skill/references/interfaces/IDMT_WorkspaceItem.md +117 -117
- package/skill/references/interfaces/IDesignPortal.md +103 -103
- package/skill/references/interfaces/ILIB_3DModelItem.md +198 -198
- package/skill/references/interfaces/ILIB_3DModelSearchItem.md +277 -277
- package/skill/references/interfaces/ILIB_CbbItem.md +225 -225
- package/skill/references/interfaces/ILIB_CbbSearchItem.md +277 -277
- package/skill/references/interfaces/ILIB_ClassificationIndex.md +150 -150
- package/skill/references/interfaces/ILIB_ClassificationNode.md +98 -0
- package/skill/references/interfaces/ILIB_DeviceAssociationItem.md +210 -210
- package/skill/references/interfaces/ILIB_DeviceExtendPropertyItem.md +304 -304
- package/skill/references/interfaces/ILIB_DeviceItem.md +279 -279
- package/skill/references/interfaces/ILIB_DevicePropertiesForSearch.md +250 -250
- package/skill/references/interfaces/ILIB_DeviceSearchItem.md +521 -521
- package/skill/references/interfaces/ILIB_ExtendLibrary3DModelFunctions.md +64 -64
- package/skill/references/interfaces/ILIB_ExtendLibraryCbbFunctions.md +93 -99
- package/skill/references/interfaces/ILIB_ExtendLibraryClassificationIndex.md +150 -150
- package/skill/references/interfaces/ILIB_ExtendLibraryDeviceFunctions.md +143 -157
- package/skill/references/interfaces/ILIB_ExtendLibraryFootprintFunctions.md +63 -63
- package/skill/references/interfaces/ILIB_ExtendLibraryFunctions.md +123 -123
- package/skill/references/interfaces/ILIB_ExtendLibraryItem.md +97 -97
- package/skill/references/interfaces/ILIB_ExtendLibraryItemIndex.md +98 -98
- package/skill/references/interfaces/ILIB_ExtendLibrarySearchProperty.md +115 -115
- package/skill/references/interfaces/ILIB_ExtendLibrarySearchResult.md +169 -169
- package/skill/references/interfaces/ILIB_ExtendLibrarySearchResultDataLine.md +234 -234
- package/skill/references/interfaces/ILIB_ExtendLibrarySymbolFunctions.md +91 -105
- package/skill/references/interfaces/ILIB_ExtendLibraryUserIndex.md +96 -96
- package/skill/references/interfaces/ILIB_FootprintItem.md +256 -198
- package/skill/references/interfaces/ILIB_FootprintPropertiesForSearch.md +61 -61
- package/skill/references/interfaces/ILIB_FootprintSearchItem.md +277 -277
- package/skill/references/interfaces/ILIB_LibraryInfo.md +92 -92
- package/skill/references/interfaces/ILIB_LibraryItem.md +115 -115
- package/skill/references/interfaces/ILIB_PanelLibraryItem.md +198 -198
- package/skill/references/interfaces/ILIB_PanelLibrarySearchItem.md +277 -277
- package/skill/references/interfaces/ILIB_RegisterExtendLibraryProps.md +71 -0
- package/skill/references/interfaces/ILIB_SimulationModelItem.md +306 -306
- package/skill/references/interfaces/ILIB_SimulationModelSearchItem.md +304 -304
- package/skill/references/interfaces/ILIB_SymbolItem.md +306 -279
- package/skill/references/interfaces/ILIB_SymbolPropertiesForSearch.md +61 -61
- package/skill/references/interfaces/ILIB_SymbolSearchItem.md +304 -304
- package/skill/references/interfaces/IPCB_AutoLayoutResult.md +169 -169
- package/skill/references/interfaces/IPCB_AutoRoutingProps.md +220 -220
- package/skill/references/interfaces/IPCB_AutoRoutingResult.md +169 -169
- package/skill/references/interfaces/IPCB_BomPropertiesTableColumns.md +169 -169
- package/skill/references/interfaces/IPCB_DifferentialPairItem.md +115 -115
- package/skill/references/interfaces/IPCB_DiscretizeOptions.md +65 -65
- package/skill/references/interfaces/IPCB_DiscretizedPoint.md +88 -88
- package/skill/references/interfaces/IPCB_EqualLengthNetGroupItem.md +115 -115
- package/skill/references/interfaces/IPCB_LayerItem.md +277 -277
- package/skill/references/interfaces/IPCB_NetClassItem.md +115 -115
- package/skill/references/interfaces/IPCB_NetInfo.md +115 -115
- package/skill/references/interfaces/IPCB_PadPairGroupItem.md +88 -88
- package/skill/references/interfaces/IPCB_PadPairMinWireLengthItem.md +88 -88
- package/skill/references/interfaces/IPCB_PhysicalStackingConfiguration.md +115 -115
- package/skill/references/interfaces/IPCB_Primitive.md +218 -218
- package/skill/references/interfaces/IPCB_PrimitiveAPI.md +174 -175
- package/skill/references/interfaces/IPCB_PrimitivePadHeatWelding.md +151 -151
- package/skill/references/interfaces/IPCB_PrimitivePouredPourFill.md +142 -142
- package/skill/references/interfaces/IPCB_PrimitiveSolderMaskAndPasteMaskExpansion.md +154 -154
- package/skill/references/interfaces/IPCB_RayTracerBackgroundConfig.md +223 -0
- package/skill/references/interfaces/IPCB_RayTracerLightConfig.md +412 -0
- package/skill/references/interfaces/IPCB_RayTracerMaterialConfig.md +547 -0
- package/skill/references/interfaces/IPCB_RayTracerPcbMaterialConfig.md +196 -0
- package/skill/references/interfaces/IPCB_RayTracerRenderConfigurations.md +200 -0
- package/skill/references/interfaces/IPCB_RayTracerRendererConfig.md +196 -0
- package/skill/references/interfaces/IPCB_RayTracerSceneElement.md +115 -0
- package/skill/references/interfaces/IPCB_RayTracerSceneElementTransform.md +123 -0
- package/skill/references/interfaces/IPCB_RayTracerTexture.md +88 -0
- package/skill/references/interfaces/IPCB_SubstratePhysicalProperties.md +88 -88
- package/skill/references/interfaces/IRawNet.md +103 -103
- package/skill/references/interfaces/IRawPureSchematic.md +80 -80
- package/skill/references/interfaces/IRawSchematic.md +103 -103
- package/skill/references/interfaces/IRawWire.md +149 -149
- package/skill/references/interfaces/ISCH_DrcError.md +142 -142
- package/skill/references/interfaces/ISCH_DrcErrorPrimitive.md +142 -142
- package/skill/references/interfaces/ISCH_ExportPngResolution.md +94 -94
- package/skill/references/interfaces/ISCH_NetInfo.md +88 -88
- package/skill/references/interfaces/ISCH_Primitive.md +218 -219
- package/skill/references/interfaces/ISCH_PrimitiveAPI.md +174 -175
- package/skill/references/interfaces/ISCH_ProjectNetInfo.md +142 -142
- package/skill/references/interfaces/ISCH_WireInfo.md +169 -169
- package/skill/references/interfaces/ISYS_ComparisonResponse.md +115 -0
- package/skill/references/interfaces/ISYS_ExtensionExternalApiIndex.md +13 -0
- package/skill/references/interfaces/ISYS_ExtensionRegisteredExternalApis.md +13 -0
- package/skill/references/interfaces/ISYS_ExternalApiHelp.md +173 -0
- package/skill/references/interfaces/ISYS_ExternalApiRegistration.md +146 -0
- package/skill/references/interfaces/ISYS_FileSystemFileList.md +169 -169
- package/skill/references/interfaces/ISYS_HeaderMenuSub1MenuItem.md +205 -174
- package/skill/references/interfaces/ISYS_HeaderMenuSub2MenuItem.md +178 -147
- package/skill/references/interfaces/ISYS_HeaderMenuTopMenuItem.md +115 -115
- package/skill/references/interfaces/ISYS_HeaderMenus.md +408 -408
- package/skill/references/interfaces/ISYS_HelpAudienceEntry.md +92 -0
- package/skill/references/interfaces/ISYS_HelpClassSummary.md +205 -0
- package/skill/references/interfaces/ISYS_HelpData.md +92 -0
- package/skill/references/interfaces/ISYS_HelpMethodDetail.md +310 -0
- package/skill/references/interfaces/ISYS_JobHandle.md +65 -0
- package/skill/references/interfaces/ISYS_JobLogEntry.md +142 -0
- package/skill/references/interfaces/ISYS_JobStatus.md +176 -0
- package/skill/references/interfaces/ISYS_LogLine.md +115 -115
- package/skill/references/interfaces/ISYS_MathBBox.md +142 -142
- package/skill/references/interfaces/ISYS_MathPoint.md +88 -88
- package/skill/references/interfaces/ISYS_MathPolygonWithHoles.md +92 -92
- package/skill/references/interfaces/ISYS_MessageBusTask.md +115 -115
- package/skill/references/interfaces/ISYS_MultilingualLanguagesData.md +12 -12
- package/skill/references/interfaces/ISYS_RightClickMenuItem.md +174 -174
- package/skill/references/interfaces/ISYS_ShortcutKeyData.md +169 -169
- package/skill/references/interfaces/ISYS_ShortcutKeyDataWithCallFn.md +62 -62
- package/skill/references/interfaces/ISYS_ShortcutKeyDataWithUserDefinedShortcutKey.md +62 -62
- package/skill/references/interfaces/ISYS_WindowEventListenerRemovableObject.md +109 -109
- package/skill/references/interfaces/IconProps.md +88 -88
- package/skill/references/interfaces/ImageProps.md +115 -115
- package/skill/references/interfaces/InputEditConfig.md +182 -0
- package/skill/references/interfaces/InputProps.md +547 -520
- package/skill/references/interfaces/KeyboardConfig.md +61 -0
- package/skill/references/interfaces/ListChildren.md +223 -223
- package/skill/references/interfaces/ListProps.md +250 -223
- package/skill/references/interfaces/ModalProps.md +358 -358
- package/skill/references/interfaces/NumberEditConfig.md +234 -0
- package/skill/references/interfaces/RadioGroupProps.md +196 -196
- package/skill/references/interfaces/RadioItem.md +115 -115
- package/skill/references/interfaces/RichTableProps.md +1357 -0
- package/skill/references/interfaces/RowMetaConfig.md +142 -0
- package/skill/references/interfaces/ScrollerProps.md +169 -169
- package/skill/references/interfaces/SelectEditConfig.md +211 -0
- package/skill/references/interfaces/SelectListItem.md +142 -142
- package/skill/references/interfaces/SelectOption.md +142 -0
- package/skill/references/interfaces/SelectProps.md +169 -169
- package/skill/references/interfaces/SelectionConfig.md +358 -0
- package/skill/references/interfaces/SliderProps.md +142 -0
- package/skill/references/interfaces/SlotProps.md +88 -88
- package/skill/references/interfaces/SortState.md +88 -0
- package/skill/references/interfaces/SortingConfig.md +169 -0
- package/skill/references/interfaces/StyleProps.md +439 -385
- package/skill/references/interfaces/TextAreaProps.md +196 -196
- package/skill/references/interfaces/TextProps.md +169 -169
- package/skill/references/interfaces/TextareaEditConfig.md +182 -0
- package/skill/references/interfaces/ValidationRule.md +223 -0
- package/skill/references/interfaces/VirtualScrollConfig.md +115 -0
- package/skill/references/types/Align.md +9 -0
- package/skill/references/types/CellContentType.md +9 -0
- package/skill/references/types/ColumnDefOrGroup.md +12 -0
- package/skill/references/types/ColumnEditConfig.md +13 -0
- package/skill/references/types/ColumnType.md +9 -0
- package/skill/references/types/DataChangeType.md +9 -0
- package/skill/references/types/FilterMatchMode.md +9 -0
- package/skill/references/types/RichTableRow.md +12 -0
- package/skill/references/types/Serializable.md +10 -0
- package/skill/references/types/SerializablePrimitive.md +9 -0
- package/skill/references/types/SortOrder.md +9 -0
- package/skill/references/types/TPCB_LayerTypesOfInnerLayer.md +11 -11
- package/skill/references/types/TPCB_LayersInTheSelectable.md +42 -42
- package/skill/references/types/TPCB_LayersOfComponent.md +11 -11
- package/skill/references/types/TPCB_LayersOfCopper.md +15 -15
- package/skill/references/types/TPCB_LayersOfCustom.md +41 -41
- package/skill/references/types/TPCB_LayersOfDimension.md +16 -16
- package/skill/references/types/TPCB_LayersOfFill.md +28 -28
- package/skill/references/types/TPCB_LayersOfImage.md +22 -22
- package/skill/references/types/TPCB_LayersOfInner.md +41 -41
- package/skill/references/types/TPCB_LayersOfLine.md +25 -25
- package/skill/references/types/TPCB_LayersOfObject.md +12 -12
- package/skill/references/types/TPCB_LayersOfPad.md +11 -11
- package/skill/references/types/TPCB_LayersOfRegion.md +11 -11
- package/skill/references/types/TPCB_NumberOfCopperLayers.md +9 -9
- package/skill/references/types/TPCB_PolygonSourceArray.md +85 -83
- package/skill/references/types/TPCB_PrimitiveDimensionCoordinateSet.md +66 -66
- package/skill/references/types/TPCB_PrimitivePadHole.md +30 -30
- package/skill/references/types/TPCB_PrimitivePadShape.md +61 -61
- package/skill/references/types/TPCB_PrimitiveSpecialPadShape.md +19 -19
- package/skill/references/types/TSYS_ComparisonErrorCode.md +15 -0
- package/skill/references/types/TSYS_LanguageKeyValuePairs.md +13 -0
- package/skill/references/types/TSYS_MathPolygonGroup.md +15 -15
- package/skill/references/types/TSYS_MathPolygonInput.md +20 -20
- package/skill/references/types/TSYS_ShortcutKeys.md +96 -96
- package/skill/user-guide/using-extension.md +47 -47
- package/src/json-gen.test.js +430 -0
- package/skill/guide/ancillary-projects/pro-api-sdk.md +0 -1
- package/skill/references/interfaces/ISYS_PcbComparisonResponse.md +0 -115
- package/skill/references/types/ISYS_LanguageKeyValuePairs.md +0 -13
- package/skill/references/types/TSYS_PcbComparisonErrorCode.md +0 -10
|
@@ -1,1736 +1,1736 @@
|
|
|
1
|
-
# DMT\_EditorControl class
|
|
2
|
-
|
|
3
|
-
Document tree / Editor control class
|
|
4
|
-
|
|
5
|
-
## Signature
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
class DMT_EditorControl
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Remarks
|
|
12
|
-
|
|
13
|
-
Here the editor control is based on the sheets under the currently open engineering design. Any other `documentUuid` will be considered a non-existent document page
|
|
14
|
-
|
|
15
|
-
## Methods
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Method
|
|
20
|
-
|
|
21
|
-
</th><th>
|
|
22
|
-
|
|
23
|
-
Modifiers
|
|
24
|
-
|
|
25
|
-
</th><th>
|
|
26
|
-
|
|
27
|
-
Description
|
|
28
|
-
|
|
29
|
-
</th></tr></thead>
|
|
30
|
-
<tbody><tr><td>
|
|
31
|
-
|
|
32
|
-
[activateDocument(tabId)](./DMT_EditorControl.md)
|
|
33
|
-
|
|
34
|
-
</td><td>
|
|
35
|
-
|
|
36
|
-
</td><td>
|
|
37
|
-
|
|
38
|
-
Activate a document
|
|
39
|
-
|
|
40
|
-
</td></tr>
|
|
41
|
-
<tr><td>
|
|
42
|
-
|
|
43
|
-
[activateSplitScreen(splitScreenId)](./DMT_EditorControl.md)
|
|
44
|
-
|
|
45
|
-
</td><td>
|
|
46
|
-
|
|
47
|
-
</td><td>
|
|
48
|
-
|
|
49
|
-
Activate a split screen
|
|
50
|
-
|
|
51
|
-
</td></tr>
|
|
52
|
-
<tr><td>
|
|
53
|
-
|
|
54
|
-
[closeDocument(tabId)](./DMT_EditorControl.md)
|
|
55
|
-
|
|
56
|
-
</td><td>
|
|
57
|
-
|
|
58
|
-
</td><td>
|
|
59
|
-
|
|
60
|
-
Close document
|
|
61
|
-
|
|
62
|
-
</td></tr>
|
|
63
|
-
<tr><td>
|
|
64
|
-
|
|
65
|
-
[createSplitScreen(splitScreenType, tabId)](./DMT_EditorControl.md)
|
|
66
|
-
|
|
67
|
-
</td><td>
|
|
68
|
-
|
|
69
|
-
</td><td>
|
|
70
|
-
|
|
71
|
-
Create Split screen
|
|
72
|
-
|
|
73
|
-
</td></tr>
|
|
74
|
-
<tr><td>
|
|
75
|
-
|
|
76
|
-
[generateIndicatorMarkers(markers, color, lineWidth, zoom, tabId)](./DMT_EditorControl.md)
|
|
77
|
-
|
|
78
|
-
</td><td>
|
|
79
|
-
|
|
80
|
-
</td><td>
|
|
81
|
-
|
|
82
|
-
**_(BETA)_** Generate indicator markers
|
|
83
|
-
|
|
84
|
-
</td></tr>
|
|
85
|
-
<tr><td>
|
|
86
|
-
|
|
87
|
-
[getCurrentRenderedAreaImage(tabId)](./DMT_EditorControl.md)
|
|
88
|
-
|
|
89
|
-
</td><td>
|
|
90
|
-
|
|
91
|
-
</td><td>
|
|
92
|
-
|
|
93
|
-
**_(BETA)_** Get the canvas rendering region image
|
|
94
|
-
|
|
95
|
-
</td></tr>
|
|
96
|
-
<tr><td>
|
|
97
|
-
|
|
98
|
-
[getSplitScreenIdByTabId(tabId)](./DMT_EditorControl.md)
|
|
99
|
-
|
|
100
|
-
</td><td>
|
|
101
|
-
|
|
102
|
-
</td><td>
|
|
103
|
-
|
|
104
|
-
Use tab ID get split screen ID
|
|
105
|
-
|
|
106
|
-
</td></tr>
|
|
107
|
-
<tr><td>
|
|
108
|
-
|
|
109
|
-
[getSplitScreenTree()](./DMT_EditorControl.md)
|
|
110
|
-
|
|
111
|
-
</td><td>
|
|
112
|
-
|
|
113
|
-
</td><td>
|
|
114
|
-
|
|
115
|
-
Get the editor split screen property tree
|
|
116
|
-
|
|
117
|
-
</td></tr>
|
|
118
|
-
<tr><td>
|
|
119
|
-
|
|
120
|
-
[getTabsBySplitScreenId(splitScreenId)](./DMT_EditorControl.md)
|
|
121
|
-
|
|
122
|
-
</td><td>
|
|
123
|
-
|
|
124
|
-
</td><td>
|
|
125
|
-
|
|
126
|
-
Get all tabs under the specified split screen ID
|
|
127
|
-
|
|
128
|
-
</td></tr>
|
|
129
|
-
<tr><td>
|
|
130
|
-
|
|
131
|
-
[mergeAllDocumentFromSplitScreen()](./DMT_EditorControl.md)
|
|
132
|
-
|
|
133
|
-
</td><td>
|
|
134
|
-
|
|
135
|
-
</td><td>
|
|
136
|
-
|
|
137
|
-
Merge all split screens
|
|
138
|
-
|
|
139
|
-
</td></tr>
|
|
140
|
-
<tr><td>
|
|
141
|
-
|
|
142
|
-
[moveDocumentToSplitScreen(tabId, splitScreenId)](./DMT_EditorControl.md)
|
|
143
|
-
|
|
144
|
-
</td><td>
|
|
145
|
-
|
|
146
|
-
</td><td>
|
|
147
|
-
|
|
148
|
-
Move a document to the specified split screen
|
|
149
|
-
|
|
150
|
-
</td></tr>
|
|
151
|
-
<tr><td>
|
|
152
|
-
|
|
153
|
-
[openDocument(documentUuid, splitScreenId)](./DMT_EditorControl.md)
|
|
154
|
-
|
|
155
|
-
</td><td>
|
|
156
|
-
|
|
157
|
-
</td><td>
|
|
158
|
-
|
|
159
|
-
Open document
|
|
160
|
-
|
|
161
|
-
</td></tr>
|
|
162
|
-
<tr><td>
|
|
163
|
-
|
|
164
|
-
[openLibraryDocument(libraryUuid, libraryType, uuid, splitScreenId)](./DMT_EditorControl.md)
|
|
165
|
-
|
|
166
|
-
</td><td>
|
|
167
|
-
|
|
168
|
-
</td><td>
|
|
169
|
-
|
|
170
|
-
**_(BETA)_** Open library symbol, footprint document
|
|
171
|
-
|
|
172
|
-
</td></tr>
|
|
173
|
-
<tr><td>
|
|
174
|
-
|
|
175
|
-
[removeIndicatorMarkers(tabId)](./DMT_EditorControl.md)
|
|
176
|
-
|
|
177
|
-
</td><td>
|
|
178
|
-
|
|
179
|
-
</td><td>
|
|
180
|
-
|
|
181
|
-
**_(BETA)_** Remove indicator markers
|
|
182
|
-
|
|
183
|
-
</td></tr>
|
|
184
|
-
<tr><td>
|
|
185
|
-
|
|
186
|
-
[tileAllDocumentToSplitScreen()](./DMT_EditorControl.md)
|
|
187
|
-
|
|
188
|
-
</td><td>
|
|
189
|
-
|
|
190
|
-
</td><td>
|
|
191
|
-
|
|
192
|
-
Tile all documents
|
|
193
|
-
|
|
194
|
-
</td></tr>
|
|
195
|
-
<tr><td>
|
|
196
|
-
|
|
197
|
-
[zoomTo(x, y, scaleRatio, tabId)](./DMT_EditorControl.md)
|
|
198
|
-
|
|
199
|
-
</td><td>
|
|
200
|
-
|
|
201
|
-
</td><td>
|
|
202
|
-
|
|
203
|
-
**_(BETA)_** Zoom to coordinates
|
|
204
|
-
|
|
205
|
-
</td></tr>
|
|
206
|
-
<tr><td>
|
|
207
|
-
|
|
208
|
-
[zoomToAllPrimitives(tabId)](./DMT_EditorControl.md)
|
|
209
|
-
|
|
210
|
-
</td><td>
|
|
211
|
-
|
|
212
|
-
</td><td>
|
|
213
|
-
|
|
214
|
-
**_(BETA)_** Zoom to all primitives (fit all)
|
|
215
|
-
|
|
216
|
-
</td></tr>
|
|
217
|
-
<tr><td>
|
|
218
|
-
|
|
219
|
-
[zoomToRegion(left, right, top, bottom, tabId)](./DMT_EditorControl.md)
|
|
220
|
-
|
|
221
|
-
</td><td>
|
|
222
|
-
|
|
223
|
-
</td><td>
|
|
224
|
-
|
|
225
|
-
**_(BETA)_** Zoom to region
|
|
226
|
-
|
|
227
|
-
</td></tr>
|
|
228
|
-
<tr><td>
|
|
229
|
-
|
|
230
|
-
[zoomToSelectedPrimitives(tabId)](./DMT_EditorControl.md)
|
|
231
|
-
|
|
232
|
-
</td><td>
|
|
233
|
-
|
|
234
|
-
</td><td>
|
|
235
|
-
|
|
236
|
-
**_(BETA)_** Zoom to the selected primitives (fit selection)
|
|
237
|
-
|
|
238
|
-
</td></tr>
|
|
239
|
-
</tbody></table>
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
-
|
|
243
|
-
## 方法详情
|
|
244
|
-
|
|
245
|
-
### activatedocument
|
|
246
|
-
|
|
247
|
-
# DMT\_EditorControl.activateDocument() method
|
|
248
|
-
|
|
249
|
-
Activate a document
|
|
250
|
-
|
|
251
|
-
## Signature
|
|
252
|
-
|
|
253
|
-
```typescript
|
|
254
|
-
function activateDocument(tabId: string): Promise<boolean>;
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
## Parameters
|
|
258
|
-
|
|
259
|
-
<table><thead><tr><th>
|
|
260
|
-
|
|
261
|
-
Parameter
|
|
262
|
-
|
|
263
|
-
</th><th>
|
|
264
|
-
|
|
265
|
-
Type
|
|
266
|
-
|
|
267
|
-
</th><th>
|
|
268
|
-
|
|
269
|
-
Description
|
|
270
|
-
|
|
271
|
-
</th></tr></thead>
|
|
272
|
-
<tbody><tr><td>
|
|
273
|
-
|
|
274
|
-
tabId
|
|
275
|
-
|
|
276
|
-
</td><td>
|
|
277
|
-
|
|
278
|
-
string
|
|
279
|
-
|
|
280
|
-
</td><td>
|
|
281
|
-
|
|
282
|
-
Tab ID
|
|
283
|
-
|
|
284
|
-
</td></tr>
|
|
285
|
-
</tbody></table>
|
|
286
|
-
|
|
287
|
-
## Returns
|
|
288
|
-
|
|
289
|
-
Promise<boolean>
|
|
290
|
-
|
|
291
|
-
Whether the operation is successful
|
|
292
|
-
|
|
293
|
-
## Remarks
|
|
294
|
-
|
|
295
|
-
Switch to the tab of the specified document and place the input focus in it
|
|
296
|
-
|
|
297
|
-
## Example
|
|
298
|
-
|
|
299
|
-
```javascript
|
|
300
|
-
// 1. 先后打开原理图页与 PCB,此时焦点在最后打开的 PCB 上
|
|
301
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
302
|
-
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
|
|
303
|
-
const tabSch = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
304
|
-
await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
|
|
305
|
-
|
|
306
|
-
// 2. 激活原理图标签页(真实切换回原理图画布)
|
|
307
|
-
const activated = await eda.dmt_EditorControl.activateDocument(tabSch);
|
|
308
|
-
console.log('activated:', activated);
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
### activatesplitscreen
|
|
312
|
-
|
|
313
|
-
# DMT\_EditorControl.activateSplitScreen() method
|
|
314
|
-
|
|
315
|
-
Activate a split screen
|
|
316
|
-
|
|
317
|
-
## Signature
|
|
318
|
-
|
|
319
|
-
```typescript
|
|
320
|
-
function activateSplitScreen(splitScreenId: string): Promise<boolean>;
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
## Parameters
|
|
324
|
-
|
|
325
|
-
<table><thead><tr><th>
|
|
326
|
-
|
|
327
|
-
Parameter
|
|
328
|
-
|
|
329
|
-
</th><th>
|
|
330
|
-
|
|
331
|
-
Type
|
|
332
|
-
|
|
333
|
-
</th><th>
|
|
334
|
-
|
|
335
|
-
Description
|
|
336
|
-
|
|
337
|
-
</th></tr></thead>
|
|
338
|
-
<tbody><tr><td>
|
|
339
|
-
|
|
340
|
-
splitScreenId
|
|
341
|
-
|
|
342
|
-
</td><td>
|
|
343
|
-
|
|
344
|
-
string
|
|
345
|
-
|
|
346
|
-
</td><td>
|
|
347
|
-
|
|
348
|
-
Split screen ID
|
|
349
|
-
|
|
350
|
-
</td></tr>
|
|
351
|
-
</tbody></table>
|
|
352
|
-
|
|
353
|
-
## Returns
|
|
354
|
-
|
|
355
|
-
Promise<boolean>
|
|
356
|
-
|
|
357
|
-
Whether the operation is successful
|
|
358
|
-
|
|
359
|
-
## Remarks
|
|
360
|
-
|
|
361
|
-
Give input focus
|
|
362
|
-
|
|
363
|
-
## Example
|
|
364
|
-
|
|
365
|
-
```javascript
|
|
366
|
-
// 1. 归一化布局后打开两个文档,并拆出一个新分屏
|
|
367
|
-
await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
368
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
369
|
-
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
|
|
370
|
-
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
371
|
-
const tabPcb = await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
|
|
372
|
-
const split = await eda.dmt_EditorControl.createSplitScreen('vertical', tabPcb);
|
|
373
|
-
|
|
374
|
-
// 2. 激活新分屏(输入焦点移到该分屏)
|
|
375
|
-
const activated = await eda.dmt_EditorControl.activateSplitScreen(split.newSplitScreenId);
|
|
376
|
-
console.log('activated:', activated);
|
|
377
|
-
|
|
378
|
-
// 3. 合并所有分屏,恢复单屏布局
|
|
379
|
-
const merged = await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
380
|
-
console.log('merged:', merged);
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
### closedocument
|
|
384
|
-
|
|
385
|
-
# DMT\_EditorControl.closeDocument() method
|
|
386
|
-
|
|
387
|
-
Close document
|
|
388
|
-
|
|
389
|
-
## Signature
|
|
390
|
-
|
|
391
|
-
```typescript
|
|
392
|
-
function closeDocument(tabId: string): Promise<boolean>;
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
## Parameters
|
|
396
|
-
|
|
397
|
-
<table><thead><tr><th>
|
|
398
|
-
|
|
399
|
-
Parameter
|
|
400
|
-
|
|
401
|
-
</th><th>
|
|
402
|
-
|
|
403
|
-
Type
|
|
404
|
-
|
|
405
|
-
</th><th>
|
|
406
|
-
|
|
407
|
-
Description
|
|
408
|
-
|
|
409
|
-
</th></tr></thead>
|
|
410
|
-
<tbody><tr><td>
|
|
411
|
-
|
|
412
|
-
tabId
|
|
413
|
-
|
|
414
|
-
</td><td>
|
|
415
|
-
|
|
416
|
-
string
|
|
417
|
-
|
|
418
|
-
</td><td>
|
|
419
|
-
|
|
420
|
-
Tab ID. Here [IDMT\_SchematicPageItem.uuid](../interfaces/IDMT_SchematicPageItem.md)<!-- -->, [IDMT\_PcbItem.uuid](../interfaces/IDMT_PcbItem.md)<!-- -->, and [IDMT\_PanelItem.uuid](../interfaces/IDMT_PanelItem.md) are supported as input
|
|
421
|
-
|
|
422
|
-
</td></tr>
|
|
423
|
-
</tbody></table>
|
|
424
|
-
|
|
425
|
-
## Returns
|
|
426
|
-
|
|
427
|
-
Promise<boolean>
|
|
428
|
-
|
|
429
|
-
Whether the operation is successful
|
|
430
|
-
|
|
431
|
-
## Remarks
|
|
432
|
-
|
|
433
|
-
If the document has not been saved, executing this operation will directly lose all unsaved data. After completing modification operations, first execute [SCH\_Document.save()](./SCH_Document.md)<!-- -->, [PCB\_Document.save()](./PCB_Document.md)<!-- -->, and [PNL\_Document.save()](./PNL_Document.md) to save the data
|
|
434
|
-
|
|
435
|
-
## Example
|
|
436
|
-
|
|
437
|
-
```javascript
|
|
438
|
-
// 1. 创建临时原理图并给它加一页(新建的原理图没有页面,需显式创建)
|
|
439
|
-
const schematicUuid = await eda.dmt_Schematic.createSchematic('嘉立创示例_关闭文档');
|
|
440
|
-
const pageUuid = await eda.dmt_Schematic.createSchematicPage(schematicUuid);
|
|
441
|
-
|
|
442
|
-
// 2. 打开该页面作为关闭目标
|
|
443
|
-
const tabId = await eda.dmt_EditorControl.openDocument(pageUuid);
|
|
444
|
-
console.log('opened tab:', tabId);
|
|
445
|
-
|
|
446
|
-
// 3. 关闭该标签页(空白文档,无未保存内容)
|
|
447
|
-
const closed = await eda.dmt_EditorControl.closeDocument(tabId);
|
|
448
|
-
console.log('closed:', closed);
|
|
449
|
-
|
|
450
|
-
// 4. 删除临时原理图,保持工程整洁
|
|
451
|
-
const deleted = await eda.dmt_Schematic.deleteSchematic(schematicUuid);
|
|
452
|
-
console.log('deleted:', deleted);
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
### createsplitscreen
|
|
456
|
-
|
|
457
|
-
# DMT\_EditorControl.createSplitScreen() method
|
|
458
|
-
|
|
459
|
-
Create Split screen
|
|
460
|
-
|
|
461
|
-
## Signature
|
|
462
|
-
|
|
463
|
-
```typescript
|
|
464
|
-
function createSplitScreen(
|
|
465
|
-
splitScreenType: EDMT_EditorSplitScreenDirection,
|
|
466
|
-
tabId: string,
|
|
467
|
-
): Promise<{ sourceSplitScreenId: string; newSplitScreenId: string } | undefined>;
|
|
468
|
-
```
|
|
469
|
-
|
|
470
|
-
## Parameters
|
|
471
|
-
|
|
472
|
-
<table><thead><tr><th>
|
|
473
|
-
|
|
474
|
-
Parameter
|
|
475
|
-
|
|
476
|
-
</th><th>
|
|
477
|
-
|
|
478
|
-
Type
|
|
479
|
-
|
|
480
|
-
</th><th>
|
|
481
|
-
|
|
482
|
-
Description
|
|
483
|
-
|
|
484
|
-
</th></tr></thead>
|
|
485
|
-
<tbody><tr><td>
|
|
486
|
-
|
|
487
|
-
splitScreenType
|
|
488
|
-
|
|
489
|
-
</td><td>
|
|
490
|
-
|
|
491
|
-
[EDMT\_EditorSplitScreenDirection](../enums/EDMT_EditorSplitScreenDirection.md)
|
|
492
|
-
|
|
493
|
-
</td><td>
|
|
494
|
-
|
|
495
|
-
Split screen type, `horizontal` horizontal, `vertical` vertical
|
|
496
|
-
|
|
497
|
-
</td></tr>
|
|
498
|
-
<tr><td>
|
|
499
|
-
|
|
500
|
-
tabId
|
|
501
|
-
|
|
502
|
-
</td><td>
|
|
503
|
-
|
|
504
|
-
string
|
|
505
|
-
|
|
506
|
-
</td><td>
|
|
507
|
-
|
|
508
|
-
Tab ID. This tab will be moved into the new split screen
|
|
509
|
-
|
|
510
|
-
</td></tr>
|
|
511
|
-
</tbody></table>
|
|
512
|
-
|
|
513
|
-
## Returns
|
|
514
|
-
|
|
515
|
-
Promise<{ sourceSplitScreenId: string; newSplitScreenId: string } \| undefined>
|
|
516
|
-
|
|
517
|
-
Split screen ID. `sourceSplitScreenId` represents the source split screen, and `newSplitScreenId` represents the new split screen
|
|
518
|
-
|
|
519
|
-
## Remarks
|
|
520
|
-
|
|
521
|
-
Please make sure the split screen corresponding to [tabId](./DMT_EditorControl.md) has more than two tabs; otherwise the split screen will not be executed and `undefined` will be returned
|
|
522
|
-
|
|
523
|
-
## Example
|
|
524
|
-
|
|
525
|
-
```javascript
|
|
526
|
-
// 1. 归一化布局:先合并既有分屏,保证两个标签页落在同一分屏
|
|
527
|
-
await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
528
|
-
|
|
529
|
-
// 2. 打开两个文档,让当前分屏持有两个标签页
|
|
530
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
531
|
-
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
|
|
532
|
-
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
533
|
-
const tabPcb = await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
|
|
534
|
-
|
|
535
|
-
// 3. 把 PCB 标签页拆到一个新的水平分屏
|
|
536
|
-
const split = await eda.dmt_EditorControl.createSplitScreen('horizontal', tabPcb);
|
|
537
|
-
console.log('source split:', split?.sourceSplitScreenId);
|
|
538
|
-
console.log('new split:', split?.newSplitScreenId);
|
|
539
|
-
|
|
540
|
-
// 4. 回读新分屏的标签页,确认 PCB 已在其中
|
|
541
|
-
const tabs = await eda.dmt_EditorControl.getTabsBySplitScreenId(split.newSplitScreenId);
|
|
542
|
-
console.log('tabs in new split:', tabs.map(t => t.title));
|
|
543
|
-
|
|
544
|
-
// 5. 合并所有分屏,恢复单屏布局
|
|
545
|
-
const merged = await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
546
|
-
console.log('merged:', merged);
|
|
547
|
-
```
|
|
548
|
-
|
|
549
|
-
### generateindicatormarkers
|
|
550
|
-
|
|
551
|
-
# DMT\_EditorControl.generateIndicatorMarkers() method
|
|
552
|
-
|
|
553
|
-
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
554
|
-
|
|
555
|
-
Generate indicator markers
|
|
556
|
-
|
|
557
|
-
## Signature
|
|
558
|
-
|
|
559
|
-
```typescript
|
|
560
|
-
function generateIndicatorMarkers(
|
|
561
|
-
markers: Array<IDMT_IndicatorMarkerShape>,
|
|
562
|
-
color?: { r: number; g: number; b: number; alpha: number },
|
|
563
|
-
lineWidth?: number,
|
|
564
|
-
zoom?: boolean,
|
|
565
|
-
tabId?: string,
|
|
566
|
-
): Promise<boolean>;
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
## Parameters
|
|
570
|
-
|
|
571
|
-
<table><thead><tr><th>
|
|
572
|
-
|
|
573
|
-
Parameter
|
|
574
|
-
|
|
575
|
-
</th><th>
|
|
576
|
-
|
|
577
|
-
Type
|
|
578
|
-
|
|
579
|
-
</th><th>
|
|
580
|
-
|
|
581
|
-
Description
|
|
582
|
-
|
|
583
|
-
</th></tr></thead>
|
|
584
|
-
<tbody><tr><td>
|
|
585
|
-
|
|
586
|
-
markers
|
|
587
|
-
|
|
588
|
-
</td><td>
|
|
589
|
-
|
|
590
|
-
Array<[IDMT\_IndicatorMarkerShape](../interfaces/IDMT_IndicatorMarkerShape.md)<!-- -->>
|
|
591
|
-
|
|
592
|
-
</td><td>
|
|
593
|
-
|
|
594
|
-
Array of indicator marker shape objects
|
|
595
|
-
|
|
596
|
-
</td></tr>
|
|
597
|
-
<tr><td>
|
|
598
|
-
|
|
599
|
-
color
|
|
600
|
-
|
|
601
|
-
</td><td>
|
|
602
|
-
|
|
603
|
-
\{ r: number; g: number; b: number; alpha: number \}
|
|
604
|
-
|
|
605
|
-
</td><td>
|
|
606
|
-
|
|
607
|
-
_(Optional)_ Indicator marker color
|
|
608
|
-
|
|
609
|
-
</td></tr>
|
|
610
|
-
<tr><td>
|
|
611
|
-
|
|
612
|
-
lineWidth
|
|
613
|
-
|
|
614
|
-
</td><td>
|
|
615
|
-
|
|
616
|
-
number
|
|
617
|
-
|
|
618
|
-
</td><td>
|
|
619
|
-
|
|
620
|
-
_(Optional)_ Line width
|
|
621
|
-
|
|
622
|
-
</td></tr>
|
|
623
|
-
<tr><td>
|
|
624
|
-
|
|
625
|
-
zoom
|
|
626
|
-
|
|
627
|
-
</td><td>
|
|
628
|
-
|
|
629
|
-
boolean
|
|
630
|
-
|
|
631
|
-
</td><td>
|
|
632
|
-
|
|
633
|
-
_(Optional)_ Whether to locate and zoom
|
|
634
|
-
|
|
635
|
-
</td></tr>
|
|
636
|
-
<tr><td>
|
|
637
|
-
|
|
638
|
-
tabId
|
|
639
|
-
|
|
640
|
-
</td><td>
|
|
641
|
-
|
|
642
|
-
string
|
|
643
|
-
|
|
644
|
-
</td><td>
|
|
645
|
-
|
|
646
|
-
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be used
|
|
647
|
-
|
|
648
|
-
</td></tr>
|
|
649
|
-
</tbody></table>
|
|
650
|
-
|
|
651
|
-
## Returns
|
|
652
|
-
|
|
653
|
-
Promise<boolean>
|
|
654
|
-
|
|
655
|
-
Whether the indicator markers were generated successfully, `false` indicates that the canvas does not support this operation or `tabId` does not exist
|
|
656
|
-
|
|
657
|
-
## Remarks
|
|
658
|
-
|
|
659
|
-
In the indicator marker shape data, the coordinate unit span of the schematic and symbol canvases is 0.01inch, and that of the PCB and footprint canvases is mil
|
|
660
|
-
|
|
661
|
-
## Example
|
|
662
|
-
|
|
663
|
-
```javascript
|
|
664
|
-
// 1. 打开一个原理图页,确定标记作用的画布
|
|
665
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
666
|
-
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
667
|
-
|
|
668
|
-
// 2. 生成一组标记:点 + 圆 + 矩形(原理图画布坐标单位 0.01inch)
|
|
669
|
-
const generated = await eda.dmt_EditorControl.generateIndicatorMarkers(
|
|
670
|
-
[
|
|
671
|
-
{ type: 'point', x: 100, y: 100 },
|
|
672
|
-
{ type: 'circle', x: 250, y: 150, r: 50 },
|
|
673
|
-
{ type: 'rectangle', left: 350, right: 550, top: 100, bottom: 250 },
|
|
674
|
-
],
|
|
675
|
-
{ r: 255, g: 60, b: 60, alpha: 1 }, // 标记颜色
|
|
676
|
-
2, // 线宽
|
|
677
|
-
false, // 不自动缩放定位到标记
|
|
678
|
-
tabId,
|
|
679
|
-
);
|
|
680
|
-
console.log('generated:', generated);
|
|
681
|
-
|
|
682
|
-
// 3. 用完即清,保持画布干净
|
|
683
|
-
const removed = await eda.dmt_EditorControl.removeIndicatorMarkers(tabId);
|
|
684
|
-
console.log('removed:', removed);
|
|
685
|
-
```
|
|
686
|
-
|
|
687
|
-
### getcurrentrenderedareaimage
|
|
688
|
-
|
|
689
|
-
# DMT\_EditorControl.getCurrentRenderedAreaImage() method
|
|
690
|
-
|
|
691
|
-
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
692
|
-
|
|
693
|
-
Get the canvas rendering region image
|
|
694
|
-
|
|
695
|
-
## Signature
|
|
696
|
-
|
|
697
|
-
```typescript
|
|
698
|
-
function getCurrentRenderedAreaImage(tabId?: string): Promise<Blob | undefined>;
|
|
699
|
-
```
|
|
700
|
-
|
|
701
|
-
## Parameters
|
|
702
|
-
|
|
703
|
-
<table><thead><tr><th>
|
|
704
|
-
|
|
705
|
-
Parameter
|
|
706
|
-
|
|
707
|
-
</th><th>
|
|
708
|
-
|
|
709
|
-
Type
|
|
710
|
-
|
|
711
|
-
</th><th>
|
|
712
|
-
|
|
713
|
-
Description
|
|
714
|
-
|
|
715
|
-
</th></tr></thead>
|
|
716
|
-
<tbody><tr><td>
|
|
717
|
-
|
|
718
|
-
tabId
|
|
719
|
-
|
|
720
|
-
</td><td>
|
|
721
|
-
|
|
722
|
-
string
|
|
723
|
-
|
|
724
|
-
</td><td>
|
|
725
|
-
|
|
726
|
-
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be obtained
|
|
727
|
-
|
|
728
|
-
</td></tr>
|
|
729
|
-
</tbody></table>
|
|
730
|
-
|
|
731
|
-
## Returns
|
|
732
|
-
|
|
733
|
-
Promise<Blob \| undefined>
|
|
734
|
-
|
|
735
|
-
- Blob-format image data of the canvas rendering region
|
|
736
|
-
|
|
737
|
-
## Example
|
|
738
|
-
|
|
739
|
-
```javascript
|
|
740
|
-
// 1. 打开一个原理图页,确定截图的画布
|
|
741
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
742
|
-
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
743
|
-
|
|
744
|
-
// 2. 获取该画布当前渲染区域的图像
|
|
745
|
-
const image = await eda.dmt_EditorControl.getCurrentRenderedAreaImage(tabId);
|
|
746
|
-
|
|
747
|
-
// 3. 读取 Blob 的基本信息(字节数与 MIME 类型)
|
|
748
|
-
console.log('isBlob:', image instanceof Blob);
|
|
749
|
-
console.log('size:', image.size);
|
|
750
|
-
console.log('mimeType:', image.type);
|
|
751
|
-
```
|
|
752
|
-
|
|
753
|
-
### getsplitscreenidbytabid
|
|
754
|
-
|
|
755
|
-
# DMT\_EditorControl.getSplitScreenIdByTabId() method
|
|
756
|
-
|
|
757
|
-
Use tab ID get split screen ID
|
|
758
|
-
|
|
759
|
-
## Signature
|
|
760
|
-
|
|
761
|
-
```typescript
|
|
762
|
-
function getSplitScreenIdByTabId(tabId: string): Promise<string | undefined>;
|
|
763
|
-
```
|
|
764
|
-
|
|
765
|
-
## Parameters
|
|
766
|
-
|
|
767
|
-
<table><thead><tr><th>
|
|
768
|
-
|
|
769
|
-
Parameter
|
|
770
|
-
|
|
771
|
-
</th><th>
|
|
772
|
-
|
|
773
|
-
Type
|
|
774
|
-
|
|
775
|
-
</th><th>
|
|
776
|
-
|
|
777
|
-
Description
|
|
778
|
-
|
|
779
|
-
</th></tr></thead>
|
|
780
|
-
<tbody><tr><td>
|
|
781
|
-
|
|
782
|
-
tabId
|
|
783
|
-
|
|
784
|
-
</td><td>
|
|
785
|
-
|
|
786
|
-
string
|
|
787
|
-
|
|
788
|
-
</td><td>
|
|
789
|
-
|
|
790
|
-
Tab ID
|
|
791
|
-
|
|
792
|
-
</td></tr>
|
|
793
|
-
</tbody></table>
|
|
794
|
-
|
|
795
|
-
## Returns
|
|
796
|
-
|
|
797
|
-
Promise<string \| undefined>
|
|
798
|
-
|
|
799
|
-
Split screen ID
|
|
800
|
-
|
|
801
|
-
## Example
|
|
802
|
-
|
|
803
|
-
```javascript
|
|
804
|
-
// 1. 打开一个原理图页,拿到它的标签页 ID
|
|
805
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
806
|
-
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
807
|
-
|
|
808
|
-
// 2. 查询该标签页所在的分屏
|
|
809
|
-
const splitScreenId = await eda.dmt_EditorControl.getSplitScreenIdByTabId(tabId);
|
|
810
|
-
console.log('tabId:', tabId);
|
|
811
|
-
console.log('splitScreenId:', splitScreenId);
|
|
812
|
-
```
|
|
813
|
-
|
|
814
|
-
### getsplitscreentree
|
|
815
|
-
|
|
816
|
-
# DMT\_EditorControl.getSplitScreenTree() method
|
|
817
|
-
|
|
818
|
-
Get the editor split screen property tree
|
|
819
|
-
|
|
820
|
-
## Signature
|
|
821
|
-
|
|
822
|
-
```typescript
|
|
823
|
-
function getSplitScreenTree(): Promise<IDMT_EditorSplitScreenItem | undefined>;
|
|
824
|
-
```
|
|
825
|
-
|
|
826
|
-
## Returns
|
|
827
|
-
|
|
828
|
-
Promise<[IDMT\_EditorSplitScreenItem](../interfaces/IDMT_EditorSplitScreenItem.md) \| undefined>
|
|
829
|
-
|
|
830
|
-
The editor split screen property tree. If it is `undefined`<!-- -->, the data retrieval failed
|
|
831
|
-
|
|
832
|
-
## Example
|
|
833
|
-
|
|
834
|
-
```javascript
|
|
835
|
-
// 1. 打开一个原理图页,保证分屏树里有标签页可读
|
|
836
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
837
|
-
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
838
|
-
|
|
839
|
-
// 2. 读取分屏树
|
|
840
|
-
const tree = await eda.dmt_EditorControl.getSplitScreenTree();
|
|
841
|
-
|
|
842
|
-
// 3. 递归遍历,收集所有分屏 ID 与标签页标题
|
|
843
|
-
const splitIds = [];
|
|
844
|
-
const tabTitles = [];
|
|
845
|
-
(function walk(node) {
|
|
846
|
-
splitIds.push(node.id);
|
|
847
|
-
if (node.tabs)
|
|
848
|
-
tabTitles.push(...node.tabs.map(t => t.title));
|
|
849
|
-
(node.children || []).forEach(walk);
|
|
850
|
-
})(tree);
|
|
851
|
-
console.log('split count:', splitIds.length);
|
|
852
|
-
console.log('tab titles:', tabTitles);
|
|
853
|
-
```
|
|
854
|
-
|
|
855
|
-
### gettabsbysplitscreenid
|
|
856
|
-
|
|
857
|
-
# DMT\_EditorControl.getTabsBySplitScreenId() method
|
|
858
|
-
|
|
859
|
-
Get all tabs under the specified split screen ID
|
|
860
|
-
|
|
861
|
-
## Signature
|
|
862
|
-
|
|
863
|
-
```typescript
|
|
864
|
-
function getTabsBySplitScreenId(splitScreenId: string): Promise<Array<IDMT_EditorTabItem>>;
|
|
865
|
-
```
|
|
866
|
-
|
|
867
|
-
## Parameters
|
|
868
|
-
|
|
869
|
-
<table><thead><tr><th>
|
|
870
|
-
|
|
871
|
-
Parameter
|
|
872
|
-
|
|
873
|
-
</th><th>
|
|
874
|
-
|
|
875
|
-
Type
|
|
876
|
-
|
|
877
|
-
</th><th>
|
|
878
|
-
|
|
879
|
-
Description
|
|
880
|
-
|
|
881
|
-
</th></tr></thead>
|
|
882
|
-
<tbody><tr><td>
|
|
883
|
-
|
|
884
|
-
splitScreenId
|
|
885
|
-
|
|
886
|
-
</td><td>
|
|
887
|
-
|
|
888
|
-
string
|
|
889
|
-
|
|
890
|
-
</td><td>
|
|
891
|
-
|
|
892
|
-
Split screen ID
|
|
893
|
-
|
|
894
|
-
</td></tr>
|
|
895
|
-
</tbody></table>
|
|
896
|
-
|
|
897
|
-
## Returns
|
|
898
|
-
|
|
899
|
-
Promise<Array<[IDMT\_EditorTabItem](../interfaces/IDMT_EditorTabItem.md)<!-- -->>>
|
|
900
|
-
|
|
901
|
-
Tab list
|
|
902
|
-
|
|
903
|
-
## Remarks
|
|
904
|
-
|
|
905
|
-
If there are no direct tabs under the specified split screen (that is, it still has [children](../interfaces/IDMT_EditorSplitScreenItem.md) under it), an empty array will be returned
|
|
906
|
-
|
|
907
|
-
## Example
|
|
908
|
-
|
|
909
|
-
```javascript
|
|
910
|
-
// 1. 打开一个原理图页并读取分屏树,定位一个直接持有标签页的分屏
|
|
911
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
912
|
-
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
913
|
-
const tree = await eda.dmt_EditorControl.getSplitScreenTree();
|
|
914
|
-
let leaf = null;
|
|
915
|
-
(function find(node) {
|
|
916
|
-
if (node.tabs?.length) { leaf = node; return; }
|
|
917
|
-
(node.children || []).forEach(find);
|
|
918
|
-
})(tree);
|
|
919
|
-
|
|
920
|
-
// 2. 查询该分屏下的所有标签页
|
|
921
|
-
const tabs = await eda.dmt_EditorControl.getTabsBySplitScreenId(leaf.id);
|
|
922
|
-
console.log('splitScreenId:', leaf.id);
|
|
923
|
-
console.log('tab count:', tabs.length);
|
|
924
|
-
console.log('titles:', tabs.map(t => t.title));
|
|
925
|
-
```
|
|
926
|
-
|
|
927
|
-
### mergealldocumentfromsplitscreen
|
|
928
|
-
|
|
929
|
-
# DMT\_EditorControl.mergeAllDocumentFromSplitScreen() method
|
|
930
|
-
|
|
931
|
-
Merge all split screens
|
|
932
|
-
|
|
933
|
-
## Signature
|
|
934
|
-
|
|
935
|
-
```typescript
|
|
936
|
-
function mergeAllDocumentFromSplitScreen(): Promise<boolean>;
|
|
937
|
-
```
|
|
938
|
-
|
|
939
|
-
## Returns
|
|
940
|
-
|
|
941
|
-
Promise<boolean>
|
|
942
|
-
|
|
943
|
-
Whether the operation is successful
|
|
944
|
-
|
|
945
|
-
## Remarks
|
|
946
|
-
|
|
947
|
-
Only available when child split screens exist. It will cancel all child split screens and merge all document tabs into the initial split screen
|
|
948
|
-
|
|
949
|
-
## Example
|
|
950
|
-
|
|
951
|
-
```javascript
|
|
952
|
-
// 1. 制造"存在子分屏"的前提:归一化布局后打开两个文档并拆出一个分屏
|
|
953
|
-
await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
954
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
955
|
-
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
|
|
956
|
-
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
957
|
-
const tabPcb = await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
|
|
958
|
-
await eda.dmt_EditorControl.createSplitScreen('vertical', tabPcb);
|
|
959
|
-
|
|
960
|
-
// 2. 合并所有分屏,标签页全部回到初始分屏
|
|
961
|
-
const merged = await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
962
|
-
console.log('merged:', merged);
|
|
963
|
-
|
|
964
|
-
// 3. 回读分屏树,确认已无子分屏
|
|
965
|
-
const tree = await eda.dmt_EditorControl.getSplitScreenTree();
|
|
966
|
-
console.log('child splits left:', tree.children?.length ?? 0);
|
|
967
|
-
```
|
|
968
|
-
|
|
969
|
-
### movedocumenttosplitscreen
|
|
970
|
-
|
|
971
|
-
# DMT\_EditorControl.moveDocumentToSplitScreen() method
|
|
972
|
-
|
|
973
|
-
Move a document to the specified split screen
|
|
974
|
-
|
|
975
|
-
## Signature
|
|
976
|
-
|
|
977
|
-
```typescript
|
|
978
|
-
function moveDocumentToSplitScreen(tabId: string, splitScreenId: string): Promise<boolean>;
|
|
979
|
-
```
|
|
980
|
-
|
|
981
|
-
## Parameters
|
|
982
|
-
|
|
983
|
-
<table><thead><tr><th>
|
|
984
|
-
|
|
985
|
-
Parameter
|
|
986
|
-
|
|
987
|
-
</th><th>
|
|
988
|
-
|
|
989
|
-
Type
|
|
990
|
-
|
|
991
|
-
</th><th>
|
|
992
|
-
|
|
993
|
-
Description
|
|
994
|
-
|
|
995
|
-
</th></tr></thead>
|
|
996
|
-
<tbody><tr><td>
|
|
997
|
-
|
|
998
|
-
tabId
|
|
999
|
-
|
|
1000
|
-
</td><td>
|
|
1001
|
-
|
|
1002
|
-
string
|
|
1003
|
-
|
|
1004
|
-
</td><td>
|
|
1005
|
-
|
|
1006
|
-
Tab ID
|
|
1007
|
-
|
|
1008
|
-
</td></tr>
|
|
1009
|
-
<tr><td>
|
|
1010
|
-
|
|
1011
|
-
splitScreenId
|
|
1012
|
-
|
|
1013
|
-
</td><td>
|
|
1014
|
-
|
|
1015
|
-
string
|
|
1016
|
-
|
|
1017
|
-
</td><td>
|
|
1018
|
-
|
|
1019
|
-
[Split screen ID](../interfaces/IDMT_EditorSplitScreenItem.md)
|
|
1020
|
-
|
|
1021
|
-
</td></tr>
|
|
1022
|
-
</tbody></table>
|
|
1023
|
-
|
|
1024
|
-
## Returns
|
|
1025
|
-
|
|
1026
|
-
Promise<boolean>
|
|
1027
|
-
|
|
1028
|
-
Whether the operation is successful
|
|
1029
|
-
|
|
1030
|
-
## Remarks
|
|
1031
|
-
|
|
1032
|
-
After moving the document, the editor split screen property tree may change
|
|
1033
|
-
|
|
1034
|
-
## Example
|
|
1035
|
-
|
|
1036
|
-
```javascript
|
|
1037
|
-
// 1. 归一化布局后打开两个文档,把 PCB 拆到新分屏
|
|
1038
|
-
await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
1039
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1040
|
-
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
|
|
1041
|
-
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1042
|
-
const tabPcb = await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
|
|
1043
|
-
const split = await eda.dmt_EditorControl.createSplitScreen('vertical', tabPcb);
|
|
1044
|
-
|
|
1045
|
-
// 2. 把 PCB 标签页移回源分屏
|
|
1046
|
-
const moved = await eda.dmt_EditorControl.moveDocumentToSplitScreen(tabPcb, split.sourceSplitScreenId);
|
|
1047
|
-
console.log('moved:', moved);
|
|
1048
|
-
|
|
1049
|
-
// 3. 回读源分屏标签页,确认两个标签页又同处一个分屏
|
|
1050
|
-
const tabs = await eda.dmt_EditorControl.getTabsBySplitScreenId(split.sourceSplitScreenId);
|
|
1051
|
-
console.log('source split tabs:', tabs.map(t => t.title));
|
|
1052
|
-
|
|
1053
|
-
// 4. 清理:合并残余分屏,恢复单屏布局
|
|
1054
|
-
const mergedBack = await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
1055
|
-
console.log('mergedBack:', mergedBack);
|
|
1056
|
-
```
|
|
1057
|
-
|
|
1058
|
-
### opendocument
|
|
1059
|
-
|
|
1060
|
-
# DMT\_EditorControl.openDocument() method
|
|
1061
|
-
|
|
1062
|
-
Open document
|
|
1063
|
-
|
|
1064
|
-
## Signature
|
|
1065
|
-
|
|
1066
|
-
```typescript
|
|
1067
|
-
function openDocument(documentUuid: string, splitScreenId?: string): Promise<string | undefined>;
|
|
1068
|
-
```
|
|
1069
|
-
|
|
1070
|
-
## Parameters
|
|
1071
|
-
|
|
1072
|
-
<table><thead><tr><th>
|
|
1073
|
-
|
|
1074
|
-
Parameter
|
|
1075
|
-
|
|
1076
|
-
</th><th>
|
|
1077
|
-
|
|
1078
|
-
Type
|
|
1079
|
-
|
|
1080
|
-
</th><th>
|
|
1081
|
-
|
|
1082
|
-
Description
|
|
1083
|
-
|
|
1084
|
-
</th></tr></thead>
|
|
1085
|
-
<tbody><tr><td>
|
|
1086
|
-
|
|
1087
|
-
documentUuid
|
|
1088
|
-
|
|
1089
|
-
</td><td>
|
|
1090
|
-
|
|
1091
|
-
string
|
|
1092
|
-
|
|
1093
|
-
</td><td>
|
|
1094
|
-
|
|
1095
|
-
Document UUID. Here [IDMT\_SchematicItem.uuid](../interfaces/IDMT_SchematicItem.md)<!-- -->, [IDMT\_SchematicPageItem.uuid](../interfaces/IDMT_SchematicPageItem.md)<!-- -->, [IDMT\_PcbItem.uuid](../interfaces/IDMT_PcbItem.md)<!-- -->, and [IDMT\_PanelItem.uuid](../interfaces/IDMT_PanelItem.md) are supported as input
|
|
1096
|
-
|
|
1097
|
-
</td></tr>
|
|
1098
|
-
<tr><td>
|
|
1099
|
-
|
|
1100
|
-
splitScreenId
|
|
1101
|
-
|
|
1102
|
-
</td><td>
|
|
1103
|
-
|
|
1104
|
-
string
|
|
1105
|
-
|
|
1106
|
-
</td><td>
|
|
1107
|
-
|
|
1108
|
-
_(Optional)_ Split screen ID, which is the [IDMT\_EditorSplitScreenItem.id](../interfaces/IDMT_EditorSplitScreenItem.md) obtained by the [DMT\_EditorControl.getSplitScreenTree()](./DMT_EditorControl.md) method
|
|
1109
|
-
|
|
1110
|
-
</td></tr>
|
|
1111
|
-
</tbody></table>
|
|
1112
|
-
|
|
1113
|
-
## Returns
|
|
1114
|
-
|
|
1115
|
-
Promise<string \| undefined>
|
|
1116
|
-
|
|
1117
|
-
Tab ID, if it is `undefined`<!-- -->, then open document failed
|
|
1118
|
-
|
|
1119
|
-
## Example
|
|
1120
|
-
|
|
1121
|
-
```javascript
|
|
1122
|
-
// 1. 取工程里第一个原理图页作为打开目标
|
|
1123
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1124
|
-
console.log('target:', pages[0].name);
|
|
1125
|
-
|
|
1126
|
-
// 2. 打开该页面,返回标签页 ID
|
|
1127
|
-
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1128
|
-
console.log('tabId:', tabId);
|
|
1129
|
-
```
|
|
1130
|
-
|
|
1131
|
-
### openlibrarydocument
|
|
1132
|
-
|
|
1133
|
-
# DMT\_EditorControl.openLibraryDocument() method
|
|
1134
|
-
|
|
1135
|
-
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1136
|
-
|
|
1137
|
-
Open library symbol, footprint document
|
|
1138
|
-
|
|
1139
|
-
## Signature
|
|
1140
|
-
|
|
1141
|
-
```typescript
|
|
1142
|
-
function openLibraryDocument(
|
|
1143
|
-
libraryUuid: string,
|
|
1144
|
-
libraryType: ELIB_LibraryType.SYMBOL | ELIB_LibraryType.FOOTPRINT,
|
|
1145
|
-
uuid: string,
|
|
1146
|
-
splitScreenId?: string,
|
|
1147
|
-
): Promise<string | undefined>;
|
|
1148
|
-
```
|
|
1149
|
-
|
|
1150
|
-
## Parameters
|
|
1151
|
-
|
|
1152
|
-
<table><thead><tr><th>
|
|
1153
|
-
|
|
1154
|
-
Parameter
|
|
1155
|
-
|
|
1156
|
-
</th><th>
|
|
1157
|
-
|
|
1158
|
-
Type
|
|
1159
|
-
|
|
1160
|
-
</th><th>
|
|
1161
|
-
|
|
1162
|
-
Description
|
|
1163
|
-
|
|
1164
|
-
</th></tr></thead>
|
|
1165
|
-
<tbody><tr><td>
|
|
1166
|
-
|
|
1167
|
-
libraryUuid
|
|
1168
|
-
|
|
1169
|
-
</td><td>
|
|
1170
|
-
|
|
1171
|
-
string
|
|
1172
|
-
|
|
1173
|
-
</td><td>
|
|
1174
|
-
|
|
1175
|
-
Library UUID, you can use [LIB\_LibrariesList](./LIB_LibrariesList.md) APIs in
|
|
1176
|
-
|
|
1177
|
-
</td></tr>
|
|
1178
|
-
<tr><td>
|
|
1179
|
-
|
|
1180
|
-
libraryType
|
|
1181
|
-
|
|
1182
|
-
</td><td>
|
|
1183
|
-
|
|
1184
|
-
[ELIB\_LibraryType.SYMBOL](../enums/ELIB_LibraryType.md) \| [ELIB\_LibraryType.FOOTPRINT](../enums/ELIB_LibraryType.md)
|
|
1185
|
-
|
|
1186
|
-
</td><td>
|
|
1187
|
-
|
|
1188
|
-
Library type, support symbol and footprint
|
|
1189
|
-
|
|
1190
|
-
</td></tr>
|
|
1191
|
-
<tr><td>
|
|
1192
|
-
|
|
1193
|
-
uuid
|
|
1194
|
-
|
|
1195
|
-
</td><td>
|
|
1196
|
-
|
|
1197
|
-
string
|
|
1198
|
-
|
|
1199
|
-
</td><td>
|
|
1200
|
-
|
|
1201
|
-
Symbol, footprint UUID
|
|
1202
|
-
|
|
1203
|
-
</td></tr>
|
|
1204
|
-
<tr><td>
|
|
1205
|
-
|
|
1206
|
-
splitScreenId
|
|
1207
|
-
|
|
1208
|
-
</td><td>
|
|
1209
|
-
|
|
1210
|
-
string
|
|
1211
|
-
|
|
1212
|
-
</td><td>
|
|
1213
|
-
|
|
1214
|
-
_(Optional)_ Split screen ID, which is the [IDMT\_EditorSplitScreenItem.id](../interfaces/IDMT_EditorSplitScreenItem.md) obtained by the [DMT\_EditorControl.getSplitScreenTree()](./DMT_EditorControl.md) method
|
|
1215
|
-
|
|
1216
|
-
</td></tr>
|
|
1217
|
-
</tbody></table>
|
|
1218
|
-
|
|
1219
|
-
## Returns
|
|
1220
|
-
|
|
1221
|
-
Promise<string \| undefined>
|
|
1222
|
-
|
|
1223
|
-
Tab ID, if it is `undefined`<!-- -->, then open document failed
|
|
1224
|
-
|
|
1225
|
-
## Example
|
|
1226
|
-
|
|
1227
|
-
```javascript
|
|
1228
|
-
// 1. 搜索库符号,拿到其所在库 UUID 与符号 UUID
|
|
1229
|
-
const results = await eda.lib_Symbol.search('0603');
|
|
1230
|
-
console.log('symbol:', results[0].name);
|
|
1231
|
-
|
|
1232
|
-
// 2. 打开该符号的编辑画布,返回标签页 ID
|
|
1233
|
-
const tabId = await eda.dmt_EditorControl.openLibraryDocument(results[0].libraryUuid,
|
|
1234
|
-
console.log('tabId:', tabId);
|
|
1235
|
-
|
|
1236
|
-
// 3. 看完关闭标签页
|
|
1237
|
-
const closed = await eda.dmt_EditorControl.closeDocument(tabId);
|
|
1238
|
-
console.log('closed:', closed);
|
|
1239
|
-
```
|
|
1240
|
-
|
|
1241
|
-
### removeindicatormarkers
|
|
1242
|
-
|
|
1243
|
-
# DMT\_EditorControl.removeIndicatorMarkers() method
|
|
1244
|
-
|
|
1245
|
-
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1246
|
-
|
|
1247
|
-
Remove indicator markers
|
|
1248
|
-
|
|
1249
|
-
## Signature
|
|
1250
|
-
|
|
1251
|
-
```typescript
|
|
1252
|
-
function removeIndicatorMarkers(tabId?: string): Promise<boolean>;
|
|
1253
|
-
```
|
|
1254
|
-
|
|
1255
|
-
## Parameters
|
|
1256
|
-
|
|
1257
|
-
<table><thead><tr><th>
|
|
1258
|
-
|
|
1259
|
-
Parameter
|
|
1260
|
-
|
|
1261
|
-
</th><th>
|
|
1262
|
-
|
|
1263
|
-
Type
|
|
1264
|
-
|
|
1265
|
-
</th><th>
|
|
1266
|
-
|
|
1267
|
-
Description
|
|
1268
|
-
|
|
1269
|
-
</th></tr></thead>
|
|
1270
|
-
<tbody><tr><td>
|
|
1271
|
-
|
|
1272
|
-
tabId
|
|
1273
|
-
|
|
1274
|
-
</td><td>
|
|
1275
|
-
|
|
1276
|
-
string
|
|
1277
|
-
|
|
1278
|
-
</td><td>
|
|
1279
|
-
|
|
1280
|
-
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be used
|
|
1281
|
-
|
|
1282
|
-
</td></tr>
|
|
1283
|
-
</tbody></table>
|
|
1284
|
-
|
|
1285
|
-
## Returns
|
|
1286
|
-
|
|
1287
|
-
Promise<boolean>
|
|
1288
|
-
|
|
1289
|
-
Whether the indicator markers were removed successfully, `false` indicates that the canvas does not support this operation or `tabId` does not exist
|
|
1290
|
-
|
|
1291
|
-
## Remarks
|
|
1292
|
-
|
|
1293
|
-
This API will remove all generated indicator markers
|
|
1294
|
-
|
|
1295
|
-
## Example
|
|
1296
|
-
|
|
1297
|
-
```javascript
|
|
1298
|
-
// 1. 打开一个原理图页,并先生成一个指示标记作为清理对象
|
|
1299
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1300
|
-
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1301
|
-
const generated = await eda.dmt_EditorControl.generateIndicatorMarkers(
|
|
1302
|
-
[{ type: 'circle', x: 150, y: 150, r: 60 }],
|
|
1303
|
-
{ r: 0, g: 128, b: 255, alpha: 1 },
|
|
1304
|
-
2,
|
|
1305
|
-
false,
|
|
1306
|
-
tabId,
|
|
1307
|
-
);
|
|
1308
|
-
console.log('generated:', generated);
|
|
1309
|
-
|
|
1310
|
-
// 2. 移除该画布上全部指示标记
|
|
1311
|
-
const removed = await eda.dmt_EditorControl.removeIndicatorMarkers(tabId);
|
|
1312
|
-
console.log('removed:', removed);
|
|
1313
|
-
```
|
|
1314
|
-
|
|
1315
|
-
### tilealldocumenttosplitscreen
|
|
1316
|
-
|
|
1317
|
-
# DMT\_EditorControl.tileAllDocumentToSplitScreen() method
|
|
1318
|
-
|
|
1319
|
-
Tile all documents
|
|
1320
|
-
|
|
1321
|
-
## Signature
|
|
1322
|
-
|
|
1323
|
-
```typescript
|
|
1324
|
-
function tileAllDocumentToSplitScreen(): Promise<boolean>;
|
|
1325
|
-
```
|
|
1326
|
-
|
|
1327
|
-
## Returns
|
|
1328
|
-
|
|
1329
|
-
Promise<boolean>
|
|
1330
|
-
|
|
1331
|
-
Whether the operation is successful
|
|
1332
|
-
|
|
1333
|
-
## Remarks
|
|
1334
|
-
|
|
1335
|
-
Only available when no child split screens exist. It will automatically create split screens for all opened document tabs
|
|
1336
|
-
|
|
1337
|
-
## Example
|
|
1338
|
-
|
|
1339
|
-
```javascript
|
|
1340
|
-
// 1. 归一化布局:先合并既有子分屏,满足"无子分屏"前提
|
|
1341
|
-
await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
1342
|
-
|
|
1343
|
-
// 2. 打开两个文档,给平铺提供素材
|
|
1344
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1345
|
-
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
|
|
1346
|
-
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1347
|
-
await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
|
|
1348
|
-
|
|
1349
|
-
// 3. 平铺:每个标签页各占一个分屏
|
|
1350
|
-
const tiled = await eda.dmt_EditorControl.tileAllDocumentToSplitScreen();
|
|
1351
|
-
console.log('tiled:', tiled);
|
|
1352
|
-
|
|
1353
|
-
// 4. 合并所有分屏,恢复单屏布局
|
|
1354
|
-
const merged = await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
1355
|
-
console.log('merged:', merged);
|
|
1356
|
-
```
|
|
1357
|
-
|
|
1358
|
-
### zoomto
|
|
1359
|
-
|
|
1360
|
-
# DMT\_EditorControl.zoomTo() method
|
|
1361
|
-
|
|
1362
|
-
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1363
|
-
|
|
1364
|
-
Zoom to coordinates
|
|
1365
|
-
|
|
1366
|
-
## Signature
|
|
1367
|
-
|
|
1368
|
-
```typescript
|
|
1369
|
-
function zoomTo(
|
|
1370
|
-
x?: number,
|
|
1371
|
-
y?: number,
|
|
1372
|
-
scaleRatio?: number,
|
|
1373
|
-
tabId?: string,
|
|
1374
|
-
): Promise<{ left: number; right: number; top: number; bottom: number } | false>;
|
|
1375
|
-
```
|
|
1376
|
-
|
|
1377
|
-
## Parameters
|
|
1378
|
-
|
|
1379
|
-
<table><thead><tr><th>
|
|
1380
|
-
|
|
1381
|
-
Parameter
|
|
1382
|
-
|
|
1383
|
-
</th><th>
|
|
1384
|
-
|
|
1385
|
-
Type
|
|
1386
|
-
|
|
1387
|
-
</th><th>
|
|
1388
|
-
|
|
1389
|
-
Description
|
|
1390
|
-
|
|
1391
|
-
</th></tr></thead>
|
|
1392
|
-
<tbody><tr><td>
|
|
1393
|
-
|
|
1394
|
-
x
|
|
1395
|
-
|
|
1396
|
-
</td><td>
|
|
1397
|
-
|
|
1398
|
-
number
|
|
1399
|
-
|
|
1400
|
-
</td><td>
|
|
1401
|
-
|
|
1402
|
-
_(Optional)_ Center X coordinate. If not passed in, the current X coordinate will not be changed
|
|
1403
|
-
|
|
1404
|
-
</td></tr>
|
|
1405
|
-
<tr><td>
|
|
1406
|
-
|
|
1407
|
-
y
|
|
1408
|
-
|
|
1409
|
-
</td><td>
|
|
1410
|
-
|
|
1411
|
-
number
|
|
1412
|
-
|
|
1413
|
-
</td><td>
|
|
1414
|
-
|
|
1415
|
-
_(Optional)_ Center Y coordinate. If not passed in, the current Y coordinate will not be changed
|
|
1416
|
-
|
|
1417
|
-
</td></tr>
|
|
1418
|
-
<tr><td>
|
|
1419
|
-
|
|
1420
|
-
scaleRatio
|
|
1421
|
-
|
|
1422
|
-
</td><td>
|
|
1423
|
-
|
|
1424
|
-
number
|
|
1425
|
-
|
|
1426
|
-
</td><td>
|
|
1427
|
-
|
|
1428
|
-
_(Optional)_ Zoom ratio. If not passed in, the current zoom ratio will not be changed. The unit span is `1/100`<!-- -->. If `200` is passed in, it means a zoom ratio of `200%`
|
|
1429
|
-
|
|
1430
|
-
</td></tr>
|
|
1431
|
-
<tr><td>
|
|
1432
|
-
|
|
1433
|
-
tabId
|
|
1434
|
-
|
|
1435
|
-
</td><td>
|
|
1436
|
-
|
|
1437
|
-
string
|
|
1438
|
-
|
|
1439
|
-
</td><td>
|
|
1440
|
-
|
|
1441
|
-
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be used
|
|
1442
|
-
|
|
1443
|
-
</td></tr>
|
|
1444
|
-
</tbody></table>
|
|
1445
|
-
|
|
1446
|
-
## Returns
|
|
1447
|
-
|
|
1448
|
-
Promise<{ left: number; right: number; top: number; bottom: number } \| false>
|
|
1449
|
-
|
|
1450
|
-
Region data after zooming. `false` indicates that the canvas does not support the zoom operation or the `tabId` does not exist
|
|
1451
|
-
|
|
1452
|
-
## Remarks
|
|
1453
|
-
|
|
1454
|
-
In the schematic and symbol canvases, the coordinate unit span is 0.01inch; in the PCB and footprint canvases, it is mil
|
|
1455
|
-
|
|
1456
|
-
## Example
|
|
1457
|
-
|
|
1458
|
-
```javascript
|
|
1459
|
-
// 1. 打开一个原理图页,确定缩放的画布
|
|
1460
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1461
|
-
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1462
|
-
|
|
1463
|
-
// 2. 视口中心移到 (100, 100),缩放比 200%(单位跨度 1/100)
|
|
1464
|
-
const bounds = await eda.dmt_EditorControl.zoomTo(100, 100, 200, tabId);
|
|
1465
|
-
console.log('bounds:', bounds);
|
|
1466
|
-
```
|
|
1467
|
-
|
|
1468
|
-
### zoomtoallprimitives
|
|
1469
|
-
|
|
1470
|
-
# DMT\_EditorControl.zoomToAllPrimitives() method
|
|
1471
|
-
|
|
1472
|
-
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1473
|
-
|
|
1474
|
-
Zoom to all primitives (fit all)
|
|
1475
|
-
|
|
1476
|
-
## Signature
|
|
1477
|
-
|
|
1478
|
-
```typescript
|
|
1479
|
-
function zoomToAllPrimitives(
|
|
1480
|
-
tabId?: string,
|
|
1481
|
-
): Promise<{ left: number; right: number; top: number; bottom: number } | false>;
|
|
1482
|
-
```
|
|
1483
|
-
|
|
1484
|
-
## Parameters
|
|
1485
|
-
|
|
1486
|
-
<table><thead><tr><th>
|
|
1487
|
-
|
|
1488
|
-
Parameter
|
|
1489
|
-
|
|
1490
|
-
</th><th>
|
|
1491
|
-
|
|
1492
|
-
Type
|
|
1493
|
-
|
|
1494
|
-
</th><th>
|
|
1495
|
-
|
|
1496
|
-
Description
|
|
1497
|
-
|
|
1498
|
-
</th></tr></thead>
|
|
1499
|
-
<tbody><tr><td>
|
|
1500
|
-
|
|
1501
|
-
tabId
|
|
1502
|
-
|
|
1503
|
-
</td><td>
|
|
1504
|
-
|
|
1505
|
-
string
|
|
1506
|
-
|
|
1507
|
-
</td><td>
|
|
1508
|
-
|
|
1509
|
-
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be used
|
|
1510
|
-
|
|
1511
|
-
</td></tr>
|
|
1512
|
-
</tbody></table>
|
|
1513
|
-
|
|
1514
|
-
## Returns
|
|
1515
|
-
|
|
1516
|
-
Promise<{ left: number; right: number; top: number; bottom: number } \| false>
|
|
1517
|
-
|
|
1518
|
-
Region data after zooming. `false` indicates that the canvas does not support the zoom operation or the `tabId` does not exist
|
|
1519
|
-
|
|
1520
|
-
## Remarks
|
|
1521
|
-
|
|
1522
|
-
In the returned data, the coordinate unit span of the schematic and symbol canvases is 0.01inch, and that of the PCB and footprint canvases is mil
|
|
1523
|
-
|
|
1524
|
-
## Example
|
|
1525
|
-
|
|
1526
|
-
```javascript
|
|
1527
|
-
// 1. 打开一个原理图页,确定缩放的画布
|
|
1528
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1529
|
-
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1530
|
-
|
|
1531
|
-
// 2. 适应全部图元,返回缩放后的可视区域边界
|
|
1532
|
-
const bounds = await eda.dmt_EditorControl.zoomToAllPrimitives(tabId);
|
|
1533
|
-
console.log('bounds:', bounds);
|
|
1534
|
-
```
|
|
1535
|
-
|
|
1536
|
-
### zoomtoregion
|
|
1537
|
-
|
|
1538
|
-
# DMT\_EditorControl.zoomToRegion() method
|
|
1539
|
-
|
|
1540
|
-
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1541
|
-
|
|
1542
|
-
Zoom to region
|
|
1543
|
-
|
|
1544
|
-
## Signature
|
|
1545
|
-
|
|
1546
|
-
```typescript
|
|
1547
|
-
function zoomToRegion(
|
|
1548
|
-
left: number,
|
|
1549
|
-
right: number,
|
|
1550
|
-
top: number,
|
|
1551
|
-
bottom: number,
|
|
1552
|
-
tabId?: string,
|
|
1553
|
-
): Promise<boolean>;
|
|
1554
|
-
```
|
|
1555
|
-
|
|
1556
|
-
## Parameters
|
|
1557
|
-
|
|
1558
|
-
<table><thead><tr><th>
|
|
1559
|
-
|
|
1560
|
-
Parameter
|
|
1561
|
-
|
|
1562
|
-
</th><th>
|
|
1563
|
-
|
|
1564
|
-
Type
|
|
1565
|
-
|
|
1566
|
-
</th><th>
|
|
1567
|
-
|
|
1568
|
-
Description
|
|
1569
|
-
|
|
1570
|
-
</th></tr></thead>
|
|
1571
|
-
<tbody><tr><td>
|
|
1572
|
-
|
|
1573
|
-
left
|
|
1574
|
-
|
|
1575
|
-
</td><td>
|
|
1576
|
-
|
|
1577
|
-
number
|
|
1578
|
-
|
|
1579
|
-
</td><td>
|
|
1580
|
-
|
|
1581
|
-
First X coordinate of the rectangle
|
|
1582
|
-
|
|
1583
|
-
</td></tr>
|
|
1584
|
-
<tr><td>
|
|
1585
|
-
|
|
1586
|
-
right
|
|
1587
|
-
|
|
1588
|
-
</td><td>
|
|
1589
|
-
|
|
1590
|
-
number
|
|
1591
|
-
|
|
1592
|
-
</td><td>
|
|
1593
|
-
|
|
1594
|
-
Second X coordinate of the rectangle
|
|
1595
|
-
|
|
1596
|
-
</td></tr>
|
|
1597
|
-
<tr><td>
|
|
1598
|
-
|
|
1599
|
-
top
|
|
1600
|
-
|
|
1601
|
-
</td><td>
|
|
1602
|
-
|
|
1603
|
-
number
|
|
1604
|
-
|
|
1605
|
-
</td><td>
|
|
1606
|
-
|
|
1607
|
-
First Y coordinate of the rectangle
|
|
1608
|
-
|
|
1609
|
-
</td></tr>
|
|
1610
|
-
<tr><td>
|
|
1611
|
-
|
|
1612
|
-
bottom
|
|
1613
|
-
|
|
1614
|
-
</td><td>
|
|
1615
|
-
|
|
1616
|
-
number
|
|
1617
|
-
|
|
1618
|
-
</td><td>
|
|
1619
|
-
|
|
1620
|
-
Second Y coordinate of the rectangle
|
|
1621
|
-
|
|
1622
|
-
</td></tr>
|
|
1623
|
-
<tr><td>
|
|
1624
|
-
|
|
1625
|
-
tabId
|
|
1626
|
-
|
|
1627
|
-
</td><td>
|
|
1628
|
-
|
|
1629
|
-
string
|
|
1630
|
-
|
|
1631
|
-
</td><td>
|
|
1632
|
-
|
|
1633
|
-
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be used
|
|
1634
|
-
|
|
1635
|
-
</td></tr>
|
|
1636
|
-
</tbody></table>
|
|
1637
|
-
|
|
1638
|
-
## Returns
|
|
1639
|
-
|
|
1640
|
-
Promise<boolean>
|
|
1641
|
-
|
|
1642
|
-
Whether the operation is successful
|
|
1643
|
-
|
|
1644
|
-
## Remarks
|
|
1645
|
-
|
|
1646
|
-
In the schematic and symbol canvases, the coordinate unit span is 0.01inch; in the PCB and footprint canvases, it is mil
|
|
1647
|
-
|
|
1648
|
-
## Example
|
|
1649
|
-
|
|
1650
|
-
```javascript
|
|
1651
|
-
// 1. 打开一个原理图页,确定缩放的画布
|
|
1652
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1653
|
-
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1654
|
-
|
|
1655
|
-
// 2. 缩放到 (0,0)-(400,300) 的矩形区域
|
|
1656
|
-
const zoomed = await eda.dmt_EditorControl.zoomToRegion(0, 400, 0, 300, tabId);
|
|
1657
|
-
console.log('zoomed:', zoomed);
|
|
1658
|
-
```
|
|
1659
|
-
|
|
1660
|
-
### zoomtoselectedprimitives
|
|
1661
|
-
|
|
1662
|
-
# DMT\_EditorControl.zoomToSelectedPrimitives() method
|
|
1663
|
-
|
|
1664
|
-
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1665
|
-
|
|
1666
|
-
Zoom to the selected primitives (fit selection)
|
|
1667
|
-
|
|
1668
|
-
## Signature
|
|
1669
|
-
|
|
1670
|
-
```typescript
|
|
1671
|
-
function zoomToSelectedPrimitives(
|
|
1672
|
-
tabId?: string,
|
|
1673
|
-
): Promise<{ left: number; right: number; top: number; bottom: number } | false>;
|
|
1674
|
-
```
|
|
1675
|
-
|
|
1676
|
-
## Parameters
|
|
1677
|
-
|
|
1678
|
-
<table><thead><tr><th>
|
|
1679
|
-
|
|
1680
|
-
Parameter
|
|
1681
|
-
|
|
1682
|
-
</th><th>
|
|
1683
|
-
|
|
1684
|
-
Type
|
|
1685
|
-
|
|
1686
|
-
</th><th>
|
|
1687
|
-
|
|
1688
|
-
Description
|
|
1689
|
-
|
|
1690
|
-
</th></tr></thead>
|
|
1691
|
-
<tbody><tr><td>
|
|
1692
|
-
|
|
1693
|
-
tabId
|
|
1694
|
-
|
|
1695
|
-
</td><td>
|
|
1696
|
-
|
|
1697
|
-
string
|
|
1698
|
-
|
|
1699
|
-
</td><td>
|
|
1700
|
-
|
|
1701
|
-
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be used
|
|
1702
|
-
|
|
1703
|
-
</td></tr>
|
|
1704
|
-
</tbody></table>
|
|
1705
|
-
|
|
1706
|
-
## Returns
|
|
1707
|
-
|
|
1708
|
-
Promise<{ left: number; right: number; top: number; bottom: number } \| false>
|
|
1709
|
-
|
|
1710
|
-
Region data after zooming. `false` indicates that the canvas does not support the zoom operation or the `tabId` does not exist
|
|
1711
|
-
|
|
1712
|
-
## Remarks
|
|
1713
|
-
|
|
1714
|
-
In the returned data, the coordinate unit span of the schematic and symbol canvases is 0.01inch, and that of the PCB and footprint canvases is mil
|
|
1715
|
-
|
|
1716
|
-
## Example
|
|
1717
|
-
|
|
1718
|
-
```javascript
|
|
1719
|
-
// 1. 打开原理图页,创建一个文本图元作为选中目标
|
|
1720
|
-
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1721
|
-
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1722
|
-
const text = await eda.sch_PrimitiveText.create(100, 80, '嘉立创示例_缩放目标');
|
|
1723
|
-
|
|
1724
|
-
// 2. 以图元 ID 建立选中状态
|
|
1725
|
-
const selected = await eda.sch_SelectControl.doSelectPrimitives([text.getState_PrimitiveId()]);
|
|
1726
|
-
console.log('selected:', selected);
|
|
1727
|
-
|
|
1728
|
-
// 3. 缩放到选中的图元,返回可视区域边界
|
|
1729
|
-
const bounds = await eda.dmt_EditorControl.zoomToSelectedPrimitives(tabId);
|
|
1730
|
-
console.log('bounds:', bounds);
|
|
1731
|
-
|
|
1732
|
-
// 4. 清理:取消选中并删除测试图元
|
|
1733
|
-
await eda.sch_SelectControl.clearSelected();
|
|
1734
|
-
await eda.sch_PrimitiveText.delete([text.getState_PrimitiveId()]);
|
|
1735
|
-
console.log('cleaned');
|
|
1736
|
-
```
|
|
1
|
+
# DMT\_EditorControl class
|
|
2
|
+
|
|
3
|
+
Document tree / Editor control class
|
|
4
|
+
|
|
5
|
+
## Signature
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
class DMT_EditorControl
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Remarks
|
|
12
|
+
|
|
13
|
+
Here the editor control is based on the sheets under the currently open engineering design. Any other `documentUuid` will be considered a non-existent document page
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
<table><thead><tr><th>
|
|
18
|
+
|
|
19
|
+
Method
|
|
20
|
+
|
|
21
|
+
</th><th>
|
|
22
|
+
|
|
23
|
+
Modifiers
|
|
24
|
+
|
|
25
|
+
</th><th>
|
|
26
|
+
|
|
27
|
+
Description
|
|
28
|
+
|
|
29
|
+
</th></tr></thead>
|
|
30
|
+
<tbody><tr><td>
|
|
31
|
+
|
|
32
|
+
[activateDocument(tabId)](./DMT_EditorControl.md)
|
|
33
|
+
|
|
34
|
+
</td><td>
|
|
35
|
+
|
|
36
|
+
</td><td>
|
|
37
|
+
|
|
38
|
+
Activate a document
|
|
39
|
+
|
|
40
|
+
</td></tr>
|
|
41
|
+
<tr><td>
|
|
42
|
+
|
|
43
|
+
[activateSplitScreen(splitScreenId)](./DMT_EditorControl.md)
|
|
44
|
+
|
|
45
|
+
</td><td>
|
|
46
|
+
|
|
47
|
+
</td><td>
|
|
48
|
+
|
|
49
|
+
Activate a split screen
|
|
50
|
+
|
|
51
|
+
</td></tr>
|
|
52
|
+
<tr><td>
|
|
53
|
+
|
|
54
|
+
[closeDocument(tabId)](./DMT_EditorControl.md)
|
|
55
|
+
|
|
56
|
+
</td><td>
|
|
57
|
+
|
|
58
|
+
</td><td>
|
|
59
|
+
|
|
60
|
+
Close document
|
|
61
|
+
|
|
62
|
+
</td></tr>
|
|
63
|
+
<tr><td>
|
|
64
|
+
|
|
65
|
+
[createSplitScreen(splitScreenType, tabId)](./DMT_EditorControl.md)
|
|
66
|
+
|
|
67
|
+
</td><td>
|
|
68
|
+
|
|
69
|
+
</td><td>
|
|
70
|
+
|
|
71
|
+
Create Split screen
|
|
72
|
+
|
|
73
|
+
</td></tr>
|
|
74
|
+
<tr><td>
|
|
75
|
+
|
|
76
|
+
[generateIndicatorMarkers(markers, color, lineWidth, zoom, tabId)](./DMT_EditorControl.md)
|
|
77
|
+
|
|
78
|
+
</td><td>
|
|
79
|
+
|
|
80
|
+
</td><td>
|
|
81
|
+
|
|
82
|
+
**_(BETA)_** Generate indicator markers
|
|
83
|
+
|
|
84
|
+
</td></tr>
|
|
85
|
+
<tr><td>
|
|
86
|
+
|
|
87
|
+
[getCurrentRenderedAreaImage(tabId)](./DMT_EditorControl.md)
|
|
88
|
+
|
|
89
|
+
</td><td>
|
|
90
|
+
|
|
91
|
+
</td><td>
|
|
92
|
+
|
|
93
|
+
**_(BETA)_** Get the canvas rendering region image
|
|
94
|
+
|
|
95
|
+
</td></tr>
|
|
96
|
+
<tr><td>
|
|
97
|
+
|
|
98
|
+
[getSplitScreenIdByTabId(tabId)](./DMT_EditorControl.md)
|
|
99
|
+
|
|
100
|
+
</td><td>
|
|
101
|
+
|
|
102
|
+
</td><td>
|
|
103
|
+
|
|
104
|
+
Use tab ID get split screen ID
|
|
105
|
+
|
|
106
|
+
</td></tr>
|
|
107
|
+
<tr><td>
|
|
108
|
+
|
|
109
|
+
[getSplitScreenTree()](./DMT_EditorControl.md)
|
|
110
|
+
|
|
111
|
+
</td><td>
|
|
112
|
+
|
|
113
|
+
</td><td>
|
|
114
|
+
|
|
115
|
+
Get the editor split screen property tree
|
|
116
|
+
|
|
117
|
+
</td></tr>
|
|
118
|
+
<tr><td>
|
|
119
|
+
|
|
120
|
+
[getTabsBySplitScreenId(splitScreenId)](./DMT_EditorControl.md)
|
|
121
|
+
|
|
122
|
+
</td><td>
|
|
123
|
+
|
|
124
|
+
</td><td>
|
|
125
|
+
|
|
126
|
+
Get all tabs under the specified split screen ID
|
|
127
|
+
|
|
128
|
+
</td></tr>
|
|
129
|
+
<tr><td>
|
|
130
|
+
|
|
131
|
+
[mergeAllDocumentFromSplitScreen()](./DMT_EditorControl.md)
|
|
132
|
+
|
|
133
|
+
</td><td>
|
|
134
|
+
|
|
135
|
+
</td><td>
|
|
136
|
+
|
|
137
|
+
Merge all split screens
|
|
138
|
+
|
|
139
|
+
</td></tr>
|
|
140
|
+
<tr><td>
|
|
141
|
+
|
|
142
|
+
[moveDocumentToSplitScreen(tabId, splitScreenId)](./DMT_EditorControl.md)
|
|
143
|
+
|
|
144
|
+
</td><td>
|
|
145
|
+
|
|
146
|
+
</td><td>
|
|
147
|
+
|
|
148
|
+
Move a document to the specified split screen
|
|
149
|
+
|
|
150
|
+
</td></tr>
|
|
151
|
+
<tr><td>
|
|
152
|
+
|
|
153
|
+
[openDocument(documentUuid, splitScreenId)](./DMT_EditorControl.md)
|
|
154
|
+
|
|
155
|
+
</td><td>
|
|
156
|
+
|
|
157
|
+
</td><td>
|
|
158
|
+
|
|
159
|
+
Open document
|
|
160
|
+
|
|
161
|
+
</td></tr>
|
|
162
|
+
<tr><td>
|
|
163
|
+
|
|
164
|
+
[openLibraryDocument(libraryUuid, libraryType, uuid, splitScreenId)](./DMT_EditorControl.md)
|
|
165
|
+
|
|
166
|
+
</td><td>
|
|
167
|
+
|
|
168
|
+
</td><td>
|
|
169
|
+
|
|
170
|
+
**_(BETA)_** Open library symbol, footprint document
|
|
171
|
+
|
|
172
|
+
</td></tr>
|
|
173
|
+
<tr><td>
|
|
174
|
+
|
|
175
|
+
[removeIndicatorMarkers(tabId)](./DMT_EditorControl.md)
|
|
176
|
+
|
|
177
|
+
</td><td>
|
|
178
|
+
|
|
179
|
+
</td><td>
|
|
180
|
+
|
|
181
|
+
**_(BETA)_** Remove indicator markers
|
|
182
|
+
|
|
183
|
+
</td></tr>
|
|
184
|
+
<tr><td>
|
|
185
|
+
|
|
186
|
+
[tileAllDocumentToSplitScreen()](./DMT_EditorControl.md)
|
|
187
|
+
|
|
188
|
+
</td><td>
|
|
189
|
+
|
|
190
|
+
</td><td>
|
|
191
|
+
|
|
192
|
+
Tile all documents
|
|
193
|
+
|
|
194
|
+
</td></tr>
|
|
195
|
+
<tr><td>
|
|
196
|
+
|
|
197
|
+
[zoomTo(x, y, scaleRatio, tabId)](./DMT_EditorControl.md)
|
|
198
|
+
|
|
199
|
+
</td><td>
|
|
200
|
+
|
|
201
|
+
</td><td>
|
|
202
|
+
|
|
203
|
+
**_(BETA)_** Zoom to coordinates
|
|
204
|
+
|
|
205
|
+
</td></tr>
|
|
206
|
+
<tr><td>
|
|
207
|
+
|
|
208
|
+
[zoomToAllPrimitives(tabId)](./DMT_EditorControl.md)
|
|
209
|
+
|
|
210
|
+
</td><td>
|
|
211
|
+
|
|
212
|
+
</td><td>
|
|
213
|
+
|
|
214
|
+
**_(BETA)_** Zoom to all primitives (fit all)
|
|
215
|
+
|
|
216
|
+
</td></tr>
|
|
217
|
+
<tr><td>
|
|
218
|
+
|
|
219
|
+
[zoomToRegion(left, right, top, bottom, tabId)](./DMT_EditorControl.md)
|
|
220
|
+
|
|
221
|
+
</td><td>
|
|
222
|
+
|
|
223
|
+
</td><td>
|
|
224
|
+
|
|
225
|
+
**_(BETA)_** Zoom to region
|
|
226
|
+
|
|
227
|
+
</td></tr>
|
|
228
|
+
<tr><td>
|
|
229
|
+
|
|
230
|
+
[zoomToSelectedPrimitives(tabId)](./DMT_EditorControl.md)
|
|
231
|
+
|
|
232
|
+
</td><td>
|
|
233
|
+
|
|
234
|
+
</td><td>
|
|
235
|
+
|
|
236
|
+
**_(BETA)_** Zoom to the selected primitives (fit selection)
|
|
237
|
+
|
|
238
|
+
</td></tr>
|
|
239
|
+
</tbody></table>
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## 方法详情
|
|
244
|
+
|
|
245
|
+
### activatedocument
|
|
246
|
+
|
|
247
|
+
# DMT\_EditorControl.activateDocument() method
|
|
248
|
+
|
|
249
|
+
Activate a document
|
|
250
|
+
|
|
251
|
+
## Signature
|
|
252
|
+
|
|
253
|
+
```typescript
|
|
254
|
+
function activateDocument(tabId: string): Promise<boolean>;
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Parameters
|
|
258
|
+
|
|
259
|
+
<table><thead><tr><th>
|
|
260
|
+
|
|
261
|
+
Parameter
|
|
262
|
+
|
|
263
|
+
</th><th>
|
|
264
|
+
|
|
265
|
+
Type
|
|
266
|
+
|
|
267
|
+
</th><th>
|
|
268
|
+
|
|
269
|
+
Description
|
|
270
|
+
|
|
271
|
+
</th></tr></thead>
|
|
272
|
+
<tbody><tr><td>
|
|
273
|
+
|
|
274
|
+
tabId
|
|
275
|
+
|
|
276
|
+
</td><td>
|
|
277
|
+
|
|
278
|
+
string
|
|
279
|
+
|
|
280
|
+
</td><td>
|
|
281
|
+
|
|
282
|
+
Tab ID
|
|
283
|
+
|
|
284
|
+
</td></tr>
|
|
285
|
+
</tbody></table>
|
|
286
|
+
|
|
287
|
+
## Returns
|
|
288
|
+
|
|
289
|
+
Promise<boolean>
|
|
290
|
+
|
|
291
|
+
Whether the operation is successful
|
|
292
|
+
|
|
293
|
+
## Remarks
|
|
294
|
+
|
|
295
|
+
Switch to the tab of the specified document and place the input focus in it
|
|
296
|
+
|
|
297
|
+
## Example
|
|
298
|
+
|
|
299
|
+
```javascript
|
|
300
|
+
// 1. 先后打开原理图页与 PCB,此时焦点在最后打开的 PCB 上
|
|
301
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
302
|
+
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
|
|
303
|
+
const tabSch = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
304
|
+
await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
|
|
305
|
+
|
|
306
|
+
// 2. 激活原理图标签页(真实切换回原理图画布)
|
|
307
|
+
const activated = await eda.dmt_EditorControl.activateDocument(tabSch);
|
|
308
|
+
console.log('activated:', activated);
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### activatesplitscreen
|
|
312
|
+
|
|
313
|
+
# DMT\_EditorControl.activateSplitScreen() method
|
|
314
|
+
|
|
315
|
+
Activate a split screen
|
|
316
|
+
|
|
317
|
+
## Signature
|
|
318
|
+
|
|
319
|
+
```typescript
|
|
320
|
+
function activateSplitScreen(splitScreenId: string): Promise<boolean>;
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## Parameters
|
|
324
|
+
|
|
325
|
+
<table><thead><tr><th>
|
|
326
|
+
|
|
327
|
+
Parameter
|
|
328
|
+
|
|
329
|
+
</th><th>
|
|
330
|
+
|
|
331
|
+
Type
|
|
332
|
+
|
|
333
|
+
</th><th>
|
|
334
|
+
|
|
335
|
+
Description
|
|
336
|
+
|
|
337
|
+
</th></tr></thead>
|
|
338
|
+
<tbody><tr><td>
|
|
339
|
+
|
|
340
|
+
splitScreenId
|
|
341
|
+
|
|
342
|
+
</td><td>
|
|
343
|
+
|
|
344
|
+
string
|
|
345
|
+
|
|
346
|
+
</td><td>
|
|
347
|
+
|
|
348
|
+
Split screen ID
|
|
349
|
+
|
|
350
|
+
</td></tr>
|
|
351
|
+
</tbody></table>
|
|
352
|
+
|
|
353
|
+
## Returns
|
|
354
|
+
|
|
355
|
+
Promise<boolean>
|
|
356
|
+
|
|
357
|
+
Whether the operation is successful
|
|
358
|
+
|
|
359
|
+
## Remarks
|
|
360
|
+
|
|
361
|
+
Give input focus
|
|
362
|
+
|
|
363
|
+
## Example
|
|
364
|
+
|
|
365
|
+
```javascript
|
|
366
|
+
// 1. 归一化布局后打开两个文档,并拆出一个新分屏
|
|
367
|
+
await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
368
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
369
|
+
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
|
|
370
|
+
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
371
|
+
const tabPcb = await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
|
|
372
|
+
const split = await eda.dmt_EditorControl.createSplitScreen('vertical', tabPcb);
|
|
373
|
+
|
|
374
|
+
// 2. 激活新分屏(输入焦点移到该分屏)
|
|
375
|
+
const activated = await eda.dmt_EditorControl.activateSplitScreen(split.newSplitScreenId);
|
|
376
|
+
console.log('activated:', activated);
|
|
377
|
+
|
|
378
|
+
// 3. 合并所有分屏,恢复单屏布局
|
|
379
|
+
const merged = await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
380
|
+
console.log('merged:', merged);
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### closedocument
|
|
384
|
+
|
|
385
|
+
# DMT\_EditorControl.closeDocument() method
|
|
386
|
+
|
|
387
|
+
Close document
|
|
388
|
+
|
|
389
|
+
## Signature
|
|
390
|
+
|
|
391
|
+
```typescript
|
|
392
|
+
function closeDocument(tabId: string): Promise<boolean>;
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
## Parameters
|
|
396
|
+
|
|
397
|
+
<table><thead><tr><th>
|
|
398
|
+
|
|
399
|
+
Parameter
|
|
400
|
+
|
|
401
|
+
</th><th>
|
|
402
|
+
|
|
403
|
+
Type
|
|
404
|
+
|
|
405
|
+
</th><th>
|
|
406
|
+
|
|
407
|
+
Description
|
|
408
|
+
|
|
409
|
+
</th></tr></thead>
|
|
410
|
+
<tbody><tr><td>
|
|
411
|
+
|
|
412
|
+
tabId
|
|
413
|
+
|
|
414
|
+
</td><td>
|
|
415
|
+
|
|
416
|
+
string
|
|
417
|
+
|
|
418
|
+
</td><td>
|
|
419
|
+
|
|
420
|
+
Tab ID. Here [IDMT\_SchematicPageItem.uuid](../interfaces/IDMT_SchematicPageItem.md)<!-- -->, [IDMT\_PcbItem.uuid](../interfaces/IDMT_PcbItem.md)<!-- -->, and [IDMT\_PanelItem.uuid](../interfaces/IDMT_PanelItem.md) are supported as input
|
|
421
|
+
|
|
422
|
+
</td></tr>
|
|
423
|
+
</tbody></table>
|
|
424
|
+
|
|
425
|
+
## Returns
|
|
426
|
+
|
|
427
|
+
Promise<boolean>
|
|
428
|
+
|
|
429
|
+
Whether the operation is successful
|
|
430
|
+
|
|
431
|
+
## Remarks
|
|
432
|
+
|
|
433
|
+
If the document has not been saved, executing this operation will directly lose all unsaved data. After completing modification operations, first execute [SCH\_Document.save()](./SCH_Document.md)<!-- -->, [PCB\_Document.save()](./PCB_Document.md)<!-- -->, and [PNL\_Document.save()](./PNL_Document.md) to save the data
|
|
434
|
+
|
|
435
|
+
## Example
|
|
436
|
+
|
|
437
|
+
```javascript
|
|
438
|
+
// 1. 创建临时原理图并给它加一页(新建的原理图没有页面,需显式创建)
|
|
439
|
+
const schematicUuid = await eda.dmt_Schematic.createSchematic('嘉立创示例_关闭文档');
|
|
440
|
+
const pageUuid = await eda.dmt_Schematic.createSchematicPage(schematicUuid);
|
|
441
|
+
|
|
442
|
+
// 2. 打开该页面作为关闭目标
|
|
443
|
+
const tabId = await eda.dmt_EditorControl.openDocument(pageUuid);
|
|
444
|
+
console.log('opened tab:', tabId);
|
|
445
|
+
|
|
446
|
+
// 3. 关闭该标签页(空白文档,无未保存内容)
|
|
447
|
+
const closed = await eda.dmt_EditorControl.closeDocument(tabId);
|
|
448
|
+
console.log('closed:', closed);
|
|
449
|
+
|
|
450
|
+
// 4. 删除临时原理图,保持工程整洁
|
|
451
|
+
const deleted = await eda.dmt_Schematic.deleteSchematic(schematicUuid);
|
|
452
|
+
console.log('deleted:', deleted);
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
### createsplitscreen
|
|
456
|
+
|
|
457
|
+
# DMT\_EditorControl.createSplitScreen() method
|
|
458
|
+
|
|
459
|
+
Create Split screen
|
|
460
|
+
|
|
461
|
+
## Signature
|
|
462
|
+
|
|
463
|
+
```typescript
|
|
464
|
+
function createSplitScreen(
|
|
465
|
+
splitScreenType: EDMT_EditorSplitScreenDirection,
|
|
466
|
+
tabId: string,
|
|
467
|
+
): Promise<{ sourceSplitScreenId: string; newSplitScreenId: string } | undefined>;
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
## Parameters
|
|
471
|
+
|
|
472
|
+
<table><thead><tr><th>
|
|
473
|
+
|
|
474
|
+
Parameter
|
|
475
|
+
|
|
476
|
+
</th><th>
|
|
477
|
+
|
|
478
|
+
Type
|
|
479
|
+
|
|
480
|
+
</th><th>
|
|
481
|
+
|
|
482
|
+
Description
|
|
483
|
+
|
|
484
|
+
</th></tr></thead>
|
|
485
|
+
<tbody><tr><td>
|
|
486
|
+
|
|
487
|
+
splitScreenType
|
|
488
|
+
|
|
489
|
+
</td><td>
|
|
490
|
+
|
|
491
|
+
[EDMT\_EditorSplitScreenDirection](../enums/EDMT_EditorSplitScreenDirection.md)
|
|
492
|
+
|
|
493
|
+
</td><td>
|
|
494
|
+
|
|
495
|
+
Split screen type, `horizontal` horizontal, `vertical` vertical
|
|
496
|
+
|
|
497
|
+
</td></tr>
|
|
498
|
+
<tr><td>
|
|
499
|
+
|
|
500
|
+
tabId
|
|
501
|
+
|
|
502
|
+
</td><td>
|
|
503
|
+
|
|
504
|
+
string
|
|
505
|
+
|
|
506
|
+
</td><td>
|
|
507
|
+
|
|
508
|
+
Tab ID. This tab will be moved into the new split screen
|
|
509
|
+
|
|
510
|
+
</td></tr>
|
|
511
|
+
</tbody></table>
|
|
512
|
+
|
|
513
|
+
## Returns
|
|
514
|
+
|
|
515
|
+
Promise<{ sourceSplitScreenId: string; newSplitScreenId: string } \| undefined>
|
|
516
|
+
|
|
517
|
+
Split screen ID. `sourceSplitScreenId` represents the source split screen, and `newSplitScreenId` represents the new split screen
|
|
518
|
+
|
|
519
|
+
## Remarks
|
|
520
|
+
|
|
521
|
+
Please make sure the split screen corresponding to [tabId](./DMT_EditorControl.md) has more than two tabs; otherwise the split screen will not be executed and `undefined` will be returned
|
|
522
|
+
|
|
523
|
+
## Example
|
|
524
|
+
|
|
525
|
+
```javascript
|
|
526
|
+
// 1. 归一化布局:先合并既有分屏,保证两个标签页落在同一分屏
|
|
527
|
+
await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
528
|
+
|
|
529
|
+
// 2. 打开两个文档,让当前分屏持有两个标签页
|
|
530
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
531
|
+
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
|
|
532
|
+
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
533
|
+
const tabPcb = await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
|
|
534
|
+
|
|
535
|
+
// 3. 把 PCB 标签页拆到一个新的水平分屏
|
|
536
|
+
const split = await eda.dmt_EditorControl.createSplitScreen('horizontal', tabPcb);
|
|
537
|
+
console.log('source split:', split?.sourceSplitScreenId);
|
|
538
|
+
console.log('new split:', split?.newSplitScreenId);
|
|
539
|
+
|
|
540
|
+
// 4. 回读新分屏的标签页,确认 PCB 已在其中
|
|
541
|
+
const tabs = await eda.dmt_EditorControl.getTabsBySplitScreenId(split.newSplitScreenId);
|
|
542
|
+
console.log('tabs in new split:', tabs.map(t => t.title));
|
|
543
|
+
|
|
544
|
+
// 5. 合并所有分屏,恢复单屏布局
|
|
545
|
+
const merged = await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
546
|
+
console.log('merged:', merged);
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
### generateindicatormarkers
|
|
550
|
+
|
|
551
|
+
# DMT\_EditorControl.generateIndicatorMarkers() method
|
|
552
|
+
|
|
553
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
554
|
+
|
|
555
|
+
Generate indicator markers
|
|
556
|
+
|
|
557
|
+
## Signature
|
|
558
|
+
|
|
559
|
+
```typescript
|
|
560
|
+
function generateIndicatorMarkers(
|
|
561
|
+
markers: Array<IDMT_IndicatorMarkerShape>,
|
|
562
|
+
color?: { r: number; g: number; b: number; alpha: number },
|
|
563
|
+
lineWidth?: number,
|
|
564
|
+
zoom?: boolean,
|
|
565
|
+
tabId?: string,
|
|
566
|
+
): Promise<boolean>;
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
## Parameters
|
|
570
|
+
|
|
571
|
+
<table><thead><tr><th>
|
|
572
|
+
|
|
573
|
+
Parameter
|
|
574
|
+
|
|
575
|
+
</th><th>
|
|
576
|
+
|
|
577
|
+
Type
|
|
578
|
+
|
|
579
|
+
</th><th>
|
|
580
|
+
|
|
581
|
+
Description
|
|
582
|
+
|
|
583
|
+
</th></tr></thead>
|
|
584
|
+
<tbody><tr><td>
|
|
585
|
+
|
|
586
|
+
markers
|
|
587
|
+
|
|
588
|
+
</td><td>
|
|
589
|
+
|
|
590
|
+
Array<[IDMT\_IndicatorMarkerShape](../interfaces/IDMT_IndicatorMarkerShape.md)<!-- -->>
|
|
591
|
+
|
|
592
|
+
</td><td>
|
|
593
|
+
|
|
594
|
+
Array of indicator marker shape objects
|
|
595
|
+
|
|
596
|
+
</td></tr>
|
|
597
|
+
<tr><td>
|
|
598
|
+
|
|
599
|
+
color
|
|
600
|
+
|
|
601
|
+
</td><td>
|
|
602
|
+
|
|
603
|
+
\{ r: number; g: number; b: number; alpha: number \}
|
|
604
|
+
|
|
605
|
+
</td><td>
|
|
606
|
+
|
|
607
|
+
_(Optional)_ Indicator marker color
|
|
608
|
+
|
|
609
|
+
</td></tr>
|
|
610
|
+
<tr><td>
|
|
611
|
+
|
|
612
|
+
lineWidth
|
|
613
|
+
|
|
614
|
+
</td><td>
|
|
615
|
+
|
|
616
|
+
number
|
|
617
|
+
|
|
618
|
+
</td><td>
|
|
619
|
+
|
|
620
|
+
_(Optional)_ Line width
|
|
621
|
+
|
|
622
|
+
</td></tr>
|
|
623
|
+
<tr><td>
|
|
624
|
+
|
|
625
|
+
zoom
|
|
626
|
+
|
|
627
|
+
</td><td>
|
|
628
|
+
|
|
629
|
+
boolean
|
|
630
|
+
|
|
631
|
+
</td><td>
|
|
632
|
+
|
|
633
|
+
_(Optional)_ Whether to locate and zoom
|
|
634
|
+
|
|
635
|
+
</td></tr>
|
|
636
|
+
<tr><td>
|
|
637
|
+
|
|
638
|
+
tabId
|
|
639
|
+
|
|
640
|
+
</td><td>
|
|
641
|
+
|
|
642
|
+
string
|
|
643
|
+
|
|
644
|
+
</td><td>
|
|
645
|
+
|
|
646
|
+
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be used
|
|
647
|
+
|
|
648
|
+
</td></tr>
|
|
649
|
+
</tbody></table>
|
|
650
|
+
|
|
651
|
+
## Returns
|
|
652
|
+
|
|
653
|
+
Promise<boolean>
|
|
654
|
+
|
|
655
|
+
Whether the indicator markers were generated successfully, `false` indicates that the canvas does not support this operation or `tabId` does not exist
|
|
656
|
+
|
|
657
|
+
## Remarks
|
|
658
|
+
|
|
659
|
+
In the indicator marker shape data, the coordinate unit span of the schematic and symbol canvases is 0.01inch, and that of the PCB and footprint canvases is mil
|
|
660
|
+
|
|
661
|
+
## Example
|
|
662
|
+
|
|
663
|
+
```javascript
|
|
664
|
+
// 1. 打开一个原理图页,确定标记作用的画布
|
|
665
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
666
|
+
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
667
|
+
|
|
668
|
+
// 2. 生成一组标记:点 + 圆 + 矩形(原理图画布坐标单位 0.01inch)
|
|
669
|
+
const generated = await eda.dmt_EditorControl.generateIndicatorMarkers(
|
|
670
|
+
[
|
|
671
|
+
{ type: 'point', x: 100, y: 100 },
|
|
672
|
+
{ type: 'circle', x: 250, y: 150, r: 50 },
|
|
673
|
+
{ type: 'rectangle', left: 350, right: 550, top: 100, bottom: 250 },
|
|
674
|
+
],
|
|
675
|
+
{ r: 255, g: 60, b: 60, alpha: 1 }, // 标记颜色
|
|
676
|
+
2, // 线宽
|
|
677
|
+
false, // 不自动缩放定位到标记
|
|
678
|
+
tabId,
|
|
679
|
+
);
|
|
680
|
+
console.log('generated:', generated);
|
|
681
|
+
|
|
682
|
+
// 3. 用完即清,保持画布干净
|
|
683
|
+
const removed = await eda.dmt_EditorControl.removeIndicatorMarkers(tabId);
|
|
684
|
+
console.log('removed:', removed);
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
### getcurrentrenderedareaimage
|
|
688
|
+
|
|
689
|
+
# DMT\_EditorControl.getCurrentRenderedAreaImage() method
|
|
690
|
+
|
|
691
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
692
|
+
|
|
693
|
+
Get the canvas rendering region image
|
|
694
|
+
|
|
695
|
+
## Signature
|
|
696
|
+
|
|
697
|
+
```typescript
|
|
698
|
+
function getCurrentRenderedAreaImage(tabId?: string): Promise<Blob | undefined>;
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
## Parameters
|
|
702
|
+
|
|
703
|
+
<table><thead><tr><th>
|
|
704
|
+
|
|
705
|
+
Parameter
|
|
706
|
+
|
|
707
|
+
</th><th>
|
|
708
|
+
|
|
709
|
+
Type
|
|
710
|
+
|
|
711
|
+
</th><th>
|
|
712
|
+
|
|
713
|
+
Description
|
|
714
|
+
|
|
715
|
+
</th></tr></thead>
|
|
716
|
+
<tbody><tr><td>
|
|
717
|
+
|
|
718
|
+
tabId
|
|
719
|
+
|
|
720
|
+
</td><td>
|
|
721
|
+
|
|
722
|
+
string
|
|
723
|
+
|
|
724
|
+
</td><td>
|
|
725
|
+
|
|
726
|
+
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be obtained
|
|
727
|
+
|
|
728
|
+
</td></tr>
|
|
729
|
+
</tbody></table>
|
|
730
|
+
|
|
731
|
+
## Returns
|
|
732
|
+
|
|
733
|
+
Promise<Blob \| undefined>
|
|
734
|
+
|
|
735
|
+
- Blob-format image data of the canvas rendering region
|
|
736
|
+
|
|
737
|
+
## Example
|
|
738
|
+
|
|
739
|
+
```javascript
|
|
740
|
+
// 1. 打开一个原理图页,确定截图的画布
|
|
741
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
742
|
+
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
743
|
+
|
|
744
|
+
// 2. 获取该画布当前渲染区域的图像
|
|
745
|
+
const image = await eda.dmt_EditorControl.getCurrentRenderedAreaImage(tabId);
|
|
746
|
+
|
|
747
|
+
// 3. 读取 Blob 的基本信息(字节数与 MIME 类型)
|
|
748
|
+
console.log('isBlob:', image instanceof Blob);
|
|
749
|
+
console.log('size:', image.size);
|
|
750
|
+
console.log('mimeType:', image.type);
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
### getsplitscreenidbytabid
|
|
754
|
+
|
|
755
|
+
# DMT\_EditorControl.getSplitScreenIdByTabId() method
|
|
756
|
+
|
|
757
|
+
Use tab ID get split screen ID
|
|
758
|
+
|
|
759
|
+
## Signature
|
|
760
|
+
|
|
761
|
+
```typescript
|
|
762
|
+
function getSplitScreenIdByTabId(tabId: string): Promise<string | undefined>;
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
## Parameters
|
|
766
|
+
|
|
767
|
+
<table><thead><tr><th>
|
|
768
|
+
|
|
769
|
+
Parameter
|
|
770
|
+
|
|
771
|
+
</th><th>
|
|
772
|
+
|
|
773
|
+
Type
|
|
774
|
+
|
|
775
|
+
</th><th>
|
|
776
|
+
|
|
777
|
+
Description
|
|
778
|
+
|
|
779
|
+
</th></tr></thead>
|
|
780
|
+
<tbody><tr><td>
|
|
781
|
+
|
|
782
|
+
tabId
|
|
783
|
+
|
|
784
|
+
</td><td>
|
|
785
|
+
|
|
786
|
+
string
|
|
787
|
+
|
|
788
|
+
</td><td>
|
|
789
|
+
|
|
790
|
+
Tab ID
|
|
791
|
+
|
|
792
|
+
</td></tr>
|
|
793
|
+
</tbody></table>
|
|
794
|
+
|
|
795
|
+
## Returns
|
|
796
|
+
|
|
797
|
+
Promise<string \| undefined>
|
|
798
|
+
|
|
799
|
+
Split screen ID
|
|
800
|
+
|
|
801
|
+
## Example
|
|
802
|
+
|
|
803
|
+
```javascript
|
|
804
|
+
// 1. 打开一个原理图页,拿到它的标签页 ID
|
|
805
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
806
|
+
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
807
|
+
|
|
808
|
+
// 2. 查询该标签页所在的分屏
|
|
809
|
+
const splitScreenId = await eda.dmt_EditorControl.getSplitScreenIdByTabId(tabId);
|
|
810
|
+
console.log('tabId:', tabId);
|
|
811
|
+
console.log('splitScreenId:', splitScreenId);
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
### getsplitscreentree
|
|
815
|
+
|
|
816
|
+
# DMT\_EditorControl.getSplitScreenTree() method
|
|
817
|
+
|
|
818
|
+
Get the editor split screen property tree
|
|
819
|
+
|
|
820
|
+
## Signature
|
|
821
|
+
|
|
822
|
+
```typescript
|
|
823
|
+
function getSplitScreenTree(): Promise<IDMT_EditorSplitScreenItem | undefined>;
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
## Returns
|
|
827
|
+
|
|
828
|
+
Promise<[IDMT\_EditorSplitScreenItem](../interfaces/IDMT_EditorSplitScreenItem.md) \| undefined>
|
|
829
|
+
|
|
830
|
+
The editor split screen property tree. If it is `undefined`<!-- -->, the data retrieval failed
|
|
831
|
+
|
|
832
|
+
## Example
|
|
833
|
+
|
|
834
|
+
```javascript
|
|
835
|
+
// 1. 打开一个原理图页,保证分屏树里有标签页可读
|
|
836
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
837
|
+
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
838
|
+
|
|
839
|
+
// 2. 读取分屏树
|
|
840
|
+
const tree = await eda.dmt_EditorControl.getSplitScreenTree();
|
|
841
|
+
|
|
842
|
+
// 3. 递归遍历,收集所有分屏 ID 与标签页标题
|
|
843
|
+
const splitIds = [];
|
|
844
|
+
const tabTitles = [];
|
|
845
|
+
(function walk(node) {
|
|
846
|
+
splitIds.push(node.id);
|
|
847
|
+
if (node.tabs)
|
|
848
|
+
tabTitles.push(...node.tabs.map(t => t.title));
|
|
849
|
+
(node.children || []).forEach(walk);
|
|
850
|
+
})(tree);
|
|
851
|
+
console.log('split count:', splitIds.length);
|
|
852
|
+
console.log('tab titles:', tabTitles);
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
### gettabsbysplitscreenid
|
|
856
|
+
|
|
857
|
+
# DMT\_EditorControl.getTabsBySplitScreenId() method
|
|
858
|
+
|
|
859
|
+
Get all tabs under the specified split screen ID
|
|
860
|
+
|
|
861
|
+
## Signature
|
|
862
|
+
|
|
863
|
+
```typescript
|
|
864
|
+
function getTabsBySplitScreenId(splitScreenId: string): Promise<Array<IDMT_EditorTabItem>>;
|
|
865
|
+
```
|
|
866
|
+
|
|
867
|
+
## Parameters
|
|
868
|
+
|
|
869
|
+
<table><thead><tr><th>
|
|
870
|
+
|
|
871
|
+
Parameter
|
|
872
|
+
|
|
873
|
+
</th><th>
|
|
874
|
+
|
|
875
|
+
Type
|
|
876
|
+
|
|
877
|
+
</th><th>
|
|
878
|
+
|
|
879
|
+
Description
|
|
880
|
+
|
|
881
|
+
</th></tr></thead>
|
|
882
|
+
<tbody><tr><td>
|
|
883
|
+
|
|
884
|
+
splitScreenId
|
|
885
|
+
|
|
886
|
+
</td><td>
|
|
887
|
+
|
|
888
|
+
string
|
|
889
|
+
|
|
890
|
+
</td><td>
|
|
891
|
+
|
|
892
|
+
Split screen ID
|
|
893
|
+
|
|
894
|
+
</td></tr>
|
|
895
|
+
</tbody></table>
|
|
896
|
+
|
|
897
|
+
## Returns
|
|
898
|
+
|
|
899
|
+
Promise<Array<[IDMT\_EditorTabItem](../interfaces/IDMT_EditorTabItem.md)<!-- -->>>
|
|
900
|
+
|
|
901
|
+
Tab list
|
|
902
|
+
|
|
903
|
+
## Remarks
|
|
904
|
+
|
|
905
|
+
If there are no direct tabs under the specified split screen (that is, it still has [children](../interfaces/IDMT_EditorSplitScreenItem.md) under it), an empty array will be returned
|
|
906
|
+
|
|
907
|
+
## Example
|
|
908
|
+
|
|
909
|
+
```javascript
|
|
910
|
+
// 1. 打开一个原理图页并读取分屏树,定位一个直接持有标签页的分屏
|
|
911
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
912
|
+
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
913
|
+
const tree = await eda.dmt_EditorControl.getSplitScreenTree();
|
|
914
|
+
let leaf = null;
|
|
915
|
+
(function find(node) {
|
|
916
|
+
if (node.tabs?.length) { leaf = node; return; }
|
|
917
|
+
(node.children || []).forEach(find);
|
|
918
|
+
})(tree);
|
|
919
|
+
|
|
920
|
+
// 2. 查询该分屏下的所有标签页
|
|
921
|
+
const tabs = await eda.dmt_EditorControl.getTabsBySplitScreenId(leaf.id);
|
|
922
|
+
console.log('splitScreenId:', leaf.id);
|
|
923
|
+
console.log('tab count:', tabs.length);
|
|
924
|
+
console.log('titles:', tabs.map(t => t.title));
|
|
925
|
+
```
|
|
926
|
+
|
|
927
|
+
### mergealldocumentfromsplitscreen
|
|
928
|
+
|
|
929
|
+
# DMT\_EditorControl.mergeAllDocumentFromSplitScreen() method
|
|
930
|
+
|
|
931
|
+
Merge all split screens
|
|
932
|
+
|
|
933
|
+
## Signature
|
|
934
|
+
|
|
935
|
+
```typescript
|
|
936
|
+
function mergeAllDocumentFromSplitScreen(): Promise<boolean>;
|
|
937
|
+
```
|
|
938
|
+
|
|
939
|
+
## Returns
|
|
940
|
+
|
|
941
|
+
Promise<boolean>
|
|
942
|
+
|
|
943
|
+
Whether the operation is successful
|
|
944
|
+
|
|
945
|
+
## Remarks
|
|
946
|
+
|
|
947
|
+
Only available when child split screens exist. It will cancel all child split screens and merge all document tabs into the initial split screen
|
|
948
|
+
|
|
949
|
+
## Example
|
|
950
|
+
|
|
951
|
+
```javascript
|
|
952
|
+
// 1. 制造"存在子分屏"的前提:归一化布局后打开两个文档并拆出一个分屏
|
|
953
|
+
await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
954
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
955
|
+
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
|
|
956
|
+
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
957
|
+
const tabPcb = await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
|
|
958
|
+
await eda.dmt_EditorControl.createSplitScreen('vertical', tabPcb);
|
|
959
|
+
|
|
960
|
+
// 2. 合并所有分屏,标签页全部回到初始分屏
|
|
961
|
+
const merged = await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
962
|
+
console.log('merged:', merged);
|
|
963
|
+
|
|
964
|
+
// 3. 回读分屏树,确认已无子分屏
|
|
965
|
+
const tree = await eda.dmt_EditorControl.getSplitScreenTree();
|
|
966
|
+
console.log('child splits left:', tree.children?.length ?? 0);
|
|
967
|
+
```
|
|
968
|
+
|
|
969
|
+
### movedocumenttosplitscreen
|
|
970
|
+
|
|
971
|
+
# DMT\_EditorControl.moveDocumentToSplitScreen() method
|
|
972
|
+
|
|
973
|
+
Move a document to the specified split screen
|
|
974
|
+
|
|
975
|
+
## Signature
|
|
976
|
+
|
|
977
|
+
```typescript
|
|
978
|
+
function moveDocumentToSplitScreen(tabId: string, splitScreenId: string): Promise<boolean>;
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
## Parameters
|
|
982
|
+
|
|
983
|
+
<table><thead><tr><th>
|
|
984
|
+
|
|
985
|
+
Parameter
|
|
986
|
+
|
|
987
|
+
</th><th>
|
|
988
|
+
|
|
989
|
+
Type
|
|
990
|
+
|
|
991
|
+
</th><th>
|
|
992
|
+
|
|
993
|
+
Description
|
|
994
|
+
|
|
995
|
+
</th></tr></thead>
|
|
996
|
+
<tbody><tr><td>
|
|
997
|
+
|
|
998
|
+
tabId
|
|
999
|
+
|
|
1000
|
+
</td><td>
|
|
1001
|
+
|
|
1002
|
+
string
|
|
1003
|
+
|
|
1004
|
+
</td><td>
|
|
1005
|
+
|
|
1006
|
+
Tab ID
|
|
1007
|
+
|
|
1008
|
+
</td></tr>
|
|
1009
|
+
<tr><td>
|
|
1010
|
+
|
|
1011
|
+
splitScreenId
|
|
1012
|
+
|
|
1013
|
+
</td><td>
|
|
1014
|
+
|
|
1015
|
+
string
|
|
1016
|
+
|
|
1017
|
+
</td><td>
|
|
1018
|
+
|
|
1019
|
+
[Split screen ID](../interfaces/IDMT_EditorSplitScreenItem.md)
|
|
1020
|
+
|
|
1021
|
+
</td></tr>
|
|
1022
|
+
</tbody></table>
|
|
1023
|
+
|
|
1024
|
+
## Returns
|
|
1025
|
+
|
|
1026
|
+
Promise<boolean>
|
|
1027
|
+
|
|
1028
|
+
Whether the operation is successful
|
|
1029
|
+
|
|
1030
|
+
## Remarks
|
|
1031
|
+
|
|
1032
|
+
After moving the document, the editor split screen property tree may change
|
|
1033
|
+
|
|
1034
|
+
## Example
|
|
1035
|
+
|
|
1036
|
+
```javascript
|
|
1037
|
+
// 1. 归一化布局后打开两个文档,把 PCB 拆到新分屏
|
|
1038
|
+
await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
1039
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1040
|
+
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
|
|
1041
|
+
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1042
|
+
const tabPcb = await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
|
|
1043
|
+
const split = await eda.dmt_EditorControl.createSplitScreen('vertical', tabPcb);
|
|
1044
|
+
|
|
1045
|
+
// 2. 把 PCB 标签页移回源分屏
|
|
1046
|
+
const moved = await eda.dmt_EditorControl.moveDocumentToSplitScreen(tabPcb, split.sourceSplitScreenId);
|
|
1047
|
+
console.log('moved:', moved);
|
|
1048
|
+
|
|
1049
|
+
// 3. 回读源分屏标签页,确认两个标签页又同处一个分屏
|
|
1050
|
+
const tabs = await eda.dmt_EditorControl.getTabsBySplitScreenId(split.sourceSplitScreenId);
|
|
1051
|
+
console.log('source split tabs:', tabs.map(t => t.title));
|
|
1052
|
+
|
|
1053
|
+
// 4. 清理:合并残余分屏,恢复单屏布局
|
|
1054
|
+
const mergedBack = await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
1055
|
+
console.log('mergedBack:', mergedBack);
|
|
1056
|
+
```
|
|
1057
|
+
|
|
1058
|
+
### opendocument
|
|
1059
|
+
|
|
1060
|
+
# DMT\_EditorControl.openDocument() method
|
|
1061
|
+
|
|
1062
|
+
Open document
|
|
1063
|
+
|
|
1064
|
+
## Signature
|
|
1065
|
+
|
|
1066
|
+
```typescript
|
|
1067
|
+
function openDocument(documentUuid: string, splitScreenId?: string): Promise<string | undefined>;
|
|
1068
|
+
```
|
|
1069
|
+
|
|
1070
|
+
## Parameters
|
|
1071
|
+
|
|
1072
|
+
<table><thead><tr><th>
|
|
1073
|
+
|
|
1074
|
+
Parameter
|
|
1075
|
+
|
|
1076
|
+
</th><th>
|
|
1077
|
+
|
|
1078
|
+
Type
|
|
1079
|
+
|
|
1080
|
+
</th><th>
|
|
1081
|
+
|
|
1082
|
+
Description
|
|
1083
|
+
|
|
1084
|
+
</th></tr></thead>
|
|
1085
|
+
<tbody><tr><td>
|
|
1086
|
+
|
|
1087
|
+
documentUuid
|
|
1088
|
+
|
|
1089
|
+
</td><td>
|
|
1090
|
+
|
|
1091
|
+
string
|
|
1092
|
+
|
|
1093
|
+
</td><td>
|
|
1094
|
+
|
|
1095
|
+
Document UUID. Here [IDMT\_SchematicItem.uuid](../interfaces/IDMT_SchematicItem.md)<!-- -->, [IDMT\_SchematicPageItem.uuid](../interfaces/IDMT_SchematicPageItem.md)<!-- -->, [IDMT\_PcbItem.uuid](../interfaces/IDMT_PcbItem.md)<!-- -->, and [IDMT\_PanelItem.uuid](../interfaces/IDMT_PanelItem.md) are supported as input
|
|
1096
|
+
|
|
1097
|
+
</td></tr>
|
|
1098
|
+
<tr><td>
|
|
1099
|
+
|
|
1100
|
+
splitScreenId
|
|
1101
|
+
|
|
1102
|
+
</td><td>
|
|
1103
|
+
|
|
1104
|
+
string
|
|
1105
|
+
|
|
1106
|
+
</td><td>
|
|
1107
|
+
|
|
1108
|
+
_(Optional)_ Split screen ID, which is the [IDMT\_EditorSplitScreenItem.id](../interfaces/IDMT_EditorSplitScreenItem.md) obtained by the [DMT\_EditorControl.getSplitScreenTree()](./DMT_EditorControl.md) method
|
|
1109
|
+
|
|
1110
|
+
</td></tr>
|
|
1111
|
+
</tbody></table>
|
|
1112
|
+
|
|
1113
|
+
## Returns
|
|
1114
|
+
|
|
1115
|
+
Promise<string \| undefined>
|
|
1116
|
+
|
|
1117
|
+
Tab ID, if it is `undefined`<!-- -->, then open document failed
|
|
1118
|
+
|
|
1119
|
+
## Example
|
|
1120
|
+
|
|
1121
|
+
```javascript
|
|
1122
|
+
// 1. 取工程里第一个原理图页作为打开目标
|
|
1123
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1124
|
+
console.log('target:', pages[0].name);
|
|
1125
|
+
|
|
1126
|
+
// 2. 打开该页面,返回标签页 ID
|
|
1127
|
+
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1128
|
+
console.log('tabId:', tabId);
|
|
1129
|
+
```
|
|
1130
|
+
|
|
1131
|
+
### openlibrarydocument
|
|
1132
|
+
|
|
1133
|
+
# DMT\_EditorControl.openLibraryDocument() method
|
|
1134
|
+
|
|
1135
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1136
|
+
|
|
1137
|
+
Open library symbol, footprint document
|
|
1138
|
+
|
|
1139
|
+
## Signature
|
|
1140
|
+
|
|
1141
|
+
```typescript
|
|
1142
|
+
function openLibraryDocument(
|
|
1143
|
+
libraryUuid: string,
|
|
1144
|
+
libraryType: ELIB_LibraryType.SYMBOL | ELIB_LibraryType.FOOTPRINT,
|
|
1145
|
+
uuid: string,
|
|
1146
|
+
splitScreenId?: string,
|
|
1147
|
+
): Promise<string | undefined>;
|
|
1148
|
+
```
|
|
1149
|
+
|
|
1150
|
+
## Parameters
|
|
1151
|
+
|
|
1152
|
+
<table><thead><tr><th>
|
|
1153
|
+
|
|
1154
|
+
Parameter
|
|
1155
|
+
|
|
1156
|
+
</th><th>
|
|
1157
|
+
|
|
1158
|
+
Type
|
|
1159
|
+
|
|
1160
|
+
</th><th>
|
|
1161
|
+
|
|
1162
|
+
Description
|
|
1163
|
+
|
|
1164
|
+
</th></tr></thead>
|
|
1165
|
+
<tbody><tr><td>
|
|
1166
|
+
|
|
1167
|
+
libraryUuid
|
|
1168
|
+
|
|
1169
|
+
</td><td>
|
|
1170
|
+
|
|
1171
|
+
string
|
|
1172
|
+
|
|
1173
|
+
</td><td>
|
|
1174
|
+
|
|
1175
|
+
Library UUID, you can use [LIB\_LibrariesList](./LIB_LibrariesList.md) APIs in
|
|
1176
|
+
|
|
1177
|
+
</td></tr>
|
|
1178
|
+
<tr><td>
|
|
1179
|
+
|
|
1180
|
+
libraryType
|
|
1181
|
+
|
|
1182
|
+
</td><td>
|
|
1183
|
+
|
|
1184
|
+
[ELIB\_LibraryType.SYMBOL](../enums/ELIB_LibraryType.md) \| [ELIB\_LibraryType.FOOTPRINT](../enums/ELIB_LibraryType.md)
|
|
1185
|
+
|
|
1186
|
+
</td><td>
|
|
1187
|
+
|
|
1188
|
+
Library type, support symbol and footprint
|
|
1189
|
+
|
|
1190
|
+
</td></tr>
|
|
1191
|
+
<tr><td>
|
|
1192
|
+
|
|
1193
|
+
uuid
|
|
1194
|
+
|
|
1195
|
+
</td><td>
|
|
1196
|
+
|
|
1197
|
+
string
|
|
1198
|
+
|
|
1199
|
+
</td><td>
|
|
1200
|
+
|
|
1201
|
+
Symbol, footprint UUID
|
|
1202
|
+
|
|
1203
|
+
</td></tr>
|
|
1204
|
+
<tr><td>
|
|
1205
|
+
|
|
1206
|
+
splitScreenId
|
|
1207
|
+
|
|
1208
|
+
</td><td>
|
|
1209
|
+
|
|
1210
|
+
string
|
|
1211
|
+
|
|
1212
|
+
</td><td>
|
|
1213
|
+
|
|
1214
|
+
_(Optional)_ Split screen ID, which is the [IDMT\_EditorSplitScreenItem.id](../interfaces/IDMT_EditorSplitScreenItem.md) obtained by the [DMT\_EditorControl.getSplitScreenTree()](./DMT_EditorControl.md) method
|
|
1215
|
+
|
|
1216
|
+
</td></tr>
|
|
1217
|
+
</tbody></table>
|
|
1218
|
+
|
|
1219
|
+
## Returns
|
|
1220
|
+
|
|
1221
|
+
Promise<string \| undefined>
|
|
1222
|
+
|
|
1223
|
+
Tab ID, if it is `undefined`<!-- -->, then open document failed
|
|
1224
|
+
|
|
1225
|
+
## Example
|
|
1226
|
+
|
|
1227
|
+
```javascript
|
|
1228
|
+
// 1. 搜索库符号,拿到其所在库 UUID 与符号 UUID
|
|
1229
|
+
const results = await eda.lib_Symbol.search('0603');
|
|
1230
|
+
console.log('symbol:', results[0].name);
|
|
1231
|
+
|
|
1232
|
+
// 2. 打开该符号的编辑画布,返回标签页 ID
|
|
1233
|
+
const tabId = await eda.dmt_EditorControl.openLibraryDocument(results[0].libraryUuid, ELIB_LibraryType.SYMBOL, results[0].uuid);
|
|
1234
|
+
console.log('tabId:', tabId);
|
|
1235
|
+
|
|
1236
|
+
// 3. 看完关闭标签页
|
|
1237
|
+
const closed = await eda.dmt_EditorControl.closeDocument(tabId);
|
|
1238
|
+
console.log('closed:', closed);
|
|
1239
|
+
```
|
|
1240
|
+
|
|
1241
|
+
### removeindicatormarkers
|
|
1242
|
+
|
|
1243
|
+
# DMT\_EditorControl.removeIndicatorMarkers() method
|
|
1244
|
+
|
|
1245
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1246
|
+
|
|
1247
|
+
Remove indicator markers
|
|
1248
|
+
|
|
1249
|
+
## Signature
|
|
1250
|
+
|
|
1251
|
+
```typescript
|
|
1252
|
+
function removeIndicatorMarkers(tabId?: string): Promise<boolean>;
|
|
1253
|
+
```
|
|
1254
|
+
|
|
1255
|
+
## Parameters
|
|
1256
|
+
|
|
1257
|
+
<table><thead><tr><th>
|
|
1258
|
+
|
|
1259
|
+
Parameter
|
|
1260
|
+
|
|
1261
|
+
</th><th>
|
|
1262
|
+
|
|
1263
|
+
Type
|
|
1264
|
+
|
|
1265
|
+
</th><th>
|
|
1266
|
+
|
|
1267
|
+
Description
|
|
1268
|
+
|
|
1269
|
+
</th></tr></thead>
|
|
1270
|
+
<tbody><tr><td>
|
|
1271
|
+
|
|
1272
|
+
tabId
|
|
1273
|
+
|
|
1274
|
+
</td><td>
|
|
1275
|
+
|
|
1276
|
+
string
|
|
1277
|
+
|
|
1278
|
+
</td><td>
|
|
1279
|
+
|
|
1280
|
+
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be used
|
|
1281
|
+
|
|
1282
|
+
</td></tr>
|
|
1283
|
+
</tbody></table>
|
|
1284
|
+
|
|
1285
|
+
## Returns
|
|
1286
|
+
|
|
1287
|
+
Promise<boolean>
|
|
1288
|
+
|
|
1289
|
+
Whether the indicator markers were removed successfully, `false` indicates that the canvas does not support this operation or `tabId` does not exist
|
|
1290
|
+
|
|
1291
|
+
## Remarks
|
|
1292
|
+
|
|
1293
|
+
This API will remove all generated indicator markers
|
|
1294
|
+
|
|
1295
|
+
## Example
|
|
1296
|
+
|
|
1297
|
+
```javascript
|
|
1298
|
+
// 1. 打开一个原理图页,并先生成一个指示标记作为清理对象
|
|
1299
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1300
|
+
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1301
|
+
const generated = await eda.dmt_EditorControl.generateIndicatorMarkers(
|
|
1302
|
+
[{ type: 'circle', x: 150, y: 150, r: 60 }],
|
|
1303
|
+
{ r: 0, g: 128, b: 255, alpha: 1 },
|
|
1304
|
+
2,
|
|
1305
|
+
false,
|
|
1306
|
+
tabId,
|
|
1307
|
+
);
|
|
1308
|
+
console.log('generated:', generated);
|
|
1309
|
+
|
|
1310
|
+
// 2. 移除该画布上全部指示标记
|
|
1311
|
+
const removed = await eda.dmt_EditorControl.removeIndicatorMarkers(tabId);
|
|
1312
|
+
console.log('removed:', removed);
|
|
1313
|
+
```
|
|
1314
|
+
|
|
1315
|
+
### tilealldocumenttosplitscreen
|
|
1316
|
+
|
|
1317
|
+
# DMT\_EditorControl.tileAllDocumentToSplitScreen() method
|
|
1318
|
+
|
|
1319
|
+
Tile all documents
|
|
1320
|
+
|
|
1321
|
+
## Signature
|
|
1322
|
+
|
|
1323
|
+
```typescript
|
|
1324
|
+
function tileAllDocumentToSplitScreen(): Promise<boolean>;
|
|
1325
|
+
```
|
|
1326
|
+
|
|
1327
|
+
## Returns
|
|
1328
|
+
|
|
1329
|
+
Promise<boolean>
|
|
1330
|
+
|
|
1331
|
+
Whether the operation is successful
|
|
1332
|
+
|
|
1333
|
+
## Remarks
|
|
1334
|
+
|
|
1335
|
+
Only available when no child split screens exist. It will automatically create split screens for all opened document tabs
|
|
1336
|
+
|
|
1337
|
+
## Example
|
|
1338
|
+
|
|
1339
|
+
```javascript
|
|
1340
|
+
// 1. 归一化布局:先合并既有子分屏,满足"无子分屏"前提
|
|
1341
|
+
await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
1342
|
+
|
|
1343
|
+
// 2. 打开两个文档,给平铺提供素材
|
|
1344
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1345
|
+
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
|
|
1346
|
+
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1347
|
+
await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
|
|
1348
|
+
|
|
1349
|
+
// 3. 平铺:每个标签页各占一个分屏
|
|
1350
|
+
const tiled = await eda.dmt_EditorControl.tileAllDocumentToSplitScreen();
|
|
1351
|
+
console.log('tiled:', tiled);
|
|
1352
|
+
|
|
1353
|
+
// 4. 合并所有分屏,恢复单屏布局
|
|
1354
|
+
const merged = await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
|
|
1355
|
+
console.log('merged:', merged);
|
|
1356
|
+
```
|
|
1357
|
+
|
|
1358
|
+
### zoomto
|
|
1359
|
+
|
|
1360
|
+
# DMT\_EditorControl.zoomTo() method
|
|
1361
|
+
|
|
1362
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1363
|
+
|
|
1364
|
+
Zoom to coordinates
|
|
1365
|
+
|
|
1366
|
+
## Signature
|
|
1367
|
+
|
|
1368
|
+
```typescript
|
|
1369
|
+
function zoomTo(
|
|
1370
|
+
x?: number,
|
|
1371
|
+
y?: number,
|
|
1372
|
+
scaleRatio?: number,
|
|
1373
|
+
tabId?: string,
|
|
1374
|
+
): Promise<{ left: number; right: number; top: number; bottom: number } | false>;
|
|
1375
|
+
```
|
|
1376
|
+
|
|
1377
|
+
## Parameters
|
|
1378
|
+
|
|
1379
|
+
<table><thead><tr><th>
|
|
1380
|
+
|
|
1381
|
+
Parameter
|
|
1382
|
+
|
|
1383
|
+
</th><th>
|
|
1384
|
+
|
|
1385
|
+
Type
|
|
1386
|
+
|
|
1387
|
+
</th><th>
|
|
1388
|
+
|
|
1389
|
+
Description
|
|
1390
|
+
|
|
1391
|
+
</th></tr></thead>
|
|
1392
|
+
<tbody><tr><td>
|
|
1393
|
+
|
|
1394
|
+
x
|
|
1395
|
+
|
|
1396
|
+
</td><td>
|
|
1397
|
+
|
|
1398
|
+
number
|
|
1399
|
+
|
|
1400
|
+
</td><td>
|
|
1401
|
+
|
|
1402
|
+
_(Optional)_ Center X coordinate. If not passed in, the current X coordinate will not be changed
|
|
1403
|
+
|
|
1404
|
+
</td></tr>
|
|
1405
|
+
<tr><td>
|
|
1406
|
+
|
|
1407
|
+
y
|
|
1408
|
+
|
|
1409
|
+
</td><td>
|
|
1410
|
+
|
|
1411
|
+
number
|
|
1412
|
+
|
|
1413
|
+
</td><td>
|
|
1414
|
+
|
|
1415
|
+
_(Optional)_ Center Y coordinate. If not passed in, the current Y coordinate will not be changed
|
|
1416
|
+
|
|
1417
|
+
</td></tr>
|
|
1418
|
+
<tr><td>
|
|
1419
|
+
|
|
1420
|
+
scaleRatio
|
|
1421
|
+
|
|
1422
|
+
</td><td>
|
|
1423
|
+
|
|
1424
|
+
number
|
|
1425
|
+
|
|
1426
|
+
</td><td>
|
|
1427
|
+
|
|
1428
|
+
_(Optional)_ Zoom ratio. If not passed in, the current zoom ratio will not be changed. The unit span is `1/100`<!-- -->. If `200` is passed in, it means a zoom ratio of `200%`
|
|
1429
|
+
|
|
1430
|
+
</td></tr>
|
|
1431
|
+
<tr><td>
|
|
1432
|
+
|
|
1433
|
+
tabId
|
|
1434
|
+
|
|
1435
|
+
</td><td>
|
|
1436
|
+
|
|
1437
|
+
string
|
|
1438
|
+
|
|
1439
|
+
</td><td>
|
|
1440
|
+
|
|
1441
|
+
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be used
|
|
1442
|
+
|
|
1443
|
+
</td></tr>
|
|
1444
|
+
</tbody></table>
|
|
1445
|
+
|
|
1446
|
+
## Returns
|
|
1447
|
+
|
|
1448
|
+
Promise<{ left: number; right: number; top: number; bottom: number } \| false>
|
|
1449
|
+
|
|
1450
|
+
Region data after zooming. `false` indicates that the canvas does not support the zoom operation or the `tabId` does not exist
|
|
1451
|
+
|
|
1452
|
+
## Remarks
|
|
1453
|
+
|
|
1454
|
+
In the schematic and symbol canvases, the coordinate unit span is 0.01inch; in the PCB and footprint canvases, it is mil
|
|
1455
|
+
|
|
1456
|
+
## Example
|
|
1457
|
+
|
|
1458
|
+
```javascript
|
|
1459
|
+
// 1. 打开一个原理图页,确定缩放的画布
|
|
1460
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1461
|
+
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1462
|
+
|
|
1463
|
+
// 2. 视口中心移到 (100, 100),缩放比 200%(单位跨度 1/100)
|
|
1464
|
+
const bounds = await eda.dmt_EditorControl.zoomTo(100, 100, 200, tabId);
|
|
1465
|
+
console.log('bounds:', bounds);
|
|
1466
|
+
```
|
|
1467
|
+
|
|
1468
|
+
### zoomtoallprimitives
|
|
1469
|
+
|
|
1470
|
+
# DMT\_EditorControl.zoomToAllPrimitives() method
|
|
1471
|
+
|
|
1472
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1473
|
+
|
|
1474
|
+
Zoom to all primitives (fit all)
|
|
1475
|
+
|
|
1476
|
+
## Signature
|
|
1477
|
+
|
|
1478
|
+
```typescript
|
|
1479
|
+
function zoomToAllPrimitives(
|
|
1480
|
+
tabId?: string,
|
|
1481
|
+
): Promise<{ left: number; right: number; top: number; bottom: number } | false>;
|
|
1482
|
+
```
|
|
1483
|
+
|
|
1484
|
+
## Parameters
|
|
1485
|
+
|
|
1486
|
+
<table><thead><tr><th>
|
|
1487
|
+
|
|
1488
|
+
Parameter
|
|
1489
|
+
|
|
1490
|
+
</th><th>
|
|
1491
|
+
|
|
1492
|
+
Type
|
|
1493
|
+
|
|
1494
|
+
</th><th>
|
|
1495
|
+
|
|
1496
|
+
Description
|
|
1497
|
+
|
|
1498
|
+
</th></tr></thead>
|
|
1499
|
+
<tbody><tr><td>
|
|
1500
|
+
|
|
1501
|
+
tabId
|
|
1502
|
+
|
|
1503
|
+
</td><td>
|
|
1504
|
+
|
|
1505
|
+
string
|
|
1506
|
+
|
|
1507
|
+
</td><td>
|
|
1508
|
+
|
|
1509
|
+
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be used
|
|
1510
|
+
|
|
1511
|
+
</td></tr>
|
|
1512
|
+
</tbody></table>
|
|
1513
|
+
|
|
1514
|
+
## Returns
|
|
1515
|
+
|
|
1516
|
+
Promise<{ left: number; right: number; top: number; bottom: number } \| false>
|
|
1517
|
+
|
|
1518
|
+
Region data after zooming. `false` indicates that the canvas does not support the zoom operation or the `tabId` does not exist
|
|
1519
|
+
|
|
1520
|
+
## Remarks
|
|
1521
|
+
|
|
1522
|
+
In the returned data, the coordinate unit span of the schematic and symbol canvases is 0.01inch, and that of the PCB and footprint canvases is mil
|
|
1523
|
+
|
|
1524
|
+
## Example
|
|
1525
|
+
|
|
1526
|
+
```javascript
|
|
1527
|
+
// 1. 打开一个原理图页,确定缩放的画布
|
|
1528
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1529
|
+
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1530
|
+
|
|
1531
|
+
// 2. 适应全部图元,返回缩放后的可视区域边界
|
|
1532
|
+
const bounds = await eda.dmt_EditorControl.zoomToAllPrimitives(tabId);
|
|
1533
|
+
console.log('bounds:', bounds);
|
|
1534
|
+
```
|
|
1535
|
+
|
|
1536
|
+
### zoomtoregion
|
|
1537
|
+
|
|
1538
|
+
# DMT\_EditorControl.zoomToRegion() method
|
|
1539
|
+
|
|
1540
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1541
|
+
|
|
1542
|
+
Zoom to region
|
|
1543
|
+
|
|
1544
|
+
## Signature
|
|
1545
|
+
|
|
1546
|
+
```typescript
|
|
1547
|
+
function zoomToRegion(
|
|
1548
|
+
left: number,
|
|
1549
|
+
right: number,
|
|
1550
|
+
top: number,
|
|
1551
|
+
bottom: number,
|
|
1552
|
+
tabId?: string,
|
|
1553
|
+
): Promise<boolean>;
|
|
1554
|
+
```
|
|
1555
|
+
|
|
1556
|
+
## Parameters
|
|
1557
|
+
|
|
1558
|
+
<table><thead><tr><th>
|
|
1559
|
+
|
|
1560
|
+
Parameter
|
|
1561
|
+
|
|
1562
|
+
</th><th>
|
|
1563
|
+
|
|
1564
|
+
Type
|
|
1565
|
+
|
|
1566
|
+
</th><th>
|
|
1567
|
+
|
|
1568
|
+
Description
|
|
1569
|
+
|
|
1570
|
+
</th></tr></thead>
|
|
1571
|
+
<tbody><tr><td>
|
|
1572
|
+
|
|
1573
|
+
left
|
|
1574
|
+
|
|
1575
|
+
</td><td>
|
|
1576
|
+
|
|
1577
|
+
number
|
|
1578
|
+
|
|
1579
|
+
</td><td>
|
|
1580
|
+
|
|
1581
|
+
First X coordinate of the rectangle
|
|
1582
|
+
|
|
1583
|
+
</td></tr>
|
|
1584
|
+
<tr><td>
|
|
1585
|
+
|
|
1586
|
+
right
|
|
1587
|
+
|
|
1588
|
+
</td><td>
|
|
1589
|
+
|
|
1590
|
+
number
|
|
1591
|
+
|
|
1592
|
+
</td><td>
|
|
1593
|
+
|
|
1594
|
+
Second X coordinate of the rectangle
|
|
1595
|
+
|
|
1596
|
+
</td></tr>
|
|
1597
|
+
<tr><td>
|
|
1598
|
+
|
|
1599
|
+
top
|
|
1600
|
+
|
|
1601
|
+
</td><td>
|
|
1602
|
+
|
|
1603
|
+
number
|
|
1604
|
+
|
|
1605
|
+
</td><td>
|
|
1606
|
+
|
|
1607
|
+
First Y coordinate of the rectangle
|
|
1608
|
+
|
|
1609
|
+
</td></tr>
|
|
1610
|
+
<tr><td>
|
|
1611
|
+
|
|
1612
|
+
bottom
|
|
1613
|
+
|
|
1614
|
+
</td><td>
|
|
1615
|
+
|
|
1616
|
+
number
|
|
1617
|
+
|
|
1618
|
+
</td><td>
|
|
1619
|
+
|
|
1620
|
+
Second Y coordinate of the rectangle
|
|
1621
|
+
|
|
1622
|
+
</td></tr>
|
|
1623
|
+
<tr><td>
|
|
1624
|
+
|
|
1625
|
+
tabId
|
|
1626
|
+
|
|
1627
|
+
</td><td>
|
|
1628
|
+
|
|
1629
|
+
string
|
|
1630
|
+
|
|
1631
|
+
</td><td>
|
|
1632
|
+
|
|
1633
|
+
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be used
|
|
1634
|
+
|
|
1635
|
+
</td></tr>
|
|
1636
|
+
</tbody></table>
|
|
1637
|
+
|
|
1638
|
+
## Returns
|
|
1639
|
+
|
|
1640
|
+
Promise<boolean>
|
|
1641
|
+
|
|
1642
|
+
Whether the operation is successful
|
|
1643
|
+
|
|
1644
|
+
## Remarks
|
|
1645
|
+
|
|
1646
|
+
In the schematic and symbol canvases, the coordinate unit span is 0.01inch; in the PCB and footprint canvases, it is mil
|
|
1647
|
+
|
|
1648
|
+
## Example
|
|
1649
|
+
|
|
1650
|
+
```javascript
|
|
1651
|
+
// 1. 打开一个原理图页,确定缩放的画布
|
|
1652
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1653
|
+
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1654
|
+
|
|
1655
|
+
// 2. 缩放到 (0,0)-(400,300) 的矩形区域
|
|
1656
|
+
const zoomed = await eda.dmt_EditorControl.zoomToRegion(0, 400, 0, 300, tabId);
|
|
1657
|
+
console.log('zoomed:', zoomed);
|
|
1658
|
+
```
|
|
1659
|
+
|
|
1660
|
+
### zoomtoselectedprimitives
|
|
1661
|
+
|
|
1662
|
+
# DMT\_EditorControl.zoomToSelectedPrimitives() method
|
|
1663
|
+
|
|
1664
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1665
|
+
|
|
1666
|
+
Zoom to the selected primitives (fit selection)
|
|
1667
|
+
|
|
1668
|
+
## Signature
|
|
1669
|
+
|
|
1670
|
+
```typescript
|
|
1671
|
+
function zoomToSelectedPrimitives(
|
|
1672
|
+
tabId?: string,
|
|
1673
|
+
): Promise<{ left: number; right: number; top: number; bottom: number } | false>;
|
|
1674
|
+
```
|
|
1675
|
+
|
|
1676
|
+
## Parameters
|
|
1677
|
+
|
|
1678
|
+
<table><thead><tr><th>
|
|
1679
|
+
|
|
1680
|
+
Parameter
|
|
1681
|
+
|
|
1682
|
+
</th><th>
|
|
1683
|
+
|
|
1684
|
+
Type
|
|
1685
|
+
|
|
1686
|
+
</th><th>
|
|
1687
|
+
|
|
1688
|
+
Description
|
|
1689
|
+
|
|
1690
|
+
</th></tr></thead>
|
|
1691
|
+
<tbody><tr><td>
|
|
1692
|
+
|
|
1693
|
+
tabId
|
|
1694
|
+
|
|
1695
|
+
</td><td>
|
|
1696
|
+
|
|
1697
|
+
string
|
|
1698
|
+
|
|
1699
|
+
</td><td>
|
|
1700
|
+
|
|
1701
|
+
_(Optional)_ Tab ID. If not passed in, the canvas with the last input focus will be used
|
|
1702
|
+
|
|
1703
|
+
</td></tr>
|
|
1704
|
+
</tbody></table>
|
|
1705
|
+
|
|
1706
|
+
## Returns
|
|
1707
|
+
|
|
1708
|
+
Promise<{ left: number; right: number; top: number; bottom: number } \| false>
|
|
1709
|
+
|
|
1710
|
+
Region data after zooming. `false` indicates that the canvas does not support the zoom operation or the `tabId` does not exist
|
|
1711
|
+
|
|
1712
|
+
## Remarks
|
|
1713
|
+
|
|
1714
|
+
In the returned data, the coordinate unit span of the schematic and symbol canvases is 0.01inch, and that of the PCB and footprint canvases is mil
|
|
1715
|
+
|
|
1716
|
+
## Example
|
|
1717
|
+
|
|
1718
|
+
```javascript
|
|
1719
|
+
// 1. 打开原理图页,创建一个文本图元作为选中目标
|
|
1720
|
+
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
|
|
1721
|
+
const tabId = await eda.dmt_EditorControl.openDocument(pages[0].uuid);
|
|
1722
|
+
const text = await eda.sch_PrimitiveText.create(100, 80, '嘉立创示例_缩放目标');
|
|
1723
|
+
|
|
1724
|
+
// 2. 以图元 ID 建立选中状态
|
|
1725
|
+
const selected = await eda.sch_SelectControl.doSelectPrimitives([text.getState_PrimitiveId()]);
|
|
1726
|
+
console.log('selected:', selected);
|
|
1727
|
+
|
|
1728
|
+
// 3. 缩放到选中的图元,返回可视区域边界
|
|
1729
|
+
const bounds = await eda.dmt_EditorControl.zoomToSelectedPrimitives(tabId);
|
|
1730
|
+
console.log('bounds:', bounds);
|
|
1731
|
+
|
|
1732
|
+
// 4. 清理:取消选中并删除测试图元
|
|
1733
|
+
await eda.sch_SelectControl.clearSelected();
|
|
1734
|
+
await eda.sch_PrimitiveText.delete([text.getState_PrimitiveId()]);
|
|
1735
|
+
console.log('cleaned');
|
|
1736
|
+
```
|