Mercurial > hg > ltpda
comparison m-toolbox/classes/@LTPDARepositoryManager/resetTimer.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 % RESETTIMER resets the input timer. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % description: RESETTIMER resets the input timer. | |
5 % | |
6 % call: resetTimer(t) | |
7 % | |
8 % inputs t - timer object or the name of a timer. | |
9 % | |
10 % version: $Id: resetTimer.m,v 1.3 2011/04/08 08:56:35 hewitson Exp $ | |
11 % | |
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
13 | |
14 function resetTimer(inputTimer, conn) | |
15 | |
16 if ischar(inputTimer) | |
17 inputTimer = timerfind('name', inputTimer); | |
18 end | |
19 | |
20 if isa(inputTimer, 'timer') | |
21 stop(inputTimer); | |
22 start(inputTimer); | |
23 end | |
24 | |
25 newTime = java.lang.System.currentTimeMillis(); | |
26 if nargin == 2 && isa(conn, 'mpipeline.repository.RepositoryConnection') | |
27 conn.setConnectedAt(newTime); | |
28 conn.setPasswordSetAt(newTime); | |
29 else | |
30 rm = LTPDARepositoryManager(); | |
31 conns = rm.manager.getConnections(); | |
32 for ii=1:conns.size | |
33 conn = conns.get(ii-1); | |
34 conn.setConnectedAt(newTime); | |
35 conn.setPasswordSetAt(newTime); | |
36 end | |
37 end | |
38 | |
39 end |