Creazione di maschere del blocco
Creare un aspetto personalizzato, creare un'interfaccia definita dall'utente, incapsulare la logica e nascondere i dati per i sottosistemi e i blocchi personalizzati
Simulink® consente di creare maschere del blocco. Una maschera è un'interfaccia utente personalizzata per un blocco.
Mascherando un blocco, si incapsula il diagramma del blocco in modo da avere una propria finestra di dialogo dei parametri con una propria descrizione del blocco, il prompt dei parametri e i testi di supporto.
È possibile mascherare un blocco personalizzato indipendente che può essere riutilizzato come blocco unico, come quelli definiti in Simulink.
Per informazioni sulla creazione di una maschera del blocco, vedere Create a Simple Mask.
Classi
Simulink.Mask | Control masks programmatically |
Simulink.Mask.Constraints | Create mask parameter constraint |
Simulink.Mask.PortConstraints | Create mask port constraints programmatically (Da R2022a) |
Simulink.Mask.ParameterCondition | Create mask parameter conditions (Da R2022a) |
Simulink.Mask.PortConstraintRule | Create instance of Simulink.Mask.PortConstraintRule to define
rules of port constraint (Da R2022a) |
Simulink.Mask.PortIdentifier | Create port identifiers to identify ports of block in mask object (Da R2022a) |
Simulink.Mask.CrossPortConstraints | Creates cross-port constraint among ports of the same masked block (Da R2023a) |
Simulink.Mask.SharedConstraintFile | Constraints that needs to be saved in an XML file (Da R2023a) |
Simulink.MaskParameter | Control mask parameters programmatically |
Simulink.Mask.EnumerationBase | Derive an enumeration class to hold numeric values of any datatype (Da R2021a) |
Simulink.Mask.EnumerationTypeOptions | Parse information from enumeration file derived from
Simulink.IntEnumType and
Simulink.Mask.EnumerationBase (Da R2021a) |
Simulink.dialog.Control | Create instance of dialog control |
Simulink.dialog.parameter.CustomTable | Create custom tables programmatically |
Simulink.dialog.ListboxControl | Control list box programmatically (Da R2019a) |
Simulink.dialog.TreeControl | Control Tree control programmatically |
Simulink.dialog.LookupTableControl | Control mask lookup tables programmatically (Da R2021b) |
Simulink.dialog.LookupTableControl.Table | Control table data for mask lookup table (Da R2021b) |
Simulink.dialog.LookupTableControl.Breakpoints | Control breakpoint data set for mask lookup table (Da R2021b) |
Argomenti
Introduzione al mascheramento
- Masking Fundamentals
Learn the basics about masking and when to mask blocks. - Create a Simple Mask
You can mask a block interactively by using the Mask Editor or mask it programmatically. - Manage Existing Masks
View or edit an existing block mask.
Interfaccia utente dell'editor di mascheramento
- Mask Editor Overview
Create and customize masks using the Mask Editor interface. - Specify Data Types Using DataTypeStr Parameter
Add data type constraint for an Edit mask parameter. - Design a Mask Dialog Box
Try this example to create a mask dialog box and understand the use of some Mask Editor features. - Handling Large Number of Mask Parameters
Add large number of mask parameters in a Table programmatically. - Customize Tables for Masked Blocks
Add custom tables to mask dialog box. - Control Custom Table Programmatically
Use a programmatic interface to control custom tables. - Control Masks Programmatically
Simulink® defines a set of parameters that help in setting and editing masks.
Feature di mascheramento
- Validating Mask Parameters Using Constraints
Add validation to mask parameters using constraints. - Custom Constraint for Mask Parameter
A mask can contain parameters that accept user input values. - Share Parameter Constraints Across Multiple Block Masks
This example shows how to create a parameter constraint and share it across masks of different blocks in the same model or different models. - Validate Input and Output Port Signals Using Port Constraints
You can validate compile-time signal attributes on the input and output ports of a masked block by using port constraints. - Validate Port Signals Among Ports of the Same Masked Block
This example shows how to create cross port constraints to validate compile-time signal attributes among ports of the same masked block. - Mask Callback Code
Add and execute mask callback code. - Initialize Mask
Use MATLAB® code to initialize a block mask. - Promote Block Parameters on a Mask
Blocks and subsystems can have multiple parameters associated with them. - Pass Values to Blocks Under the Mask
Specify input values using the mask dialog box. - Mask Linked Blocks
Add custom interface to linked blocks. - Approaches to Control Active Variant Choice of a Variant Block Using Mask or Model Workspace
This example shows different approaches to control the active choice of inline variant and Variant Subsystem blocks from a mask or a model workspace. - Define Measurement Units for Masked Blocks
Set measurement units for output and input ports of a masked block. - Add Images in Masks
Add images as mask icons and save them in the SLX file. - Graphical Icon Editor Overview
Create and edit mask icon of a block in a graphical environment. - Create Hierarchical List in Mask Dialog
Create a hierarchical list of data on a mask. - Tune Mask Enumeration Parameters - Popup and Radio Button
Reference external enumeration file to assign numerical values to popup parameter. - Visualize and Plot N-Dimensional Data Using Mask Lookup Table Control
Use a lookup table to evaluate a sampled representation of a function using simple lookup operations.
Richiami alla maschera
- Organize Mask Initialization and Callbacks in a MATLAB File
You can organize mask initialization and mask callback code in a separate MATLAB® class file. - Dynamic Mask Dialog Box
You can create dialogs for masked blocks whose appearance changes in response to user input. - Dynamic Masked Subsystem
Create masked library blocks that can modify their structural contents. - Debug Masks That Use MATLAB Code
Troubleshoot errors in the mask initialization code.
Maschera di sistema
- Introduction to System Mask
Learn about masking a model. - Control Masks Programmatically
Simulink® defines a set of parameters that help in setting and editing masks. - Create and Reference a Masked Model
Mask a model interactively. - Create and Display System Mask Programmatically
You can apply a system mask to a model or a subsystem block diagram.
Modelli di esempio
- Masking Example Models
View Simulink models that demonstrate masking capabilities.