主要内容

创建模块封装

自定义模块外观、用户界面和模块图

模块封装是您可以为模块创建的自定义用户界面。封装模块可隐藏其底层实现细节,并提供更用户友好的界面来设置参数和选项。模块封装对于复杂模块或子系统特别有用,这些模块或子系统的内部工作原理不需要用户理解或直接交互。您可以为自定义模块创建一个封装,并将其作为模块的唯一实例重用。

全部展开

Simulink.Mask以编程方式控制封装
Simulink.Mask.ConstraintsCreate mask parameter constraint
Simulink.Mask.PortConstraintCreate mask port constraints programmatically (自 R2022a 起)
Simulink.Mask.ParameterConditionCreate mask parameter conditions (自 R2022a 起)
Simulink.Mask.PortConstraintRuleCreate instance of Simulink.Mask.PortConstraintRule to define rules of port constraint (自 R2022a 起)
Simulink.Mask.PortIdentifierCreate port identifiers to identify ports of block in mask object (自 R2022a 起)
Simulink.Mask.CrossPortConstraintCreates cross-port constraint among ports of the same masked block (自 R2023a 起)
Simulink.Mask.CrossPortParameterConstraintCross port parameter constraint between ports and parameters of same masked block (自 R2025a 起)
Simulink.Mask.CrossPortParameterConstraintAssociationCross port parameter constraint association between mask parameters and ports (自 R2025a 起)
Simulink.Mask.SharedConstraintFileConstraints that needs to be saved in an XML file (自 R2023a 起)
Simulink.MaskParameter以编程方式控制封装参数
Simulink.Mask.EnumerationBaseDerive enumeration class to hold numeric values of any data type (自 R2021a 起)
Simulink.Mask.EnumerationTypeOptionsParse information from enumeration file derived from Simulink.IntEnumType and Simulink.Mask.EnumerationBase (自 R2021a 起)
Simulink.ConstraintManagerManage parameter and port constraints (自 R2024b 起)
Simulink.Mask.WorkspaceMask workspace object (自 R2025a 起)
Simulink.dialog.Control创建对话框控件的实例
Simulink.dialog.ButtonCreate instance of button dialog control
Simulink.dialog.HyperlinkCreate instance of hyperlink dialog control
Simulink.dialog.ImageManage image dialog control
Simulink.dialog.TextManage text dialog control
Simulink.dialog.ListboxControlControl list box programmatically
Simulink.dialog.parameter.ControlCreate a parameter dialog control
Simulink.dialog.parameter.CustomTableCreate custom tables programmatically
Simulink.dialog.TreeControlControl Tree control programmatically
Simulink.dialog.LookupTableControlControl mask lookup tables programmatically (自 R2021b 起)
Simulink.dialog.LookupTableControl.TableControl table data for mask lookup table (自 R2021b 起)
Simulink.dialog.LookupTableControl.BreakpointsControl breakpoint data set for mask lookup table (自 R2021b 起)
Simulink.dialog.ContainerCreate instance of container dialog control
Simulink.dialog.GroupCreate instance of group dialog control
Simulink.dialog.PanelCreate instance of panel dialog control
Simulink.dialog.TabCreate instance of tab dialog control
Simulink.dialog.TabContainerCreate instance of tab container dialog control
Simulink.dialog.MaskPartReferenceCreate and save parameters and dialog controls and reuse them across multiple masked blocks (自 R2024b 起)

主题

封装简介

  • 封装基础知识
    了解封装基础知识和何时封装模块。
  • 创建简单封装
    使用封装编辑器以交互方式封装模块,或以编程方式封装模块。此示例说明如何使用封装编辑器来封装模块。要以编程方式封装模块,请参阅以编程方式控制封装。
  • 管理现有封装
    查看或编辑现有的模块封装。

封装编辑器

封装功能

封装约束

图形图标编辑器

封装回调

系统封装

示例模型

精选示例