Main Content

autosar.dictionary.ARClassicPlatformMapping

AUTOSAR Classic Platform にマッピングされたインターフェイス ディクショナリ内の要素についてのプラットフォーム固有のプロパティの管理

R2022b 以降

    説明

    autosar.dictionary.ARClassicPlatformMapping オブジェクトは、AUTOSAR Classic Platform にマッピングされたインターフェイス ディクショナリでプラットフォーム固有のプロパティを管理するのに役立つメソッドを提供します。

    作成

    autosar.dictionary.ARClassicPlatformMapping オブジェクトの作成には関数 addPlatformMapping を使用します。

    % after creating a Simulink.interface.dictionary object, dictAPI,
    % you can create a platformMapping object 
    platformMapping = dictAPI.addPlatformMapping('AUTOSARClassic');

    Classic Platform にマッピングされたインターフェイス ディクショナリが既にある場合は、関数 getPlatformMapping を使用して autosar.dictionary.ARClassicPlatformMapping オブジェクトを表すことができます。

    platformMapping = dictAPI.getPlatformMapping('AUTOSARClassic');

    オブジェクト関数

    exportDictionaryインターフェイス ディクショナリからのインターフェイス、データ型、およびプラットフォーム固有の定義のエクスポート
    getPlatformPropertiesインターフェイス ディクショナリからの AUTOSAR プラットフォーム プロパティの取得
    getPlatformPropertyインターフェイス ディクショナリからの AUTOSAR プラットフォーム プロパティの取得
    setPlatformPropertyインターフェイス ディクショナリ内のデータ インターフェイスまたはデータ要素の AUTOSAR プロパティの設定

    すべて折りたたむ

    この例では、Simulink.interface.dictionary オブジェクトを作成し、ディクショナリの内容を構成してから、プラットフォーム固有の要素を追加します。

    インターフェイス ディクショナリを作成します。

    dictName = 'MyInterfaces.sldd';
    dictAPI = Simulink.interface.dictionary.create(dictName);

    列挙、エイリアス タイプ、値タイプ、および構造体を含むデータ型を追加します。

    % Enum Types
    myEnumType1 = addEnumType(dictAPI,'myColor');
    myEnumType1.addEnumeral('RED','0','Solid Red');
    myEnumType1.addEnumeral('BLUE','1','Solid Blue');
    myEnumType1.StorageType = 'int16';
     
    % set base type of an alias type to enum object
    myAliasType1 = addAliasType(dictAPI,'myAliasType1');
    myAliasType1.BaseType = myEnumType1;
     
    % ValueType
    myValueType1 = addValueType(dictAPI,'myValueType1');
    myValueType1.DataType = 'int32';
    myValueType1.Dimensions = '[2 3]';
    myValueType1.DataType = myEnumType1; % can also use interface dict type objs
     
    % StructType
    myStructType1 = addStructType(dictAPI,'myStructType1');
    structElement1 = myStructType1.addElement('Element1');
    structElement1.Type.DataType = 'single';
    structElement1.Type.Dimensions = '3';
    structElement2 = myStructType1.addElement('Element2');
    structElement2.Type = myValueType1;
    % or
    structElement2.Type = 'ValueType: myValueType1';
    

    データ インターフェイスを追加し、データ要素を構成します。

    dataInterface1 = addDataInterface(dictAPI,'DataInterface');
     
    dataElm1 = addElement(dataInterface1,'DE1');
    dataElm1.Type = myValueType1;
     
    dataElm2 = addElement(dataInterface1,'DE2');
    dataElm2.Type = myStructType1;
    dataElm2.Dimensions = '4';
    dataElm2.Description = 'I am a data element with datatype = array of struct type';
     
    % data element with owned type
    dataElm3 = addElement(dataInterface1,'DE3');
    dataElm3.Type.DataType = 'single';
    dataElm3.Type.Dimensions = '10';
    dataElm3.Type.Minimum = '-5';
     
    dataInterface2 = addDataInterface(dictAPI,'DataInterface2');

    AUTOSAR Classic マッピングを追加します。

    platformMapping = addPlatformMapping(dictAPI,'AUTOSARClassic');

    パッケージ パスや不揮発性データ通信など、Classic コンポーネントのインターフェイス プロパティを構成します。

    setPlatformProperty(platformMapping, dataInterface1,...
        'Package','/Interface2','InterfaceKind','NvDataInterface');

    プラットフォーム プロパティを取得します。

    [pNames, pValues] = getPlatformProperties(platformMapping,dataInterface1);

    ディクショナリに VAR1 ソフトウェア アドレス メソッドを追加し、データ インターフェイス DataInterface 内のデータ要素 DE1 についての AUTOSAR プラットフォーム固有のプロパティを設定します。

    arObj = autosar.api.getAUTOSARProperties(dictName);
    addPackageableElement(arObj,'SwAddrMethod', ... 
        '/SwAddressMethods','VAR1','SectionType','Var');
    setPlatformProperty(platformMapping,dataElm1, ...
        'SwAddrMethod','VAR1','SwCalibrationAccess', ... 
        'ReadWrite','DisplayFormat','%.3f');

    バージョン履歴

    R2022b で導入