Simulink: Setting Mask's tab visibility

Dear all,
Recently i'm facing difficulty of setting the visibility of masked parameter. Here's my problem...
I already created masked subsystem in Simulink. The mask have four tabs; Movers, Diesel Parameter, Motor Parameter and Gas Tubine Parameter
In the first tab (Movers), i created pop-up button called "Movers" with three option (Diesel;Motor;Gas Turbine).
Based on the selection on the pop-up button "Movers", i would like to show applicable tab only. So ideally, user will should see 2 tabs on the mask, "Movers" and (say) Mover's parameter.
It won't be so much trouble if each parameter's tab only have several inputs. I mean i can set each parameter's visibility manually. But, since the mask have in total 30 parameters, it's a big hassle to manually set the visibility on or off (for each parameter)
My question,
  • Is there a way to get_param list of the parameters based on their tab?
  • Is there also a way to set_param the parameters visibility based on their tab?
Thanks,
IH

1 件のコメント

Ilham Hardy
Ilham Hardy 2012 年 8 月 23 日
Anyone have an idea on how to do this?
Before i embark to the point with no return? (manually setting visibility for each parameter)

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

 採用された回答

TAB
TAB 2012 年 8 月 23 日

0 投票

AFAIK, you can not completely disable a tab. But, using below piece of code, you can turn-off the visibility of all parameters present in a particular tab.
% Get all Tab Names returned in cell array
TabNames = get_param(gcbh,'MaskTabNames');
% Get visibility of all parameters
TabVis = get_param(gcbh,'MaskVisibilities');
% Find the index of Tab in which, you want to disable parameters
DisableTabIdx = find(strcmp(TabNames,'TabNameHere'));
% Turn of the visibility of parameters present in the Tab
for x=1:length(DisableTabIdx)
TabVis{DisableTabIdx(x)}='off';
end
% Pass the modify visibility values to block
set_param(gcbh,'MaskVisibilities',TabVis)

3 件のコメント

Ilham Hardy
Ilham Hardy 2012 年 8 月 23 日
Thanks a lot..
I know something like this should be possible.. (Just don't know how..)
Tudor
Tudor 2015 年 6 月 4 日
This sholution no longer works, as 'MaskTabNames' no longer returns the names of the tabs. Do you know of any solution to this problem?
Alexander Hackner
Alexander Hackner 2016 年 12 月 19 日
You can turn the Tab visibility of.
p=Simulink.Mask.get(gcb);
p.getDialogControl('TabName').Visible='off';

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

製品

質問済み:

2012 年 8 月 22 日

コメント済み:

2016 年 12 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by