Main Content

HasInterface

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

    Description

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

    example

    Examples

    collapse all

    Import the package 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 interfaces in a port with KeyFOBPosition in the Name and run the query.

    constraint = HasPort(HasInterface(contains(Property("Name"),"KeyFOBPosition")));
    portInterfaces = find(model,constraint,Recurse=true,IncludeReferenceModels=true)
    portInterfaces = 10×1 cell
        {'KeylessEntryArchitecture/Sound System/Sound Controller'                 }
        {'KeylessEntryArchitecture/FOB Locater System'                            }
        {'KeylessEntryArchitecture/Lighting System/Lighting Controller'           }
        {'KeylessEntryArchitecture/FOB Locater System/FOB Locater Module'         }
        {'KeylessEntryArchitecture/Engine Control System/Keyless Start Controller'}
        {'KeylessEntryArchitecture/Lighting System'                               }
        {'KeylessEntryArchitecture/Door Lock//Unlock System'                      }
        {'KeylessEntryArchitecture/Sound System'                                  }
        {'KeylessEntryArchitecture/Door Lock//Unlock System/Door Lock Controller' }
        {'KeylessEntryArchitecture/Engine Control 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