comparison m-toolbox/m/gui/ltpdv/callbacks/ltpdv_server_get_data.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 a = ltpdv_server_get_data(mainfig)
2
3 % Get times
4 times = ltpdv_server_get_times(mainfig);
5
6 % Get server details
7 [dtype, server, port, rds, cal, stat] = ltpdv_server_get_server(mainfig);
8 spl = plist('Type', dtype, 'SERVER', server, 'port', port);
9 % Get selected channels
10 chans = ltpdv_server_get_channels(mainfig);
11
12 % Loop over times and channels
13 a = [];
14 for k=1:length(times)
15
16 ts = times(k);
17 start = char(ts.startT);
18 nsecs = ts.endT-ts.startT+1;
19 % Loop over channels
20 for j=1:length(chans)
21 chan = chans{j};
22 disp(sprintf('=== Getting %s | %s [%ds]', chan, start, nsecs));
23 na = ao(spl, plist('channels', chan, 'starttime', start, 'nsecs', nsecs));
24 a = [a na];
25 end % End chans loop
26 end % End time loop
27