主要内容

accept

R2026b

Accept detected change in Safety Analysis Manager document

Since R2024b

Description

accept(detectedChange) accepts the detected change in the Safety Analysis Manager document.

This function requires Requirements Toolbox™.

example

Examples

collapse all

Open the example and the project.

openExample("faultanalyzer/ChangeTrackingSpreadsheetExample")
openProject("EvaluateFaultsFuelSystemProject");

The example contains a model and a Safety Analysis Manager spreadsheet that does not have links or faults. Open the sldemo_fuelsys_fault_analyzer model and the FuelSysFMEA.mldatx spreadsheet. Create faults and links between the faults and the spreadsheet by using the fuelSysFaultSetupProject helper function.

mdl = "sldemo_fuelsys_fault_analyzer";
open_system(mdl);
FMEAName = safetyAnalysisMgr.openDocument("FuelSysFMEA.mldatx");
fuelSysFaultSetupProject

Get the fault from the model on the third input port of the To Controller subsystem by using the Simulink.fault.findFaults function.

myFault = Simulink.fault.findFaults(...
mdl,ModelElement=mdl + "/To Controller/Inport/3");

Set the trigger time of the fault to 10 by changing the Fault object property values and save the fault information by using the Simulink.fault.save function.

myFault.StartTime = 10;
Simulink.fault.save(mdl)

Detect the changes to the linked artifact in the FuelSysFMEA.mldatx spreadsheet by using the detectChanges function on the spreadsheet, and retrieve the ChangeInformation objects of the changes.

detectChanges(FMEAName)
myChanges = getChanges(FMEAName);

Accept the first change.

accept(myChanges(1))

Since R2026b

Open the example and the project.

openExample("faultanalyzer/ChangeTrackingFaultTreeDocumentExample")
openProject("aircraftElevatorFaultTreeProject");

The project contains a fault tree document, an architecture model, and a link set. Open the aircraftElevatorPlantArchitecture model and the elevatorFaultTree.mldatx fault tree document.

mdl = "aircraftElevatorPlantArchitecture";
open_system(mdl);
FaultTreeDoc = safetyAnalysisMgr.openDocument(...
  "elevatorFaultTree.mldatx");

Delete the fault in the Measured Hydraulic Pressure System 1 component.

Simulink.fault.deleteFault(mdl + "/Measured Hydraulic Pressure System 1" + ... 
"/Hydraulic Pressure/Outport/1")

Save the fault information by using the Simulink.fault.save function.

Simulink.fault.save(mdl)

Detect the changes to the linked artifact in elevatorFaultTree.mldatx by using the detectChanges function on the fault tree document, and retrieve the ChangeInformation objects of the changes.

detectChanges(FaultTreeDoc)
myChanges = getChanges(FaultTreeDoc);

Accept the change.

accept(myChanges(1))

Input Arguments

collapse all

Detected change in the Safety Analysis Manager document, returned as a ChangeInformation object.

Version History

Introduced in R2024b

expand all