フィルターのクリア

Simulink - Input Dialog box while saving the model

2 ビュー (過去 30 日間)
Kaushik
Kaushik 2023 年 11 月 29 日
コメント済み: Kaushik 2024 年 1 月 10 日
Hello Everyone,
I am using MATLAB 2018B and TargetLink 4.4 for code generation.
In my generated code, I want to include the version of the model file, which is checked in to the version control. I am able to include this information by using a custom code block. Now I want to have an input dialog box while closing the model, in which user will give the next version number manually before saving the model. This will help in minimizing missing out on updating the version info in the model and thereby in the generated code. I have already tried with the message prompt for the history. But, it does not allow user to update the model version. Also, the model version update can be set to %<AutoIncrement>, but, that's not what I want. I want the version number of the version control tool to be included in the model and the generated code.
Any help will be much appreciated.
Thank you in advance,
Regards,
Kaushik Datye
  1 件のコメント
Kaushik
Kaushik 2023 年 11 月 29 日
A small mistake in the question above. I want to have a dialog box while saving the model, not while closing the model.

サインインしてコメントする。

採用された回答

Fangjun Jiang
Fangjun Jiang 2023 年 11 月 29 日
Utilize the 'PreSaveFcn' callback of the model, where you can launch a dialog window, ask the user to input a new version number, then use set_param() to write the new version number to the model.
This is all manual. To read the version number of the version control software and write it to the model, you need to check the API of that version control software.
  2 件のコメント
Kaushik
Kaushik 2024 年 1 月 10 日
Thanks a lot Jiang, I'll try this way and reply to this message again. I appreciate your efforts.
Kaushik
Kaushik 2024 年 1 月 10 日
It has worked well. I also used CloseFcn to remove the variable from the workspace.
Thank you, Jiang.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by