Home > m > gui > gltpda > g_copyparams.m

g_copyparams

PURPOSE ^

This is the automatic function wrapper

SYNOPSIS ^

function g_copyparams(block)

DESCRIPTION ^

             This is the automatic function wrapper
 =================================================================
 ================ level-2 M file S-function ======================
 =================================================================
 To save as standalone variable(s) into global shared workspace the AO(s)
 received as input from the corresponding block, executed in Simulink.

  $Id: g_copyparams.m,v 1.1 2008/03/01 13:43:20 nicola Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function g_copyparams(block)
0002 
0003 %             This is the automatic function wrapper
0004 % =================================================================
0005 % ================ level-2 M file S-function ======================
0006 % =================================================================
0007 % To save as standalone variable(s) into global shared workspace the AO(s)
0008 % received as input from the corresponding block, executed in Simulink.
0009 %
0010 %  $Id: g_copyparams.m,v 1.1 2008/03/01 13:43:20 nicola Exp $
0011 
0012 setup(block);
0013   
0014 %%
0015 function setup(block)
0016 
0017   %% Register dialog parameter: none, because they're retrieved directly
0018   %% from the memory. This will prevent the user to modify the parameters
0019   %% outside the proper parameters panel:
0020   block.NumDialogPrms = 0;
0021 
0022   %% Register number of input and output ports
0023   block.NumInputPorts  = 2;
0024   block.NumOutputPorts = 1;
0025 
0026   %% Setup functional port properties to dynamically inherited.
0027   block.SetPreCompInpPortInfoToDynamic;
0028   block.SetPreCompOutPortInfoToDynamic;
0029   
0030   block.InputPort(1).DirectFeedthrough = true;
0031   block.InputPort(1).DatatypeID = 0;
0032   block.InputPort(1).Complexity = 0;
0033 % block.InputPort(1).Dimensions = 2;
0034   block.InputPort(2).DirectFeedthrough = true;
0035   block.InputPort(2).DatatypeID = 0;
0036   block.InputPort(2).Complexity = 0;
0037 % block.InputPort(2).Dimensions = 2;
0038   block.OutputPort(1).DatatypeID = 0;
0039   block.OutputPort(1).Complexity = 0;
0040 % block.OutputPort(1).Dimensions = 1;
0041   block.SampleTimes = [0 0];
0042   block.SetAccelRunOnTLC(false);
0043  
0044   %% Register methods
0045 %   block.RegBlockMethod('SetInputPortSamplingMode',@SetInpPortFrameData);
0046   block.RegBlockMethod('SetInputPortDimensions',  @SetInpPortDims);
0047   block.RegBlockMethod('SetOutputPortDimensions', @SetOutPortDims);
0048   block.RegBlockMethod('Outputs',                 @Outputs);
0049   
0050 %   function SetInpPortFrameData(block, idx, fd)
0051 %   block.InputPort(1).SamplingMode = fd;
0052 %   block.OutputPort(1).SamplingMode = fd;
0053 
0054   function SetInpPortDims(block, idx, di)
0055   block.InputPort(idx).Dimensions = di;
0056 
0057   function SetOutPortDims(block, idx, di)
0058   block.OutputPort(idx).Dimensions = di;
0059 
0060 %%
0061 function Outputs(block)
0062 
0063 % currBlk=get(gcbh,'Parent');
0064   currBlkConnect=get_param(get(gcbh,'Parent'),'PortConnectivity');
0065   parentBlkHandle=currBlkConnect(2).SrcBlock;
0066   childBlkHandle=currBlkConnect(3).DstBlock;
0067   param2copy=get_param(parentBlkHandle,'Description');
0068   set_param(childBlkHandle,'Description',param2copy);
0069   annotation=get_param(parentBlkHandle,'AttributesFormatString');
0070   set_param(childBlkHandle,'AttributesFormatString',annotation);
0071 
0072   block.OutputPort(1).Data = block.InputPort(1).Data;
0073 
0074 %endfunction
0075

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003