Main Content

DocumentFlag

Flags in Safety Analysis Manager

Since R2023b

Description

DocumentFlag objects represent flags in Safety Analysis Manager spreadsheet cells. Use DocumentFlag objects to configure flags you use for safety analyses.

Creation

To create a DocumentFlag object, use the getFlags function to retrieve the flags in a Safety Analysis Manager spreadsheet or a single spreadsheet cell.

Properties

expand all

This property is read-only.

Type of flag, returned as one of these values:

ValueDescription
'error'

An error flag. Cells with an error flag display the error icon .

'warning'

A warning flag. Cells with a warning flag display the warning icon .

'check'

A check flag. Cells with a check flag display the check icon .

Data Types: enumeration

This property is read-only.

Description of the flag, returned as a character vector.

Data Types: char

This property is read-only.

Flag tag, returned as a character vector.

Data Types: char

This property is read-only.

Cell in the Safety Analysis Manager spreadsheet that contains the flag, returned as a SpreadsheetCell object.

Object Functions

clearClear Safety Analysis Manager document flag

Examples

collapse all

Create a new Safety Analysis Manager spreadsheet.

mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;

Add two text columns and two rows to the spreadsheet.

addRow(mySpreadsheet,Count=2)
addColumn(mySpreadsheet,Count=2)

Retrieve the SpreadsheetCell objects for the cells in the second column.

for n = 1:mySpreadsheet.Rows
  myCells(n) = getCell(mySpreadsheet,n,2);
end

Add a warning flag to the cells in the first and second row of the second column.

addFlag(myCells(1),"warning")
addFlag(myCells(2),"warning")

Retrieve the DocumentFlag objects from the spreadsheet.

myFlags = getFlags(mySpreadsheet);

Create a new Safety Analysis Manager spreadsheet.

mySpreadsheet = safetyAnalysisMgr.newSpreadsheet;

Add two text columns and two rows to the spreadsheet.

addRow(mySpreadsheet,Count=2)
addColumn(mySpreadsheet,Count=2)

Retrieve the SpreadsheetCell objects for the cells in the second column.

for n = 1:mySpreadsheet.Rows
  myCells(n) = getCell(mySpreadsheet,n,2);
end

Add a warning flag to the cells in the first and second row of the second column.

addFlag(myCells(1),"warning")
addFlag(myCells(2),"warning")

Retrieve the DocumentFlag object from the cell in the first row.

myFlags = getFlags(myCells(1));

Version History

Introduced in R2023b