view m-toolbox/m/gui/ltpdv/callbacks/ltpdv_importObjs.m @ 29:54f14716c721
database-connection-manager
Update Java code
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Mon, 05 Dec 2011 16:20:06 +0100 (2011-12-05)
parents
f0afece42f48
children
line source
+ − function ltpdv_importObjs(varargin)
+ − % LTPDV_IMPORTOBJS import given objects to the object list
+ − %
+ − % M Hewitson 22-04-08
+ − %
+ − % $Id: ltpdv_importObjs.m,v 1.2 2008/06/18 15:07:35 hewitson Exp $
+ − %
+ −
+ − myh = varargin{1};
+ − mainfig = varargin{end-1};
+ − oh = varargin{end};
+ −
+ − % Get data
+ − data = get(oh, 'Data');
+ −
+ − % Get selected rows
+ − rows = getappdata(mainfig, 'ImportWorkspaceSelectedRows');
+ −
+ − % Do we rename to variable name?
+ − ch = findobj(mainfig, 'Tag', 'LTPDVusevarnameChk');
+ − if get(ch, 'Value')
+ − useVarname = true;
+ − else
+ − useVarname = false;
+ − end
+ −
+ − % Data to import
+ − idata = data(rows,:);
+ − % Current objects
+ − % Get each object from the workspace
+ − for j=1:size(idata,1)
+ − % get variable name
+ − varname = idata{j,1};
+ − % get object
+ − obj = evalin('base', varname);
+ − if useVarname
+ − for k=1:numel(obj)
+ − obj(k) = obj(k).setName(varname);
+ − end
+ − end
+ − % Add these objecs to the object list
+ − for j=1:numel(obj)
+ − objs = getappdata(mainfig, 'LTPDAobjects');
+ − setappdata(mainfig, 'LTPDAobjects', [objs {obj(j)}]);
+ − end
+ − % Refresh object list
+ − ltpdv_refresh_object_list(mainfig);
+ − end
+ −
+ −
+ −
+ − % END