function fig = cvt2mat()
% This is the machine-generated representation of a Handle Graphics object
% and its children.  Note that handle values may change when these objects
% are re-created. This may cause problems with any callbacks written to
% depend on the value of the handle at the time the object was saved.
% This problem is solved by saving the output as a FIG-file.
%
% To reopen this object, just type the name of the M-file at the MATLAB
% prompt. The M-file and its associated MAT-file must be on your path.
% 
% NOTE: certain newer features in MATLAB may not have been saved in this
% M-file due to limitations of this format, which has been superseded by
% FIG-files.  Figures which have been annotated using the plot editor tools
% are incompatible with the M-file/MAT-file format, and should be saved as
% FIG-files.

arch=computer;
  if (strcmp(arch,'PCWIN') | strcmp(arch,'MAC2'))
     win_dim=[150 125 410 275];
  else
     if (isunix)
        win_dim=[450 350 410 275];
     else
        win_dim=[150 125 410 275];
     end
  end

h0 = figure('Units','points', ...
	'Color',[0.2 0.7 0.7], ...
	'Colormap','default', ...
	'FileName','cvt2mat.m', ...
	'Name','convert window', ...
	'NumberTitle','off', ...
	'PaperPosition',[18 180 576 432], ...
	'PaperUnits','points', ...
	'Position',win_dim, ...
	'Tag','setupWindow', ...
	'ToolBar','none');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.5 0.7 0.7], ...
	'ListboxTop',0, ...
	'Position',[0 0 412 275], ...
	'Style','frame', ...
	'Tag','bgFrame');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.5 0.7 0.7], ...
	'ListboxTop',0, ...
	'FontSize',14,'FontWeight','bold',...
	'Position',[15.2 252 380.8 17.6], ...
	'String','Enter MP ascii conversion set-up parameters', ...
	'Style','text', ...
	'Tag','hdrText');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.5 0.7 0.7], ...
	'ListboxTop',0, ...
	'FontSize',12',...
	'Position',[15.2 230 380.8 17.6], ...
	'String','Remember - input filenames must be ALL CAPS or all lowercase !!', ...
	'Style','text', ...
	'Tag','hdr2Text');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.3 0.6 0.7], ...
	'ListboxTop',0, ...
	'Position',[13.6 180.4 386.4 43.2], ...
	'Style','frame', ...
	'Tag','inFrame');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.3 0.6 0.7], ...
	'ListboxTop',0, ...
	'Position',[16 186 124 29.6], ...
	'String','Enter INPUT file directory (use full path)', ...
	'Style','text', ...
	'Tag','inText');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[1 1 1], ...
	'HorizontalAlignment','left', ...
	'ListboxTop',0, ...
	'Position',[144 193 244 22], ...
	'String',' ', ...
	'Style','edit', ...
	'Tag','inEd');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.3 0.6 0.7], ...
	'ListboxTop',0, ...
	'Position',[13.6 125 386.4 43.2], ...
	'Style','frame', ...
	'Tag','outFrame');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.3 0.6 0.7], ...
	'ListboxTop',0, ...
	'Position',[17.6 125 131.2 32], ...
	'String','Enter OUTPUT file directory (use full path)', ...
	'Style','text', ...
	'Tag','outText');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[1 1 1], ...
	'HorizontalAlignment','left', ...
	'ListboxTop',0, ...
	'Position',[149.6 136 244 22], ...
	'String',' ', ...
	'Style','edit', ...
	'Tag','outEd');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.3 0.6 0.7], ...
	'ListboxTop',0, ...
	'Position',[59.2 65 280.8 45.6], ...
	'Style','frame', ...
	'Tag','drngFrame');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.3 0.6 0.7], ...
	'ListboxTop',0, ...
	'Position',[63.2 75 107.2 24.8], ...
	'String','Enter dive range to process (ie [3 10])', ...
	'Style','text', ...
	'Tag','drngText');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[1 1 1], ...
	'ListboxTop',0, ...
	'Position',[177.6 79 148.8 22], ...
	'String',' ', ...
	'Style','edit', ...
	'Tag','drngEd');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.1 0.85 0.2], ...
	'Callback','do_convert2; close;', ...
	'FontSize',12, ...
	'ListboxTop',0, ...
	'Position',[39 20 80 30], ...
	'String','convert', ...
	'Tag','SetupPush');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.8 0.1 0.15], ...
	'Callback','close;', ...
	'FontSize',12, ...
	'ListboxTop',0, ...
	'Position',[145 20 80 30], ...
	'String','QUIT', ...
	'Tag','quitPush');
h1 = uicontrol('Parent',h0, ...
	'Units','points', ...
	'BackgroundColor',[0.9 0.7 0.15], ...
	'Callback','save_params(''cvt_params'');', ...
	'FontSize',12, ...
	'ListboxTop',0, ...
	'Position',[250 20 150 30], ...
	'String','Save current settings', ...
	'Tag','savePush');

 if exist('cvt_params.mat','file')
    load cvt_params;
    t=findobj(gcf,'Style','Edit');
      for ik=1:length(t)                      
       set(t(ik),'String',cellstr(params{ik}))
      end
 else
     load def_params;
   t=findobj(gcf,'Style','Edit');
      set(t(3),'String',cellstr(params{length(pl)}))
      set(t(2),'String',cellstr(params{length(pl)}))
      set(t(1),'String',cellstr(params{length(pl)-4}))
 end
set(t,'fontsize',14)


