Mercurial > hg > ltpda
comparison m-toolbox/m/gui/ltpdv/callbacks/ltpdv_server_get_start_time.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 function gps = ltpdv_server_get_start_time(mainfig) | |
2 | |
3 % Handle | |
4 sh = findobj(mainfig, 'Tag', 'LTPDVserverStartEdit'); | |
5 | |
6 % Get string | |
7 sstr = get(sh, 'String'); | |
8 | |
9 | |
10 if sstr(1) == '+' | |
11 % get start | |
12 start = ltpdv_server_get_stop_time(mainfig); | |
13 gps = start + str2num(sstr(2:end)) -1; | |
14 set(sh, 'String', GPS2UTC(gps)); | |
15 return | |
16 end | |
17 if sstr(1) == '-' | |
18 % get start | |
19 start = ltpdv_server_get_stop_time(mainfig); | |
20 gps = start - str2num(sstr(2:end)) +1; | |
21 set(sh, 'String', GPS2UTC(gps)); | |
22 return | |
23 end | |
24 | |
25 % Is this GPS? | |
26 if ~isempty(sstr) | |
27 try | |
28 gps = eval(sstr); | |
29 utc = GPS2UTC(gps); | |
30 catch | |
31 utc = sstr; | |
32 gps = UTC2GPS(utc); | |
33 end | |
34 else | |
35 gps = -1; | |
36 end | |
37 | |
38 | |
39 |