function mcs_name_update(cback_fig)
%
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
mcs_global
%
% Update GUI boxes with available files in directory and current choice:
%
%MCS.fft_files=gui_pop_update(cback_fig,'*_fft',4,'FFT Files',MCS.fft_root);
%tms:  look for shortcuts also
sufs={'*_fft','*_fft.lnk'}; lsufs=[4,8];
MCS.fft_files=gui_pop_update(cback_fig,sufs,lsufs,'FFT Files',MCS.fft_root,MCS.dir);
if ~isfield(MCS.TAPE,'cal_root'), MCS.TAPE.cal_root=[]; end
MCS.TAPE.cal_files=gui_pop_update(cback_fig,'*_CAL.mat',4,'Cal Files',MCS.TAPE.cal_root,MCS.dir);
sufs={'*_TLm.mat','*_SL.mat'}; lsufs=[4,4];
MCS.TLm_files=gui_pop_update(cback_fig,sufs,lsufs,'TLm/SL Files',MCS.TLm_root,MCS.dir);
MCS.AN_files=gui_pop_update(cback_fig,'*_AN.mat',4,'AN Files',MCS.AN_root,MCS.dir);
MCS.SL_files=gui_pop_update(cback_fig,'*_SL.mat',4,'SL Files',MCS.SL_root,MCS.dir);
% Call with ii_cur=0 so current directory not checked (bug in Unix):
if isempty(MCS.wf_dir),
%    xx=which('mcs_act'); xx=xx(1:end-21); MCS.MCS.wf_dir=[xx,'Waveforms/'];
    MCS.wf_dir=[getevar('home'),'\inp\waveforms\']; 
    if ~isdir(MCS.wf_dir),
        xx=which('mcs_act'); xx=xx(1:end-21); MCS.wf_dir=[xx,'Waveforms\'];
        if ~isdir(MCS.wf_dir),
            disp(['Could not find Waveforms Directory in \home\inp\waveforms or Matlab\Waveforms']);
            MCS.wf_dir=pwd;
        end
    end
end
MCS.mcs_files=gui_pop_update(cback_fig,'*_mcs.mat',8,'Load _mcs root',MCS.mcs_root);
MCS.cts_files=gui_pop_update(cback_fig,'*.cts',4,'CTS Files',MCS.cts_root,MCS.dir);
for jcomb=1:MCS.comb_parms(2),
    tag1=sprintf(['CTS File ',int2str(jcomb)]);
    MCS.comb_cts=gui_pop_update(cback_fig,'*.cts',0,tag1,MCS.comb_files(jcomb));
end
% Find list of CTS files in MCS.wf_dir:
MCS.src_files=gui_pop_update(cback_fig,'*.cts',4,'SRC CTS File',MCS.src_root,MCS.wf_dir);
% switch MCS.make_parms(1)
% case {8,9}
% 	sufs={'*.dat'}; lsufs=[0];
% case {11}
%     sufs={'*.BIN'}; lsufs=[0];
% otherwise
% 	sufs={'*.bin','*.bin.lnk'}; lsufs=[0 0];
% end
%tms
sufs={'*.bin','*.bin.lnk', '*.dat','*.dat.lnk'}; lsufs=[0 0 0 0];

MCS.data_files=gui_pop_update(cback_fig,sufs,lsufs,'Last Data File',MCS.data_last,MCS.dir);
MCS.data_files=gui_pop_update(cback_fig,sufs,lsufs,'Data Files',MCS.data_root,MCS.dir);
% Allow multiple formats for array geometry file:
nav_dir=[getevar('home'),'\inp\arrays\']; MCS.nav_dir=nav_dir;
sufs={'*_array','*_geom','*.xyz'}; lsufs=[0 0 0];
MCS.geom_files=gui_pop_update(cback_fig,sufs,lsufs,'Array Geometry Files',MCS.geom_file,nav_dir);
%
MCS.hdf_files=gui_pop_update(cback_fig,'*.hdf',4,'HDF File',MCS.hdf_root,MCS.dir);
% Load appropriate file based on which program user is running:
%
switch MCS.iiprog,
case {1},
	mcs_act('FFT Files');
case {2},
	mcs_act('FFT Files');
%%	mcs_act('Replica Corr');
case {3},
	mcs_act('FFT Files');
	mcs_act('Array Geometry Files');
case {4},
	mcs_act('FFT Files');
%    gui_box_vis(cback_fig,'AN Frequency Band(s)',MCS.ii_AN);
%    gui_box_vis(cback_fig,'TL Frequency Band(s)',MCS.ii_TL);
    mcs_act('Compute TL'); mcs_act('Compute AN'); mcs_act('Compute SL');
    mcs_act('Correct for AN');
	mcs_act('Array Geometry Files');
case {5},
	mcs_act('FFT Files');
case {6},
	mcs_act('CTS Files'); 
%%%	mcs_act('Use Header from CTS File'); 
	FFT=[];	% Not sure this will work
case {7},
% Specify by decimal hour for fft_make:
	h1=findobj(cback_fig,'Tag','Time Specification'); set(h1,'Value',3); 
	MCS.tspec=3;
	mcs_act('Type of Data');
	mcs_act('Proc Mult Files');
    mcs_act('Use Calibration File');
    mcs_act('Remove Spikes');
% From mcs_act('Input From Tape'):
    h1=findobj(cback_fig,'Tag','Input From Tape');MCS.TAPE.isatape=get(h1,'Value');
    h1=findobj(cback_fig,'Tag','Use Fast Positioning'); set(h1,'Value',MCS.TAPE.use_fp);
    gui_box_vis(cback_fig,{'Data Files','Proc Mult Files'},MCS.TAPE.isatape==0); 
    gui_box_vis(cback_fig,{'Tape Address','Read Tape Jday,Jhour'},MCS.TAPE.isatape==1); 
    gui_box_vis(cback_fig,{'Last Data File'},((MCS.TAPE.isatape==0) & (MCS.make_parms(7)==1)));   %tms
    gui_box_vis(cback_fig,{'Use Fast Positioning'},(any(MCS.make_parms(1)==[2,5]) & MCS.TAPE.isatape==1));   %tms
    if ~MCS.TAPE.isatape, MCS.TAPE.use_fp=0; else, MCS.make_parms(7)=0; end
	FFT=[];	% Not sure this will work
case 9,
    MCS.cts_heads=MCS.cts_files; MCS.cts_heads{end+1}='None'; 
    h1=findobj(cback_fig,'Tag','Use Header from CTS File'); set(h1,'String',MCS.cts_heads);
    if get(h1,'Value')>length(MCS.cts_heads), set(h1,'Value',1); end
case {10,12},
	mcs_act('FFT Files');
case 12,
	mcs_act('FFT Files'); mcs_act('Rep Corr FFT');
case 13,
    mcs_act('# CTS Files to Combine');
case 14,
    mcs_act('HDF File');
end

