view m-toolbox/m/gui/ltpdv/callbacks/ltpdv_server_channellist.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line source

function ltpdv_server_channellist(varargin)

% Handles
myh     = varargin{1};
mainfig = varargin{end};

% Get selected channels
idx = get(myh, 'Value');
if length(idx) == 1

   % get channel
   strs = cellstr(get(myh, 'String'));
   channel = strs{idx};

   % Get one second of data
   start = ltpdv_server_get_start_time(mainfig);
   stop = ltpdv_server_get_stop_time(mainfig);
   % Get server details
   [dtype, server, port, rds, cal, stat] = ltpdv_server_get_server(mainfig);

   switch dtype
      case 'frame data'
         pltype = 'FRAMES';
      case 'h(t) frames'
         pltype = 'HFRAMES';
      case 'raw data'
         pltype = 'RAW';
      case 'hour trends'
         pltype = 'HOUR';
      case 'day trends'
         pltype = 'DAY';
      case 'chour trends'
         pltype = 'CHOUR';
      case 'cday trends'
         pltype = 'CDAY';
   end
   
   if start < 0
      % get latest
      [start, chans] = ltpdv_server_get_latest_chans(mainfig);
   end

   % get AO
   a = geo2ao(plist('Type', pltype, 'SERVER', server, 'port', port, 'channels', channel, ...
                'starttime', start, 'nsecs', 1, 'STAT', stat));

else

end