view m-toolbox/m/gui/ltpdv/callbacks/ltpdv_server_get_data.m @ 24:056f8e1e995e database-connection-manager

Properly record history in fromRepository constructors
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

function a = ltpdv_server_get_data(mainfig)

% Get times
times = ltpdv_server_get_times(mainfig);

% Get server details
[dtype, server, port, rds, cal, stat] = ltpdv_server_get_server(mainfig);
spl = plist('Type', dtype, 'SERVER', server, 'port', port);
% Get selected channels 
chans = ltpdv_server_get_channels(mainfig);

% Loop over times and channels
a = [];
for k=1:length(times)
   
   ts = times(k);
   start = char(ts.startT);
   nsecs = ts.endT-ts.startT+1;
   % Loop over channels
   for j=1:length(chans)      
      chan = chans{j};
      disp(sprintf('=== Getting %s | %s [%ds]', chan, start, nsecs));      
      na = ao(spl, plist('channels', chan, 'starttime', start, 'nsecs', nsecs));
      a = [a na];
   end % End chans loop      
end % End time loop