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