Mercurial > hg > ltpda
comparison m-toolbox/classes/@ltpda_uoh/created.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 % CREATED Returns a time object of the last modification. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: Returns a time object of the last modification. | |
5 % | |
6 % CALL: <time-object> = created(obj) | |
7 % | |
8 % <a href="matlab:utils.helper.displayMethodInfo('ltpda_uoh', 'created')">Parameters Description</a> | |
9 % | |
10 % VERSION: $Id: created.m,v 1.10 2011/04/08 08:56:30 hewitson Exp $ | |
11 % | |
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
13 | |
14 function varargout = created(varargin) | |
15 | |
16 %%% Check if this is a call for parameters | |
17 if utils.helper.isinfocall(varargin{:}) | |
18 varargout{1} = getInfo(varargin{3}); | |
19 return | |
20 end | |
21 | |
22 import utils.const.* | |
23 utils.helper.msg(msg.PROC3, 'running %s/%s', mfilename('class'), mfilename); | |
24 | |
25 %%% Collect all objects with the class of the first object. | |
26 objs = utils.helper.collect_objects(varargin(:), ''); | |
27 | |
28 created_o(1,numel(objs)) = time(NaN); | |
29 for ii = 1:numel(objs); | |
30 if ~isempty(objs(ii).hist) | |
31 created_o(ii) = time(objs(ii).hist.proctime/1000); | |
32 end | |
33 end | |
34 | |
35 created_o = reshape(created_o, size(objs)); | |
36 | |
37 varargout{1} = created_o; | |
38 end | |
39 | |
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
41 % Local Functions % | |
42 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
43 | |
44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
45 % | |
46 % FUNCTION: getInfo | |
47 % | |
48 % DESCRIPTION: Get Info Object | |
49 % | |
50 % HISTORY: 10-12-2008 Diepholz | |
51 % Creation. | |
52 % | |
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
54 function ii = getInfo(varargin) | |
55 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
56 sets = {}; | |
57 pl = []; | |
58 else | |
59 sets = {'Default'}; | |
60 pl = getDefaultPlist; | |
61 end | |
62 % Build info object | |
63 ii = minfo(mfilename, 'ltpda_uoh', 'ltpda', utils.const.categories.helper, '$Id: created.m,v 1.10 2011/04/08 08:56:30 hewitson Exp $', sets, pl); | |
64 ii.setModifier(false); | |
65 end | |
66 | |
67 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
68 % | |
69 % FUNCTION: getDefaultPlist | |
70 % | |
71 % DESCRIPTION: Get Default Plist | |
72 % | |
73 % HISTORY: 10-12-2008 Diepholz | |
74 % Creation. | |
75 % | |
76 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
77 function plout = getDefaultPlist() | |
78 persistent pl; | |
79 if exist('pl', 'var')==0 || isempty(pl) | |
80 pl = buildplist(); | |
81 end | |
82 plout = pl; | |
83 end | |
84 | |
85 function pl = buildplist() | |
86 pl = plist.EMPTY_PLIST; | |
87 end | |
88 |