comparison m-toolbox/m/gui/gltpda/g_pl2ao.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 function g_pl2ao(block)
2 % For the block plist2AO : let the user to build a plist and convert it
3 % into an AO in memory at the time of execution.
4
5 % $Id: g_pl2ao.m,v 1.1 2008/03/01 13:43:20 nicola Exp $Revision: 1.1 $
6
7 setup(block);
8
9 %%
10 function setup(block)
11
12 %% Register dialog parameter: none, because they're retrieved directly
13 %% from the memory. This will prevent the user to modify the parameters
14 %% outside the proper parameters panel:
15 block.NumDialogPrms = 0;
16
17 %% Register number of input and output ports
18 block.NumInputPorts = 0;
19 block.NumOutputPorts = 1;
20
21 %% Setup functional port properties to dynamically inherited.
22 block.SetPreCompOutPortInfoToDynamic;
23
24 block.OutputPort(1).DatatypeID = 0;
25 block.OutputPort(1).Complexity = 0;
26 block.OutputPort(1).Dimensions = 1;
27 block.OutputPort(1).SamplingMode = 'sample';
28 block.SampleTimes = [0 0];
29 block.SetAccelRunOnTLC(false);
30
31 %% Register methods
32 % block.RegBlockMethod('SetOutputPortDimensions', @SetOutPortDims);
33 block.RegBlockMethod('Outputs', @Outputs);
34
35 % function SetOutPortDims(block, idx, di)
36 % block.OutputPort(idx).Dimensions = 1;
37
38
39 %%
40 function Outputs(block)
41 global LTPDAinvar
42
43 currhandle=gcbh;
44 currparent=get_param(currhandle,'Parent');
45
46 paramcommand = get_param(currparent,'Description');
47 eval(paramcommand)
48 try
49 outdata = ao(params);
50 catch
51 outdata = ao(1);
52 end
53
54
55 xx = size(LTPDAinvar,1);
56 LTPDAinvar(xx+1,:) = [num2cell(outdata),0];
57 % LTPDAinvar{xx+1} = {outdata,0};
58 block.OutputPort(1).Data = xx+1;
59