PropertyValue

Create query to select property from object or stereotype property and then evaluate property value

    Description

    example

    query = PropertyValue(name) creates a query object that the find method and the createViewArchitecture method use to select properties or stereotype properties for objects based on specified property name and then evaluate the property value.

    Examples

    collapse all

    Import the package that contains all of the System Composer™ queries.

    import systemcomposer.query.*;
    

    Open the Simulink® project file.

    scKeylessEntrySystem

    Open the model.

    m = systemcomposer.openModel('KeylessEntryArchitecture');

    Create a query to find components that contain the character vector 'Sensor' in their 'Name' property and run the query.

    constraint = PropertyValue('AutoProfile.BaseComponent.Latency')==30;
    latency = find(m,constraint,'Recurse',true,'IncludeReferenceModels',true)
    
    latency = 
    
    4×1 cell array
    
        {'KeylessEntryArchitecture/Door Lock//Unlock System/Front Driver Door Lock Actuator'}
        {'KeylessEntryArchitecture/Door Lock//Unlock System/Front Pass Door Lock Actuator'  }
        {'KeylessEntryArchitecture/Door Lock//Unlock System/Rear Driver Door Lock Actuator' }
        {'KeylessEntryArchitecture/Door Lock//Unlock System/Rear Pass Door Lock Actuator'   }

    Input Arguments

    collapse all

    Property name for model element, specified as a character vector as fully qualified name '<profile name>.<stereotype name>.<property name>' or any property on the designated class.

    Example: 'Name'

    Example: 'AutoProfile.BaseComponent.Latency'

    Data Types: char

    Output Arguments

    collapse all

    Query, returned as a systemcomposer.query.Constraint object.

    Introduced in R2019b