@windypro-rourou/dsh-eda 0.1.4 → 0.1.6
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/backend.js +49 -0
- package/lib/capabilities.js +6 -2
- package/lib/client.js +33 -0
- package/lib/index.js +197 -3
- 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,973 +1,973 @@
|
|
|
1
|
-
# ISCH\_PrimitiveBus class
|
|
2
|
-
|
|
3
|
-
Bus primitive
|
|
4
|
-
|
|
5
|
-
## Signature
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
class ISCH_PrimitiveBus implements ISCH_Primitive
|
|
9
|
-
```
|
|
10
|
-
**Implements:** [ISCH\_Primitive](../interfaces/ISCH_Primitive.md)
|
|
11
|
-
|
|
12
|
-
## Remarks
|
|
13
|
-
|
|
14
|
-
Unresolved issues:
|
|
15
|
-
|
|
16
|
-
The `ISCH_PrimitiveWire.net` global net name property involves multi-sheet refresh, so the currently obtained value may be \*\*incorrect\*\*. When you try to set multiple names for a wire or bus (by placing multiple net labels), the obtained `net` property may not be the latest. You need to wait for the canvas event to asynchronously refresh the global nets before reading it again.
|
|
17
|
-
|
|
18
|
-
## Methods
|
|
19
|
-
|
|
20
|
-
<table><thead><tr><th>
|
|
21
|
-
|
|
22
|
-
Method
|
|
23
|
-
|
|
24
|
-
</th><th>
|
|
25
|
-
|
|
26
|
-
Modifiers
|
|
27
|
-
|
|
28
|
-
</th><th>
|
|
29
|
-
|
|
30
|
-
Description
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
[done()](./ISCH_PrimitiveBus.md)
|
|
36
|
-
|
|
37
|
-
</td><td>
|
|
38
|
-
|
|
39
|
-
</td><td>
|
|
40
|
-
|
|
41
|
-
**_(BETA)_** Apply the changes to the primitives to the canvas
|
|
42
|
-
|
|
43
|
-
</td></tr>
|
|
44
|
-
<tr><td>
|
|
45
|
-
|
|
46
|
-
[getState\_BusName()](./ISCH_PrimitiveBus.md)
|
|
47
|
-
|
|
48
|
-
</td><td>
|
|
49
|
-
|
|
50
|
-
</td><td>
|
|
51
|
-
|
|
52
|
-
Get the property state: bus name
|
|
53
|
-
|
|
54
|
-
</td></tr>
|
|
55
|
-
<tr><td>
|
|
56
|
-
|
|
57
|
-
[getState\_Color()](./ISCH_PrimitiveBus.md)
|
|
58
|
-
|
|
59
|
-
</td><td>
|
|
60
|
-
|
|
61
|
-
</td><td>
|
|
62
|
-
|
|
63
|
-
Get the property state: bus color
|
|
64
|
-
|
|
65
|
-
</td></tr>
|
|
66
|
-
<tr><td>
|
|
67
|
-
|
|
68
|
-
[getState\_Line()](./ISCH_PrimitiveBus.md)
|
|
69
|
-
|
|
70
|
-
</td><td>
|
|
71
|
-
|
|
72
|
-
</td><td>
|
|
73
|
-
|
|
74
|
-
Get the property state: polyline coordinate group
|
|
75
|
-
|
|
76
|
-
</td></tr>
|
|
77
|
-
<tr><td>
|
|
78
|
-
|
|
79
|
-
[getState\_LineType()](./ISCH_PrimitiveBus.md)
|
|
80
|
-
|
|
81
|
-
</td><td>
|
|
82
|
-
|
|
83
|
-
</td><td>
|
|
84
|
-
|
|
85
|
-
Get the property state: line type
|
|
86
|
-
|
|
87
|
-
</td></tr>
|
|
88
|
-
<tr><td>
|
|
89
|
-
|
|
90
|
-
[getState\_LineWidth()](./ISCH_PrimitiveBus.md)
|
|
91
|
-
|
|
92
|
-
</td><td>
|
|
93
|
-
|
|
94
|
-
</td><td>
|
|
95
|
-
|
|
96
|
-
Get the property state: Line width
|
|
97
|
-
|
|
98
|
-
</td></tr>
|
|
99
|
-
<tr><td>
|
|
100
|
-
|
|
101
|
-
[getState\_PrimitiveId()](./ISCH_PrimitiveBus.md)
|
|
102
|
-
|
|
103
|
-
</td><td>
|
|
104
|
-
|
|
105
|
-
</td><td>
|
|
106
|
-
|
|
107
|
-
Get the property state: primitive ID
|
|
108
|
-
|
|
109
|
-
</td></tr>
|
|
110
|
-
<tr><td>
|
|
111
|
-
|
|
112
|
-
[getState\_PrimitiveType()](./ISCH_PrimitiveBus.md)
|
|
113
|
-
|
|
114
|
-
</td><td>
|
|
115
|
-
|
|
116
|
-
</td><td>
|
|
117
|
-
|
|
118
|
-
Get the property state: primitive type
|
|
119
|
-
|
|
120
|
-
</td></tr>
|
|
121
|
-
<tr><td>
|
|
122
|
-
|
|
123
|
-
[isAsync()](./ISCH_PrimitiveBus.md)
|
|
124
|
-
|
|
125
|
-
</td><td>
|
|
126
|
-
|
|
127
|
-
</td><td>
|
|
128
|
-
|
|
129
|
-
Query whether the primitive is an async primitive
|
|
130
|
-
|
|
131
|
-
</td></tr>
|
|
132
|
-
<tr><td>
|
|
133
|
-
|
|
134
|
-
[setState\_BusName(busName)](./ISCH_PrimitiveBus.md)
|
|
135
|
-
|
|
136
|
-
</td><td>
|
|
137
|
-
|
|
138
|
-
</td><td>
|
|
139
|
-
|
|
140
|
-
**_(BETA)_** Set the property state: bus name
|
|
141
|
-
|
|
142
|
-
</td></tr>
|
|
143
|
-
<tr><td>
|
|
144
|
-
|
|
145
|
-
[setState\_Color(color)](./ISCH_PrimitiveBus.md)
|
|
146
|
-
|
|
147
|
-
</td><td>
|
|
148
|
-
|
|
149
|
-
</td><td>
|
|
150
|
-
|
|
151
|
-
**_(BETA)_** Set the property state: Bus color
|
|
152
|
-
|
|
153
|
-
</td></tr>
|
|
154
|
-
<tr><td>
|
|
155
|
-
|
|
156
|
-
[setState\_Line(line)](./ISCH_PrimitiveBus.md)
|
|
157
|
-
|
|
158
|
-
</td><td>
|
|
159
|
-
|
|
160
|
-
</td><td>
|
|
161
|
-
|
|
162
|
-
**_(BETA)_** Set the property state: polyline coordinate group
|
|
163
|
-
|
|
164
|
-
</td></tr>
|
|
165
|
-
<tr><td>
|
|
166
|
-
|
|
167
|
-
[setState\_LineType(lineType)](./ISCH_PrimitiveBus.md)
|
|
168
|
-
|
|
169
|
-
</td><td>
|
|
170
|
-
|
|
171
|
-
</td><td>
|
|
172
|
-
|
|
173
|
-
**_(BETA)_** Set the property state: line type
|
|
174
|
-
|
|
175
|
-
</td></tr>
|
|
176
|
-
<tr><td>
|
|
177
|
-
|
|
178
|
-
[setState\_LineWidth(lineWidth)](./ISCH_PrimitiveBus.md)
|
|
179
|
-
|
|
180
|
-
</td><td>
|
|
181
|
-
|
|
182
|
-
</td><td>
|
|
183
|
-
|
|
184
|
-
**_(BETA)_** Set the property state: Line width
|
|
185
|
-
|
|
186
|
-
</td></tr>
|
|
187
|
-
<tr><td>
|
|
188
|
-
|
|
189
|
-
[toAsync()](./ISCH_PrimitiveBus.md)
|
|
190
|
-
|
|
191
|
-
</td><td>
|
|
192
|
-
|
|
193
|
-
</td><td>
|
|
194
|
-
|
|
195
|
-
Convert Primitive to Async primitive
|
|
196
|
-
|
|
197
|
-
</td></tr>
|
|
198
|
-
<tr><td>
|
|
199
|
-
|
|
200
|
-
[toSync()](./ISCH_PrimitiveBus.md)
|
|
201
|
-
|
|
202
|
-
</td><td>
|
|
203
|
-
|
|
204
|
-
</td><td>
|
|
205
|
-
|
|
206
|
-
Convert Primitive to Sync primitive
|
|
207
|
-
|
|
208
|
-
</td></tr>
|
|
209
|
-
</tbody></table>
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## 方法详情
|
|
214
|
-
|
|
215
|
-
### done
|
|
216
|
-
|
|
217
|
-
# ISCH\_PrimitiveBus.done() method
|
|
218
|
-
|
|
219
|
-
> 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.
|
|
220
|
-
|
|
221
|
-
Apply the changes to the primitives to the canvas
|
|
222
|
-
|
|
223
|
-
## Signature
|
|
224
|
-
|
|
225
|
-
```typescript
|
|
226
|
-
function done(): Promise<ISCH_PrimitiveBus>;
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
## Returns
|
|
230
|
-
|
|
231
|
-
Promise<[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)<!-- -->>
|
|
232
|
-
|
|
233
|
-
Bus primitive object
|
|
234
|
-
|
|
235
|
-
## Example
|
|
236
|
-
|
|
237
|
-
```javascript
|
|
238
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
239
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
240
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
241
|
-
|
|
242
|
-
// 2. 创建一条测试总线(SCH 坐标单位 10mil)
|
|
243
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y]);
|
|
244
|
-
|
|
245
|
-
// 3. 切换异步模式,累计两处修改(改名称 + 改颜色)
|
|
246
|
-
const asyncBus = bus.toAsync();
|
|
247
|
-
asyncBus.setState_BusName('ADDR[0..15]');
|
|
248
|
-
asyncBus.setState_Color('#00AA00');
|
|
249
|
-
|
|
250
|
-
// 4. 一次性提交到画布
|
|
251
|
-
await asyncBus.done();
|
|
252
|
-
|
|
253
|
-
// 5. 从画布重新读取,确认两处修改都已生效(保留现场供观察)
|
|
254
|
-
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
255
|
-
|
|
256
|
-
console.log('busName:', 'DATA[0..7]', '→', refetched.getState_BusName());
|
|
257
|
-
console.log('color:', '#00AA00', '→', refetched.getState_Color());
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
### getstate_busname
|
|
261
|
-
|
|
262
|
-
# ISCH\_PrimitiveBus.getState\_BusName() method
|
|
263
|
-
|
|
264
|
-
Get the property state: bus name
|
|
265
|
-
|
|
266
|
-
## Signature
|
|
267
|
-
|
|
268
|
-
```typescript
|
|
269
|
-
function getState_BusName(): string;
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
## Returns
|
|
273
|
-
|
|
274
|
-
string
|
|
275
|
-
|
|
276
|
-
Bus name
|
|
277
|
-
|
|
278
|
-
## Example
|
|
279
|
-
|
|
280
|
-
```javascript
|
|
281
|
-
// 1. 创建一条名为 DATA[0..7] 的测试总线(总线名称必须是合法切片格式,SCH 坐标单位 10mil)
|
|
282
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000]);
|
|
283
|
-
|
|
284
|
-
// 2. 读取总线名称
|
|
285
|
-
const busName = bus.getState_BusName();
|
|
286
|
-
|
|
287
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
288
|
-
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
289
|
-
|
|
290
|
-
console.log('busName:', busName);
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### getstate_color
|
|
294
|
-
|
|
295
|
-
# ISCH\_PrimitiveBus.getState\_Color() method
|
|
296
|
-
|
|
297
|
-
Get the property state: bus color
|
|
298
|
-
|
|
299
|
-
## Signature
|
|
300
|
-
|
|
301
|
-
```typescript
|
|
302
|
-
function getState_Color(): string | null;
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
## Returns
|
|
306
|
-
|
|
307
|
-
string \| null
|
|
308
|
-
|
|
309
|
-
Bus color
|
|
310
|
-
|
|
311
|
-
## Example
|
|
312
|
-
|
|
313
|
-
```javascript
|
|
314
|
-
// 1. 创建一条红色测试总线(SCH 坐标单位 10mil)
|
|
315
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000], '#FF0000', 6, 1);
|
|
316
|
-
|
|
317
|
-
// 2. 读取总线颜色
|
|
318
|
-
const color = bus.getState_Color();
|
|
319
|
-
|
|
320
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
321
|
-
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
322
|
-
|
|
323
|
-
console.log('color:', color);
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
### getstate_line
|
|
327
|
-
|
|
328
|
-
# ISCH\_PrimitiveBus.getState\_Line() method
|
|
329
|
-
|
|
330
|
-
Get the property state: polyline coordinate group
|
|
331
|
-
|
|
332
|
-
## Signature
|
|
333
|
-
|
|
334
|
-
```typescript
|
|
335
|
-
function getState_Line(): Array<number> | Array<Array<number>>;
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
## Returns
|
|
339
|
-
|
|
340
|
-
Array<number> \| Array<Array<number>>
|
|
341
|
-
|
|
342
|
-
Polyline coordinate group
|
|
343
|
-
|
|
344
|
-
## Example
|
|
345
|
-
|
|
346
|
-
```javascript
|
|
347
|
-
// 1. 创建一条水平测试总线(SCH 坐标单位 10mil)
|
|
348
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000]);
|
|
349
|
-
|
|
350
|
-
// 2. 读取多段线坐标组(返回画布规格化后的坐标,段内端点顺序可能与创建时相反)
|
|
351
|
-
const line = bus.getState_Line();
|
|
352
|
-
|
|
353
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
354
|
-
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
355
|
-
|
|
356
|
-
console.log('line:', JSON.stringify(line));
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
### getstate_linetype
|
|
360
|
-
|
|
361
|
-
# ISCH\_PrimitiveBus.getState\_LineType() method
|
|
362
|
-
|
|
363
|
-
Get the property state: line type
|
|
364
|
-
|
|
365
|
-
## Signature
|
|
366
|
-
|
|
367
|
-
```typescript
|
|
368
|
-
function getState_LineType(): ESCH_PrimitiveLineType | null;
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
## Returns
|
|
372
|
-
|
|
373
|
-
[ESCH\_PrimitiveLineType](../enums/ESCH_PrimitiveLineType.md) \| null
|
|
374
|
-
|
|
375
|
-
Line type
|
|
376
|
-
|
|
377
|
-
## Example
|
|
378
|
-
|
|
379
|
-
```javascript
|
|
380
|
-
// 1. 创建一条虚线(DASHED=1)测试总线(SCH 坐标单位 10mil)
|
|
381
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000], null, 6, 1);
|
|
382
|
-
|
|
383
|
-
// 2. 读取线型
|
|
384
|
-
const lineType = bus.getState_LineType();
|
|
385
|
-
|
|
386
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
387
|
-
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
388
|
-
|
|
389
|
-
console.log('lineType:', lineType);
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
### getstate_linewidth
|
|
393
|
-
|
|
394
|
-
# ISCH\_PrimitiveBus.getState\_LineWidth() method
|
|
395
|
-
|
|
396
|
-
Get the property state: Line width
|
|
397
|
-
|
|
398
|
-
## Signature
|
|
399
|
-
|
|
400
|
-
```typescript
|
|
401
|
-
function getState_LineWidth(): number | null;
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
## Returns
|
|
405
|
-
|
|
406
|
-
number \| null
|
|
407
|
-
|
|
408
|
-
Line width
|
|
409
|
-
|
|
410
|
-
## Example
|
|
411
|
-
|
|
412
|
-
```javascript
|
|
413
|
-
// 1. 创建一条线宽 6 的测试总线(SCH 坐标单位 10mil)
|
|
414
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000], null, 6, null);
|
|
415
|
-
|
|
416
|
-
// 2. 读取线宽
|
|
417
|
-
const lineWidth = bus.getState_LineWidth();
|
|
418
|
-
|
|
419
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
420
|
-
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
421
|
-
|
|
422
|
-
console.log('lineWidth:', lineWidth);
|
|
423
|
-
```
|
|
424
|
-
|
|
425
|
-
### getstate_primitiveid
|
|
426
|
-
|
|
427
|
-
# ISCH\_PrimitiveBus.getState\_PrimitiveId() method
|
|
428
|
-
|
|
429
|
-
Get the property state: primitive ID
|
|
430
|
-
|
|
431
|
-
## Signature
|
|
432
|
-
|
|
433
|
-
```typescript
|
|
434
|
-
function getState_PrimitiveId(): string;
|
|
435
|
-
```
|
|
436
|
-
|
|
437
|
-
## Returns
|
|
438
|
-
|
|
439
|
-
string
|
|
440
|
-
|
|
441
|
-
Primitive ID
|
|
442
|
-
|
|
443
|
-
## Example
|
|
444
|
-
|
|
445
|
-
```javascript
|
|
446
|
-
// 1. 创建一条测试总线(SCH 坐标单位 10mil)
|
|
447
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000]);
|
|
448
|
-
|
|
449
|
-
// 2. 读取图元 ID
|
|
450
|
-
const primitiveId = bus.getState_PrimitiveId();
|
|
451
|
-
|
|
452
|
-
// 3. 用该 ID 反查同一图元,验证 ID 有效(查询类案例不留测试对象)
|
|
453
|
-
const refetched = await eda.sch_PrimitiveBus.get(primitiveId);
|
|
454
|
-
await eda.sch_PrimitiveBus.delete([primitiveId]);
|
|
455
|
-
|
|
456
|
-
console.log('primitiveId:', primitiveId);
|
|
457
|
-
console.log('refetch matched:', refetched.getState_PrimitiveId() === primitiveId);
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
### getstate_primitivetype
|
|
461
|
-
|
|
462
|
-
# ISCH\_PrimitiveBus.getState\_PrimitiveType() method
|
|
463
|
-
|
|
464
|
-
Get the property state: primitive type
|
|
465
|
-
|
|
466
|
-
## Signature
|
|
467
|
-
|
|
468
|
-
```typescript
|
|
469
|
-
function getState_PrimitiveType(): ESCH_PrimitiveType;
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
## Returns
|
|
473
|
-
|
|
474
|
-
[ESCH\_PrimitiveType](../enums/ESCH_PrimitiveType.md)
|
|
475
|
-
|
|
476
|
-
Primitive type
|
|
477
|
-
|
|
478
|
-
## Example
|
|
479
|
-
|
|
480
|
-
```javascript
|
|
481
|
-
// 1. 创建一条测试总线(SCH 坐标单位 10mil)
|
|
482
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000]);
|
|
483
|
-
|
|
484
|
-
// 2. 读取图元类型
|
|
485
|
-
const primitiveType = bus.getState_PrimitiveType();
|
|
486
|
-
|
|
487
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
488
|
-
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
489
|
-
|
|
490
|
-
console.log('primitiveType:', primitiveType);
|
|
491
|
-
```
|
|
492
|
-
|
|
493
|
-
### isasync
|
|
494
|
-
|
|
495
|
-
# ISCH\_PrimitiveBus.isAsync() method
|
|
496
|
-
|
|
497
|
-
Query whether the primitive is an async primitive
|
|
498
|
-
|
|
499
|
-
## Signature
|
|
500
|
-
|
|
501
|
-
```typescript
|
|
502
|
-
function isAsync(): boolean;
|
|
503
|
-
```
|
|
504
|
-
|
|
505
|
-
## Returns
|
|
506
|
-
|
|
507
|
-
boolean
|
|
508
|
-
|
|
509
|
-
Whether Is async primitive
|
|
510
|
-
|
|
511
|
-
## Example
|
|
512
|
-
|
|
513
|
-
```javascript
|
|
514
|
-
// 1. 创建一条测试总线,创建后默认处于异步模式
|
|
515
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000]);
|
|
516
|
-
const asyncOnCreate = bus.isAsync();
|
|
517
|
-
|
|
518
|
-
// 2. 切换到同步模式再查询一次,对比两种模式
|
|
519
|
-
bus.toSync();
|
|
520
|
-
const asyncAfterToSync = bus.isAsync();
|
|
521
|
-
|
|
522
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
523
|
-
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
524
|
-
|
|
525
|
-
console.log('isAsync on create:', asyncOnCreate);
|
|
526
|
-
console.log('isAsync after toSync:', asyncAfterToSync);
|
|
527
|
-
```
|
|
528
|
-
|
|
529
|
-
### setstate_busname
|
|
530
|
-
|
|
531
|
-
# ISCH\_PrimitiveBus.setState\_BusName() method
|
|
532
|
-
|
|
533
|
-
> 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.
|
|
534
|
-
|
|
535
|
-
Set the property state: bus name
|
|
536
|
-
|
|
537
|
-
## Signature
|
|
538
|
-
|
|
539
|
-
```typescript
|
|
540
|
-
function setState_BusName(busName: string): ISCH_PrimitiveBus;
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
## Parameters
|
|
544
|
-
|
|
545
|
-
<table><thead><tr><th>
|
|
546
|
-
|
|
547
|
-
Parameter
|
|
548
|
-
|
|
549
|
-
</th><th>
|
|
550
|
-
|
|
551
|
-
Type
|
|
552
|
-
|
|
553
|
-
</th><th>
|
|
554
|
-
|
|
555
|
-
Description
|
|
556
|
-
|
|
557
|
-
</th></tr></thead>
|
|
558
|
-
<tbody><tr><td>
|
|
559
|
-
|
|
560
|
-
busName
|
|
561
|
-
|
|
562
|
-
</td><td>
|
|
563
|
-
|
|
564
|
-
string
|
|
565
|
-
|
|
566
|
-
</td><td>
|
|
567
|
-
|
|
568
|
-
Bus name
|
|
569
|
-
|
|
570
|
-
</td></tr>
|
|
571
|
-
</tbody></table>
|
|
572
|
-
|
|
573
|
-
## Returns
|
|
574
|
-
|
|
575
|
-
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
576
|
-
|
|
577
|
-
Bus primitive object
|
|
578
|
-
|
|
579
|
-
## Example
|
|
580
|
-
|
|
581
|
-
```javascript
|
|
582
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
583
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
584
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
585
|
-
|
|
586
|
-
// 2. 创建一条名为 DATA[0..7] 的测试总线(SCH 坐标单位 10mil)
|
|
587
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y]);
|
|
588
|
-
|
|
589
|
-
// 3. 读取修改前的名称
|
|
590
|
-
const before = bus.getState_BusName();
|
|
591
|
-
|
|
592
|
-
// 4. 切换异步模式并改名为 ADDR[0..15]
|
|
593
|
-
const asyncBus = bus.toAsync();
|
|
594
|
-
asyncBus.setState_BusName('ADDR[0..15]');
|
|
595
|
-
await asyncBus.done();
|
|
596
|
-
|
|
597
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
598
|
-
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
599
|
-
|
|
600
|
-
console.log('busName:', before, '→', refetched.getState_BusName());
|
|
601
|
-
```
|
|
602
|
-
|
|
603
|
-
### setstate_color
|
|
604
|
-
|
|
605
|
-
# ISCH\_PrimitiveBus.setState\_Color() method
|
|
606
|
-
|
|
607
|
-
> 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.
|
|
608
|
-
|
|
609
|
-
Set the property state: Bus color
|
|
610
|
-
|
|
611
|
-
## Signature
|
|
612
|
-
|
|
613
|
-
```typescript
|
|
614
|
-
function setState_Color(color: string | null): ISCH_PrimitiveBus;
|
|
615
|
-
```
|
|
616
|
-
|
|
617
|
-
## Parameters
|
|
618
|
-
|
|
619
|
-
<table><thead><tr><th>
|
|
620
|
-
|
|
621
|
-
Parameter
|
|
622
|
-
|
|
623
|
-
</th><th>
|
|
624
|
-
|
|
625
|
-
Type
|
|
626
|
-
|
|
627
|
-
</th><th>
|
|
628
|
-
|
|
629
|
-
Description
|
|
630
|
-
|
|
631
|
-
</th></tr></thead>
|
|
632
|
-
<tbody><tr><td>
|
|
633
|
-
|
|
634
|
-
color
|
|
635
|
-
|
|
636
|
-
</td><td>
|
|
637
|
-
|
|
638
|
-
string \| null
|
|
639
|
-
|
|
640
|
-
</td><td>
|
|
641
|
-
|
|
642
|
-
Bus color
|
|
643
|
-
|
|
644
|
-
</td></tr>
|
|
645
|
-
</tbody></table>
|
|
646
|
-
|
|
647
|
-
## Returns
|
|
648
|
-
|
|
649
|
-
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
650
|
-
|
|
651
|
-
Bus primitive object
|
|
652
|
-
|
|
653
|
-
## Example
|
|
654
|
-
|
|
655
|
-
```javascript
|
|
656
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
657
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
658
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
659
|
-
|
|
660
|
-
// 2. 创建一条红色测试总线(SCH 坐标单位 10mil)
|
|
661
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y], '#FF0000', 6, 1);
|
|
662
|
-
|
|
663
|
-
// 3. 读取修改前的颜色
|
|
664
|
-
const before = bus.getState_Color();
|
|
665
|
-
|
|
666
|
-
// 4. 切换异步模式并改为绿色
|
|
667
|
-
const asyncBus = bus.toAsync();
|
|
668
|
-
asyncBus.setState_Color('#00AA00');
|
|
669
|
-
await asyncBus.done();
|
|
670
|
-
|
|
671
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
672
|
-
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
673
|
-
|
|
674
|
-
console.log('color:', before, '→', refetched.getState_Color());
|
|
675
|
-
```
|
|
676
|
-
|
|
677
|
-
### setstate_line
|
|
678
|
-
|
|
679
|
-
# ISCH\_PrimitiveBus.setState\_Line() method
|
|
680
|
-
|
|
681
|
-
> 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.
|
|
682
|
-
|
|
683
|
-
Set the property state: polyline coordinate group
|
|
684
|
-
|
|
685
|
-
## Signature
|
|
686
|
-
|
|
687
|
-
```typescript
|
|
688
|
-
function setState_Line(line: Array<number> | Array<Array<number>>): ISCH_PrimitiveBus;
|
|
689
|
-
```
|
|
690
|
-
|
|
691
|
-
## Parameters
|
|
692
|
-
|
|
693
|
-
<table><thead><tr><th>
|
|
694
|
-
|
|
695
|
-
Parameter
|
|
696
|
-
|
|
697
|
-
</th><th>
|
|
698
|
-
|
|
699
|
-
Type
|
|
700
|
-
|
|
701
|
-
</th><th>
|
|
702
|
-
|
|
703
|
-
Description
|
|
704
|
-
|
|
705
|
-
</th></tr></thead>
|
|
706
|
-
<tbody><tr><td>
|
|
707
|
-
|
|
708
|
-
line
|
|
709
|
-
|
|
710
|
-
</td><td>
|
|
711
|
-
|
|
712
|
-
Array<number> \| Array<Array<number>>
|
|
713
|
-
|
|
714
|
-
</td><td>
|
|
715
|
-
|
|
716
|
-
Polyline coordinate group
|
|
717
|
-
|
|
718
|
-
</td></tr>
|
|
719
|
-
</tbody></table>
|
|
720
|
-
|
|
721
|
-
## Returns
|
|
722
|
-
|
|
723
|
-
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
724
|
-
|
|
725
|
-
Bus primitive object
|
|
726
|
-
|
|
727
|
-
## Example
|
|
728
|
-
|
|
729
|
-
```javascript
|
|
730
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
731
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
732
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
733
|
-
|
|
734
|
-
// 2. 创建一条水平单段测试总线(SCH 坐标单位 10mil)
|
|
735
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y]);
|
|
736
|
-
|
|
737
|
-
// 3. 读取修改前的路径
|
|
738
|
-
const before = bus.getState_Line();
|
|
739
|
-
|
|
740
|
-
// 4. 切换异步模式并改为 L 形两段(先水平再垂直,段间共享端点)
|
|
741
|
-
const asyncBus = bus.toAsync();
|
|
742
|
-
asyncBus.setState_Line([x, y, x + 400, y, x + 400, y + 400]);
|
|
743
|
-
await asyncBus.done();
|
|
744
|
-
|
|
745
|
-
// 5. 从画布重新读取,确认路径已更新(保留现场供观察)
|
|
746
|
-
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
747
|
-
|
|
748
|
-
console.log('line:', JSON.stringify(before), '→', JSON.stringify(refetched.getState_Line()));
|
|
749
|
-
```
|
|
750
|
-
|
|
751
|
-
### setstate_linetype
|
|
752
|
-
|
|
753
|
-
# ISCH\_PrimitiveBus.setState\_LineType() method
|
|
754
|
-
|
|
755
|
-
> 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.
|
|
756
|
-
|
|
757
|
-
Set the property state: line type
|
|
758
|
-
|
|
759
|
-
## Signature
|
|
760
|
-
|
|
761
|
-
```typescript
|
|
762
|
-
function setState_LineType(lineType: ESCH_PrimitiveLineType | null): ISCH_PrimitiveBus;
|
|
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
|
-
lineType
|
|
783
|
-
|
|
784
|
-
</td><td>
|
|
785
|
-
|
|
786
|
-
[ESCH\_PrimitiveLineType](../enums/ESCH_PrimitiveLineType.md) \| null
|
|
787
|
-
|
|
788
|
-
</td><td>
|
|
789
|
-
|
|
790
|
-
Line type
|
|
791
|
-
|
|
792
|
-
</td></tr>
|
|
793
|
-
</tbody></table>
|
|
794
|
-
|
|
795
|
-
## Returns
|
|
796
|
-
|
|
797
|
-
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
798
|
-
|
|
799
|
-
Bus primitive object
|
|
800
|
-
|
|
801
|
-
## Example
|
|
802
|
-
|
|
803
|
-
```javascript
|
|
804
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
805
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
806
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
807
|
-
|
|
808
|
-
// 2. 创建一条虚线(DASHED=1)测试总线(SCH 坐标单位 10mil)
|
|
809
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y], null, 6, 1);
|
|
810
|
-
|
|
811
|
-
// 3. 读取修改前的线型
|
|
812
|
-
const before = bus.getState_LineType();
|
|
813
|
-
|
|
814
|
-
// 4. 切换异步模式并改为点线(DOTTED=2)
|
|
815
|
-
const asyncBus = bus.toAsync();
|
|
816
|
-
asyncBus.setState_LineType(2);
|
|
817
|
-
await asyncBus.done();
|
|
818
|
-
|
|
819
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
820
|
-
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
821
|
-
|
|
822
|
-
console.log('lineType:', before, '→', refetched.getState_LineType());
|
|
823
|
-
```
|
|
824
|
-
|
|
825
|
-
### setstate_linewidth
|
|
826
|
-
|
|
827
|
-
# ISCH\_PrimitiveBus.setState\_LineWidth() method
|
|
828
|
-
|
|
829
|
-
> 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.
|
|
830
|
-
|
|
831
|
-
Set the property state: Line width
|
|
832
|
-
|
|
833
|
-
## Signature
|
|
834
|
-
|
|
835
|
-
```typescript
|
|
836
|
-
function setState_LineWidth(lineWidth: number | null): ISCH_PrimitiveBus;
|
|
837
|
-
```
|
|
838
|
-
|
|
839
|
-
## Parameters
|
|
840
|
-
|
|
841
|
-
<table><thead><tr><th>
|
|
842
|
-
|
|
843
|
-
Parameter
|
|
844
|
-
|
|
845
|
-
</th><th>
|
|
846
|
-
|
|
847
|
-
Type
|
|
848
|
-
|
|
849
|
-
</th><th>
|
|
850
|
-
|
|
851
|
-
Description
|
|
852
|
-
|
|
853
|
-
</th></tr></thead>
|
|
854
|
-
<tbody><tr><td>
|
|
855
|
-
|
|
856
|
-
lineWidth
|
|
857
|
-
|
|
858
|
-
</td><td>
|
|
859
|
-
|
|
860
|
-
number \| null
|
|
861
|
-
|
|
862
|
-
</td><td>
|
|
863
|
-
|
|
864
|
-
Line width
|
|
865
|
-
|
|
866
|
-
</td></tr>
|
|
867
|
-
</tbody></table>
|
|
868
|
-
|
|
869
|
-
## Returns
|
|
870
|
-
|
|
871
|
-
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
872
|
-
|
|
873
|
-
Bus primitive object
|
|
874
|
-
|
|
875
|
-
## Example
|
|
876
|
-
|
|
877
|
-
```javascript
|
|
878
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
879
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
880
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
881
|
-
|
|
882
|
-
// 2. 创建一条线宽 6 的测试总线(SCH 坐标单位 10mil)
|
|
883
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y], null, 6, null);
|
|
884
|
-
|
|
885
|
-
// 3. 读取修改前的线宽
|
|
886
|
-
const before = bus.getState_LineWidth();
|
|
887
|
-
|
|
888
|
-
// 4. 切换异步模式并加粗到 10
|
|
889
|
-
const asyncBus = bus.toAsync();
|
|
890
|
-
asyncBus.setState_LineWidth(10);
|
|
891
|
-
await asyncBus.done();
|
|
892
|
-
|
|
893
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
894
|
-
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
895
|
-
|
|
896
|
-
console.log('lineWidth:', before, '→', refetched.getState_LineWidth());
|
|
897
|
-
```
|
|
898
|
-
|
|
899
|
-
### toasync
|
|
900
|
-
|
|
901
|
-
# ISCH\_PrimitiveBus.toAsync() method
|
|
902
|
-
|
|
903
|
-
Convert Primitive to Async primitive
|
|
904
|
-
|
|
905
|
-
## Signature
|
|
906
|
-
|
|
907
|
-
```typescript
|
|
908
|
-
function toAsync(): ISCH_PrimitiveBus;
|
|
909
|
-
```
|
|
910
|
-
|
|
911
|
-
## Returns
|
|
912
|
-
|
|
913
|
-
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
914
|
-
|
|
915
|
-
Bus primitive object
|
|
916
|
-
|
|
917
|
-
## Example
|
|
918
|
-
|
|
919
|
-
```javascript
|
|
920
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
921
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
922
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
923
|
-
|
|
924
|
-
// 2. 创建一条测试总线(创建后默认处于异步模式)
|
|
925
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y]);
|
|
926
|
-
|
|
927
|
-
// 3. 转换为异步图元
|
|
928
|
-
const asyncBus = bus.toAsync();
|
|
929
|
-
|
|
930
|
-
// 4. 异步模式下累计修改并提交
|
|
931
|
-
asyncBus.setState_LineWidth(10);
|
|
932
|
-
await asyncBus.done();
|
|
933
|
-
|
|
934
|
-
// 5. 从画布重新读取,确认提交生效(保留现场供观察)
|
|
935
|
-
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
936
|
-
|
|
937
|
-
console.log('isAsync after toAsync:', bus.isAsync());
|
|
938
|
-
console.log('lineWidth:', 6, '→', refetched.getState_LineWidth());
|
|
939
|
-
```
|
|
940
|
-
|
|
941
|
-
### tosync
|
|
942
|
-
|
|
943
|
-
# ISCH\_PrimitiveBus.toSync() method
|
|
944
|
-
|
|
945
|
-
Convert Primitive to Sync primitive
|
|
946
|
-
|
|
947
|
-
## Signature
|
|
948
|
-
|
|
949
|
-
```typescript
|
|
950
|
-
function toSync(): ISCH_PrimitiveBus;
|
|
951
|
-
```
|
|
952
|
-
|
|
953
|
-
## Returns
|
|
954
|
-
|
|
955
|
-
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
956
|
-
|
|
957
|
-
Bus primitive object
|
|
958
|
-
|
|
959
|
-
## Example
|
|
960
|
-
|
|
961
|
-
```javascript
|
|
962
|
-
// 1. 创建一条测试总线(创建后默认处于异步模式)
|
|
963
|
-
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000]);
|
|
964
|
-
|
|
965
|
-
// 2. 转换为同步图元,isAsync() 变为 false
|
|
966
|
-
const syncBus = bus.toSync();
|
|
967
|
-
const isAsyncAfterToSync = syncBus.isAsync();
|
|
968
|
-
|
|
969
|
-
// 3. 清理测试图元(本案例只演示模式转换,不修改画布)
|
|
970
|
-
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
971
|
-
|
|
972
|
-
console.log('isAsync after toSync:', isAsyncAfterToSync);
|
|
973
|
-
```
|
|
1
|
+
# ISCH\_PrimitiveBus class
|
|
2
|
+
|
|
3
|
+
Bus primitive
|
|
4
|
+
|
|
5
|
+
## Signature
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
class ISCH_PrimitiveBus implements ISCH_Primitive
|
|
9
|
+
```
|
|
10
|
+
**Implements:** [ISCH\_Primitive](../interfaces/ISCH_Primitive.md)
|
|
11
|
+
|
|
12
|
+
## Remarks
|
|
13
|
+
|
|
14
|
+
Unresolved issues:
|
|
15
|
+
|
|
16
|
+
The `ISCH_PrimitiveWire.net` global net name property involves multi-sheet refresh, so the currently obtained value may be \*\*incorrect\*\*. When you try to set multiple names for a wire or bus (by placing multiple net labels), the obtained `net` property may not be the latest. You need to wait for the canvas event to asynchronously refresh the global nets before reading it again.
|
|
17
|
+
|
|
18
|
+
## Methods
|
|
19
|
+
|
|
20
|
+
<table><thead><tr><th>
|
|
21
|
+
|
|
22
|
+
Method
|
|
23
|
+
|
|
24
|
+
</th><th>
|
|
25
|
+
|
|
26
|
+
Modifiers
|
|
27
|
+
|
|
28
|
+
</th><th>
|
|
29
|
+
|
|
30
|
+
Description
|
|
31
|
+
|
|
32
|
+
</th></tr></thead>
|
|
33
|
+
<tbody><tr><td>
|
|
34
|
+
|
|
35
|
+
[done()](./ISCH_PrimitiveBus.md)
|
|
36
|
+
|
|
37
|
+
</td><td>
|
|
38
|
+
|
|
39
|
+
</td><td>
|
|
40
|
+
|
|
41
|
+
**_(BETA)_** Apply the changes to the primitives to the canvas
|
|
42
|
+
|
|
43
|
+
</td></tr>
|
|
44
|
+
<tr><td>
|
|
45
|
+
|
|
46
|
+
[getState\_BusName()](./ISCH_PrimitiveBus.md)
|
|
47
|
+
|
|
48
|
+
</td><td>
|
|
49
|
+
|
|
50
|
+
</td><td>
|
|
51
|
+
|
|
52
|
+
Get the property state: bus name
|
|
53
|
+
|
|
54
|
+
</td></tr>
|
|
55
|
+
<tr><td>
|
|
56
|
+
|
|
57
|
+
[getState\_Color()](./ISCH_PrimitiveBus.md)
|
|
58
|
+
|
|
59
|
+
</td><td>
|
|
60
|
+
|
|
61
|
+
</td><td>
|
|
62
|
+
|
|
63
|
+
Get the property state: bus color
|
|
64
|
+
|
|
65
|
+
</td></tr>
|
|
66
|
+
<tr><td>
|
|
67
|
+
|
|
68
|
+
[getState\_Line()](./ISCH_PrimitiveBus.md)
|
|
69
|
+
|
|
70
|
+
</td><td>
|
|
71
|
+
|
|
72
|
+
</td><td>
|
|
73
|
+
|
|
74
|
+
Get the property state: polyline coordinate group
|
|
75
|
+
|
|
76
|
+
</td></tr>
|
|
77
|
+
<tr><td>
|
|
78
|
+
|
|
79
|
+
[getState\_LineType()](./ISCH_PrimitiveBus.md)
|
|
80
|
+
|
|
81
|
+
</td><td>
|
|
82
|
+
|
|
83
|
+
</td><td>
|
|
84
|
+
|
|
85
|
+
Get the property state: line type
|
|
86
|
+
|
|
87
|
+
</td></tr>
|
|
88
|
+
<tr><td>
|
|
89
|
+
|
|
90
|
+
[getState\_LineWidth()](./ISCH_PrimitiveBus.md)
|
|
91
|
+
|
|
92
|
+
</td><td>
|
|
93
|
+
|
|
94
|
+
</td><td>
|
|
95
|
+
|
|
96
|
+
Get the property state: Line width
|
|
97
|
+
|
|
98
|
+
</td></tr>
|
|
99
|
+
<tr><td>
|
|
100
|
+
|
|
101
|
+
[getState\_PrimitiveId()](./ISCH_PrimitiveBus.md)
|
|
102
|
+
|
|
103
|
+
</td><td>
|
|
104
|
+
|
|
105
|
+
</td><td>
|
|
106
|
+
|
|
107
|
+
Get the property state: primitive ID
|
|
108
|
+
|
|
109
|
+
</td></tr>
|
|
110
|
+
<tr><td>
|
|
111
|
+
|
|
112
|
+
[getState\_PrimitiveType()](./ISCH_PrimitiveBus.md)
|
|
113
|
+
|
|
114
|
+
</td><td>
|
|
115
|
+
|
|
116
|
+
</td><td>
|
|
117
|
+
|
|
118
|
+
Get the property state: primitive type
|
|
119
|
+
|
|
120
|
+
</td></tr>
|
|
121
|
+
<tr><td>
|
|
122
|
+
|
|
123
|
+
[isAsync()](./ISCH_PrimitiveBus.md)
|
|
124
|
+
|
|
125
|
+
</td><td>
|
|
126
|
+
|
|
127
|
+
</td><td>
|
|
128
|
+
|
|
129
|
+
Query whether the primitive is an async primitive
|
|
130
|
+
|
|
131
|
+
</td></tr>
|
|
132
|
+
<tr><td>
|
|
133
|
+
|
|
134
|
+
[setState\_BusName(busName)](./ISCH_PrimitiveBus.md)
|
|
135
|
+
|
|
136
|
+
</td><td>
|
|
137
|
+
|
|
138
|
+
</td><td>
|
|
139
|
+
|
|
140
|
+
**_(BETA)_** Set the property state: bus name
|
|
141
|
+
|
|
142
|
+
</td></tr>
|
|
143
|
+
<tr><td>
|
|
144
|
+
|
|
145
|
+
[setState\_Color(color)](./ISCH_PrimitiveBus.md)
|
|
146
|
+
|
|
147
|
+
</td><td>
|
|
148
|
+
|
|
149
|
+
</td><td>
|
|
150
|
+
|
|
151
|
+
**_(BETA)_** Set the property state: Bus color
|
|
152
|
+
|
|
153
|
+
</td></tr>
|
|
154
|
+
<tr><td>
|
|
155
|
+
|
|
156
|
+
[setState\_Line(line)](./ISCH_PrimitiveBus.md)
|
|
157
|
+
|
|
158
|
+
</td><td>
|
|
159
|
+
|
|
160
|
+
</td><td>
|
|
161
|
+
|
|
162
|
+
**_(BETA)_** Set the property state: polyline coordinate group
|
|
163
|
+
|
|
164
|
+
</td></tr>
|
|
165
|
+
<tr><td>
|
|
166
|
+
|
|
167
|
+
[setState\_LineType(lineType)](./ISCH_PrimitiveBus.md)
|
|
168
|
+
|
|
169
|
+
</td><td>
|
|
170
|
+
|
|
171
|
+
</td><td>
|
|
172
|
+
|
|
173
|
+
**_(BETA)_** Set the property state: line type
|
|
174
|
+
|
|
175
|
+
</td></tr>
|
|
176
|
+
<tr><td>
|
|
177
|
+
|
|
178
|
+
[setState\_LineWidth(lineWidth)](./ISCH_PrimitiveBus.md)
|
|
179
|
+
|
|
180
|
+
</td><td>
|
|
181
|
+
|
|
182
|
+
</td><td>
|
|
183
|
+
|
|
184
|
+
**_(BETA)_** Set the property state: Line width
|
|
185
|
+
|
|
186
|
+
</td></tr>
|
|
187
|
+
<tr><td>
|
|
188
|
+
|
|
189
|
+
[toAsync()](./ISCH_PrimitiveBus.md)
|
|
190
|
+
|
|
191
|
+
</td><td>
|
|
192
|
+
|
|
193
|
+
</td><td>
|
|
194
|
+
|
|
195
|
+
Convert Primitive to Async primitive
|
|
196
|
+
|
|
197
|
+
</td></tr>
|
|
198
|
+
<tr><td>
|
|
199
|
+
|
|
200
|
+
[toSync()](./ISCH_PrimitiveBus.md)
|
|
201
|
+
|
|
202
|
+
</td><td>
|
|
203
|
+
|
|
204
|
+
</td><td>
|
|
205
|
+
|
|
206
|
+
Convert Primitive to Sync primitive
|
|
207
|
+
|
|
208
|
+
</td></tr>
|
|
209
|
+
</tbody></table>
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 方法详情
|
|
214
|
+
|
|
215
|
+
### done
|
|
216
|
+
|
|
217
|
+
# ISCH\_PrimitiveBus.done() method
|
|
218
|
+
|
|
219
|
+
> 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.
|
|
220
|
+
|
|
221
|
+
Apply the changes to the primitives to the canvas
|
|
222
|
+
|
|
223
|
+
## Signature
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
function done(): Promise<ISCH_PrimitiveBus>;
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Returns
|
|
230
|
+
|
|
231
|
+
Promise<[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)<!-- -->>
|
|
232
|
+
|
|
233
|
+
Bus primitive object
|
|
234
|
+
|
|
235
|
+
## Example
|
|
236
|
+
|
|
237
|
+
```javascript
|
|
238
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
239
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
240
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
241
|
+
|
|
242
|
+
// 2. 创建一条测试总线(SCH 坐标单位 10mil)
|
|
243
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y]);
|
|
244
|
+
|
|
245
|
+
// 3. 切换异步模式,累计两处修改(改名称 + 改颜色)
|
|
246
|
+
const asyncBus = bus.toAsync();
|
|
247
|
+
asyncBus.setState_BusName('ADDR[0..15]');
|
|
248
|
+
asyncBus.setState_Color('#00AA00');
|
|
249
|
+
|
|
250
|
+
// 4. 一次性提交到画布
|
|
251
|
+
await asyncBus.done();
|
|
252
|
+
|
|
253
|
+
// 5. 从画布重新读取,确认两处修改都已生效(保留现场供观察)
|
|
254
|
+
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
255
|
+
|
|
256
|
+
console.log('busName:', 'DATA[0..7]', '→', refetched.getState_BusName());
|
|
257
|
+
console.log('color:', '#00AA00', '→', refetched.getState_Color());
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### getstate_busname
|
|
261
|
+
|
|
262
|
+
# ISCH\_PrimitiveBus.getState\_BusName() method
|
|
263
|
+
|
|
264
|
+
Get the property state: bus name
|
|
265
|
+
|
|
266
|
+
## Signature
|
|
267
|
+
|
|
268
|
+
```typescript
|
|
269
|
+
function getState_BusName(): string;
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Returns
|
|
273
|
+
|
|
274
|
+
string
|
|
275
|
+
|
|
276
|
+
Bus name
|
|
277
|
+
|
|
278
|
+
## Example
|
|
279
|
+
|
|
280
|
+
```javascript
|
|
281
|
+
// 1. 创建一条名为 DATA[0..7] 的测试总线(总线名称必须是合法切片格式,SCH 坐标单位 10mil)
|
|
282
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000]);
|
|
283
|
+
|
|
284
|
+
// 2. 读取总线名称
|
|
285
|
+
const busName = bus.getState_BusName();
|
|
286
|
+
|
|
287
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
288
|
+
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
289
|
+
|
|
290
|
+
console.log('busName:', busName);
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### getstate_color
|
|
294
|
+
|
|
295
|
+
# ISCH\_PrimitiveBus.getState\_Color() method
|
|
296
|
+
|
|
297
|
+
Get the property state: bus color
|
|
298
|
+
|
|
299
|
+
## Signature
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
function getState_Color(): string | null;
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## Returns
|
|
306
|
+
|
|
307
|
+
string \| null
|
|
308
|
+
|
|
309
|
+
Bus color
|
|
310
|
+
|
|
311
|
+
## Example
|
|
312
|
+
|
|
313
|
+
```javascript
|
|
314
|
+
// 1. 创建一条红色测试总线(SCH 坐标单位 10mil)
|
|
315
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000], '#FF0000', 6, 1);
|
|
316
|
+
|
|
317
|
+
// 2. 读取总线颜色
|
|
318
|
+
const color = bus.getState_Color();
|
|
319
|
+
|
|
320
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
321
|
+
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
322
|
+
|
|
323
|
+
console.log('color:', color);
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### getstate_line
|
|
327
|
+
|
|
328
|
+
# ISCH\_PrimitiveBus.getState\_Line() method
|
|
329
|
+
|
|
330
|
+
Get the property state: polyline coordinate group
|
|
331
|
+
|
|
332
|
+
## Signature
|
|
333
|
+
|
|
334
|
+
```typescript
|
|
335
|
+
function getState_Line(): Array<number> | Array<Array<number>>;
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
## Returns
|
|
339
|
+
|
|
340
|
+
Array<number> \| Array<Array<number>>
|
|
341
|
+
|
|
342
|
+
Polyline coordinate group
|
|
343
|
+
|
|
344
|
+
## Example
|
|
345
|
+
|
|
346
|
+
```javascript
|
|
347
|
+
// 1. 创建一条水平测试总线(SCH 坐标单位 10mil)
|
|
348
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000]);
|
|
349
|
+
|
|
350
|
+
// 2. 读取多段线坐标组(返回画布规格化后的坐标,段内端点顺序可能与创建时相反)
|
|
351
|
+
const line = bus.getState_Line();
|
|
352
|
+
|
|
353
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
354
|
+
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
355
|
+
|
|
356
|
+
console.log('line:', JSON.stringify(line));
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### getstate_linetype
|
|
360
|
+
|
|
361
|
+
# ISCH\_PrimitiveBus.getState\_LineType() method
|
|
362
|
+
|
|
363
|
+
Get the property state: line type
|
|
364
|
+
|
|
365
|
+
## Signature
|
|
366
|
+
|
|
367
|
+
```typescript
|
|
368
|
+
function getState_LineType(): ESCH_PrimitiveLineType | null;
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## Returns
|
|
372
|
+
|
|
373
|
+
[ESCH\_PrimitiveLineType](../enums/ESCH_PrimitiveLineType.md) \| null
|
|
374
|
+
|
|
375
|
+
Line type
|
|
376
|
+
|
|
377
|
+
## Example
|
|
378
|
+
|
|
379
|
+
```javascript
|
|
380
|
+
// 1. 创建一条虚线(DASHED=1)测试总线(SCH 坐标单位 10mil)
|
|
381
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000], null, 6, 1);
|
|
382
|
+
|
|
383
|
+
// 2. 读取线型
|
|
384
|
+
const lineType = bus.getState_LineType();
|
|
385
|
+
|
|
386
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
387
|
+
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
388
|
+
|
|
389
|
+
console.log('lineType:', lineType);
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### getstate_linewidth
|
|
393
|
+
|
|
394
|
+
# ISCH\_PrimitiveBus.getState\_LineWidth() method
|
|
395
|
+
|
|
396
|
+
Get the property state: Line width
|
|
397
|
+
|
|
398
|
+
## Signature
|
|
399
|
+
|
|
400
|
+
```typescript
|
|
401
|
+
function getState_LineWidth(): number | null;
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
## Returns
|
|
405
|
+
|
|
406
|
+
number \| null
|
|
407
|
+
|
|
408
|
+
Line width
|
|
409
|
+
|
|
410
|
+
## Example
|
|
411
|
+
|
|
412
|
+
```javascript
|
|
413
|
+
// 1. 创建一条线宽 6 的测试总线(SCH 坐标单位 10mil)
|
|
414
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000], null, 6, null);
|
|
415
|
+
|
|
416
|
+
// 2. 读取线宽
|
|
417
|
+
const lineWidth = bus.getState_LineWidth();
|
|
418
|
+
|
|
419
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
420
|
+
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
421
|
+
|
|
422
|
+
console.log('lineWidth:', lineWidth);
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### getstate_primitiveid
|
|
426
|
+
|
|
427
|
+
# ISCH\_PrimitiveBus.getState\_PrimitiveId() method
|
|
428
|
+
|
|
429
|
+
Get the property state: primitive ID
|
|
430
|
+
|
|
431
|
+
## Signature
|
|
432
|
+
|
|
433
|
+
```typescript
|
|
434
|
+
function getState_PrimitiveId(): string;
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
## Returns
|
|
438
|
+
|
|
439
|
+
string
|
|
440
|
+
|
|
441
|
+
Primitive ID
|
|
442
|
+
|
|
443
|
+
## Example
|
|
444
|
+
|
|
445
|
+
```javascript
|
|
446
|
+
// 1. 创建一条测试总线(SCH 坐标单位 10mil)
|
|
447
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000]);
|
|
448
|
+
|
|
449
|
+
// 2. 读取图元 ID
|
|
450
|
+
const primitiveId = bus.getState_PrimitiveId();
|
|
451
|
+
|
|
452
|
+
// 3. 用该 ID 反查同一图元,验证 ID 有效(查询类案例不留测试对象)
|
|
453
|
+
const refetched = await eda.sch_PrimitiveBus.get(primitiveId);
|
|
454
|
+
await eda.sch_PrimitiveBus.delete([primitiveId]);
|
|
455
|
+
|
|
456
|
+
console.log('primitiveId:', primitiveId);
|
|
457
|
+
console.log('refetch matched:', refetched.getState_PrimitiveId() === primitiveId);
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
### getstate_primitivetype
|
|
461
|
+
|
|
462
|
+
# ISCH\_PrimitiveBus.getState\_PrimitiveType() method
|
|
463
|
+
|
|
464
|
+
Get the property state: primitive type
|
|
465
|
+
|
|
466
|
+
## Signature
|
|
467
|
+
|
|
468
|
+
```typescript
|
|
469
|
+
function getState_PrimitiveType(): ESCH_PrimitiveType;
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
## Returns
|
|
473
|
+
|
|
474
|
+
[ESCH\_PrimitiveType](../enums/ESCH_PrimitiveType.md)
|
|
475
|
+
|
|
476
|
+
Primitive type
|
|
477
|
+
|
|
478
|
+
## Example
|
|
479
|
+
|
|
480
|
+
```javascript
|
|
481
|
+
// 1. 创建一条测试总线(SCH 坐标单位 10mil)
|
|
482
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000]);
|
|
483
|
+
|
|
484
|
+
// 2. 读取图元类型
|
|
485
|
+
const primitiveType = bus.getState_PrimitiveType();
|
|
486
|
+
|
|
487
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
488
|
+
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
489
|
+
|
|
490
|
+
console.log('primitiveType:', primitiveType);
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### isasync
|
|
494
|
+
|
|
495
|
+
# ISCH\_PrimitiveBus.isAsync() method
|
|
496
|
+
|
|
497
|
+
Query whether the primitive is an async primitive
|
|
498
|
+
|
|
499
|
+
## Signature
|
|
500
|
+
|
|
501
|
+
```typescript
|
|
502
|
+
function isAsync(): boolean;
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
## Returns
|
|
506
|
+
|
|
507
|
+
boolean
|
|
508
|
+
|
|
509
|
+
Whether Is async primitive
|
|
510
|
+
|
|
511
|
+
## Example
|
|
512
|
+
|
|
513
|
+
```javascript
|
|
514
|
+
// 1. 创建一条测试总线,创建后默认处于异步模式
|
|
515
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000]);
|
|
516
|
+
const asyncOnCreate = bus.isAsync();
|
|
517
|
+
|
|
518
|
+
// 2. 切换到同步模式再查询一次,对比两种模式
|
|
519
|
+
bus.toSync();
|
|
520
|
+
const asyncAfterToSync = bus.isAsync();
|
|
521
|
+
|
|
522
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
523
|
+
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
524
|
+
|
|
525
|
+
console.log('isAsync on create:', asyncOnCreate);
|
|
526
|
+
console.log('isAsync after toSync:', asyncAfterToSync);
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
### setstate_busname
|
|
530
|
+
|
|
531
|
+
# ISCH\_PrimitiveBus.setState\_BusName() method
|
|
532
|
+
|
|
533
|
+
> 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.
|
|
534
|
+
|
|
535
|
+
Set the property state: bus name
|
|
536
|
+
|
|
537
|
+
## Signature
|
|
538
|
+
|
|
539
|
+
```typescript
|
|
540
|
+
function setState_BusName(busName: string): ISCH_PrimitiveBus;
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
## Parameters
|
|
544
|
+
|
|
545
|
+
<table><thead><tr><th>
|
|
546
|
+
|
|
547
|
+
Parameter
|
|
548
|
+
|
|
549
|
+
</th><th>
|
|
550
|
+
|
|
551
|
+
Type
|
|
552
|
+
|
|
553
|
+
</th><th>
|
|
554
|
+
|
|
555
|
+
Description
|
|
556
|
+
|
|
557
|
+
</th></tr></thead>
|
|
558
|
+
<tbody><tr><td>
|
|
559
|
+
|
|
560
|
+
busName
|
|
561
|
+
|
|
562
|
+
</td><td>
|
|
563
|
+
|
|
564
|
+
string
|
|
565
|
+
|
|
566
|
+
</td><td>
|
|
567
|
+
|
|
568
|
+
Bus name
|
|
569
|
+
|
|
570
|
+
</td></tr>
|
|
571
|
+
</tbody></table>
|
|
572
|
+
|
|
573
|
+
## Returns
|
|
574
|
+
|
|
575
|
+
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
576
|
+
|
|
577
|
+
Bus primitive object
|
|
578
|
+
|
|
579
|
+
## Example
|
|
580
|
+
|
|
581
|
+
```javascript
|
|
582
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
583
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
584
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
585
|
+
|
|
586
|
+
// 2. 创建一条名为 DATA[0..7] 的测试总线(SCH 坐标单位 10mil)
|
|
587
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y]);
|
|
588
|
+
|
|
589
|
+
// 3. 读取修改前的名称
|
|
590
|
+
const before = bus.getState_BusName();
|
|
591
|
+
|
|
592
|
+
// 4. 切换异步模式并改名为 ADDR[0..15]
|
|
593
|
+
const asyncBus = bus.toAsync();
|
|
594
|
+
asyncBus.setState_BusName('ADDR[0..15]');
|
|
595
|
+
await asyncBus.done();
|
|
596
|
+
|
|
597
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
598
|
+
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
599
|
+
|
|
600
|
+
console.log('busName:', before, '→', refetched.getState_BusName());
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
### setstate_color
|
|
604
|
+
|
|
605
|
+
# ISCH\_PrimitiveBus.setState\_Color() method
|
|
606
|
+
|
|
607
|
+
> 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.
|
|
608
|
+
|
|
609
|
+
Set the property state: Bus color
|
|
610
|
+
|
|
611
|
+
## Signature
|
|
612
|
+
|
|
613
|
+
```typescript
|
|
614
|
+
function setState_Color(color: string | null): ISCH_PrimitiveBus;
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
## Parameters
|
|
618
|
+
|
|
619
|
+
<table><thead><tr><th>
|
|
620
|
+
|
|
621
|
+
Parameter
|
|
622
|
+
|
|
623
|
+
</th><th>
|
|
624
|
+
|
|
625
|
+
Type
|
|
626
|
+
|
|
627
|
+
</th><th>
|
|
628
|
+
|
|
629
|
+
Description
|
|
630
|
+
|
|
631
|
+
</th></tr></thead>
|
|
632
|
+
<tbody><tr><td>
|
|
633
|
+
|
|
634
|
+
color
|
|
635
|
+
|
|
636
|
+
</td><td>
|
|
637
|
+
|
|
638
|
+
string \| null
|
|
639
|
+
|
|
640
|
+
</td><td>
|
|
641
|
+
|
|
642
|
+
Bus color
|
|
643
|
+
|
|
644
|
+
</td></tr>
|
|
645
|
+
</tbody></table>
|
|
646
|
+
|
|
647
|
+
## Returns
|
|
648
|
+
|
|
649
|
+
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
650
|
+
|
|
651
|
+
Bus primitive object
|
|
652
|
+
|
|
653
|
+
## Example
|
|
654
|
+
|
|
655
|
+
```javascript
|
|
656
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
657
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
658
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
659
|
+
|
|
660
|
+
// 2. 创建一条红色测试总线(SCH 坐标单位 10mil)
|
|
661
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y], '#FF0000', 6, 1);
|
|
662
|
+
|
|
663
|
+
// 3. 读取修改前的颜色
|
|
664
|
+
const before = bus.getState_Color();
|
|
665
|
+
|
|
666
|
+
// 4. 切换异步模式并改为绿色
|
|
667
|
+
const asyncBus = bus.toAsync();
|
|
668
|
+
asyncBus.setState_Color('#00AA00');
|
|
669
|
+
await asyncBus.done();
|
|
670
|
+
|
|
671
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
672
|
+
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
673
|
+
|
|
674
|
+
console.log('color:', before, '→', refetched.getState_Color());
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
### setstate_line
|
|
678
|
+
|
|
679
|
+
# ISCH\_PrimitiveBus.setState\_Line() method
|
|
680
|
+
|
|
681
|
+
> 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.
|
|
682
|
+
|
|
683
|
+
Set the property state: polyline coordinate group
|
|
684
|
+
|
|
685
|
+
## Signature
|
|
686
|
+
|
|
687
|
+
```typescript
|
|
688
|
+
function setState_Line(line: Array<number> | Array<Array<number>>): ISCH_PrimitiveBus;
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
## Parameters
|
|
692
|
+
|
|
693
|
+
<table><thead><tr><th>
|
|
694
|
+
|
|
695
|
+
Parameter
|
|
696
|
+
|
|
697
|
+
</th><th>
|
|
698
|
+
|
|
699
|
+
Type
|
|
700
|
+
|
|
701
|
+
</th><th>
|
|
702
|
+
|
|
703
|
+
Description
|
|
704
|
+
|
|
705
|
+
</th></tr></thead>
|
|
706
|
+
<tbody><tr><td>
|
|
707
|
+
|
|
708
|
+
line
|
|
709
|
+
|
|
710
|
+
</td><td>
|
|
711
|
+
|
|
712
|
+
Array<number> \| Array<Array<number>>
|
|
713
|
+
|
|
714
|
+
</td><td>
|
|
715
|
+
|
|
716
|
+
Polyline coordinate group
|
|
717
|
+
|
|
718
|
+
</td></tr>
|
|
719
|
+
</tbody></table>
|
|
720
|
+
|
|
721
|
+
## Returns
|
|
722
|
+
|
|
723
|
+
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
724
|
+
|
|
725
|
+
Bus primitive object
|
|
726
|
+
|
|
727
|
+
## Example
|
|
728
|
+
|
|
729
|
+
```javascript
|
|
730
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
731
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
732
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
733
|
+
|
|
734
|
+
// 2. 创建一条水平单段测试总线(SCH 坐标单位 10mil)
|
|
735
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y]);
|
|
736
|
+
|
|
737
|
+
// 3. 读取修改前的路径
|
|
738
|
+
const before = bus.getState_Line();
|
|
739
|
+
|
|
740
|
+
// 4. 切换异步模式并改为 L 形两段(先水平再垂直,段间共享端点)
|
|
741
|
+
const asyncBus = bus.toAsync();
|
|
742
|
+
asyncBus.setState_Line([x, y, x + 400, y, x + 400, y + 400]);
|
|
743
|
+
await asyncBus.done();
|
|
744
|
+
|
|
745
|
+
// 5. 从画布重新读取,确认路径已更新(保留现场供观察)
|
|
746
|
+
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
747
|
+
|
|
748
|
+
console.log('line:', JSON.stringify(before), '→', JSON.stringify(refetched.getState_Line()));
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
### setstate_linetype
|
|
752
|
+
|
|
753
|
+
# ISCH\_PrimitiveBus.setState\_LineType() method
|
|
754
|
+
|
|
755
|
+
> 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.
|
|
756
|
+
|
|
757
|
+
Set the property state: line type
|
|
758
|
+
|
|
759
|
+
## Signature
|
|
760
|
+
|
|
761
|
+
```typescript
|
|
762
|
+
function setState_LineType(lineType: ESCH_PrimitiveLineType | null): ISCH_PrimitiveBus;
|
|
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
|
+
lineType
|
|
783
|
+
|
|
784
|
+
</td><td>
|
|
785
|
+
|
|
786
|
+
[ESCH\_PrimitiveLineType](../enums/ESCH_PrimitiveLineType.md) \| null
|
|
787
|
+
|
|
788
|
+
</td><td>
|
|
789
|
+
|
|
790
|
+
Line type
|
|
791
|
+
|
|
792
|
+
</td></tr>
|
|
793
|
+
</tbody></table>
|
|
794
|
+
|
|
795
|
+
## Returns
|
|
796
|
+
|
|
797
|
+
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
798
|
+
|
|
799
|
+
Bus primitive object
|
|
800
|
+
|
|
801
|
+
## Example
|
|
802
|
+
|
|
803
|
+
```javascript
|
|
804
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
805
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
806
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
807
|
+
|
|
808
|
+
// 2. 创建一条虚线(DASHED=1)测试总线(SCH 坐标单位 10mil)
|
|
809
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y], null, 6, 1);
|
|
810
|
+
|
|
811
|
+
// 3. 读取修改前的线型
|
|
812
|
+
const before = bus.getState_LineType();
|
|
813
|
+
|
|
814
|
+
// 4. 切换异步模式并改为点线(DOTTED=2)
|
|
815
|
+
const asyncBus = bus.toAsync();
|
|
816
|
+
asyncBus.setState_LineType(2);
|
|
817
|
+
await asyncBus.done();
|
|
818
|
+
|
|
819
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
820
|
+
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
821
|
+
|
|
822
|
+
console.log('lineType:', before, '→', refetched.getState_LineType());
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
### setstate_linewidth
|
|
826
|
+
|
|
827
|
+
# ISCH\_PrimitiveBus.setState\_LineWidth() method
|
|
828
|
+
|
|
829
|
+
> 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.
|
|
830
|
+
|
|
831
|
+
Set the property state: Line width
|
|
832
|
+
|
|
833
|
+
## Signature
|
|
834
|
+
|
|
835
|
+
```typescript
|
|
836
|
+
function setState_LineWidth(lineWidth: number | null): ISCH_PrimitiveBus;
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
## Parameters
|
|
840
|
+
|
|
841
|
+
<table><thead><tr><th>
|
|
842
|
+
|
|
843
|
+
Parameter
|
|
844
|
+
|
|
845
|
+
</th><th>
|
|
846
|
+
|
|
847
|
+
Type
|
|
848
|
+
|
|
849
|
+
</th><th>
|
|
850
|
+
|
|
851
|
+
Description
|
|
852
|
+
|
|
853
|
+
</th></tr></thead>
|
|
854
|
+
<tbody><tr><td>
|
|
855
|
+
|
|
856
|
+
lineWidth
|
|
857
|
+
|
|
858
|
+
</td><td>
|
|
859
|
+
|
|
860
|
+
number \| null
|
|
861
|
+
|
|
862
|
+
</td><td>
|
|
863
|
+
|
|
864
|
+
Line width
|
|
865
|
+
|
|
866
|
+
</td></tr>
|
|
867
|
+
</tbody></table>
|
|
868
|
+
|
|
869
|
+
## Returns
|
|
870
|
+
|
|
871
|
+
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
872
|
+
|
|
873
|
+
Bus primitive object
|
|
874
|
+
|
|
875
|
+
## Example
|
|
876
|
+
|
|
877
|
+
```javascript
|
|
878
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
879
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
880
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
881
|
+
|
|
882
|
+
// 2. 创建一条线宽 6 的测试总线(SCH 坐标单位 10mil)
|
|
883
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y], null, 6, null);
|
|
884
|
+
|
|
885
|
+
// 3. 读取修改前的线宽
|
|
886
|
+
const before = bus.getState_LineWidth();
|
|
887
|
+
|
|
888
|
+
// 4. 切换异步模式并加粗到 10
|
|
889
|
+
const asyncBus = bus.toAsync();
|
|
890
|
+
asyncBus.setState_LineWidth(10);
|
|
891
|
+
await asyncBus.done();
|
|
892
|
+
|
|
893
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
894
|
+
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
895
|
+
|
|
896
|
+
console.log('lineWidth:', before, '→', refetched.getState_LineWidth());
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
### toasync
|
|
900
|
+
|
|
901
|
+
# ISCH\_PrimitiveBus.toAsync() method
|
|
902
|
+
|
|
903
|
+
Convert Primitive to Async primitive
|
|
904
|
+
|
|
905
|
+
## Signature
|
|
906
|
+
|
|
907
|
+
```typescript
|
|
908
|
+
function toAsync(): ISCH_PrimitiveBus;
|
|
909
|
+
```
|
|
910
|
+
|
|
911
|
+
## Returns
|
|
912
|
+
|
|
913
|
+
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
914
|
+
|
|
915
|
+
Bus primitive object
|
|
916
|
+
|
|
917
|
+
## Example
|
|
918
|
+
|
|
919
|
+
```javascript
|
|
920
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试总线重合
|
|
921
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
922
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
923
|
+
|
|
924
|
+
// 2. 创建一条测试总线(创建后默认处于异步模式)
|
|
925
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [x, y, x + 400, y]);
|
|
926
|
+
|
|
927
|
+
// 3. 转换为异步图元
|
|
928
|
+
const asyncBus = bus.toAsync();
|
|
929
|
+
|
|
930
|
+
// 4. 异步模式下累计修改并提交
|
|
931
|
+
asyncBus.setState_LineWidth(10);
|
|
932
|
+
await asyncBus.done();
|
|
933
|
+
|
|
934
|
+
// 5. 从画布重新读取,确认提交生效(保留现场供观察)
|
|
935
|
+
const refetched = await eda.sch_PrimitiveBus.get(bus.getState_PrimitiveId());
|
|
936
|
+
|
|
937
|
+
console.log('isAsync after toAsync:', bus.isAsync());
|
|
938
|
+
console.log('lineWidth:', 6, '→', refetched.getState_LineWidth());
|
|
939
|
+
```
|
|
940
|
+
|
|
941
|
+
### tosync
|
|
942
|
+
|
|
943
|
+
# ISCH\_PrimitiveBus.toSync() method
|
|
944
|
+
|
|
945
|
+
Convert Primitive to Sync primitive
|
|
946
|
+
|
|
947
|
+
## Signature
|
|
948
|
+
|
|
949
|
+
```typescript
|
|
950
|
+
function toSync(): ISCH_PrimitiveBus;
|
|
951
|
+
```
|
|
952
|
+
|
|
953
|
+
## Returns
|
|
954
|
+
|
|
955
|
+
[ISCH\_PrimitiveBus](./ISCH_PrimitiveBus.md)
|
|
956
|
+
|
|
957
|
+
Bus primitive object
|
|
958
|
+
|
|
959
|
+
## Example
|
|
960
|
+
|
|
961
|
+
```javascript
|
|
962
|
+
// 1. 创建一条测试总线(创建后默认处于异步模式)
|
|
963
|
+
const bus = await eda.sch_PrimitiveBus.create('DATA[0..7]', [1000, 1000, 1400, 1000]);
|
|
964
|
+
|
|
965
|
+
// 2. 转换为同步图元,isAsync() 变为 false
|
|
966
|
+
const syncBus = bus.toSync();
|
|
967
|
+
const isAsyncAfterToSync = syncBus.isAsync();
|
|
968
|
+
|
|
969
|
+
// 3. 清理测试图元(本案例只演示模式转换,不修改画布)
|
|
970
|
+
await eda.sch_PrimitiveBus.delete([bus.getState_PrimitiveId()]);
|
|
971
|
+
|
|
972
|
+
console.log('isAsync after toSync:', isAsyncAfterToSync);
|
|
973
|
+
```
|