slreportgen.webview.WebViewDocument class
Package: slreportgen.webview
Superclasses:
Create a web view document generator
Description
Creates a document generator that generates an HTML document containing a web view of one or more Simulink® models.
Construction
creates a document generator that generates an HTML document at the specified location
containing a web view of the specified model. Use the generator’s
wvdocgen
= slreportgen.webview.WebViewDocument(docname
,model
)fill
method to generate the document.
creates
a document generator that includes two or more models in the web view that it creates.
This constructor assigns an array of default
wvdocgen
= slreportgen.webview.WebViewDocument(docname
,model1
,model2
,...modeln
)slreportgen.webview.ExportOptions
objects to the generator’s
ExportOptions
property, one for each of the models to be
included in the generated document’s web view. You can use the objects to specify custom
export options for the models to be exported.
assigns a default wvdoc
gen = slreportgen.webview.WebViewDocument(docname
,{model1
,model2
,...modeln
})slreportgen.webview.ExportOptions
object to the
generator’s ExportOptions
property that applies to all of the
models to be exported.
creates a web view document generator for an initially unspecified model or set of
models. Use the wvdocgen
= slreportgen.webview.WebViewDocument(docname
)Systems
property of the generator’s
ExportOptions
property to specify the model or models to be
included in the web view that it generates.
Input Arguments
Properties
Methods
Method | Purpose |
---|---|
fill | Invokes web view generator’s hole-filling methods (e.g., fillslwebview) to fill the holes in the web view document’s template |
fillslwebview | Fills template’s slwebview hole with a web view |
getExportModels | Names of models to be included in the web view |
getExportDiagrams | Paths and handles of block diagrams to be included in the web view |
getExportSimulinkSubSystems | Paths and handles of subsystem blocks to be included in this web view |
getExportStateflowCharts | Paths and handles of |
getExportStateflowDiagrams | Array of Stateflow® diagram paths |
Examples
Export Model to a Web View
import slreportgen.webview.* open_system('f14') d = WebViewDocument('f14WebView', 'f14'); fill(d); rptview(d);
Export Multiple Models to a Web View
The export options in this example allow you to view the subsystem that implements the
Simulink library block, Band-Limited White Noise, in the
f14
model and the Stateflow chart that implements the Engine
block in the
slrgex_sf_car
model. If the example did not enable the export
options, the subsystem and chart would appear only as blocks in the exported web
view.
import slreportgen.webview.* open_system('f14'); open_system('slrgex_sf_car'); wvdoc = WebViewDocument(... 'myWebview','f14','slrgex_sf_car'); opts = wvdoc.ExportOptions; f14Opts = opts(1); f14Opts.IncludeMaskedSubsystems = true; f14Opts.IncludeSimulinkLibraryLinks = true; sfcarOpts = opts(2); sfcarOpts.IncludeMaskedSubsystems = true; fill(wvdoc) rptview(wvdoc);
Export Selected Systems to a Web View
This example exports f14
’s root system and Aircraft Dynamics Model
subsystem.
import slreportgen.webview.* open_system('f14'); wvdoc = WebViewDocument('myWebView', ... {'f14', 'f14/Aircraft Dynamics Model'}); wvdoc.ExportOptions.SearchScope = 'Current'; fill(wvdoc) rptview(wvdoc);
Export Subsystem’s Ancestors to a Web View
This example exports f14
’s root system and Controller
subsystem.
import slreportgen.webview.* open_system('f14'); wvdoc = WebViewDocument(... 'mydoc', 'f14/Controller'); wvdoc.ExportOptions.SearchScope = 'CurrentAndAbove'; fill(wvdoc) rptview(wvdoc);