Configure Simulink to ask for new model version when saving the model

조회 수: 8 (최근 30일)
Currently, Simulink can be configured to prompt for a comment each time a model is saved.
I do not want it to increment the version number on its own, so I have removed the AutoIncrement macro in the History section of Model properties.
Although, I would like to have the option of choosing the model version number along with the message each time when saving the model if possible so as to increment both major and minor releases at my own pace, conveniently, and without forgetting.
Currently using MATLAB 2017b
Thanks for the help!

채택된 답변

Urmila Rajpurohith
Urmila Rajpurohith 2020년 11월 3일
This might be possible using model callbacks, but it would have to be added to every model manually, or to the default Simulink template.
EX:
open the model
set_param(bdroot, 'presavefcn', 'str=inputdlg;set_param(bdroot, ''ModelVersionFormat'', str{1})')

추가 답변 (1개)

Urmila Rajpurohith
Urmila Rajpurohith 2020년 10월 23일
Hi
If you want to change the model version you can use "set_param" function before saving the model.
for example if you want to change the model version to 1.10, then you can use
set_param(modelname,'Modelversionformat','1.10')
Hope this helps!
  댓글 수: 3
Urmila Rajpurohith
Urmila Rajpurohith 2020년 10월 30일
Hi
Can you tell us more details about why you require this workflow?
because many people would use source control tool features to do this kind of tracking rather than depending on the user typing in information on each model save.
Ansh Gandhi
Ansh Gandhi 2020년 11월 2일
편집: Ansh Gandhi 2020년 11월 2일
Hi,
I understand what you mean, in this case this workflow seems important in order to align all modelling activities and versions across different teams according to common release naming standards for major and minor versions. The documentation of the models need to be tied to SW version so having the model version number same as SW version number seemed like a good idea. Then the user needs to remember to update the major version of the model which maybe this prompt could help with. Commit ids and version control have been useful in the past, but documentation seems to be coupled more with model version number rather than commit id, which is more human readable as well.
I hope that made sense!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by