function dspblkpad(action, varargin)
% DSPBLKPAD DSP Blockset Pad block helper function

% Copyright 1995-2000 The MathWorks, Inc.
% $Revision: 1.2 $ $Date: 2000/06/21 21:25:38 $

% Cache current block
curBlk = gcb;

% Cache current block mask enables
cachedEnables   = get_param(curBlk,'maskenables');
newEnables      = cachedEnables;
padAlongWhatDim = get_param(curBlk,'padAlong');
    
if ( strcmp(padAlongWhatDim, 'Columns') )
    numOutRowsEnabled = 'on';
    numOutColsEnabled = 'off';
elseif ( strcmp(get_param(curBlk,'padAlong'), 'Rows') )
    numOutRowsEnabled = 'off';
    numOutColsEnabled = 'on';
elseif ( strcmp(get_param(curBlk,'padAlong'), 'Columns and rows') )
    numOutRowsEnabled = 'on';
    numOutColsEnabled = 'on';    
else
    % 'None' or unrecognized case
    numOutRowsEnabled = 'off';
    numOutColsEnabled = 'off';
end

newEnables{1} = 'on';
newEnables{2} = 'on';
newEnables{3} = numOutRowsEnabled;
newEnables{4} = numOutColsEnabled;

% Only update the block mask enables if they have changed
if ~(isequal(cachedEnables, newEnables))
    set_param(curBlk, 'maskenables', newEnables);
end

% [EOF] dspblkpad.m
