Requirements Manager: How to extract information from the Custom Attribute Registry inside the Requirement Set class
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Luca
el 20 de Jun. de 2024
Comentada: Luca
el 21 de Jun. de 2024
Hi all,
I have reached a good level of export requirements in the exel format using the guide indicated to me by the Matlab community: https://www.mathworks.com/help/slrequirements/ug/export-requirements-and-link-information-example.html
Now I would like to enrich the export by including the custom requirements. The method slreq.open('Name.slreqx') return me the requirement set structure but using the slreq.find() the custom attribute is not included. How can I achieve this, if it is possible? Thanks
Attached an image to show my sysReqSeqSet structure after running slreq.open('Req_TestMod_v2.slreqx') with two custom attributes added 'CustomAttributeNames', that I would like to export to the exel file along with the others.
Thank you in advance.
0 comentarios
Respuesta aceptada
Pat Canny
el 20 de Jun. de 2024
You can get an array of CustomAttributeNames as a property of a Requirement Set, then use inspectAttribute to query the Information for a given Custom Attribute.
Here is a quick example leveraging the example from the inspectAttribute page in our documentation:
slreq.load('crs_req_func_spec');
rs = slreq.find('Type','ReqSet');
addAttribute(rs,'MyCheckbox','Checkbox','Description',...
'This checkbox attribute can be true or false.');
addAttribute(rs,'MyEdit','Edit','Description',...
'This is an Edit field');
customAttributeNames = string(rs.CustomAttributeNames)';
customAttributeInfo = arrayfun(@(x) string(inspectAttribute(rs,customAttributeNames(x)).description), 1:numel(customAttributeNames))';
tableForExport = table(customAttributeNames,customAttributeInfo,'VariableNames',["Custom Attribute", "Info"])
From here you can use writetable to export to Excel.
Más respuestas (0)
Ver también
Categorías
Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!