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

波变换

开发平台:

Matlab

  1. function varargout = cw1dtool(option,varargin)
  2. %CW1DTOOL Continuous Wavelet 1-D tool (Real case).
  3. %   VARARGOUT = CW1DTOOL(OPTION,VARARGIN)
  4. %   M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 12-Mar-96.
  5. %   Last Revision: 16-Jan-2001.
  6. %   Copyright 1995-2002 The MathWorks, Inc.
  7. % $Revision: 1.19 $
  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. % Memory bloc of stored values.
  17. %==============================
  18. % MB0.
  19. %-----
  20. n_InfoInit   = 'InfoInit';
  21. ind_filename = 1;
  22. ind_pathname = 2;
  23. nb0_stored   = 2;
  24. % MB1.
  25. %-----
  26. n_param_anal   = 'Par_Anal';
  27. ind_sig_name   = 1;
  28. ind_sig_size   = 2;
  29. ind_wav_name   = 3;
  30. ind_lev_anal   = 4;
  31. ind_act_option = 5;
  32. ind_gra_area   = 6;
  33. nb1_stored     = 6;
  34. % MB2.
  35. %-----
  36. n_coefs_sca    = 'Coefs_Scales';
  37. ind_coefs      = 1;
  38. ind_scales     = 2;
  39. ind_frequences = 3;
  40. ind_sca_OR_frq = 4;
  41. nb2_stored     = 4;
  42. switch option
  43.     case 'create'
  44.         % Get Globals.
  45.         %-------------
  46.         [Def_Txt_Height,Def_Btn_Height,Def_Btn_Width,  ...
  47.          Pop_Min_Width,X_Spacing,Y_Spacing,            ...
  48.          Def_TxtBkColor,Def_EdiBkColor,Def_FraBkColor  ...
  49.          ] = mextglob('get',...
  50.               'Def_Txt_Height','Def_Btn_Height','Def_Btn_Width', ...
  51.               'Pop_Min_Width','X_Spacing','Y_Spacing',           ...
  52.               'Def_TxtBkColor','Def_EdiBkColor','Def_FraBkColor' ...
  53.               );
  54.         % window creation.
  55.         %-----------------
  56.         win_title = 'Continuous Wavelet 1-D';
  57.         [win_tool,pos_win,win_units,str_numwin,...
  58.             fra_hdl,pos_fra,Pos_Graphic_Area,pus_close] = ...
  59.                wfigmngr('create',win_title,winAttrb,...
  60.                   'ExtFig_Tool_3',mfilename,1,1,0);
  61.         if nargout>0 , varargout{1} = win_tool; end
  62. % Add Help for Tool.
  63. %------------------
  64. wfighelp('addHelpTool',win_tool,'&Continuous Analysis','CW1D_GUI');
  65. % Add Help Item.
  66. %----------------
  67. wfighelp('addHelpItem',win_tool,'Continuous Transform','CW_TRANSFORM');
  68. wfighelp('addHelpItem',win_tool,'Continuous Versus Discrete (1)','CW_CONTDISC1');
  69. wfighelp('addHelpItem',win_tool,'Continuous Versus Discrete (2)','CW_CONTDISC2');
  70. wfighelp('addHelpItem',win_tool,'Loading and Saving','CW_LOADSAVE');
  71. % Set 'WindowButtonUpFcn' function.
  72. %---------------------------------
  73. cb_up = ['cw1dmngr(''WindowButtonUpFcn'',' str_numwin ')'];
  74. set(win_tool,'WindowButtonUpFcn',cb_up);
  75. % Menu construction for current figure.
  76.         %--------------------------------------
  77.     m_files = wfigmngr('getmenus',win_tool,'file');
  78.         men_load = uimenu(m_files,...
  79.                          'Label','&Load Signal ', ...
  80.                          'Position',1,           ...
  81.                          'Callback',             ...
  82.                          ['cw1dmngr(''load'',' str_numwin ');'] ...
  83.                          );
  84.         men_save = uimenu(m_files,...
  85.                          'Label','&Save Coefficients ',...
  86.                          'Position',2,                ...
  87.                          'Enable','Off',              ...
  88.                          'Callback',                  ...
  89.                           ['cw1dmngr(''save'',' str_numwin ');'] ...
  90.                           );
  91.         men_demo = uimenu(m_files,...
  92.                          'Label','&Example Analysis ','Position',3);
  93.         demoSET = {...
  94.           'Test Singuralities (I)' , ...
  95.               'cuspamax' , 'haar' , 1 , [1,1,64]  , 128 ; ...
  96.           'Test Singuralities (II)' , ...
  97.               'cuspamax' , 'sym4' , 1 , [1,1,64]  , 128 ; ...
  98.           'Near Breaks (I)' , ...
  99.               'brkintri' , 'coif4'  1 , [1,1,64]  , 128 ; ...
  100.           'Near Breaks (II)' , ...
  101.               'brkintri' , 'gaus4', 1 , [1,1,64]  , 128 ; ...
  102.           'Cantor curve', ...
  103.               'wcantor'  , 'haar' , 1 , [1,1,64]  ,  16 ; ...
  104.           'Cantor curve' , ...
  105.               'wcantor'  , 'meyr' , 1 , [1,1,32]  ,  16 ; ...
  106.           'Cantor curve (non-abs. cfs)' , ...
  107.               'wcantor'  , 'morl' , 2 , [1,1,32]  , 128 ; ...
  108.           'Koch curve' , ...
  109.               'vonkoch'  , 'sym4' , 1 , [1,2,32]  , 128 ; ...
  110.           'Koch curve' , ...
  111.               'vonkoch'  , 'mexh' , 1 , [1,2,32]  , 128 ; ...
  112.           'Koch curve (non-abs. cfs)' , ...
  113.               'vonkoch'  , 'mexh' , 2 , [1,2,32]  , 128 ; ...
  114.           'Frequency breakdown' , ...
  115.               'freqbrk'  , 'sym4' , 1 , [1,1,64]  , 128 ; ...
  116.           'Frequency breakdown' , ...
  117.               'freqbrk'  , 'mexh' , 1 , [1,1,32]  , 128 ; ...
  118.           'Frequency breakdown (non-abs. cfs)' , ...
  119.               'freqbrk'  , 'mexh' , 2 , [1,1,32]  , 128 ; ...
  120.           'Electrical consumption' , ...
  121.               'leleccum' , 'sym6' , 1 , [1,1,32]  , 128 ; ...
  122.           'Noisy sine' , ... 
  123.               'noissin'  , 'db4'  , 2 , [1,1,48]  , 128   ...
  124.           };
  125.         beg_call_str = ['cw1dmngr(''demo'',' str_numwin ','''];
  126.         nbDEM = size(demoSET,1);
  127.         for k=1:nbDEM
  128.             nam  = demoSET{k,1};
  129.             fil  = demoSET{k,2};
  130.             wav  = demoSET{k,3};
  131.             colm = demoSET{k,4};
  132.             val  = demoSET{k,5};
  133.             nbcol = demoSET{k,6};
  134.             scales = ['[' num2str(val(1)) ':' num2str(val(2)) ...
  135.                             ':' num2str(val(3)) ']'];
  136.             libel = ['with ' wav '   at scales  ' scales ...
  137.                             '  -->  ' nam];
  138.             action = [beg_call_str fil ''',''' wav ''','  ...
  139.                     num2str(val(1)) ',' num2str(val(2)) ',' ...
  140.                     num2str(val(3)) ',' sprintf('%.0f',colm) ',' ...
  141.                     int2str(nbcol) ');'];
  142.             uimenu(men_demo,'Label',libel,'Callback',action);
  143.         end
  144.         % Begin waiting.
  145.         %---------------
  146.         wwaiting('msg',win_tool,'Wait ... initialization');
  147.         % General graphical parameters initialization.
  148.         %--------------------------------------------
  149.         x_frame   = pos_fra(1);
  150.         cmd_width = pos_fra(3);
  151.         dx = X_Spacing;
  152.         dy = Y_Spacing; dy2 = 2*dy;        
  153.         d_txt = (Def_Btn_Height-Def_Txt_Height);
  154.         pop_width = pos_fra(3)-8*dx;
  155.         % Command part of the window.
  156.         %============================
  157.         % Data, Wavelet and Level parameters.
  158.         %------------------------------------
  159.         xlocINI = pos_fra([1 3]);
  160.         ytopINI = pos_win(4)-dy;
  161.         toolPos = utanapar('create',win_tool, ...
  162.                     'levflag',0, ...
  163.                     'xloc',xlocINI,'top',ytopINI,...
  164.                     'enable','off', ...
  165.                     'wtype','cwt',            ...
  166.                     'maxlev',max_lev_anal  ...
  167.                     );
  168.         % Adding colormap GUI.
  169.         %---------------------
  170.         utcolmap('create',win_tool, ...
  171.                  'xloc',xlocINI, ...
  172.                  'enable','off', ...
  173.                  'bkcolor',Def_FraBkColor);
  174.         colmapPos = utcolmap('position',win_tool);
  175.         % Setting Initial Colormap.
  176.         %--------------------------
  177.         cbcolmap('set',win_tool,'pal',{'pink',default_nbcolors})
  178.         % UIC construction.
  179.         %------------------------------------------------------------------
  180.         y_low       = toolPos(2);
  181.         h_fra       = Def_Btn_Height+2*dy;
  182.         y_fra       = y_low-h_fra-dy2;
  183.         pos_fra_sam = [toolPos(1),y_fra,toolPos(3),h_fra];
  184.         y_low       = pos_fra_sam(2)+dy;
  185.         x_uic       = toolPos(1)+dx;
  186.         w_uic       = Pop_Min_Width;
  187.         pos_txt_sam = [x_uic, y_low+d_txt/2, 2*w_uic, Def_Txt_Height];
  188.         x_uic       = x_uic+pos_txt_sam(3);
  189.         pos_edi_sam = [x_uic, y_low , w_uic, Def_Btn_Height] ;      
  190.         %------------------------------------------------------------------
  191.         h_fra       = 4*Def_Btn_Height+7*dy;
  192.         y_fra       = pos_fra_sam(2)-h_fra-2*dy2;
  193.         pos_fra_sca = [toolPos(1),y_fra,toolPos(3),h_fra];
  194.         y_low       = y_fra+dy;
  195.         %------------------------------------------------------------------
  196.         x_left_1    = x_frame+2*dx;
  197.         x_left_2    = x_frame+(cmd_width-pop_width)/2;
  198.         y_uic       = pos_fra_sca(2)+pos_fra_sca(4)-dy;
  199.         w_uic       = 1.5*Pop_Min_Width;        
  200.         x_uic       = toolPos(1)+(toolPos(3)-w_uic)/2;
  201.         pos_txt_sca = [x_uic, y_uic, w_uic, Def_Txt_Height];
  202.         y_low       = pos_txt_sca(2)-Def_Btn_Height-dy;
  203.         pos_pop_sca = [x_left_2, y_low, pop_width, Def_Btn_Height];
  204.         %------------------------------------------------------------------
  205.         deltay      = Def_Btn_Height+dy;
  206.         w_txt       = pos_pop_sca(3)/2+2*dx;
  207.         w_edi       = pos_pop_sca(3)/2-2*dx;
  208.         y_low       = pos_pop_sca(2)-Def_Btn_Height-dy2;
  209.         pos_txt_min = [x_left_1, y_low+d_txt/2, w_txt, Def_Txt_Height];
  210.         pos_edi_min = [x_left_1+w_txt, y_low, w_edi, Def_Btn_Height];
  211.         pos_txt_stp = pos_txt_min; pos_txt_stp(2) = pos_txt_stp(2)-deltay;
  212.         pos_edi_stp = pos_edi_min; pos_edi_stp(2) = pos_edi_stp(2)-deltay;
  213.         pos_txt_max = pos_txt_stp; pos_txt_max(2) = pos_txt_max(2)-deltay;
  214.         pos_edi_max = pos_edi_stp; pos_edi_max(2) = pos_edi_max(2)-deltay;
  215.         %------------------------------------------------------------------
  216.         w_txt       = (2*Def_Btn_Width)/3;
  217.         pos_txt_pow = [x_left_1, y_low+d_txt/2, w_txt, Def_Txt_Height];
  218.         xl          = pos_txt_pow(1)+pos_txt_pow(3)+dx;
  219.         pos_pop_pow = [xl, y_low, Pop_Min_Width, Def_Btn_Height];
  220.         %------------------------------------------------------------------
  221.         pos_txt_msc = [x_left_1, y_low , pos_pop_sca(3), Def_Txt_Height];
  222.         y_low       = y_low-Def_Btn_Height-dy;
  223.         pos_edi_msc = [x_left_2, y_low , pos_pop_sca(3), Def_Btn_Height];
  224.         %------------------------------------------------------------------
  225.         w_uic       = 1.5*Def_Btn_Width;
  226.         y_uic       = 1.5*Def_Btn_Height;
  227.         y_low       = pos_fra_sca(2)-y_uic-3*dy;
  228.         x_uic       = toolPos(1)+(toolPos(3)-w_uic)/2;
  229.         pos_pus_ana = [x_uic,y_low,w_uic,y_uic];
  230.         %------------------------------------------------------------------
  231.         %------------------------------------------------------------------
  232.         y_fra       = colmapPos(2)+colmapPos(4)+3*dy;
  233.         h_fra       = Def_Btn_Height+3*dy;        
  234.         pos_fra_ccm = [toolPos(1),y_fra,toolPos(3),h_fra];
  235.         y_low       = y_fra+dy;
  236.         pos_pop_ccm = [toolPos(1)+dx,y_low,toolPos(3)-2*dx,Def_Btn_Height];
  237.         y_low       = y_low+Def_Btn_Height+dy/2;
  238.         w_uic       = 1.5*Def_Btn_Width;
  239.         x_uic       = toolPos(1)+(toolPos(3)-w_uic)/2;
  240.         pos_txt_ccm = [x_uic, y_low, w_uic, Def_Txt_Height];
  241.         %------------------------------------------------------------------
  242.         y_low       = pos_fra_ccm(2)+pos_fra_ccm(4)+2*dy2;
  243.         x_uic       = toolPos(1);
  244.         w_uic       = (toolPos(3)-dx)/2;
  245.         pos_rad_SCA = [x_uic, y_low, w_uic, Def_Btn_Height];
  246.         x_uic       = x_uic+w_uic+dx;
  247.         pos_rad_FRQ = [x_uic, y_low, w_uic, Def_Btn_Height];
  248.         %------------------------------------------------------------------
  249.         y_fra       = pos_rad_SCA(2)+pos_rad_SCA(4)+dy2;
  250.         h_fra       = 3*Def_Btn_Height+3*dy;
  251.         w_uic       = 2*Def_Btn_Width;
  252.         w_fra       = w_uic+2*dx;
  253.         x_fra       = toolPos(1)+(toolPos(3)-w_fra)/2; 
  254.         pos_fra_axe = [x_fra,y_fra,w_fra,h_fra];
  255.         y_low       = y_fra+dy;
  256.         x_uic       = x_fra+dx;
  257.         pos_chk_LML = [x_uic, y_low, w_uic, Def_Btn_Height];
  258.         y_low       = y_low+Def_Btn_Height;
  259.         pos_chk_LC  = [x_uic, y_low, w_uic, Def_Btn_Height];
  260.         y_low       = y_low+Def_Btn_Height;
  261.         pos_chk_DEC = [x_uic, y_low, w_uic, Def_Btn_Height];
  262.         y_low       = y_low+Def_Btn_Height;
  263.         w_uic       = 1.25*Def_Btn_Width;
  264.         x_uic       = toolPos(1)+(toolPos(3)-w_uic)/2; 
  265.         pos_txt_axe = [x_uic, y_low, w_uic, Def_Txt_Height];
  266.         %------------------------------------------------------------------
  267.         y_low       = pos_fra_axe(2)+pos_fra_axe(4)+2*dy2;
  268.         xg          = x_frame+(cmd_width-pop_width)/2;
  269.         pos_pus_ref = [xg,y_low,pop_width,Def_Btn_Height];
  270.         y_low       = y_low+Def_Btn_Height;
  271.         pos_pus_lin = [xg,y_low,pop_width,Def_Btn_Height];
  272.         %------------------------------------------------------------------
  273.         % String property of objects.
  274.         %----------------------------
  275.         str_txt_sam = 'Sampling Period:';
  276.         str_txt_sca = 'Scale Settings';
  277.         str_pop_sca = ...
  278.             strvcat('Step by Step Mode','Power 2 Mode','Manual Mode'); 
  279.         str_pus_ana = 'Analyze';
  280.         str_pus_lin = 'New Coefficients Line';
  281.         str_pus_ref = 'Refresh Maxima Lines';
  282.         str_txt_min = 'Min  ( > 0)';
  283.         str_txt_stp = 'Step ( > 0 )';
  284.         str_txt_max = 'Max     ';
  285.         str_txt_pow = 'Power';
  286.         str_pop_pow = int2str([1:max_lev_anal]');
  287.         str_txt_msc = 'Scales : MATLAB Vector';
  288.         str_txt_axe = 'Selected Axes';
  289.         str_chk_LML = 'Maxima Lines';
  290.         str_chk_LC  = 'Coefficients Line';
  291.         str_chk_DEC = 'Coefficients';
  292.         str_rad_SCA = 'Scales';
  293.         str_rad_FRQ = 'Frequencies';
  294.         str_txt_ccm = 'Coloration Mode';
  295.         str_pop_ccm = ['init + by scale + abs     '; ...
  296.                        'init + by scale           '; ...
  297.                        'init + all scales + abs   '; ...
  298.                        'init + all scales         '; ...
  299.                        'current + by scale + abs  '; ...
  300.                        'current + by scale        '; ...
  301.                        'current + all scales + abs'; ...
  302.                        'current + all scales      '      ];
  303.         % Callback property of objects.
  304.         %------------------------------
  305.         cba_edi_sam = ['cw1dmngr(''setSamPer'',' str_numwin ');'];
  306.         cba_pus_ana = ['cw1dmngr(''anal'',' str_numwin ');'];
  307.         cba_pus_lin = ['cw1dmngr(''newCfsLine'',' str_numwin ');'];
  308.         cba_pus_ref = ['cw1dmngr(''newChainLine'',' str_numwin ');'];
  309.         cba_pop_sca = ['cw1dmngr(''newScaleMode'',' str_numwin ');'];
  310.         cba_axe_CHK = ['cw1dmngr(''setPosAxes'',' str_numwin ');'];
  311.         cba_sof_RAD = ['cw1dmngr(''sca_OR_frq'',' str_numwin ');'];
  312.         cba_pop_ccm = ['cw1dmngr(''colorCoefs'',' str_numwin ');'];
  313.  
  314.         % UIC common properties.
  315.         %-----------------------
  316.         comPropINI = {...
  317.            'Parent',win_tool, ...
  318.            'Unit',win_units,  ...
  319.            };        
  320.         comPropAll = {comPropINI{:},'Visible','On'};
  321.         comPropFra = {comPropAll{:},       ...
  322.            'Style','frame',                ...
  323.            'Backgroundcolor',Def_FraBkColor...
  324.            };
  325.         comPropTxtLEFT = {comPropAll{:},   ...
  326.            'Style','text',                 ...
  327.            'HorizontalAlignment','left',   ...
  328.            'Backgroundcolor',Def_FraBkColor...
  329.            };
  330.         comPropTxtCENT = {comPropAll{:},   ...
  331.            'Style','text',                 ...
  332.            'HorizontalAlignment','center', ...
  333.            'Backgroundcolor',Def_FraBkColor...
  334.            };
  335.         comPropEdi = {comPropAll{:},       ...
  336.            'Style','edit',                 ...
  337.            'Enable','Off',                 ...
  338.            'HorizontalAlignment','center', ...
  339.            'Backgroundcolor',Def_EdiBkColor...
  340.            };
  341.         comPropChk = {comPropAll{:},       ...
  342.            'Style','CheckBox',             ...
  343.            'Enable','Off',                 ...
  344.            'HorizontalAlignment','center', ...
  345.            'Backgroundcolor',Def_FraBkColor...
  346.            };
  347.         comPropRad = {comPropAll{:},       ...
  348.            'Style','RadioButton',          ...
  349.            'Enable','Off',                 ...
  350.            'HorizontalAlignment','center', ...
  351.            'Backgroundcolor',Def_FraBkColor...
  352.            };
  353.         % UIC construction.
  354.         %------------------
  355.         %-----------------------------------------------------------------%
  356.         fra_sam = uicontrol(comPropFra{:},'Position',pos_fra_sam);
  357.         txt_sam = uicontrol(comPropTxtLEFT{:},              ...
  358.                             'Position',pos_txt_sam,         ...
  359.                             'HorizontalAlignment','center', ...
  360.                             'String',str_txt_sam            ...
  361.                             );
  362.         edi_sam = uicontrol(comPropEdi{:}, ...
  363.                             'Position',pos_edi_sam, ...
  364.                             'CallBack',cba_edi_sam);
  365.         %-----------------------------------------------------------------%
  366.         fra_sca = uicontrol(comPropFra{:},          ...
  367.                             'Position',pos_fra_sca, ...
  368.                             'TooltipString','Scale Settings'  ...
  369.                             );
  370.         txt_sca = uicontrol(comPropTxtCENT{:},      ...
  371.                             'Position',pos_txt_sca, ...
  372.                             'String',str_txt_sca    ...
  373.                             );
  374.         sca_mod = 1;
  375.         pop_sca = uicontrol(comPropAll{:},          ...
  376.                             'Style','Popup',        ...
  377.                             'Position',pos_pop_sca, ...
  378.                             'String',str_pop_sca,   ...
  379.                             'Value',sca_mod ,       ...
  380.                             'UserData',0,           ...
  381.                             'Enable','Off',         ...
  382.                             'Callback',cba_pop_sca  ...
  383.                              );
  384.         pus_ana = uicontrol(comPropAll{:},          ...
  385.                             'Style','Pushbutton',   ...
  386.                             'Position',pos_pus_ana, ...
  387.                             'String',xlate(str_pus_ana),   ...
  388.                             'Enable','Off',         ...
  389.                             'Callback',cba_pus_ana, ...
  390.                             'Interruptible','On'    ...
  391.                             );
  392.         %-------------------------- Mode Step by Step --------------------%
  393.         txt_min = uicontrol(comPropTxtLEFT{:},      ...
  394.                             'Position',pos_txt_min, ...
  395.                             'String',str_txt_min    ...
  396.                             );
  397.         edi_min = uicontrol(comPropEdi{:},'Position',pos_edi_min);
  398.         txt_stp = uicontrol(comPropTxtLEFT{:},      ...
  399.                             'Position',pos_txt_stp, ...
  400.                             'String',str_txt_stp    ...
  401.                             );
  402.         edi_stp = uicontrol(comPropEdi{:},'Position',pos_edi_stp);
  403.         txt_max = uicontrol(comPropTxtLEFT{:},      ...
  404.                             'Position',pos_txt_max, ...
  405.                             'String',str_txt_max    ...
  406.                             );
  407.         edi_max = uicontrol(comPropEdi{:},'Position',pos_edi_max);
  408.         %--------------------------- Mode Power 2-------------------------%
  409.         txt_pow = uicontrol(comPropTxtLEFT{:},      ...
  410.                             'Visible','Off',        ...
  411.                             'Position',pos_txt_pow, ...
  412.                             'String',str_txt_pow    ...
  413.                             );
  414.         pop_pow = uicontrol(comPropAll{:},          ...
  415.                             'Style','Popup',        ...
  416.                             'Visible','Off',        ...
  417.                             'Position',pos_pop_pow, ...
  418.                             'String',str_pop_pow,   ...
  419.                             'Enable','off'          ...
  420.                             );
  421.         %-------------------------- Mode Manual --------------------------%
  422.         txt_msc = uicontrol(comPropTxtLEFT{:},      ...
  423.                             'Visible','Off',        ...
  424.                             'Position',pos_txt_msc, ...
  425.                             'String',str_txt_msc    ...
  426.                             );
  427.         edi_msc = uicontrol(comPropEdi{:},          ...
  428.                             'Visible','Off',        ...
  429.                             'Position',pos_edi_msc, ...
  430.                             'String','[1:2:64]'     ...
  431.                             );
  432.         %-----------------------------------------------------------------%
  433.         fra_axe = uicontrol(comPropFra{:},'Position',pos_fra_axe);
  434.         txt_axe = uicontrol(comPropTxtCENT{:},      ...
  435.                             'Position',pos_txt_axe, ...
  436.                             'String',str_txt_axe    ...
  437.                             );
  438.         chk_DEC = uicontrol(comPropChk{:},          ...
  439.                             'Position',pos_chk_DEC, ...
  440.                             'String',str_chk_DEC,   ...
  441.                             'Value',1,              ...
  442.                             'Callback',cba_axe_CHK  ...
  443.                             );
  444.         chk_LC  = uicontrol(comPropChk{:},          ...
  445.                             'Position',pos_chk_LC,  ...
  446.                             'String',str_chk_LC,    ...
  447.                             'Value',1,              ...
  448.                             'Callback',cba_axe_CHK  ...
  449.                             );
  450.         chk_LML = uicontrol(comPropChk{:},          ...
  451.                             'Position',pos_chk_LML, ...
  452.                             'String',str_chk_LML,   ...
  453.                             'Value',1,              ...
  454.                             'Callback',cba_axe_CHK  ...
  455.                             );
  456.         pus_lin = uicontrol(comPropAll{:},          ...
  457.                             'Style','Pushbutton',   ...
  458.                             'Position',pos_pus_lin, ...
  459.                             'String',xlate(str_pus_lin),   ...
  460.                             'Enable','Off',         ...
  461.                             'Callback',cba_pus_lin, ...
  462. 'Tooltip','New Coefficients Line', ...
  463.                             'Interruptible','On'    ...
  464.                             );
  465.         pus_ref = uicontrol(comPropAll{:},          ...
  466.                             'Style','Pushbutton',   ...
  467.                             'Position',pos_pus_ref, ...
  468.                             'String',xlate(str_pus_ref),   ...
  469.                             'Enable','Off',         ...
  470.                             'Callback',cba_pus_ref, ...
  471. 'Tooltip','Refresh Maxima Lines', ...
  472.                             'Interruptible','On'    ...
  473.                             );
  474.         %-----------------------------------------------------------------%
  475.         rad_SCA = uicontrol(comPropRad{:},          ...
  476.                             'Position',pos_rad_SCA, ...
  477.                             'String',str_rad_SCA,   ...
  478.                             'Value',1,              ...
  479.                             'Callback',cba_sof_RAD  ...
  480.                             );
  481.         rad_FRQ = uicontrol(comPropRad{:},          ...
  482.                             'Position',pos_rad_FRQ, ...
  483.                             'String',str_rad_FRQ,   ...
  484.                             'Value',0,              ...
  485.                             'Callback',cba_sof_RAD  ...                            
  486.                             );
  487.         %-----------------------------------------------------------------%
  488.         fra_ccm = uicontrol(comPropFra{:},'Position',pos_fra_ccm);
  489.         txt_ccm = uicontrol(comPropTxtCENT{:},      ...
  490.                             'Position',pos_txt_ccm, ...
  491.                             'String',str_txt_ccm    ...
  492.                             );
  493.         pop_ccm = uicontrol(comPropAll{:},          ...
  494.                             'Style','Popup',        ...
  495.                             'Position',pos_pop_ccm, ...
  496.                             'String',str_pop_ccm,   ...
  497.                             'Value',1,              ...
  498.                             'UserData',0,           ...
  499.                             'Enable','Off',         ...
  500.                             'Callback',cba_pop_ccm  ...
  501.                             );
  502.         %-----------------------------------------------------------------%
  503.         % Callbacks update.
  504.         %------------------
  505.         utanapar('set_cba_num',win_tool,[m_files;pus_ana]);
  506.         drawnow;
  507.         %  Normalization.
  508.         %----------------
  509.         Pos_Graphic_Area = wfigmngr('normalize',win_tool,Pos_Graphic_Area);
  510.         % Tool Parameters & Axes Construction.
  511.         %-------------------------------------     
  512.         hdl_Re_AXES = cw1dutil('initPosAxes',win_tool,'real',Pos_Graphic_Area);
  513. % Add Context Sensitive Help (CSHelp).
  514. %-------------------------------------
  515. hdl_CW_SCALES = [ ...
  516. fra_sca,txt_sca,pop_sca, ...
  517. txt_min,edi_min,txt_stp,edi_stp, ...
  518. txt_max,edi_max,txt_pow,pop_pow, ...
  519. txt_msc,edi_msc                  ...
  520. ];
  521. hdl_CW_COEFLINE = [pus_lin];
  522. hdl_CW_MAXLINE  = [pus_ref];
  523. hdl_CW_SCAL2FRQ = [rad_SCA,rad_FRQ];
  524. hdl_CW_COLMODE  = [fra_ccm,txt_ccm,pop_ccm];
  525. wfighelp('add_ContextMenu',win_tool,hdl_CW_SCALES,'CW_SCALES');
  526. wfighelp('add_ContextMenu',win_tool,hdl_CW_COEFLINE,'CW_COEFLINE');
  527. wfighelp('add_ContextMenu',win_tool,hdl_CW_MAXLINE,'CW_MAXLINE');
  528. wfighelp('add_ContextMenu',win_tool,hdl_CW_SCAL2FRQ,'CW_SCAL2FRQ');
  529. wfighelp('add_ContextMenu',win_tool,hdl_CW_COLMODE,'CW_COLMODE');
  530. %-------------------------------------
  531.         % Memory for stored values.
  532.         %--------------------------
  533.         wmemtool('ini',win_tool,n_InfoInit,nb0_stored);
  534.         wmemtool('ini',win_tool,n_param_anal,nb1_stored);
  535.         wmemtool('ini',win_tool,n_coefs_sca,nb2_stored);
  536.         wmemtool('wmb',win_tool,n_param_anal,ind_gra_area,Pos_Graphic_Area);
  537.         wmemtool('wmb',win_tool,n_coefs_sca,ind_sca_OR_frq,ind_scales);
  538.         fields = {...
  539.           'fra_sam','txt_sam','edi_sam', ...
  540.           'fra_sca','txt_sca','pop_sca', ...
  541.           'pus_ana',                     ...
  542.           'txt_min','edi_min',           ...
  543.           'txt_stp','edi_stp',           ...
  544.           'txt_max','edi_max',           ...
  545.           'txt_pow','pop_pow',           ...
  546.           'txt_msc','edi_msc',           ...
  547.           'pus_lin','pus_ref',           ...
  548.           'fra_axe','txt_axe',           ...
  549.           'chk_DEC','chk_LC' ,'chk_LML', ...
  550.           'rad_SCA','rad_FRQ',           ...
  551.           'fra_ccm','txt_ccm','pop_ccm'  ...
  552.           };
  553.         values = {...
  554.            fra_sam , txt_sam , edi_sam , ...
  555.            fra_sca , txt_sca , pop_sca , ...
  556.            pus_ana ,                     ...
  557.            txt_min , edi_min ,           ...
  558.            txt_stp , edi_stp ,           ...
  559.            txt_max , edi_max ,           ...
  560.            txt_pow , pop_pow ,           ...
  561.            txt_msc , edi_msc ,           ...
  562.            pus_lin , pus_ref ,           ...
  563.            fra_axe , txt_axe ,           ...
  564.            chk_DEC , chk_LC  , chk_LML , ...
  565.            rad_SCA , rad_FRQ ,           ...
  566.            fra_ccm , txt_ccm , pop_ccm   ...
  567.            };
  568.         
  569.         hdl_UIC = cell2struct(values,fields,2);
  570.         hdl_MEN = [men_load ; men_save ; men_demo];
  571.         handles = struct(...
  572.             'hdl_MEN',hdl_MEN, ...
  573.             'hdl_UIC',hdl_UIC, ...
  574.             'hdl_Re_AXES',hdl_Re_AXES ...
  575.             );
  576.         wfigmngr('storeValue',win_tool,['CW1D_handles'],handles);
  577.         % End waiting.
  578.         %---------------
  579.         wwaiting('off',win_tool);
  580.     case 'close'
  581.     otherwise
  582.         errargt(mfilename,'Unknown Option','msg');
  583.         error('*');
  584. end