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

波变换

开发平台:

Matlab

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