フィルターのクリア

How do I flow Block Annotation settings through a Configurable Subsystem?

4 ビュー (過去 30 日間)
Bill
Bill 2014 年 11 月 5 日
コメント済み: Bill 2014 年 11 月 6 日
When using a Configurable Subsystem block to switch between library blocks I see the Configurable Subsystem does a nice job of representing the mask properties in the chosen block. However, Block Annotation is not showing up. Is there a way to flow up the Block Annotation properties? Normally I am showing parameter values below the blocks by using Block Annotation but this doesn’t work if I wrap the blocks in a Configurable Subsystem.

採用された回答

Sreeram Mohan
Sreeram Mohan 2014 年 11 月 6 日
Hi Bill,
You could try something like this, I am not sure if this will work but worth a try : In the copyfcn call back of the configurable subsystem template block add a call back 1) Get the current block choice 2) Get the full path of the block and then get the paremeter values that are needed. 3) Concatenate all of the values into a string 4) set the AttributesFormatString property with the string formed in step 3. set_param(gcb, 'AttributesFormatString', string);
If the copyFcn callback does not work you could may be create a subsystem on the configurable subsystem block and use set_param(gcb, 'AttributesFormatString', string)on by getting the properties in the model. This would definitely work but adds a extra layer (but its virtual subsystem so should not be a performance hit though!!)
Hope this helps !!!
Sreeram
  1 件のコメント
Bill
Bill 2014 年 11 月 6 日
Thanks Sreeram -
To get the values within the selected block I can use: Par1 = get_param([gcb,'/',get_param(gcb, 'BlockChoice')], 'Par1'); Par2 = get_param([gcb,'/',get_param(gcb, 'BlockChoice')], 'Par2'); set_param(gcb, 'AttributesFormatString', [Par1, ' / ', Par2]);
OR Alternatively to just copy the Block Annotation: set_param(gcb, 'AttributesFormatString', get_param([gcb,'/',get_param(gcb, 'BlockChoice')], 'AttributesFormatString'))
I put the code into the InitFcn callback to run when model is updated.
Thanks for the help! - Bill

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSubsystems についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by