dw1dtool.m
上传用户:haiyisale
上传日期:2013-01-09
资源大小:3246k
文件大小:27k
源码类别:

波变换

开发平台:

Matlab

  1. function varargout = dw1dtool(option,varargin)
  2. %DW1DTOOL Discrete Wavelet 1-D tool.
  3. %   VARARGOUT = DW1DTOOL(OPTION,VARARGIN)
  4. %   M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 12-Mar-96.
  5. %   Last Revision: 20-Feb-2001.
  6. %   Copyright 1995-2002 The MathWorks, Inc.
  7. %   $Revision: 1.19 $ $Date: 2002/06/17 12:19:15 $
  8. % Test inputs.
  9. %-------------
  10. if nargin==0 , option = 'create'; end
  11. [option,winAttrb] = utguidiv('ini',option,varargin{:});
  12. % Default values.
  13. %----------------
  14. max_lev_anal = 12;
  15. default_nbcolors = 128;
  16. % MemBloc0 of stored values.
  17. %---------------------------
  18. n_InfoInit   = 'DW1D_InfoInit';
  19. ind_filename =  1;
  20. ind_pathname =  2;
  21. nb0_stored   =  2;
  22. % MemBloc1 of stored values.
  23. %---------------------------
  24. n_param_anal   = 'DWAn1d_Par_Anal';
  25. ind_sig_name   = 1;
  26. ind_sig_size   = 2;
  27. ind_wav_name   = 3;
  28. ind_lev_anal   = 4;
  29. ind_axe_ref    = 5;
  30. ind_act_option = 6;
  31. ind_ssig_type  = 7;
  32. ind_thr_val    = 8;
  33. nb1_stored     = 8;
  34. % MemBloc2 of stored values.
  35. %---------------------------
  36. n_coefs_longs = 'Coefs_and_Longs';
  37. ind_coefs     = 1;
  38. ind_longs     = 2;
  39. nb2_stored    = 2;
  40. % MemBloc3 of stored values.
  41. %---------------------------
  42. n_synt_sig = 'Synt_Sig';
  43. ind_ssig   =  1;
  44. nb3_stored =  1;
  45. % MemBloc4 of stored values.
  46. %---------------------------
  47. n_miscella     = 'DWAn1d_Miscella';
  48. ind_graph_area =  1;
  49. ind_view_mode  =  2;
  50. ind_savepath   =  3;
  51. nb4_stored     =  3;
  52. % Tag property of objects.
  53. %-------------------------
  54. tag_m_savesyn   = 'Save_Syn';
  55. tag_m_savecfs   = 'Save_Cfs';
  56. tag_m_savedec   = 'Save_Dec';
  57. tag_pus_anal    = 'Pus_Anal';
  58. tag_pus_deno    = 'Pus_Deno';
  59. tag_pus_comp    = 'Pus_Comp';
  60. tag_pus_hist    = 'Pus_Hist';
  61. tag_pus_stat    = 'Pus_Stat';
  62. tag_pop_viewm   = 'View_Mode';
  63. tag_pus_dispopt = 'Pus_Options';
  64. tag_valapp_scr  = 'ValApp_Scr';
  65. tag_txtapp_scr  = 'TxtApp_Scr';
  66. tag_valdet_scr  = 'ValDet_Scr';
  67. tag_txtdet_scr  = 'TxtDet_Scr';
  68. tag_declev      = 'Pop_DecLev';
  69. tag_txtdeclev   = 'Txt_DecLev';
  70. tag_Def_DispM   = 'Default_DispM';
  71. switch option
  72.     case 'create'
  73.         % Get Globals.
  74.         %--------------
  75.         [Def_Btn_Height,Def_Btn_Width,Pop_Min_Width,  ...
  76.          Def_Txt_Height,X_Spacing,Y_Spacing,Def_FraBkColor ] = ...
  77.             mextglob('get',...
  78.                 'Def_Btn_Height','Def_Btn_Width','Pop_Min_Width',  ...
  79.                 'Def_Txt_Height','X_Spacing','Y_Spacing','Def_FraBkColor' ...
  80.                 );
  81.         % Wavelet 1-D window initialization.
  82.         %-----------------------------------
  83.         win_title = 'Wavelet 1-D';
  84.         [win_dw1dtool,pos_win,win_units,str_numwin,...
  85.             frame0,pos_frame0,Pos_Graphic_Area,pus_close] = ...
  86.                 wfigmngr('create',win_title,winAttrb,'ExtFig_Tool',mfilename,1,1,0);
  87.         varargout{1} = win_dw1dtool;
  88. % Add Help for Tool.
  89. %------------------
  90. wfighelp('addHelpTool',win_dw1dtool,'&One-Dimensional Analysis','DW1D_GUI');
  91. % Add Help Item.
  92. %----------------
  93. wfighelp('addHelpItem',win_dw1dtool,'Wavelets in Action','DW1D_INACTION');
  94. wfighelp('addHelpItem',win_dw1dtool,'General Concepts','DW1D_GENERAL');
  95. wfighelp('addHelpItem',win_dw1dtool,'Wavelet Decomposition','DW1D_DECOMPOS');
  96. wfighelp('addHelpItem',win_dw1dtool,'Loading and Saving','DW1D_LOADSAVE');
  97.         % Menu construction for current figure.
  98.         %--------------------------------------
  99. [m_files,m_load,m_save,m_view] = ...
  100. wfigmngr('getmenus',win_dw1dtool,'file','load','save','view');
  101.         m_loadsig = uimenu(m_load,...
  102.                                 'Label','&Signal',   ...
  103.                                 'Position',1,             ...
  104.                                 'Callback',               ...
  105.                                 ['dw1dmngr(''load_sig'',' ...
  106.                                         str_numwin ');']  ...
  107.                                 );
  108.         m_loadcfs = uimenu(m_load,...
  109.                                 'Label','&Coefficients',  ...
  110.                                 'Position',2,             ...
  111.                                 'Callback',               ...
  112.                                 ['dw1dmngr(''load_cfs'',' ...
  113.                                         str_numwin ');']  ...
  114.                                 );
  115.         m_loaddec = uimenu(m_load,...
  116.                                 'Label','&Decomposition', ...
  117.                                 'Position',3,             ...
  118.                                 'Callback',               ...
  119.                                 ['dw1dmngr(''load_dec'',' ...
  120.                                         str_numwin ');']  ...
  121.                                 );
  122. m_savesyn = uimenu(m_save,...
  123.                                 'Label','&Synthesized Signal',...
  124.                                 'Position',1,                 ...
  125.                                 'Enable','Off',               ...
  126.                                 'Tag',tag_m_savesyn,          ...
  127.                                 'Callback',                   ...
  128.                                 ['dw1dmngr(''save_synt'','    ...
  129.                                         str_numwin ');']      ...
  130.                                 );
  131.         m_savecfs = uimenu(m_save,...
  132.                                 'Label','&Coefficients',  ...
  133.                                 'Position',2,             ...
  134.                                 'Enable','Off',           ...
  135.                                 'Tag',tag_m_savecfs,      ...
  136.                                 'Callback',               ...
  137.                                 ['dw1dmngr(''save_cfs'',' ...
  138.                                         str_numwin ');']  ...
  139.                                 );
  140.         m_savedec = uimenu(m_save,...
  141.                                 'Label','&Decomposition', ...
  142.                                 'Position',3,             ...
  143.                                 'Enable','Off',           ...
  144.                                 'Tag',tag_m_savedec,      ...
  145.                                 'Callback',               ...
  146.                                 ['dw1dmngr(''save_dec'',' ...
  147.                                         str_numwin ');']  ...
  148.                                 );
  149.         m_demo = uimenu(m_files,...
  150.                    'Label','&Example Analysis','Position',3,'Separator','Off');
  151.         m_demo_1 = uimenu(m_demo,'Label','Basic Signals');
  152.         m_demo_2 = uimenu(m_demo,...
  153. 'Label','Noisy Signals - Constant Noise Variance');
  154.         m_demo_3 = uimenu(m_demo,...
  155. 'Label','Noisy Signals - Interval Dependent Noise Variance');
  156.    
  157.    
  158.         % Submenu of test signals.
  159.         %-------------------------
  160.         names(1,:)  = 'Sum of sines               ';
  161.         names(2,:)  = 'Frequency breakdown        ';
  162.         names(3,:)  = 'Uniform white noise        ';
  163.         names(4,:)  = 'AR(3) noise                ';
  164.         names(5,:)  = 'Noisy polynomial           ';
  165.         names(6,:)  = 'Noisy polynomial           ';
  166.         names(7,:)  = 'Step signal                ';
  167.         names(8,:)  = 'Two nearby discontinuities ';
  168.         names(9,:)  = 'Two nearby discontinuities ';
  169.         names(10,:) = 'Second derivative breakdown';
  170.         names(11,:) = 'Second derivative breakdown';
  171.         names(12,:) = 'Ramp + white noise         ';
  172.         names(13,:) = 'Ramp + colored noise       ';
  173.         names(14,:) = 'Sine + white noise         ';
  174.         names(15,:) = 'Triangle + sine            ';
  175.         names(16,:) = 'Triangle + sine + noise    ';
  176.         names(17,:) = 'Electrical consumption     ';
  177.         names(18,:) = 'Cantor curve               ';
  178.         names(19,:) = 'Koch curve                 ';
  179.         files = [ 'sumsin  ' ; 'freqbrk ' ; 'whitnois' ; 'warma   ' ; ...
  180.                   'noispol ' ; 'noispol ' ; 'wstep   ' ; 'nearbrk ' ; ...
  181.                   'nearbrk ' ; 'scddvbrk' ; 'scddvbrk' ; 'wnoislop' ; ...
  182.                   'cnoislop' ; 'noissin ' ; 'trsin   ' ; 'wntrsin ' ; ...
  183.                   'leleccum' ; 'wcantor ' ; 'vonkoch '                    ];    
  184.         waves = ['db3' ; 'db5' ; 'db3' ; 'db3' ; 'db2' ; 'db3' ; 'db2' ; ...
  185.                  'db2' ; 'db7' ; 'db1' ; 'db4' ; 'db3' ; 'db3' ; 'db5' ; ...
  186.                  'db5' ; 'db5' ; 'db3' ; 'db1' ; 'db1'                      ];
  187.         levels = ['5';'5';'5';'5';'4';'4';'5';'5';'5';'2';'2';'6';'6';'5';...
  188.                         '6';'7';'5';'5';'5'];
  189.         beg_call_str = ['dw1dmngr(''demo'',' str_numwin ','''];
  190.         for i=1:size(files,1)
  191.                 libel = ['with ' waves(i,:) ' at level ' levels(i,:) ...
  192.                                 '  --->  ' names(i,:)];
  193.                 action = [beg_call_str files(i,:) ''',''' ...
  194.                                 waves(i,:) ''',' levels(i,:) ');'];
  195.                 uimenu(m_demo_1,'Label',libel,'Callback',action);
  196.         end
  197.     names = [...
  198.          'Noisy blocks   '; ...
  199.          'Noisy bumps    '; ...
  200.          'Noisy heavysin '; ...
  201.          'Noisy Doppler  '; ...
  202.          'Noisy quadchirp'; ...
  203. 'Noisy mishmash '  ...
  204. ];
  205.         files       = [ 'noisbloc' ; 'noisbump' ; 'heavysin' ; ...
  206.                         'noisdopp' ; 'noischir' ; 'noismima'      ];
  207.         waves   = ['sym8';'sym4';'sym8';'sym4';'db1 ';'db3 '];
  208.         levels  = ['5';'5';'5';'5';'5';'5'];
  209.         beg_call_str = ['dw1dmngr(''demo'',' str_numwin ','''];
  210.         for i=1:size(files,1)
  211.             libel = ['with ' waves(i,:) ' at level ' levels(i,:) ...
  212.                             '  --->  ' names(i,:)];
  213.             action = [beg_call_str files(i,:) ''',''' ...
  214.                             waves(i,:) ''',' levels(i,:) ');'];
  215.             uimenu(m_demo_2,'Label',libel,'Callback',action);
  216.         end
  217.         demoSET = {...
  218.           'Noisy blocks (I)  - 3 intervals' , 'nblocr1' , 'sym4', 5 , 3  ; ...
  219.           'Noisy blocks (II) - 3 intervals' , 'nblocr2' , 'sym4', 5 , 3  ; ...
  220.           'Noisy Doppler (I) - 3 intervals' , 'ndoppr1' , 'sym4', 5 , 3  ; ...
  221.           'Noisy bumps (I)   - 3 intervals' , 'nbumpr1' , 'sym4', 5 , 3  ; ...
  222.           'Noisy bumps (II)  - 2 intervals' , 'nbumpr2' , 'sym4', 5 , 2  ; ...
  223.           'Noisy bumps (III) - 4 intervals' , 'nbumpr3' , 'sym4', 5 , 4  ; ...
  224.           'Elec. consumption - 3 intervals' , 'nelec'   , 'sym4', 5 , 3    ...
  225.           };
  226.         for k=1:length(demoSET)
  227.             nam = demoSET{k,1};
  228.             fil = demoSET{k,2};
  229.             wav = demoSET{k,3};
  230.             lev = int2str(demoSET{k,4});
  231.             nbI = int2str(demoSET{k,5});        % Dummy
  232.             libel = ['with ' wav ' at level ' lev  '  --->  ' nam];
  233.             action = [beg_call_str fil ''',''' wav ''',' lev ');'];
  234.             uimenu(m_demo_3,'Label',libel,'Callback',action);
  235.         end
  236.         % Adding option for choosing Default Display Mode.
  237.         %-------------------------------------------------
  238.         viewmode_Names  = strvcat(...
  239.                             'Show and Scroll',    ...
  240.                             'Full Decomposition', ...
  241.                             'Separate Mode',      ...
  242.                             'Superimpose Mode',   ...
  243.                             'Tree Mode',          ...
  244.                             'Show and Scroll (Stem Cfs)' ...
  245.                             );
  246.         viewmode_Names = viewmode_Names(1:end,:);
  247.         DW1D_Display_Mode = 2;
  248.         m_disp = uimenu(m_view,                         ...
  249.                         'Label','Default Display &Mode', ...
  250.                         'Separator','On'                ...
  251.                         );
  252.         nbm     = size(viewmode_Names,1);
  253.         dm      = zeros(1,nbm);
  254.         for k=1:nbm
  255.             dm(k) = uimenu(m_disp,                      ...
  256.                           'Label',viewmode_Names(k,:),  ...
  257.                           'Checked','Off'               ...
  258.                           );
  259.         end
  260.         dmstr = num2mstr(dm);
  261.         for k = 1:nbm
  262.             set(dm(k),            ...
  263.                     'Userdata',k, ...
  264.                     'CallBack',   ...
  265.                     ['dw1dvdrv(''default'',' str_numwin ...
  266.                     ','  dmstr ',' sprintf('%.0f',k) ');']);
  267.         end
  268.         dw1dvdrv('default',win_dw1dtool,dm,DW1D_Display_Mode);
  269.         % Begin waiting.
  270.         %---------------
  271.         wwaiting('msg',win_dw1dtool,'Wait ... initialization');
  272.         % Borders and double borders.
  273.         %----------------------------
  274.         dx = X_Spacing;   dx2 = 2*dx;
  275.         dy = Y_Spacing;   dy2 = 2*dy;
  276.         d_txt = (Def_Btn_Height-Def_Txt_Height);
  277.         % Position property of objects.
  278.         %------------------------------
  279.         x_frame0    = pos_frame0(1);
  280.         cmd_width   = pos_frame0(3);
  281.         xlocINI     = pos_frame0([1 3]);
  282.         ybottomINI  = pos_win(4)-3.5*Def_Btn_Height-dy2;
  283.         y_low       = ybottomINI-2.5*Def_Btn_Height-dy2;
  284.         w_uic       = 1.5*Def_Btn_Width;
  285.         h_uic       = 1.5*Def_Btn_Height;
  286.         bdx         = (cmd_width-w_uic)/2;
  287.         x_left      = x_frame0+bdx;
  288.         pos_anal    = [x_left, y_low, w_uic, h_uic];
  289.         x_left      = x_frame0+dx2;
  290.         y_low       = pos_anal(2)-h_uic-2*dy2;
  291.         push_width  = (cmd_width-3*dx2)/2;
  292.         pos_stat    = [x_left, y_low, push_width, h_uic];
  293.         pos_comp    = pos_stat;
  294.         pos_comp(1) = pos_stat(1)+pos_stat(3)+dx2;
  295.         y_low       = y_low-h_uic-dy;
  296.         pos_hist    = [x_left, y_low, push_width, h_uic];
  297.         pos_deno    = pos_hist;
  298.         pos_deno(1) = pos_hist(1)+pos_hist(3)+dx2;
  299.         y_low           = pos_hist(2)-h_uic-2*dy2;
  300.         pos_viewm_txt   = [x_left, y_low, 2*Def_Btn_Width, Def_Txt_Height];
  301.         pop_width       = cmd_width-4*dx2;       
  302.         x_left          = x_frame0+(cmd_width-pop_width)/2;
  303.         y_low           = pos_viewm_txt(2)-Def_Btn_Height-dy;
  304.         pos_pop_viewm   = [x_left, y_low, pop_width, Def_Btn_Height];
  305.         pos_pus_dispopt = [x_left, y_low, pop_width, Def_Btn_Height];
  306.         y_low           = pos_pop_viewm(2)-Def_Btn_Height-dy2;
  307.         x_left          = pos_frame0(1)+dx2;
  308.         w_txt           = Pop_Min_Width/2+dx/4;
  309.         pos_txtapp_scr  = [x_left,y_low+d_txt/2, w_txt, Def_Txt_Height];
  310.         xl              = pos_txtapp_scr(1)+pos_txtapp_scr(3)+dx;
  311.         pos_valapp_scr  = [xl, y_low, Pop_Min_Width, Def_Btn_Height];
  312.         xl              = pos_valapp_scr(1)+pos_valapp_scr(3)+dx2;
  313.         pos_txtdet_scr  = [xl, y_low+d_txt/2, w_txt, Def_Txt_Height];
  314.         xl              = pos_txtdet_scr(1)+pos_txtdet_scr(3)+dx;
  315.         pos_valdet_scr  = [xl, y_low, Pop_Min_Width, Def_Btn_Height];
  316.         y_low           = pos_pop_viewm(2)-Def_Btn_Height-dy2;
  317.         pos_txtlev_dec  = [x_left, y_low+d_txt/2, Def_Btn_Width, Def_Txt_Height];
  318.         xl              = pos_txtlev_dec(1)+Def_Btn_Width+dx2;
  319.         pos_declev      = [xl, y_low, Pop_Min_Width, Def_Btn_Height];
  320.         % String property of objects.
  321.         %----------------------------
  322.         str_levels      = int2str([1:max_lev_anal]');
  323.         str_anal        = 'Analyze';
  324.         str_stat        = 'Statistics';
  325.         str_comp        = 'Compress';
  326.         str_hist        = 'Histograms';
  327.         str_deno        = 'De-noise';
  328.         str_viewm_txt   = 'Display mode : ';
  329.         str_pop_viewm   = viewmode_Names;
  330.         str_pus_dispopt = 'More Display Options';
  331.         str_txtapp_scr  = 'App.';
  332.         str_valapp_scr  = str_levels;
  333.         str_txtdet_scr  = 'Det.';
  334.         str_valdet_scr  = str_levels;
  335.         str_txtlev_dec  = 'at level';
  336.         str_declev      = str_levels;
  337.         % Callback property of objects.
  338.         %------------------------------
  339.         cba_anal    = ['dw1dmngr(''anal'',' str_numwin ');'];
  340.         cba_stat    = ['dw1dmngr(''stat'',' str_numwin ');'];
  341.         cba_comp    = ['dw1dmngr(''comp'',' str_numwin ');'];
  342.         cba_hist    = ['dw1dmngr(''hist'',' str_numwin ');'];
  343.         cba_deno    = ['dw1dmngr(''deno'',' str_numwin ');'];
  344.         cba_viewm   = ['dw1dvmod(''ch_vm'',' str_numwin ');'];
  345.         cba_mdisp   = ['dw1ddisp(''create'',' str_numwin ');'];
  346.         cba_app_scr = ['dw1dtool(''app'',' str_numwin ');'];
  347.         cba_det_scr = ['dw1dtool(''det'',' str_numwin ');'];
  348.         cba_declev  = ['dw1dtool(''dec'',' str_numwin ');'];
  349.         % Command part of the window.
  350.         %============================
  351.         % Data, Wavelet and Level parameters.
  352.         %------------------------------------
  353.         utanapar('create',win_dw1dtool, ...
  354.                  'xloc',xlocINI,'bottom',ybottomINI,...
  355.                  'enable','off', ...
  356.                  'wtype','dwt'   ...
  357.                  );
  358.         commonProp = {...
  359.             'Parent',win_dw1dtool, ...
  360.             'Style','Pushbutton',  ...
  361.             'Unit',win_units,      ...
  362.             'Enable','off'         ...
  363.             };
  364.         pus_anal = uicontrol(commonProp{:},...
  365.                              'Position',pos_anal,  ...
  366.                              'String',xlate(str_anal),    ...
  367.                              'Tag',tag_pus_anal,   ...
  368.                              'Callback',cba_anal,  ...
  369.                              'Interruptible','On'  ...
  370.                              );
  371.         pus_stat = uicontrol(commonProp{:},...
  372.                              'Position',pos_stat,  ...
  373.                              'String',xlate(str_stat),    ...
  374.                              'Tag',tag_pus_stat,   ...
  375.                              'Callback',cba_stat   ...
  376.                              );
  377.         pus_comp = uicontrol(commonProp{:},...
  378.                              'Position',pos_comp,  ...
  379.                              'String',xlate(str_comp),    ...
  380.                              'Tag',tag_pus_comp,   ...
  381.                              'Callback',cba_comp   ...
  382.                              );
  383.         pus_hist = uicontrol(commonProp{:},...
  384.                              'Position',pos_hist,  ...
  385.                              'String',xlate(str_hist),    ...
  386.                              'Tag',tag_pus_hist,   ...
  387.                              'Callback',cba_hist   ...
  388.                              );
  389.         pus_deno = uicontrol(commonProp{:},...
  390.                              'Position',pos_deno,  ...
  391.                              'String',xlate(str_deno),    ...
  392.                              'Tag',tag_pus_deno,   ...
  393.                              'Callback',cba_deno   ...
  394.                              );
  395.         txt_viewm  = uicontrol(...
  396.                                'Parent',win_dw1dtool,          ...
  397.                                'Style','text',                 ...
  398.                                'Unit',win_units,               ...
  399.                                'HorizontalAlignment','left',   ...
  400.                                'Position',pos_viewm_txt,       ...
  401.                                'String',str_viewm_txt,         ...
  402.                                'Backgroundcolor',Def_FraBkColor...
  403.                                );
  404.         view_mode = 1;
  405.         pop_viewm = uicontrol(...
  406.                               'Parent',win_dw1dtool,    ...
  407.                               'Style','Popup',          ...
  408.                               'Unit',win_units,         ...
  409.                               'Position',pos_pop_viewm, ...
  410.                               'String',str_pop_viewm,   ...
  411.                               'Value',view_mode,        ...
  412.                               'UserData',view_mode,     ...
  413.                               'Enable','off',           ...
  414.                               'Callback',cba_viewm,     ...
  415.                               'Tag',tag_pop_viewm       ...
  416.                               );
  417.         pus_dispopt     = uicontrol(...
  418.                                     'Parent',win_dw1dtool,      ...
  419.                                     'Style','Pushbutton',       ...
  420.                                     'Unit',win_units,           ...
  421.                                     'Position',pos_pus_dispopt, ...
  422.                                     'String',xlate(str_pus_dispopt),   ...
  423.                                     'Visible','off',            ...
  424.                                     'Enable','off',             ...
  425.                                     'Tag',tag_pus_dispopt,      ...
  426.                                     'Interruptible','On',       ...
  427.                                     'Callback',cba_mdisp        ...
  428.                                     );
  429.         txt_txtapp_scr  = uicontrol(...
  430.                                         'Parent',win_dw1dtool,          ...
  431.                                         'Style','Text',                 ...
  432.                                         'Unit',win_units,               ...
  433.                                         'Position',pos_txtapp_scr,      ...
  434.                                         'Visible','Off',                ...
  435.                                         'String',str_txtapp_scr,        ...
  436.                                         'Backgroundcolor',Def_FraBkColor,...
  437.                                         'Tag',tag_txtapp_scr            ...
  438.                                         );
  439.         pop_valapp_scr  = uicontrol(...
  440.                                         'Parent',win_dw1dtool,          ...
  441.                                         'Style','Popup',                ...
  442.                                         'Unit',win_units,               ...
  443.                                         'Position',pos_valapp_scr,      ...
  444.                                         'Visible','Off',                ...
  445.                                         'String',str_valapp_scr,        ...
  446.                                         'Enable','off',                 ...
  447.                                         'Tag',tag_valapp_scr,           ...
  448.                                         'Callback',cba_app_scr          ...
  449.                                         );
  450.         txt_txtdet_scr  = uicontrol(...
  451.                                         'Parent',win_dw1dtool,          ...
  452.                                         'Style','Text',                 ...
  453.                                         'Unit',win_units,               ...
  454.                                         'Position',pos_txtdet_scr,      ...
  455.                                         'Visible','Off',                ...
  456.                                         'String',str_txtdet_scr,        ...
  457.                                         'Backgroundcolor',Def_FraBkColor,...
  458.                                         'Tag',tag_txtdet_scr            ...
  459.                                         );
  460.         pop_valdet_scr  = uicontrol(...
  461.                                         'Parent',win_dw1dtool,          ...
  462.                                         'Style','Popup',                ...
  463.                                         'Unit',win_units,               ...
  464.                                         'Position',pos_valdet_scr,      ...
  465.                                         'Visible','Off',                ...
  466.                                         'String',str_valdet_scr,        ...
  467.                                         'Enable','off',                 ...
  468.                                         'Tag',tag_valdet_scr,           ...
  469.                                         'Callback',cba_det_scr          ...
  470.                                         );
  471.         txt_txtlev_dec  = uicontrol(...
  472.                                         'Parent',win_dw1dtool,          ...
  473.                                         'Style','Text',                 ...
  474.                                         'Unit',win_units,               ...
  475.                                         'Position',pos_txtlev_dec,      ...
  476.                                         'Visible','Off',                ...
  477.                                         'String',str_txtlev_dec,        ...
  478.                                         'Backgroundcolor',Def_FraBkColor,...
  479.                                         'Tag',tag_txtdeclev             ...
  480.                                         );
  481.         pop_declev      = uicontrol(...
  482.                                         'Parent',win_dw1dtool, ...
  483.                                         'Style','Popup',       ...
  484.                                         'Unit',win_units,      ...
  485.                                         'Position',pos_declev, ...
  486.                                         'Visible','Off',       ...
  487.                                         'String',str_declev,   ...
  488.                                         'Enable','off',        ...
  489.                                         'Tag',tag_declev,      ...
  490.                                         'Callback',cba_declev  ...
  491.                                         );
  492.         % Adding colormap GUI.
  493.         %---------------------
  494.         utcolmap('create',win_dw1dtool, ...
  495.                  'xloc',xlocINI,        ...
  496.                  'enable','off',        ...
  497.                  'briflag',0,           ...
  498.                  'bkcolor',Def_FraBkColor);
  499.         % Initial Mode.
  500.         %--------------
  501.         pos_txt1   = get(txt_txtapp_scr,'Position');
  502.         pos_opt    = get(pus_dispopt,'Position');
  503.         pos_opt(2) = pos_txt1(2)-Def_Btn_Height-2*dy2;
  504.         set(pus_dispopt,'Position',pos_opt);
  505.         set([txt_txtapp_scr, txt_txtdet_scr,...
  506.              pop_valapp_scr, pop_valdet_scr, pus_dispopt],'Visible','on');
  507.         drawnow
  508. % Add Context Sensitive Help (CSHelp).
  509. %-------------------------------------
  510. hdl_DW1D_DISPMODE = [txt_viewm,pop_viewm];
  511. hdl_DW1D_MOREDISP = [pus_dispopt];
  512. wfighelp('add_ContextMenu',win_dw1dtool,hdl_DW1D_DISPMODE,'DW1D_DISPMODE');
  513. wfighelp('add_ContextMenu',win_dw1dtool,hdl_DW1D_MOREDISP,'DW1D_MOREDISP');
  514. %-------------------------------------
  515.         %  Normalisation.
  516.         %----------------
  517.         Pos_Graphic_Area = wfigmngr('normalize',win_dw1dtool,Pos_Graphic_Area);
  518.         % Callbacks update.
  519.         %------------------
  520.         utanapar('set_cba_num',win_dw1dtool,[m_files;pus_anal]);
  521.         % Memory for stored values.
  522.         %--------------------------
  523.         wmemtool('ini',win_dw1dtool,n_InfoInit,nb0_stored);
  524.         wmemtool('ini',win_dw1dtool,n_param_anal,nb1_stored);
  525.         wmemtool('ini',win_dw1dtool,n_coefs_longs,nb2_stored);
  526.         wmemtool('ini',win_dw1dtool,n_synt_sig,nb3_stored);
  527.         wmemtool('ini',win_dw1dtool,n_miscella,nb4_stored);
  528.         wmemtool('wmb',win_dw1dtool,n_miscella,...
  529.                        ind_graph_area,Pos_Graphic_Area);
  530.         % Setting Initial Colormap.
  531.         %--------------------------
  532.         cbcolmap('set',win_dw1dtool,'pal',{'pink',default_nbcolors});
  533.         % Initialize View Mode Parametres.
  534.         %---------------------------------
  535.         dw1dvmod('ini_vm',win_dw1dtool);
  536.         % End waiting.
  537.         %---------------
  538.         wwaiting('off',win_dw1dtool);
  539.     case {'app','det'}
  540.         fig = varargin{1};
  541.         pop_viewm = findobj(get(fig,'Children'),'flat','tag',tag_pop_viewm);
  542.         view_mode = get(pop_viewm,'Value');
  543.         switch view_mode
  544.             case 1 , dw1dscrm(option,fig);
  545.             case 6 , dw1dcfsm(option,fig);
  546.         end
  547.     case 'dec'
  548.         fig = varargin{1};
  549.         dw1ddecm('dec',fig);
  550.     case 'close'
  551.         % in2 = win_dw1dtool
  552.         %--------------------
  553.         fig = varargin{1};
  554.         called_win = wfindobj('figure','Userdata',fig);
  555.         delete(called_win);
  556.         set(fig,'Visible','Off')
  557.         drawnow
  558.         feval('dw1dfile','del',fig);
  559.     otherwise
  560.         errargt(mfilename,'Unknown Option','msg');
  561.         error('*');
  562. end