comparison m-toolbox/classes/@ssmport/update_struct.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 % UPDATE_STRUCT update the input structure to the current ltpda version
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % FUNCTION: update_struct
5 %
6 % DESCRIPTION: UPDATE_STRUCT update the input structure to the current
7 % ltpda version
8 %
9 % CALL: obj_struct = update_struct(obj_struct, version_str);
10 %
11 % VERSION: $Id: update_struct.m,v 1.4 2011/02/18 16:48:55 ingo Exp $
12 %
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
15 function varargout = update_struct(varargin)
16 utils.helper.msg(utils.const.msg.MNAME, ['running ', mfilename]);
17
18 obj_struct = varargin{1};
19 struct_ver = varargin{2};
20
21 % get the version of the current toolbox
22 tbx_ver = strtok(getappdata(0, 'ltpda_version'));
23
24 % get only the version string without the MATLAB version
25 struct_ver = strtok(struct_ver);
26
27 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.0 -> 1.9.1' %%%%%%%%%%%%%%%%%%%%%%%
28
29 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
30 strcmp(struct_ver, '1.0')
31
32 struct_ver = '1.9.1';
33 end
34
35 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.1' ->'1.9.2' %%%%%%%%%%%%%%%%%%%%%%%
36
37 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
38 strcmp(struct_ver, '1.9.1')
39
40 struct_ver = '1.9.2';
41 end
42
43 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.2' ->'1.9.3' %%%%%%%%%%%%%%%%%%%%%%%
44
45 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
46 strcmp(struct_ver, '1.9.2')
47
48 struct_ver = '1.9.3';
49 end
50
51 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.3' ->'1.9.4' %%%%%%%%%%%%%%%%%%%%%%%
52
53 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
54 strcmp(struct_ver, '1.9.3')
55
56 struct_ver = '1.9.4';
57 end
58
59 %%%%%%%%%%%%%%%%%%%%%%% Update version '1.9.4' ->'2.0' %%%%%%%%%%%%%%%%%%%%%%%
60
61 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
62 strcmp(struct_ver, '1.9.4')
63
64 struct_ver = '2.0';
65 end
66
67 %%%%%%%%%%%%%%%%%%%%%%% Update version '2.0' ->'2.0.1' %%%%%%%%%%%%%%%%%%%%%%%
68
69 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
70 strcmp(struct_ver, '2.0')
71
72 struct_ver = '2.0.1';
73 end
74
75 %%%%%%%%%%%%%%%%%%%%%%% Update version '2.0.1' ->'2.1' %%%%%%%%%%%%%%%%%%%%%%%
76
77 if utils.helper.ver2num(struct_ver) < utils.helper.ver2num(tbx_ver) && ...
78 strcmp(struct_ver, '2.0.1')
79
80 struct_ver = '2.1';
81 end
82
83 varargout{1} = obj_struct;
84 end
85