view m-toolbox/m/gui/ltpdv/callbacks/ltpdv_server_get_start_time.m @ 52:daf4eab1a51e database-connection-manager tip

Fix. Default password should be [] not an empty string
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:29:47 +0100
parents f0afece42f48
children
line wrap: on
line source

function gps = ltpdv_server_get_start_time(mainfig)

% Handle
sh = findobj(mainfig, 'Tag', 'LTPDVserverStartEdit');

% Get string
sstr = get(sh, 'String');


if sstr(1) == '+'
   % get start
   start = ltpdv_server_get_stop_time(mainfig);
   gps = start + str2num(sstr(2:end)) -1;
   set(sh, 'String', GPS2UTC(gps));
   return
end
if sstr(1) == '-'
   % get start
   start = ltpdv_server_get_stop_time(mainfig);
   gps = start - str2num(sstr(2:end)) +1;
   set(sh, 'String', GPS2UTC(gps));
   return
end

% Is this GPS?
if ~isempty(sstr)
   try
      gps = eval(sstr);
      utc = GPS2UTC(gps);
   catch
      utc = sstr;
      gps = UTC2GPS(utc);
   end
else
   gps = -1;
end