setPostLoadFcn
Class: slreq.ReqSet
Package: slreq
Syntax
setPostLoadFcn(rs,callbackScript)
Description
setPostLoadFcn(
assigns the script specified by rs
,callbackScript
)callbackScript
as the
PostLoadFcn
callback script for the requirement set
rs
.
Input Arguments
rs
— Requirement set
slreq.ReqSet
object
Requirement set, specified as an slreq.ReqSet
object.
callbackScript
— Name of script to register
string scalar | character vector
Name of the script to register as the PostLoadFcn
callback for
the requirement set, specified as a string scalar or character vector.
Examples
Get and Set PostLoadFcn
Callback
This example shows how to get and set the PostLoadFcn
callback for a requirement set.
Add the current folder to the path.
addpath(pwd)
Open the ShortestPath
project.
openProject("ShortestPath");
Open the shortest_path_tests_reqs
requirement set. The requirement set contains test requirements that describe the functional behavior that must be tested by a test case in order to verify the shortest_path
algorithm in the project.
testReqs = slreq.open("shortest_path_tests_reqs");
Register the postLoadTestReqs
script as the PostLoadFcn
callback.
setPostLoadFcn(testReqs,"postLoadTestReqs");
Confirm that the postLoadTestReqs
script is the PostLoadFcn
callback for the shortest_path_tests_reqs
requirement set.
callbackScript = getPostLoadFcn(testReqs)
callbackScript = 'postLoadTestReqs'
Save and close the shortest_path_tests_reqs
requirement set, then re-open the requirement set. The PostLoadFcn
callback executes.
save(testReqs);
slreq.clear;
testReqs = slreq.load("shortest_path_tests_reqs");
The postLoadTestReqs
script opens the test file associated with the test requirements, graph_unit_tests.m
and imports the Requirements Editor view settings from myViewSettings.mat
.
type postLoadTestReqs.m
open("graph_unit_tests.m"); slreq.importViewSettings("myViewSettings.mat",1);
Version History
Introduced in R2022a
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)