Main Content

HasInterfaceElement

Create query to select architectural elements with interface element on interface based on specified subconstraint

    Description

    query = HasInterfaceElement(subconstraint) creates a query query that the find and createView functions use to select architectural elements with an interface element that satisfies the given subconstraint subconstraint.

    example

    Examples

    collapse all

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

    import systemcomposer.query.*

    Open the Simulink® project file for the keyless entry system.

    openProject("scKeylessEntrySystem");

    Load the architecture model.

    model = systemcomposer.loadModel("KeylessEntryArchitecture");

    Create a query for all the interface elements with c in the Name and run the query.

    constraint = HasPort(HasInterface(HasInterfaceElement(contains(Property("Name"),"c"))));
    elements = find(model,constraint,Recurse=true,IncludeReferenceModels=true)
    elements = 10×1 cell
        {'KeylessEntryArchitecture/Engine Control System'                         }
        {'KeylessEntryArchitecture/Door Lock//Unlock System/Door Lock Controller' }
        {'KeylessEntryArchitecture/Sound System'                                  }
        {'KeylessEntryArchitecture/Lighting System'                               }
        {'KeylessEntryArchitecture/Sound System/Sound Controller'                 }
        {'KeylessEntryArchitecture/FOB Locater System/FOB Locater Module'         }
        {'KeylessEntryArchitecture/Engine Control System/Keyless Start Controller'}
        {'KeylessEntryArchitecture/Lighting System/Lighting Controller'           }
        {'KeylessEntryArchitecture/FOB Locater System'                            }
        {'KeylessEntryArchitecture/Door Lock//Unlock System'                      }
    
    

    Input Arguments

    collapse all

    Condition restricting the query, specified as a systemcomposer.query.Constraint object.

    Output Arguments

    collapse all

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

    More About

    collapse all

    Version History

    Introduced in R2019b