Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

slreportgen.report.Diagram.customizeReporter

クラス: slreportgen.report.Diagram
名前空間: slreportgen.report

カスタム ブロック線図レポーター クラスを作成

構文

reporter = slreportgen.report.Diagram.customizeReporter(classpath)

説明

reporter = slreportgen.report.Diagram.customizeReporter(classpath) は、slreportgen.report.Diagram のサブクラスであるブロック線図クラス定義ファイルを作成します。ファイルは指定した classpath の場所に作成されます。さらに、customizeReporter メソッドは、既定のブロック線図テンプレートを <classpath>/resources/template フォルダーにコピーします。新しいクラス定義ファイルを開始点として使用して、レポート用にカスタムのブロック線図クラスを設計できます。

入力引数

すべて展開する

新しいクラス定義ファイルのパスと名前。string スカラーまたは文字ベクトルとして指定します。

説明
slreportgen.report.Diagram.customizeReporter("myFolder/MyClass")現在のフォルダーのサブフォルダー myFolderMyClass.m を作成します。
slreportgen.report.Diagram.customizeReporter("myFolder/@MyClass")

クラス名の前に @ 文字を付けて、レポーター クラスをクラス フォルダー内に作成します.m 拡張子は指定しないでください。

クラス定義を含むフォルダーを参照してください。

slreportgen.report.Diagram.customizeReporter("+myOrg/@MyClass")フォルダー名の前に + 文字を付けて、レポーター クラスをクラス パッケージ内に作成します。

メモ

相対パスまたは絶対パスを指定できます。

データ型: string | char

出力引数

すべて展開する

新しいレポーター クラスのパスとファイル名。string スカラーとして返されます。

カスタム ブロック線図レポーターの作成

次のコマンドを実行して、この例で使用するサポート ファイルにアクセスします。

openExample('rptgenext/SimulinkReportGeneratorFilesExample');

カスタム ブロック線図レポーターとそれに関連する既定のテンプレートを作成します。派生クラス ファイルは現在の作業フォルダーに対する指定した相対パスに作成されます。この場合、MyDiagram.m クラス ファイルのパスは <current working folder>/newDiagram/@MyDiagram/MyDiagram.m です。既定のブロック線図テンプレートは <current working folder>/newDiagram/@MyDiagram/resources/templates フォルダーにあります。

import slreportgen.report.*
Diagram.customizeReporter('newDiagram/@MyDiagram');

この新しいクラス ファイルを編集してモデルを読み込むと、新しいブロック線図レポーターを使用できます。

slrgex_sf_car;
diagram = MyDiagram('slrgex_sf_car');

バージョン履歴

R2017b で導入