Mercurial > hg > ltpda
view m-toolbox/classes/@parfrac/update_struct.m @ 47:dd93c9ba6624 database-connection-manager
Fix Java dialog
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Tue, 06 Dec 2011 19:07:27 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
% UPDATE_STRUCT update the input structure to the current ltpda version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % FUNCTION: update_struct % % DESCRIPTION: UPDATE_STRUCT update the input structure to the current % ltpda version % % CALL: obj_struct = update_struct(obj_struct, version_str); % % VERSION: $Id: update_struct.m,v 1.5 2009/08/31 17:16:30 ingo Exp $ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function varargout = update_struct(varargin) obj_struct = varargin{1}; struct_ver = varargin{2}; % get the version of the current toolbox tbx_ver = strtok(getappdata(0, 'ltpda_version')); % get only the version string without the MATLAB version struct_ver = strtok(struct_ver); %%%%%%%%%%%%%%%%%%%%%%% Update version '1.0 -> 1.9.1' %%%%%%%%%%%%%%%%%%%%%%% if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ... strcmp(struct_ver, '1.0') struct_ver = '1.9.1'; end %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.1' ->'1.9.2' %%%%%%%%%%%%%%%%%%%%%%% if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ... strcmp(struct_ver, '1.9.1') struct_ver = '1.9.2'; end %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.2' ->'1.9.3' %%%%%%%%%%%%%%%%%%%%%%% if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ... strcmp(struct_ver, '1.9.2') struct_ver = '1.9.3'; end %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.3' ->'1.9.4' %%%%%%%%%%%%%%%%%%%%%%% if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ... strcmp(struct_ver, '1.9.3') %%% created if isfield(obj_struct, 'created') obj_struct = rmfield(obj_struct, 'created'); end %%% creator if isfield(obj_struct, 'creator') obj_struct = rmfield(obj_struct, 'creator'); end struct_ver = '1.9.4'; end %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.4' ->'2.0' %%%%%%%%%%%%%%%%%%%%%%% if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ... strcmp(struct_ver, '1.9.4') % It might be possible that the poles is a pz-object or a struct for ss = 1:numel(obj_struct) if isa(obj_struct(ss).poles, 'pz') || isstruct(obj_struct(ss).poles) ps = []; for ii = 1:numel(obj_struct(ss).poles) if ~isnan(obj_struct(ss).poles(ii).ri(1)) if numel(obj_struct(ss).poles(ii).ri) == 2 ps = [ps obj_struct(ss).poles(ii).ri(1) obj_struct(ss).poles(ii).ri(2)]; else ps = [ps obj_struct(ss).poles(ii).ri(1)]; end end end obj_struct(ss).poles = ps; end % if the property 'pmul' doesn't exist then add this fieldname and % compute the values if ~isfield(obj_struct, 'pmul') obj_struct(ss).pmul = mpoles( obj_struct(ss).poles, 1e-15, 0 ).'; end end struct_ver = '2.0'; end %%%%%%%%%%%%%%%%%%%%%%% Update version '2.0' ->'2.0.1' %%%%%%%%%%%%%%%%%%%%%%% if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ... strcmp(struct_ver, '2.0') struct_ver = '2.0.1'; end %%%%%%%%%%%%%%%%%%%%%%% Update version '2.0.1' ->'2.1' %%%%%%%%%%%%%%%%%%%%%%% if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ... strcmp(struct_ver, '2.0.1') struct_ver = '2.1'; end varargout{1} = obj_struct; end