diff m-toolbox/m/gui/gltpda/g_cleaninput.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/m/gui/gltpda/g_cleaninput.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,67 @@
+function g_cleaninput(block)
+
+%             This is the automatic function wrapper
+% =================================================================
+% ================ level-2 M file S-function ======================
+% =================================================================
+% To remove an object from the list of the inputs.
+%
+%  $Id: g_cleaninput.m,v 1.1 2008/04/10 15:27:52 nicola Exp $
+
+setup(block);
+  
+%%
+function setup(block)
+
+  %% Register dialog parameter: none, because they're retrieved directly
+  %% from the memory. This will prevent the user to modify the parameters
+  %% outside the proper parameters panel:
+  block.NumDialogPrms = 0;
+
+  %% Register number of input and output ports
+  block.NumInputPorts  = 2;
+  block.NumOutputPorts = 1;
+
+  %% Setup functional port properties to dynamically inherited.
+  block.SetPreCompInpPortInfoToDynamic;
+  block.SetPreCompOutPortInfoToDynamic;
+  
+  block.InputPort(1).DirectFeedthrough = true;
+  block.InputPort(1).DatatypeID = 0;
+  block.InputPort(1).Complexity = 0;
+% block.InputPort(1).Dimensions = 2;
+  block.InputPort(2).DirectFeedthrough = true;
+  block.InputPort(2).DatatypeID = 0;
+  block.InputPort(2).Complexity = 0;
+% block.InputPort(2).Dimensions = 2;
+  block.OutputPort(1).DatatypeID = 0;
+  block.OutputPort(1).Complexity = 0;
+% block.OutputPort(1).Dimensions = 1;
+  block.SampleTimes = [0 0];
+  block.SetAccelRunOnTLC(false);
+ 
+  %% Register methods
+%   block.RegBlockMethod('SetInputPortSamplingMode',@SetInpPortFrameData);
+  block.RegBlockMethod('SetInputPortDimensions',  @SetInpPortDims);
+  block.RegBlockMethod('SetOutputPortDimensions', @SetOutPortDims);
+  block.RegBlockMethod('Outputs',                 @Outputs);
+  
+%   function SetInpPortFrameData(block, idx, fd)
+%   block.InputPort(1).SamplingMode = fd;
+%   block.OutputPort(1).SamplingMode = fd;
+
+  function SetInpPortDims(block, idx, di)
+  block.InputPort(idx).Dimensions = di;
+
+  function SetOutPortDims(block, idx, di)
+  block.OutputPort(idx).Dimensions = di;
+
+%%
+function Outputs(block)
+    global LTPDAinvar
+    
+    LTPDAinvar{block.InputPort(2).Data,1} = [];
+    block.OutputPort(1).Data = block.InputPort(1).Data;
+
+%endfunction 
+