www.gusucode.com > rmidemos工具箱matlab源码程序 > rmidemos/slvnvdemo_powerwindow_report.m
%% How to Include Linked Requirements Details in Generated Report % The requirements report is a feature in RMI that scans the Simulink model % for links to external requirements documents and generates a report. % When documents are available for reading during requirements report % generation, you have an option to insert referenced document fragments % into the generated content to produce a more detailed report. % Copyright 2011-2013 The MathWorks, Inc. %% Open Example Model and Load RMI Links Data. % This example uses the Power Window Controller model and relies on an % externally stored set of links. % See <matlab:showdemo('slvnvdemo_powerwindow_external') Managing Requirements Without Modifying Simulink Model Files> % example for a detailed demonstration of external storage feature in RMI. % % Please run the following commands to % % * <matlab:rmipref('StoreDataExternally',true); Enable externally stored links feature> % * <matlab:rmimap.map(which('slvnvdemo_powerwindowController'),fullfile(matlabroot,'toolbox','slvnv','rmidemos','powerwin_reqs','slvnvdemo_powerwindowOffice.req')); % Associate the example model with externally stored RMI data> % * <matlab:open_system('slvnvdemo_powerwindowController') Open the model> % rmipref('StoreDataExternally', true); modelPath = which('slvnvdemo_powerwindowController'); reqFilePath = fullfile(matlabroot, 'toolbox', 'slvnv', 'rmidemos', 'powerwin_reqs', 'slvnvdemo_powerwindowOffice.req'); rmimap.map(modelPath, reqFilePath); open_system('slvnvdemo_powerwindowController'); %% Navigate Links to See Target Content in Documents % <matlab:rmidemo_callback('highlight','slvnvdemo_powerwindowController') % Highlight the model> to locate objects with links and navigate to % documents. Included links demonstrate several possible styles of linking % with Microsoft Office documents: % % * The <matlab:rmidemo_callback('locate','slvnvdemo_powerwindowController/control') control chart> % links to a % <matlab:rmidemo_callback('view','slvnvdemo_powerwindowController/control',1) major subheader in the Word document>. % * Both <matlab:rmidemo_callback('locate',{'slvnvdemo_powerwindowController/Truth%20Table','slvnvdemo_powerwindowController/Truth%20Table1'}) truth tables> % link so a % <matlab:rmidemo_callback('view','slvnvdemo_powerwindowController/Truth%20Table',1) % subheader and a table>. % * <matlab:rmidemo_callback('locate','slvnvdemo_powerwindowController/Mux1') driver-side Mux> % links to a % <matlab:rmidemo_callback('view','slvnvdemo_powerwindowController/Mux1',1) % subheader including some bullet points>. % * <matlab:rmidemo_callback('locate','slvnvdemo_powerwindowController/Mux4') passenger-side Mux> % links to % <matlab:rmidemo_callback('view','slvnvdemo_powerwindowController/Mux4',1) % just a subheader>. % rmi('highlightModel', 'slvnvdemo_powerwindowController'); %% Requirements Report without Document Fragments % % * Uncheck *Include details from linked documents* in the *Report* tab of % <matlab:rmidemo_callback('details',0) Requirements Settings dialog>. % % <<PowerWindow_settingsDetailsOff.png>> % % * <matlab:rmi('report',gcs) Generate a report>. This may take a bit % longer on the first run. % * Note that the tables in the report include only short labels % of links. These are the same string labels you see in the object context % menus and in the *Link Editor* dialog box. % % <<PowerWindow_RptDetailsNone.png>> %% Requirements Report with Documents Content Inserted % % * Select *Include details from linked documents* in *Report* tab of the % <matlab:rmidemo_callback('details',1) Requirements Settings dialog box>. % % <<PowerWindow_settingsDetails.png>> % % * <matlab:rmi('report',gcs) Re-generate the report>. % * When the target range in a Microsoft Word document % <matlab:rmidemo_callback('view','slvnvdemo_powerwindowController/Truth%20Table',1) includes a table>, % the table is now included in generated report. % % <<PowerWindow_RptDetailsWordTable.png>> % % * When the target location in Microsoft Word is a subheader, child % content is included in generated report. Use this feature with caution: % linking to a major subheader in the document could mean large amounts of % text are copied from the document into the report. % % <<PowerWindow_RptDetailsWordParags.png>> % % * When the target location is a range of cells in Microsoft Excel, the % target worksheet fragment is inserted in the report. % % <<PowerWindow_RptDetailsExlTable.png>> % % * When the target location is a single cell in Microsoft Excel % worksheet, the content of cells to the right of the target cell is also % inserted into the report. % % <<PowerWindow_RptDetailsExlRow.png>> % %% Include IBM Rational DOORS Attributes in RMI Report % For users linking with IBM Rational DOORS, RMI provides more % control over which object attributes to include in the % requirements tables. % % <<PowerWindow_RptDetailsDoors.png>> % % * The default configuration will include DOORS Object Heading, DOORS % Object Text and all other attributes except: "Created Thru", % all attributes with empty string values, and % system attributes that are false. % * The list of attribute names to include in generated report is stored as % part of RMI settings under user _prefdir_. % * Use the <matlab:help('RptgenRMI.doorsAttribs') RptgenRMI.doorsAttribs % utility> to include/exclude certain attributes and/or groups of % attributes. % current_settings = RptgenRMI.doorsAttribs('show') help RptgenRMI.doorsAttribs %% Cleanup % Steps in this example might have created files inside the examples folder % and modified your stored mapping of |.req| file names. % <matlab:rmidemo_callback('cleanup') Click to cleanup>. close_system('slvnvdemo_powerwindowController', 0); % close demo model, discard changes if any tmpfilepath = fullfile(matlabroot, 'toolbox', 'slvnv', 'rmidemos', 'slvnvdemo_powerwindowController.mdl'); rmimap.map(tmpfilepath, 'clear'); % forget mdl-to-req mappings clear tmpfilepath; displayEndOfDemoMessage(mfilename)