主要内容

本页采用了机器翻译。点击此处可查看英文原文。

Simulink.CloneDetection.Settings 类

命名空间: Simulink.CloneDetection

findClones 函数的条件

描述

使用 Simulink.CloneDetection.Settings 类的对象来指定调用 Simulink.CloneDetection.findClones 函数时的某些条件。

创建对象

描述

Simulink.CloneDetection.Settings 创建一个 Simulink.CloneDetection.Settings 类的对象。

属性

全部展开

检测克隆时,可以选择忽略信号名称差异,指定为 falsetrue

检测克隆时忽略模块属性差异的选项,指定为 falsetrue

可选择从搜索克隆模式中排除模型引用块,指定为 falsetrue

可选择从搜索克隆模式中排除库链接,指定为 falsetrue

允许将某个模式视为克隆的差异数,以 uint32 整数表示。

可以选择用子系统参考块替换精确克隆,指定为 falsetrue

用于替换模型中模式的库的路径,以字符向量或字符向量数组的形式指定。

包含模型的文件夹路径,以字符向量或字符向量数组的形式指定。

可以选择从指定文件夹(指定为 falsetrue)内的文件夹中查找模型的克隆。

此属性仅在您向 Folders 提供输入时适用。

可选择检测模型中任意位置的克隆,指定为 falsetrue

将某个模式视为克隆所需的区域中的最小块数,以 uint32 整数表示。

此属性仅在 DetectClonesAcrossModeltrue 时适用。

将某个模式视为克隆组所需的最小克隆模式出现次数,以 uint32 整数表示。

此属性仅在 DetectClonesAcrossModeltrue 时适用。

可选择从搜索克隆模式中排除非活动区域或注释掉的区域,指定为 falsetrue

确定库子系统的输入数据类型是否与模型中克隆的输入数据类型匹配,指定为 falsetrue

方法

全部展开

示例

全部折叠

  1. Simulink.CloneDetection.Settings 类创建一个 cloneDetectionSettings 对象。

    cloneDetectionSettings = Simulink.CloneDetection.Settings();
  2. IgnoreSignalName 的属性更改为 true,以便在检测克隆时忽略信号名称差异。

    cloneDetectionSettings.IgnoreSignalName = true
    cloneDetectionSettings = 
    
      Settings with properties:                            
                                IgnoreSignalName: 1
                             IgnoreBlockProperty: 0
                          ExcludeModelReferences: 0
                             ExcludeLibraryLinks: 0
                          SelectedSystemBoundary: ''
                  FindClonesRecursivelyInFolders: 1
                        ParamDifferenceThreshold: 50
        ReplaceExactClonesWithSubsystemReference: 0
                                       Libraries: {}
                                         Folders: {} 
                         DetectClonesAcrossModel: 0
                          ExcludeInactiveRegions: 0
                                   DataTypeCheck: 0
    

版本历史记录

在 R2021a 中推出