Home > m > gui > gltpda > g_pl2ao.m

g_pl2ao

PURPOSE ^

For the block plist2AO : let the user to build a plist and convert it

SYNOPSIS ^

function g_pl2ao(block)

DESCRIPTION ^

 For the block plist2AO : let the user to build a plist and convert it
 into an AO in memory at the time of execution.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function g_pl2ao(block)
0002 % For the block plist2AO : let the user to build a plist and convert it
0003 % into an AO in memory at the time of execution.
0004 
0005 %  $Id: g_pl2ao.m,v 1.1 2008/03/01 13:43:20 nicola Exp $Revision: 1.1 $
0006 
0007 setup(block);
0008   
0009 %%
0010 function setup(block)
0011 
0012   %% Register dialog parameter: none, because they're retrieved directly
0013   %% from the memory. This will prevent the user to modify the parameters
0014   %% outside the proper parameters panel:
0015   block.NumDialogPrms = 0;
0016 
0017   %% Register number of input and output ports
0018   block.NumInputPorts  = 0;
0019   block.NumOutputPorts = 1;
0020 
0021   %% Setup functional port properties to dynamically inherited.
0022   block.SetPreCompOutPortInfoToDynamic;
0023   
0024   block.OutputPort(1).DatatypeID = 0;
0025   block.OutputPort(1).Complexity = 0;
0026   block.OutputPort(1).Dimensions = 1;
0027   block.OutputPort(1).SamplingMode = 'sample';
0028   block.SampleTimes = [0 0];
0029   block.SetAccelRunOnTLC(false);
0030  
0031   %% Register methods
0032 % block.RegBlockMethod('SetOutputPortDimensions', @SetOutPortDims);
0033   block.RegBlockMethod('Outputs',                 @Outputs);
0034   
0035 % function SetOutPortDims(block, idx, di)
0036 % block.OutputPort(idx).Dimensions = 1;
0037 
0038 
0039 %%
0040 function Outputs(block)
0041 global LTPDAinvar
0042 
0043   currhandle=gcbh;
0044   currparent=get_param(currhandle,'Parent');
0045 
0046   paramcommand = get_param(currparent,'Description');
0047   eval(paramcommand)
0048   try
0049       outdata = ao(params);
0050   catch
0051       outdata = ao(1);
0052   end
0053 
0054 
0055   xx = size(LTPDAinvar,1);
0056   LTPDAinvar(xx+1,:) = [num2cell(outdata),0];
0057 %   LTPDAinvar{xx+1} = {outdata,0};
0058   block.OutputPort(1).Data = xx+1;
0059

Generated on Mon 31-Mar-2008 13:54:54 by m2html © 2003