メインコンテンツ

ソフトウェア アーキテクチャ用の System Composer レポート API によるシステム アーキテクチャ レポートの生成

R2026b
R2022b 以降

この例では、System Composer™ ソフトウェア アーキテクチャ モデルとそのアーティファクトについて、レポート API ベースのアーキテクチャ レポートを生成する方法を示します。

この例に含まれている generateSoftwareArchitectureReport 関数は、次のセクションを含むレポートを生成します。

  • タイトル ページ

  • 目次

  • モデル要素を含むアーキテクチャ要素の章

  • インターフェイスと要素を含むサービス インターフェイスの章

  • モデルに関連付けられているカスタムのビューと図を含むビューと図の章

generateSoftwareArchitectureReport.m ファイルを変更して、カスタム システム アーキテクチャ設計レポートを作成できます。

generateSoftwareArchitectureReport 関数は、次のレポート API クラスのオブジェクトを使用して、アーキテクチャ設計要素を検索し、設計についてのレポートを生成します。

完全な generateSoftwareArchitectureReport 関数は、この例の最後に記載されています。

ACCSoftwareComposition ソフトウェア アーキテクチャの PDF システム アーキテクチャ レポートの生成

ACCSoftwareComposition アーキテクチャ モデルを開きます。

modelName = "ACCSoftwareComposition";
systemcomposer.loadModel(modelName);

ACCSoftwareComposition アーキテクチャ モデルのシステム アーキテクチャ レポートを生成します。PDF ドキュメントにするように指定します。

generateSoftwareArchitectureReport(modelName, "pdf");

この関数は、ACCSoftwareComposition Architecture Report.pdf という名前の新しいファイルをプロジェクトのルート フォルダーに作成します。

generateSoftwareArchitectureReport 関数

systemcomposer.rptgen 名前空間のレポーター クラス、ファインダー クラス、結果クラスを使用して、システム アーキテクチャ レポートの内容をカスタマイズできます。これらのオブジェクトのプロパティを使用して、レポートされる情報へのフィルターの適用と書式設定ができます。

この例に含まれている generateSoftwareArchitectureReport 関数は次のとおりです。

type generateSoftwareArchitectureReport.m
function generateArchitectureReport(mdl, doctype)
%GENERATEARCHITECTUREREPORT Generates a system architecture report from the
%architecture model.
% 
% generateArchitectureReport() generates a PDF system architecture report
% for the ACCSoftwareComposition software architecture model.
%
% generateArchitectureReport(mdl) generates a PDF system architecture
% report for the specified model.
%
% generateArchitectureReport(mdl, doctype) generates a system
% architecture report from the specified model and document type: 'html',
% 'docx', or 'pdf'.
%
% The generated document is a description of an architecture's
% design generated from its System Composer software architecture model. The
% description contains the following sections:
% 
% * Title Page
% * Table of Contents
% * Architecture Elements Chapter -- Contains each component in the
%   architecture model along with their connectors.

import mlreportgen.report.*
import slreportgen.report.*
import slreportgen.finder.*
import mlreportgen.dom.*
import mlreportgen.utils.*
import systemcomposer.query.*
import systemcomposer.rptgen.finder.*

if nargin < 1
    mdl = "ACCSoftwareComposition";
    doctype = "pdf";
end

if nargin < 2
    doctype = "pdf";
end

mdlHandle = systemcomposer.loadModel(mdl);

rptFileName = mdl + " Architecture Report";

rpt = slreportgen.report.Report(OutputPath=rptFileName, ...
    Type=doctype, CompileModelBeforeReporting=false);
open(rpt);

makeTitlePage(rpt, mdlHandle);
append(rpt, TableOfContents);
makeIntroduction(rpt);
makeArchitectureElements(rpt, mdlHandle);

close(rpt);
close_system(mdl);
rptview(rpt);

end

AUTOSAR ソフトウェア アーキテクチャ用のレポートの生成

この例のスクリプトを使用して、AUTOSAR アーキテクチャ モデルとそのアーティファクトのレポートを生成できます。AUTOSAR モデルを読み込むには、autosar.arch.loadModel (AUTOSAR Blockset)を使用します。モデル、プロファイル、要件、およびディクショナリのファイル名が、ご使用の AUTOSAR モデルに合わせて更新されていることを確認します。AUTOSAR アーキテクチャの詳細については、ソフトウェア アーキテクチャのモデル化 (AUTOSAR Blockset)を参照してください。

参考

ツール

クラス

トピック