Hook functions for RTW
Mostrar comentarios más antiguos
Hi all, I followed the guide for specifying a RTW hook function (namely I copied the ert_make_rtw_hook.m in my path and edited it at my convenience). All I want to do is to move MyModel.trc from my current folder to C:\FolderB at the end of the building process. Therefore, edited the part of code related to the 'exit' phase. What happens at the end of the building process is... nothing. How can I solve it?
Here is how my MyModel_make_rtw_hook.m
function MyModel_make_rtw_hook(hookMethod,modelName,rtwroot,templateMakefile,buildOpts,buildArgs)
switch hookMethod
case 'error'
msg = DAStudio.message('RTW:makertw:buildAborted', modelName);
disp(msg);
case 'entry'
msg = DAStudio.message('RTW:makertw:enterRTWBuild', modelName);
disp(msg);
option = LocalParseArgList(buildArgs);
if ~strcmp(option,'none')
ert_unspecified_hardware(modelName);
cs = getActiveConfigSet(modelName);
cscopy = cs.copy;
ert_auto_configuration(modelName,option);
locReportDifference(cscopy, cs);
end
case 'before_tlc'
case 'after_tlc'
case 'before_make'
case 'after_make'
case 'exit'
if strcmp(get_param(modelName,'GenCodeOnly'),'off')
msgID = 'RTW:makertw:exitRTWBuild';
else
msgID = 'RTW:makertw:exitRTWGenCodeOnly';
end
msg = DAStudio.message(msgID,modelName);
disp(msg);
% Move MyModel.trc into C:\FolderB
movefile MyModel.trc 'C:\FolderB'
end
% Simple parse function to find:
% optimized_fixed_point=1
% optimized_floating_point=1
function option = LocalParseArgList(args)
if strfind(args,'optimized_fixed_point=1')
option = 'optimized_fixed_point';
elseif strfind(args,'optimized_floating_point=1')
option = 'optimized_floating_point';
else
option = 'none';
end
% local function: report difference between the configuration set settings
% before and after running auto-configuration script.
function locReportDifference(cs1, cs2)
[iseq, diffs] = slprivate('diff_config_sets', cs1, cs2, 'string');
if ~iseq
msg = DAStudio.message('RTW:makertw:incompatibleParamsUpdated', diffs);
summary = DAStudio.message('RTW:makertw:autoconfigSummary');
rtwprivate('rtw_disp_info',...
get_param(cs2.getModel, 'Name'),...
summary,...
msg);
end
1 comentario
Ubaldo
el 10 de Mayo de 2017
Respuestas (1)
MATLAB_atian
el 16 de Nov. de 2017
0 votos
Hi can you give me your guide editing the hook function
2 comentarios
Ubaldo
el 17 de Nov. de 2017
Laszlo Dombai
el 16 de En. de 2020
Search for the next text in Matlab Help:
"Customize Build Process with STF_make_rtw_hook File"
Categorías
Más información sobre Deployment, Integration, and Supported Hardware en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!