How to refresh System Target File (.tlc) SelectCallback?
Mostrar comentarios más antiguos
I have a custom target file that is based on ert.tlc. I am editing the target-specific code generation options for a model's Configuration Parameters dialog box using a custom SelectCallback script (e.g., custom_ert_callback.m). In my custom_ert.tlc I have:
rtwgensettings.SelectCallback = 'custom_ert_callback(hDlg,hSrc)';
Using this SelectCallback, I am changing some of the configuration parameters to be specific values for my custom target, or disabling some altogether so the user can't edit it themselves. For example:
slConfigUISetVal(hDlg,hSrc,'ArrayBoundsChecking', 'error'); % Set parameter
slConfigUISetEnabled(hDlg,hSrc,'ArrayBoundsChecking', false); % Disable users from changing it
My question is, after changes are made to the callback, how do I refesh the target to reflect the changes in a model's configuration parameters? For example, I have a closed model that is already using my custom target (i.e. the SystemTargetFile parameter is already set to custom_ert.tlc). I then change the custom_ert_callback.m to apply the above changes, that is, make the ArrayBoundsChecking parameter disabled and set it to 'error'. When I open the model, and view the Configuration Parameters, this field is still enabled and the value is still set to 'none'. Is there a way to ensure the changes are registered? I essentially want something akin to the sl_refresh_customizations command, but for tlc callbacks.
The only way I can acheive a 'refresh' is to set the target file back to ert.tlc, and then back again to my custom tlc:
set_param(gcs, 'SystemTargetFile', 'ert.tlc');
set_param(gcs, 'SystemTargetFile', 'custom_ert.tlc');
Is there a better way?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Custom Software for Target 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!