function dammenu
%
%  Name: dammenu.m
% 
%  Usage: dammenu
% 
%  Description:
%     Initializes damage identification menus
%

%  Version SWD970916
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This matlab source code was originally     %
% developed as part of "DIAMOND" at          %
% Los Alamos National Laboratory. It may     %
% be copied, modified, and distributed in    %
% any form, provided:                        %
%  a) This notice accompanies the files and  %
%     appears near the top of all source     %
%     code files.                            %
%  b) No payment or commercial services are  %
%     received in exchange for the code.     %
%                                            %
% Original copyright is reserved by the      %
% Regents of the University of California,   %
% in addition to Scott W. Doebling, Phillip  %
% J. Cornwell, Erik G. Straser, and Charles  %
% R. Farrar.                                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%

global HANDLES

%=============================================
% Damage ID Load/Save menu
%=============================================
HANDLES.hmmenu{7}(1)=uimenu(HANDLES.hfigdmnd,'Label','Load/Save','enable','on');  
uimenu(HANDLES.hmmenu{7}(1),'Label','Load Undamaged Modes','Callback', ...
   ['[filename,pathname,error]=loadfile(1,pathname);', ...
      'if error==0,',...
      '   disp(''Loading Undamaged Modes...''),',...
      '   ldundammd(pathname,filename),', ...
      '   disp(''Done Loading Undamaged Modes''),',...
      'end;']);             
uimenu(HANDLES.hmmenu{7}(1),'Label','Load Damaged Modes','Callback', ...
   ['[filename,pathname,error]=loadfile(1,pathname);', ...
      'if error==0,',...
      '   disp(''Loading Damaged Modes...''),',...
      '   lddammd(pathname,filename),', ...
      '   disp(''Done Loading Damaged Modes''),',...
      'end;']);             
uimenu(HANDLES.hmmenu{7}(1),'Label','Load Geometry','Callback', ...
   ['[filename,pathname,error]=loadfile(2,pathname);', ...
      'if error==0,',...
      '   disp(''Loading Geometry...''),',...
      '   loadgeom(pathname,filename),',...
      '   disp(''Done Loading Geometry''),',...
      'end;']);
uimenu(HANDLES.hmmenu{7}(1),'label','List Filenames','callback',...
   ['disp('' ''),',...
    'if isfield(DAMAGEID,''undamfile''), disp([''Undamaged Modes File: '',DAMAGEID.undampath,DAMAGEID.undamfile]), end,',...
    'if isfield(DAMAGEID,''damfile''), disp([''Damaged Modes File: '',DAMAGEID.dampath,DAMAGEID.damfile]), end,',...
    'if isfield(GEOM,''filename''), disp([''Geometry File: '',GEOM.pathname,GEOM.filename]), end,',...
    'drawnow,']);


%=============================================
% Methods menu
%=============================================
HANDLES.hmmenu{8}(1)=uimenu(HANDLES.hfigdmnd,'Label','Methods','enable','on');  
uimenu(HANDLES.hmmenu{8}(1),'Label','Strain Energy Methods','Callback',[ ...
      'set(HANDLES.hfigdmnd,''name'',''Diamond: Damage Identification (Strain energy)'');', ...
      'semwind']);
uimenu(HANDLES.hmmenu{8}(1),'Label','Flexibility Methods','Callback',[ ...
      'set(HANDLES.hfigdmnd,''name'',''Diamond: Damage Identification (Flexibility)'');', ...
      'flexwind']);
uimenu(HANDLES.hmmenu{8}(1),'Label','MAC/COMAC','Callback',[ ...
      'set(HANDLES.hfigdmnd,''name'',''Diamond: Damage Identification (MAC/COMAC)'');', ...
      'macwind']);
uimenu(HANDLES.hmmenu{8}(1),'Label','Your Method Here','enable','off');
uimenu(HANDLES.hmmenu{8}(1),'Label','Your Other Method Here','enable','off');

%
% Viewport menu
%

HANDLES.hmmenu{17}(1) = uimenu(HANDLES.hfigdmnd,'Label','Viewports','enable','on');  
uimenu(HANDLES.hmmenu{17}(1),'label','Show Viewports','callback','figure(HANDLES.hvpfig)')
uimenu(HANDLES.hmmenu{17}(1),'label','Send to Viewport 1','callback','vpsend(HANDLES.hvpfig,DAMAGEID.haxes,DAMAGEID.hlegax,HANDLES.hvpdataax(1),HANDLES.hvplegax(1)), DAMAGEID.vpinfostr{1}=DAMAGEID.damtitstr; set(HANDLES.hvpinfotext(1),''string'',DAMAGEID.vpinfostr{1})')
uimenu(HANDLES.hmmenu{17}(1),'label','Send to Viewport 2','callback','vpsend(HANDLES.hvpfig,DAMAGEID.haxes,DAMAGEID.hlegax,HANDLES.hvpdataax(2),HANDLES.hvplegax(2)), DAMAGEID.vpinfostr{2}=DAMAGEID.damtitstr; set(HANDLES.hvpinfotext(2),''string'',DAMAGEID.vpinfostr{2})')
uimenu(HANDLES.hmmenu{17}(1),'label','Send to Viewport 3','callback','vpsend(HANDLES.hvpfig,DAMAGEID.haxes,DAMAGEID.hlegax,HANDLES.hvpdataax(3),HANDLES.hvplegax(3)), DAMAGEID.vpinfostr{3}=DAMAGEID.damtitstr; set(HANDLES.hvpinfotext(3),''string'',DAMAGEID.vpinfostr{3})')
uimenu(HANDLES.hmmenu{17}(1),'label','Send to Viewport 4','callback','vpsend(HANDLES.hvpfig,DAMAGEID.haxes,DAMAGEID.hlegax,HANDLES.hvpdataax(4),HANDLES.hvplegax(4)), DAMAGEID.vpinfostr{4}=DAMAGEID.damtitstr; set(HANDLES.hvpinfotext(4),''string'',DAMAGEID.vpinfostr{4})')
   
return