comparison m-toolbox/classes/@LTPDARepositoryManager/LTPDARepositoryManager.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 % LTPDARepositoryManager creates the LTPDA Repository Manager.
2 %
3 % CALL:
4 % >> LTPDARepositoryManager
5 %
6 % M Hewitson 08-01-10
7 %
8 % $Id: LTPDARepositoryManager.m,v 1.14 2011/02/03 13:46:23 ingo Exp $
9 %
10
11
12 classdef LTPDARepositoryManager < handle
13 %------------------------------------------------
14 %---------- Private read-only Properties --------
15 %------------------------------------------------
16 properties (SetAccess = private, GetAccess = public)
17 manager = [];
18 gui = [];
19 selector = [];
20 timerDisconnect = [];
21 timerClearPass = [];
22 h1;
23 h2;
24 h3;
25 h4;
26 h5;
27 h6;
28 h7;
29 h8;
30 h9;
31 end
32
33 properties (Constant = true, GetAccess = private)
34 DISCONNECT = 60;
35 end
36
37 %-----------------------------------------
38 % Public methods
39 %-----------------------------------------
40 methods
41
42 %-----------------------------------------
43 % Constructor
44 %-----------------------------------------
45 function wb = LTPDARepositoryManager(varargin)
46
47 twb = getappdata(0, 'LTPDARepositoryManager');
48
49 if isa(twb, mfilename)
50
51 wb = twb;
52
53 else
54
55 switch nargin
56 case 0
57 % Create a new repository manager
58 wb.manager = mpipeline.repository.RepositoryManager();
59 % Create timer which disconnects the open connections
60 wb.timerDisconnect = LTPDARepositoryManager.startTimer('LTPDA_disconnectConnections', @LTPDARepositoryManager.cb_timerDisconnect, wb.DISCONNECT);
61 % Create timer which clears the password
62 prefs = getappdata(0, 'LTPDApreferences');
63 expiry = double(prefs.getRepoPrefs.getExpiry);
64 wb.timerClearPass = LTPDARepositoryManager.startTimer('LTPDA_clearPassword', @LTPDARepositoryManager.cb_timerClearPassord, expiry);
65 pause(0.1);
66 end
67
68 % Store the manager in the application workspace
69 setappdata(0, 'LTPDARepositoryManager', wb);
70
71 wb.updatePrefs();
72
73 end
74 end % End constructor
75
76 %-----------------------------------------
77 % Destructor
78 %-----------------------------------------
79 function delete(h)
80 disp('*** Deleting repository manager')
81 if ~isempty(h)
82 disp(' - closing repository connections')
83 h.manager.closeAllConnections();
84 h.deleteTimer('timerClearPass');
85 h.deleteTimer('timerDisconnect');
86 % close gui
87 if ~isempty(h.gui)
88 h.gui.dispose();
89 end
90 end
91 end
92
93
94 function initGUI(wb)
95
96 % Create a new GUI
97 wb.gui = mpipeline.repository.RepositoryManagerGUI([], wb.manager);
98 % Create new selector
99 wb.selector = mpipeline.repository.ConnectionSelector([], wb.manager);
100
101 %--- called when window is closed
102 wb.h1 = handle(wb.gui, 'callbackproperties');
103 wb.h1.WindowClosedCallback = @LTPDARepositoryManager.cb_guiClosed;
104
105
106 end
107
108 end % End public methods
109
110 methods
111 varargout = display(varargin)
112 varargout = updatePrefs(varargin)
113 varargout = restartTimers(varargin)
114 varargout = showGui(varargin)
115 varargout = listConnections(varargin)
116
117 varargout = deleteTimer(varargin)
118 end
119
120 methods (Static=true)
121
122 % Callback methods
123 varargout = cb_timerDisconnect(varargin)
124 varargout = cb_timerClearPassord(varargin)
125 varargout = cb_newConnection(varargin)
126 varargout = cb_guiClosed(varargin)
127
128 % Timer methods
129 varargout = startTimer(varargin)
130 varargout = resetTimer(varargin)
131
132 % Helper Methods
133 varargout = getSinfo(varargin)
134 varargout = executeQuery(varargin)
135 varargout = copyObjects(varargin)
136
137 function ii = getInfo(varargin)
138 ii = utils.helper.generic_getInfo(varargin{:}, 'LTPDARepositoryManager');
139 end
140
141 % Return the plist for a particular parameter set
142 function out = getDefaultPlist(set)
143 out = plist();
144 end
145
146 function out = VEROUT()
147 out = '$Id: LTPDARepositoryManager.m,v 1.14 2011/02/03 13:46:23 ingo Exp $';
148 end
149
150 function out = SETS()
151 out = {'Default'};
152 end
153
154 function obj = initObjectWithSize(n,m)
155 obj = LTPDARepositoryManager.newarray([n m]);
156 end
157
158 end
159 %------------------------------------------------
160 % Private static methods
161 %------------------------------------------------
162 methods(Access=private, Static=true)
163 end
164
165 end
166