Home > functions > device > meg > vb_meginfo_get_next_acq_type.m

vb_meginfo_get_next_acq_type

PURPOSE ^

[usage]

SYNOPSIS ^

function next_acqtype = vb_meginfo_get_next_acq_type(meginfo, event, loadspec)

DESCRIPTION ^

 [usage]
   next_acqtype = vb_meginfo_get_next_acq_type(meginfo, event, loadspec)
 [input]
   meginfo : <required> <<struct>> MEGinfo
     event : <optional> <<string>> event name with which condition transfer
           :  ['LOAD_DATA']
  loadspec : <optional> <<struct>> specification to load the fields of which
           :  are mainly as follows:
           :   
 [output]
   next_acqtype : next value of acq_type field
 [note]
   support for only YOKOGAWA
 [history]
   2008-02-21 (Sako) initial version
   2009-07-28 (Sako) added loadspec
   2011-05-30 (Sako) modified to convert device character to be upper case

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function next_acqtype = vb_meginfo_get_next_acq_type(meginfo, event, loadspec)
0002 % [usage]
0003 %   next_acqtype = vb_meginfo_get_next_acq_type(meginfo, event, loadspec)
0004 % [input]
0005 %   meginfo : <required> <<struct>> MEGinfo
0006 %     event : <optional> <<string>> event name with which condition transfer
0007 %           :  ['LOAD_DATA']
0008 %  loadspec : <optional> <<struct>> specification to load the fields of which
0009 %           :  are mainly as follows:
0010 %           :
0011 % [output]
0012 %   next_acqtype : next value of acq_type field
0013 % [note]
0014 %   support for only YOKOGAWA
0015 % [history]
0016 %   2008-02-21 (Sako) initial version
0017 %   2009-07-28 (Sako) added loadspec
0018 %   2011-05-30 (Sako) modified to convert device character to be upper case
0019 %
0020 % Copyright (C) 2011, ATR All Rights Reserved.
0021 % License : New BSD License(see VBMEG_LICENSE.txt)
0022 
0023 % --- CHECK ARGUMENTS --- %
0024 if ~exist('meginfo', 'var'), meginfo = []; end
0025 if ~exist('event', 'var'), event = ''; end
0026 if ~exist('loadspec', 'var'), loadspec = []; end
0027 [meginfo, event, loadspec] = inner_check_arguments(meginfo, event, loadspec);
0028 
0029 % --- MAIN PROCEDURE --------------------------------------------------------- %
0030 %
0031 func_ = mfilename;
0032 
0033 vb_define_device;
0034 
0035 device = vb_meginfo_get_device(meginfo);
0036 Device = upper(device);
0037 cur_acqtype = vb_meginfo_get_acqtype(meginfo);
0038 
0039 if strcmp(Device, 'YOKOGAWA')
0040   
0041   switch event
0042     case 'LOAD_DATA'
0043       switch cur_acqtype
0044         case MEG_ACQTYPE_CON_RAW
0045           if ~isempty(loadspec) ...
0046             && isfield(loadspec, 'Trigger') ...
0047             && length(loadspec.Trigger) > 1
0048             next_acqtype = MEG_ACQTYPE_EVO_RAW;
0049           else
0050             next_acqtype = cur_acqtype;
0051           end
0052 
0053         case MEG_ACQTYPE_EVO_RAW
0054           next_acqtype = MEG_ACQTYPE_EVO_RAW;
0055 
0056         case MEG_ACQTYPE_EVO_AVE
0057           next_acqtype = MEG_ACQTYPE_EVO_AVE;
0058 
0059         otherwise
0060           warning('(%s)unknown acq_type : %s - not be changed\n', ...
0061             func_, cur_acqtype);
0062           next_acqtype = cur_acqtype;
0063       end
0064 
0065     otherwise
0066       warning('(%s)unknown event : %s - not be changed\n', ...
0067         func_, cur_acqtype);
0068       next_acqtype = cur_acqtype;
0069   end
0070 
0071 else
0072   warning('(%s)Device (%s) is officially not be supported\n', func_, Device);
0073   next_acqtype = cur_acqtype;
0074 end
0075 return;
0076 %
0077 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0078 
0079 % --- INNER FUNCTIONS -------------------------------------------------------- %
0080 %
0081 % --- inner_check_arguments()
0082 %
0083 function [meginfo, event, loadspec] = ...
0084   inner_check_arguments(meginfo, event, loadspec)
0085 func_ = mfilename;
0086 if isempty(meginfo)
0087   error('(%s)meginfo is a required parameter', func_);
0088 end
0089 
0090 if isempty(event)
0091   event = 'LOAD_DATA';
0092 end
0093 
0094 if isempty(loadspec)
0095   % require no action
0096 end
0097 return
0098 %
0099 % --- end of inner_check_arguments()
0100 %
0101 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0102 
0103 
0104 % --- END OF FILE --- %

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005