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:
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?