<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Dynamic Mask Dialogs</title>
	<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/</link>
	<description>This blog is about Simulink.</description>
	<pubDate>Mon, 23 Nov 2009 01:20:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Seth</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-700</link>
		<dc:creator>Seth</dc:creator>
		<pubDate>Tue, 03 Mar 2009 02:13:10 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-700</guid>
		<description>@Tom - Buttons can not be added to user written masks using the Mask Editor.  If the mask editor doesn't provide the flexibility you need, make a GUI using M-code or GUIDE and set the OpenFcn for the block to launch your GUI.</description>
		<content:encoded><![CDATA[<p>@Tom - Buttons can not be added to user written masks using the Mask Editor.  If the mask editor doesn&#8217;t provide the flexibility you need, make a GUI using M-code or GUIDE and set the OpenFcn for the block to launch your GUI.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guy Rouleau</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-699</link>
		<dc:creator>Guy Rouleau</dc:creator>
		<pubDate>Tue, 03 Mar 2009 00:31:51 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-699</guid>
		<description>@Tom,

You should have a look at previous posts from Seth, there is an example that exactly address this question:

http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/</description>
		<content:encoded><![CDATA[<p>@Tom,</p>
<p>You should have a look at previous posts from Seth, there is an example that exactly address this question:</p>
<p><a href="http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/" rel="nofollow">http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-697</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Mon, 02 Mar 2009 20:42:28 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-697</guid>
		<description>In the Simulink "discontinuities" library, the "Saturation Dynamic" block has a button in it's dialog, and appears to be a masked subsystem.  The mask uses callbacks and initialization code. I'd like to do something similar in my own custom dialogs. Can you explain how this is done?</description>
		<content:encoded><![CDATA[<p>In the Simulink &#8220;discontinuities&#8221; library, the &#8220;Saturation Dynamic&#8221; block has a button in it&#8217;s dialog, and appears to be a masked subsystem.  The mask uses callbacks and initialization code. I&#8217;d like to do something similar in my own custom dialogs. Can you explain how this is done?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-511</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 27 Aug 2008 12:03:17 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-511</guid>
		<description>Is it possible to dynamically change the MaskStyle, i.e. change the text entries of a popup parameter? 

For example, I would like to have a popup, whichs offers the choice between different parameter files I can load for the block. Now, I don't want to alter the popup manually everytime I add a parameter-file to the list in the library block but rather scan a folder containing the files and create the popup list accordingly. Whenever I try something like this in the dialog callback with 
set_param(blk,'MaskStyles',list) 
the dialog is closed automatically with a warning that a mask parameter has been changed. 

Any suggestions/ideas on how to solve this problem?

Thanks</description>
		<content:encoded><![CDATA[<p>Is it possible to dynamically change the MaskStyle, i.e. change the text entries of a popup parameter? </p>
<p>For example, I would like to have a popup, whichs offers the choice between different parameter files I can load for the block. Now, I don&#8217;t want to alter the popup manually everytime I add a parameter-file to the list in the library block but rather scan a folder containing the files and create the popup list accordingly. Whenever I try something like this in the dialog callback with<br />
set_param(blk,&#8217;MaskStyles&#8217;,list)<br />
the dialog is closed automatically with a warning that a mask parameter has been changed. </p>
<p>Any suggestions/ideas on how to solve this problem?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waqas Mahmood</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-495</link>
		<dc:creator>Waqas Mahmood</dc:creator>
		<pubDate>Mon, 18 Aug 2008 16:15:27 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-495</guid>
		<description>Thanks for the respsonse. My other question is, Tracking with zoom-in/out requires to change the template size from frame to frame, in this particular case, how the template size can be varied dynamically during simulation? If not, what alternate method can I try from within Simulink?

Thanks and Regards
Mahmood</description>
		<content:encoded><![CDATA[<p>Thanks for the respsonse. My other question is, Tracking with zoom-in/out requires to change the template size from frame to frame, in this particular case, how the template size can be varied dynamically during simulation? If not, what alternate method can I try from within Simulink?</p>
<p>Thanks and Regards<br />
Mahmood</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seth</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-494</link>
		<dc:creator>Seth</dc:creator>
		<pubDate>Mon, 18 Aug 2008 02:18:27 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-494</guid>
		<description>@Mahmood - thanks for the good question.  I'm glad Witek was able to respond. (Thanks Witek!)

@Ashish - This is an excellent tip and a very clear example. I'm sure I will be using that in the future.

@Hans-Werner - The hidden/visible state of a mask widget is controlled by the MaskVisibilities parameter.  It uses a cell array of 'on'/'off' values to control your mask. Try:

get_param(blk,'MaskVisibilities')

The method I have used to set values of one popup based on another also involves MaskVisibilities.  This only works if you have a small number of groups to switch between.  Create a separate popup for each group and make the appropriate popup that corresponds to that group visible, and all the alternatives invisible.  The programming gets very complicated to do it this way.  The other option is to build your GUI using GUIDE and replace the OpenFcn for the block.</description>
		<content:encoded><![CDATA[<p>@Mahmood - thanks for the good question.  I&#8217;m glad Witek was able to respond. (Thanks Witek!)</p>
<p>@Ashish - This is an excellent tip and a very clear example. I&#8217;m sure I will be using that in the future.</p>
<p>@Hans-Werner - The hidden/visible state of a mask widget is controlled by the MaskVisibilities parameter.  It uses a cell array of &#8216;on&#8217;/'off&#8217; values to control your mask. Try:</p>
<p>get_param(blk,&#8217;MaskVisibilities&#8217;)</p>
<p>The method I have used to set values of one popup based on another also involves MaskVisibilities.  This only works if you have a small number of groups to switch between.  Create a separate popup for each group and make the appropriate popup that corresponds to that group visible, and all the alternatives invisible.  The programming gets very complicated to do it this way.  The other option is to build your GUI using GUIDE and replace the OpenFcn for the block.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Witek Jachimczyk (team lead for the Video Blockset)</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-491</link>
		<dc:creator>Witek Jachimczyk (team lead for the Video Blockset)</dc:creator>
		<pubDate>Thu, 14 Aug 2008 20:18:35 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-491</guid>
		<description>Mahmood,

&#62;&#62; pos.template_orig = template_orig;
&#62;&#62; pos.template_size = template_size;
&#62;&#62; pos.search_border = search_border;

Both template_size and search_border affect the size of Simulink connections (wires). Simulink requires fixed size connections during runtime, therefore this information must be  gathered prior to running the model.

template_orig provides location information.  It does not affect wire size, therefore it can be set dynamically during runtime.  Although the Stabilization demo doesn't show you how to do it, it's possible to turn the mask input into a port to the Stabilize subsystem.

Witek</description>
		<content:encoded><![CDATA[<p>Mahmood,</p>
<p>&gt;&gt; pos.template_orig = template_orig;<br />
&gt;&gt; pos.template_size = template_size;<br />
&gt;&gt; pos.search_border = search_border;</p>
<p>Both template_size and search_border affect the size of Simulink connections (wires). Simulink requires fixed size connections during runtime, therefore this information must be  gathered prior to running the model.</p>
<p>template_orig provides location information.  It does not affect wire size, therefore it can be set dynamically during runtime.  Although the Stabilization demo doesn&#8217;t show you how to do it, it&#8217;s possible to turn the mask input into a port to the Stabilize subsystem.</p>
<p>Witek</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans-Werner</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-486</link>
		<dc:creator>Hans-Werner</dc:creator>
		<pubDate>Thu, 14 Aug 2008 10:38:29 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-486</guid>
		<description>What if I want to have a parameter that is only visible if another parameter gets a certain value ? For example a popup that is hidden and only visible when I select a checkbox. What if the values of a popup are subject to another popup ? Think of countries and states.</description>
		<content:encoded><![CDATA[<p>What if I want to have a parameter that is only visible if another parameter gets a certain value ? For example a popup that is hidden and only visible when I select a checkbox. What if the values of a popup are subject to another popup ? Think of countries and states.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashish Sadanandan</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-485</link>
		<dc:creator>Ashish Sadanandan</dc:creator>
		<pubDate>Thu, 14 Aug 2008 05:20:50 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-485</guid>
		<description>I wanted to add another tip. When referring to the mask parameters within your callback it's very useful to create a C-style enumeration instead of calling them explicitly by numbers. In the above example, change the callback M file to:

% uplimsrc_cb Dialog Callback
function uplimsrc_cb(blk)

UPPER_LIM_SRC = 1;
UPPER_LIM     = UPPER_LIM_SRC + 1;
LOWER_LIM_SRC = UPPER_LIM + 1;
LOWER_LIM     = LOWER_LIM_SRC + 1;

en = get_param(blk,'MaskEnables');

switch get_param(blk,'uplimsrc')
    case 'external'
        en{UPPER_LIM} = 'off';
    case 'internal'
        en{UPPER_LIM} = 'on';
    otherwise
        disp('Should never get here')
end

set_param(blk,'MaskEnables',en);


This comes in very handy for masks with a large number of parameters and also if you need to add / remove a parameter from the mask.

Ashish.</description>
		<content:encoded><![CDATA[<p>I wanted to add another tip. When referring to the mask parameters within your callback it&#8217;s very useful to create a C-style enumeration instead of calling them explicitly by numbers. In the above example, change the callback M file to:</p>
<p>% uplimsrc_cb Dialog Callback<br />
function uplimsrc_cb(blk)</p>
<p>UPPER_LIM_SRC = 1;<br />
UPPER_LIM     = UPPER_LIM_SRC + 1;<br />
LOWER_LIM_SRC = UPPER_LIM + 1;<br />
LOWER_LIM     = LOWER_LIM_SRC + 1;</p>
<p>en = get_param(blk,&#8217;MaskEnables&#8217;);</p>
<p>switch get_param(blk,&#8217;uplimsrc&#8217;)<br />
    case &#8216;external&#8217;<br />
        en{UPPER_LIM} = &#8216;off&#8217;;<br />
    case &#8216;internal&#8217;<br />
        en{UPPER_LIM} = &#8216;on&#8217;;<br />
    otherwise<br />
        disp(&#8217;Should never get here&#8217;)<br />
end</p>
<p>set_param(blk,&#8217;MaskEnables&#8217;,en);</p>
<p>This comes in very handy for masks with a large number of parameters and also if you need to add / remove a parameter from the mask.</p>
<p>Ashish.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waqas Mahmood</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-484</link>
		<dc:creator>Waqas Mahmood</dc:creator>
		<pubDate>Thu, 14 Aug 2008 02:48:39 +0000</pubDate>
		<guid>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-484</guid>
		<description>In video stabilization demo provided with video and image processing blockset, the 'Stabilization' block has a mask that takes parameters as:
    pos.template_orig = template_orig;
    pos.template_size = template_size;
    pos.search_border = search_border;
Initial inputs are acquied via user dialog. My question is how can i make it dynamic? i.e. pass these parameters to the block in runtime rather than specifying them before running the simulation.

Thanks</description>
		<content:encoded><![CDATA[<p>In video stabilization demo provided with video and image processing blockset, the &#8216;Stabilization&#8217; block has a mask that takes parameters as:<br />
    pos.template_orig = template_orig;<br />
    pos.template_size = template_size;<br />
    pos.search_border = search_border;<br />
Initial inputs are acquied via user dialog. My question is how can i make it dynamic? i.e. pass these parameters to the block in runtime rather than specifying them before running the simulation.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
