MATLAB 帮助中心
本页采用了机器翻译。点击此处可查看最新英文版本。
类: slreq.ReqSet 命名空间: slreq
获取 PostLoadFcn 回调的内容
PostLoadFcn
自 R2022a 起
callback = getPostLoadFcn(rs)
callback = getPostLoadFcn(rs) 返回需求集 rs 的 PostLoadFcn 回调的内容。
callback
rs
全部展开
slreq.ReqSet
需求集,指定为 slreq.ReqSet 对象。
需求集的 PostLoadFcn 回调脚本的内容,以字符向量形式返回。
此示例显示如何获取和设置需求集的 PostLoadFcn 回调。
将当前文件夹添加到路径中。
addpath(pwd)
打开 ShortestPath 工程。
ShortestPath
openProject("ShortestPath");
打开 shortest_path_tests_reqs 需求集。需求集包含测试需求,描述了为了验证工程中的 shortest_path 算法必须通过测试用例测试的功能行为。
shortest_path_tests_reqs
shortest_path
testReqs = slreq.open("shortest_path_tests_reqs");
将 postLoadTestReqs 脚本注册为 PostLoadFcn 回调。
postLoadTestReqs
setPostLoadFcn(testReqs,"postLoadTestReqs");
确认 postLoadTestReqs 脚本是 PostLoadFcn 需求集的 shortest_path_tests_reqs 回调。
callbackScript = getPostLoadFcn(testReqs)
callbackScript = 'postLoadTestReqs'
保存并关闭 shortest_path_tests_reqs 需求集,然后重新打开需求集。PostLoadFcn 回调会执行。
save(testReqs); close(testReqs); testReqs = slreq.load("shortest_path_tests_reqs");
postLoadTestReqs 脚本打开与测试需求相关的测试文件 graph_unit_tests.m 并从 myViewSettings.mat 导入需求编辑器视图设置。
graph_unit_tests.m
myViewSettings.mat
type postLoadTestReqs.m
open("graph_unit_tests.m"); slreq.importViewSettings("myViewSettings.mat",1);
在 R2022a 中推出
slreq.ReqSet | setPostLoadFcn | setPreSaveFcn | getPreSaveFcn
setPostLoadFcn
setPreSaveFcn
getPreSaveFcn
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处