📄 cw1dtool.m
字号:
str_rad_FRQ = 'Frequencies';
str_txt_ccm = 'Coloration Mode';
str_pop_ccm = ['init + by scale + abs '; ...
'init + by scale '; ...
'init + all scales + abs '; ...
'init + all scales '; ...
'current + by scale + abs '; ...
'current + by scale '; ...
'current + all scales + abs'; ...
'current + all scales ' ];
% Callback property of objects.
%------------------------------
cba_edi_sam = ['cw1dmngr(''setSamPer'',' str_numwin ');'];
cba_pus_ana = ['cw1dmngr(''anal'',' str_numwin ');'];
cba_pus_lin = ['cw1dmngr(''newCfsLine'',' str_numwin ');'];
cba_pus_ref = ['cw1dmngr(''newChainLine'',' str_numwin ');'];
cba_pop_sca = ['cw1dmngr(''newScaleMode'',' str_numwin ');'];
cba_axe_CHK = ['cw1dmngr(''setPosAxes'',' str_numwin ');'];
cba_sof_RAD = ['cw1dmngr(''sca_OR_frq'',' str_numwin ');'];
cba_pop_ccm = ['cw1dmngr(''colorCoefs'',' str_numwin ');'];
% UIC common properties.
%-----------------------
comPropINI = {...
'Parent',win_tool, ...
'Unit',win_units, ...
};
comPropAll = {comPropINI{:},'Visible','On'};
comPropFra = {comPropAll{:}, ...
'Style','frame', ...
'Backgroundcolor',Def_FraBkColor...
};
comPropTxtLEFT = {comPropAll{:}, ...
'Style','text', ...
'HorizontalAlignment','left', ...
'Backgroundcolor',Def_FraBkColor...
};
comPropTxtCENT = {comPropAll{:}, ...
'Style','text', ...
'HorizontalAlignment','center', ...
'Backgroundcolor',Def_FraBkColor...
};
comPropEdi = {comPropAll{:}, ...
'Style','edit', ...
'Enable','Off', ...
'HorizontalAlignment','center', ...
'Backgroundcolor',Def_EdiBkColor...
};
comPropChk = {comPropAll{:}, ...
'Style','CheckBox', ...
'Enable','Off', ...
'HorizontalAlignment','center', ...
'Backgroundcolor',Def_FraBkColor...
};
comPropRad = {comPropAll{:}, ...
'Style','RadioButton', ...
'Enable','Off', ...
'HorizontalAlignment','center', ...
'Backgroundcolor',Def_FraBkColor...
};
% UIC construction.
%------------------
%-----------------------------------------------------------------%
fra_sam = uicontrol(comPropFra{:},'Position',pos_fra_sam);
txt_sam = uicontrol(comPropTxtLEFT{:}, ...
'Position',pos_txt_sam, ...
'HorizontalAlignment','center', ...
'String',str_txt_sam ...
);
edi_sam = uicontrol(comPropEdi{:}, ...
'Position',pos_edi_sam, ...
'CallBack',cba_edi_sam);
%-----------------------------------------------------------------%
fra_sca = uicontrol(comPropFra{:}, ...
'Position',pos_fra_sca, ...
'TooltipString','Scale Settings' ...
);
txt_sca = uicontrol(comPropTxtCENT{:}, ...
'Position',pos_txt_sca, ...
'String',str_txt_sca ...
);
sca_mod = 1;
pop_sca = uicontrol(comPropAll{:}, ...
'Style','Popup', ...
'Position',pos_pop_sca, ...
'String',str_pop_sca, ...
'Value',sca_mod , ...
'UserData',0, ...
'Enable','Off', ...
'Callback',cba_pop_sca ...
);
pus_ana = uicontrol(comPropAll{:}, ...
'Style','Pushbutton', ...
'Position',pos_pus_ana, ...
'String',xlate(str_pus_ana), ...
'Enable','Off', ...
'Callback',cba_pus_ana, ...
'Interruptible','On' ...
);
%-------------------------- Mode Step by Step --------------------%
txt_min = uicontrol(comPropTxtLEFT{:}, ...
'Position',pos_txt_min, ...
'String',str_txt_min ...
);
edi_min = uicontrol(comPropEdi{:},'Position',pos_edi_min);
txt_stp = uicontrol(comPropTxtLEFT{:}, ...
'Position',pos_txt_stp, ...
'String',str_txt_stp ...
);
edi_stp = uicontrol(comPropEdi{:},'Position',pos_edi_stp);
txt_max = uicontrol(comPropTxtLEFT{:}, ...
'Position',pos_txt_max, ...
'String',str_txt_max ...
);
edi_max = uicontrol(comPropEdi{:},'Position',pos_edi_max);
%--------------------------- Mode Power 2-------------------------%
txt_pow = uicontrol(comPropTxtLEFT{:}, ...
'Visible','Off', ...
'Position',pos_txt_pow, ...
'String',str_txt_pow ...
);
pop_pow = uicontrol(comPropAll{:}, ...
'Style','Popup', ...
'Visible','Off', ...
'Position',pos_pop_pow, ...
'String',str_pop_pow, ...
'Enable','off' ...
);
%-------------------------- Mode Manual --------------------------%
txt_msc = uicontrol(comPropTxtLEFT{:}, ...
'Visible','Off', ...
'Position',pos_txt_msc, ...
'String',str_txt_msc ...
);
edi_msc = uicontrol(comPropEdi{:}, ...
'Visible','Off', ...
'Position',pos_edi_msc, ...
'String','[1:2:64]' ...
);
%-----------------------------------------------------------------%
fra_axe = uicontrol(comPropFra{:},'Position',pos_fra_axe);
txt_axe = uicontrol(comPropTxtCENT{:}, ...
'Position',pos_txt_axe, ...
'String',str_txt_axe ...
);
chk_DEC = uicontrol(comPropChk{:}, ...
'Position',pos_chk_DEC, ...
'String',str_chk_DEC, ...
'Value',1, ...
'Callback',cba_axe_CHK ...
);
chk_LC = uicontrol(comPropChk{:}, ...
'Position',pos_chk_LC, ...
'String',str_chk_LC, ...
'Value',1, ...
'Callback',cba_axe_CHK ...
);
chk_LML = uicontrol(comPropChk{:}, ...
'Position',pos_chk_LML, ...
'String',str_chk_LML, ...
'Value',1, ...
'Callback',cba_axe_CHK ...
);
pus_lin = uicontrol(comPropAll{:}, ...
'Style','Pushbutton', ...
'Position',pos_pus_lin, ...
'String',xlate(str_pus_lin), ...
'Enable','Off', ...
'Callback',cba_pus_lin, ...
'Tooltip','New Coefficients Line', ...
'Interruptible','On' ...
);
pus_ref = uicontrol(comPropAll{:}, ...
'Style','Pushbutton', ...
'Position',pos_pus_ref, ...
'String',xlate(str_pus_ref), ...
'Enable','Off', ...
'Callback',cba_pus_ref, ...
'Tooltip','Refresh Maxima Lines', ...
'Interruptible','On' ...
);
%-----------------------------------------------------------------%
rad_SCA = uicontrol(comPropRad{:}, ...
'Position',pos_rad_SCA, ...
'String',str_rad_SCA, ...
'Value',1, ...
'Callback',cba_sof_RAD ...
);
rad_FRQ = uicontrol(comPropRad{:}, ...
'Position',pos_rad_FRQ, ...
'String',str_rad_FRQ, ...
'Value',0, ...
'Callback',cba_sof_RAD ...
);
%-----------------------------------------------------------------%
fra_ccm = uicontrol(comPropFra{:},'Position',pos_fra_ccm);
txt_ccm = uicontrol(comPropTxtCENT{:}, ...
'Position',pos_txt_ccm, ...
'String',str_txt_ccm ...
);
pop_ccm = uicontrol(comPropAll{:}, ...
'Style','Popup', ...
'Position',pos_pop_ccm, ...
'String',str_pop_ccm, ...
'Value',1, ...
'UserData',0, ...
'Enable','Off', ...
'Callback',cba_pop_ccm ...
);
%-----------------------------------------------------------------%
% Callbacks update.
%------------------
utanapar('set_cba_num',win_tool,[m_files;pus_ana]);
drawnow;
% Normalization.
%----------------
Pos_Graphic_Area = wfigmngr('normalize',win_tool,Pos_Graphic_Area);
% Tool Parameters & Axes Construction.
%-------------------------------------
hdl_Re_AXES = cw1dutil('initPosAxes',win_tool,'real',Pos_Graphic_Area);
% Add Context Sensitive Help (CSHelp).
%-------------------------------------
hdl_CW_SCALES = [ ...
fra_sca,txt_sca,pop_sca, ...
txt_min,edi_min,txt_stp,edi_stp, ...
txt_max,edi_max,txt_pow,pop_pow, ...
txt_msc,edi_msc ...
];
hdl_CW_COEFLINE = [pus_lin];
hdl_CW_MAXLINE = [pus_ref];
hdl_CW_SCAL2FRQ = [rad_SCA,rad_FRQ];
hdl_CW_COLMODE = [fra_ccm,txt_ccm,pop_ccm];
wfighelp('add_ContextMenu',win_tool,hdl_CW_SCALES,'CW_SCALES');
wfighelp('add_ContextMenu',win_tool,hdl_CW_COEFLINE,'CW_COEFLINE');
wfighelp('add_ContextMenu',win_tool,hdl_CW_MAXLINE,'CW_MAXLINE');
wfighelp('add_ContextMenu',win_tool,hdl_CW_SCAL2FRQ,'CW_SCAL2FRQ');
wfighelp('add_ContextMenu',win_tool,hdl_CW_COLMODE,'CW_COLMODE');
%-------------------------------------
% Memory for stored values.
%--------------------------
wmemtool('ini',win_tool,n_InfoInit,nb0_stored);
wmemtool('ini',win_tool,n_param_anal,nb1_stored);
wmemtool('ini',win_tool,n_coefs_sca,nb2_stored);
wmemtool('wmb',win_tool,n_param_anal,ind_gra_area,Pos_Graphic_Area);
wmemtool('wmb',win_tool,n_coefs_sca,ind_sca_OR_frq,ind_scales);
fields = {...
'fra_sam','txt_sam','edi_sam', ...
'fra_sca','txt_sca','pop_sca', ...
'pus_ana', ...
'txt_min','edi_min', ...
'txt_stp','edi_stp', ...
'txt_max','edi_max', ...
'txt_pow','pop_pow', ...
'txt_msc','edi_msc', ...
'pus_lin','pus_ref', ...
'fra_axe','txt_axe', ...
'chk_DEC','chk_LC' ,'chk_LML', ...
'rad_SCA','rad_FRQ', ...
'fra_ccm','txt_ccm','pop_ccm' ...
};
values = {...
fra_sam , txt_sam , edi_sam , ...
fra_sca , txt_sca , pop_sca , ...
pus_ana , ...
txt_min , edi_min , ...
txt_stp , edi_stp , ...
txt_max , edi_max , ...
txt_pow , pop_pow , ...
txt_msc , edi_msc , ...
pus_lin , pus_ref , ...
fra_axe , txt_axe , ...
chk_DEC , chk_LC , chk_LML , ...
rad_SCA , rad_FRQ , ...
fra_ccm , txt_ccm , pop_ccm ...
};
hdl_UIC = cell2struct(values,fields,2);
hdl_MEN = [men_load ; men_save ; men_demo];
handles = struct(...
'hdl_MEN',hdl_MEN, ...
'hdl_UIC',hdl_UIC, ...
'hdl_Re_AXES',hdl_Re_AXES ...
);
wfigmngr('storeValue',win_tool,['CW1D_handles'],handles);
% End waiting.
%---------------
wwaiting('off',win_tool);
case 'close'
otherwise
errargt(mfilename,'Unknown Option','msg');
error('*');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -