view m-toolbox/sltpda/getVarBlockCommands.m @ 33:5e7477b94d94 database-connection-manager

Add known repositories list to LTPDAPreferences
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

function cmds = getVarBlockCommands(blocks)

% GETVARBLOCKCOMMANDS get a set of commands from a set of sLTPDA variable blocks.
%
% M Hewitson 27-03-07
%


disp('   + compiling variable block list');

cmds = [];

for j=1:length(blocks)
  b         = blocks(j);
  blocktype = get(b, 'BlockType');
  name      = get(b, 'Name');
  if strcmp(name, 'variable')
    parent    = get(b, 'Parent');
    name = [parent '_' name];
    name = sltpda_reduceVarName(name);

    vname = get(b, 'vname');
    vval  = sltpda_getvar(b, 'vval');
    % store info
    info.fcn      = '';
    info.params   = '';
    info.plist    = plist();
    info.ins      = cellstr(vval);
    info.outs     = cellstr(vname);
    info.outsUsed = [];
    info.cmd      = ['global ' vname '; ' vname ' = [' vval '];']
    info.name     = get(b, 'Name');
    info.handle   = get(b, 'Handle');
    info.ranges   = [];

    cmds = [cmds info];
  end
end