Home > m > gui > specwin_viewer > specwin_viewer.m

specwin_viewer

PURPOSE ^

SPECWIN_VIEWER allows the user to explore spectral windows.

SYNOPSIS ^

function varargout = specwin_viewer(varargin)

DESCRIPTION ^

 SPECWIN_VIEWER allows the user to explore spectral windows.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: SPECWIN_VIEWER allows the user to explore spectral windows.

 CALL:        specwin_viewer


 VERSION:     $Id: specwin_viewer.m,v 1.2 2008/03/07 13:35:16 hewitson Exp $

 HISTORY: 07-03-08 M Hewitson
             Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function varargout = specwin_viewer(varargin)
0002 
0003 % SPECWIN_VIEWER allows the user to explore spectral windows.
0004 %
0005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0006 %
0007 % DESCRIPTION: SPECWIN_VIEWER allows the user to explore spectral windows.
0008 %
0009 % CALL:        specwin_viewer
0010 %
0011 %
0012 % VERSION:     $Id: specwin_viewer.m,v 1.2 2008/03/07 13:35:16 hewitson Exp $
0013 %
0014 % HISTORY: 07-03-08 M Hewitson
0015 %             Creation
0016 %
0017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0018 
0019 
0020 %% Check if I exist already
0021 id = findobj('Tag', 'LTPDAspecwin_viewer');
0022 if ~isempty(id)
0023   figure(id)
0024   return
0025 end
0026 
0027 %% Some initial setup
0028 
0029 Gproperties.Gcol    = [240 240 240]/255;
0030 Gproperties.Gwidth  = 800;
0031 Gproperties.Gheight = 400;
0032 Gproperties.Gborder = 10;
0033 fontsize = getappdata(0, 'ltpda_repo_gui_fontsize');
0034 
0035 Gproperties.Screen   = get(0,'screensize');
0036 Gproperties.Gposition = [150 ...
0037   150 ...
0038   Gproperties.Gwidth...
0039   Gproperties.Gheight];
0040 
0041 %  Initialize and hide the GUI as it is being constructed.
0042 mainfig = figure('Name', 'LTPDA Spectral Window Viewer',...
0043   'NumberTitle', 'off',...
0044   'Visible','off',...
0045   'Position',Gproperties.Gposition,...
0046   'Color', Gproperties.Gcol,...
0047   'Toolbar', 'none',...
0048   'MenuBar', 'none',...
0049   'Resize', 'off',...
0050   'Tag', 'LTPDAspecwin_viewer');
0051 
0052 % Set mainfig callbacks
0053 set(mainfig, 'CloseRequestFcn', {'ltpda_specwin_viewer_close', mainfig});
0054 
0055 % Set Application data
0056 setappdata(mainfig, 'Gproperties', Gproperties);
0057 
0058 
0059 %% Window selection dialog
0060 
0061 %----------------------------------- Window selection box
0062 buildWindowSelectionMenu(mainfig);
0063 
0064 %----------------------------------- Window size
0065 
0066 sth = uicontrol(mainfig,'Style','text',...
0067   'String','Window Size',...
0068   'BackgroundColor', Gprops.Gcol, ...
0069   'Position',[10 Gprops.Gheight-70 80 25]);
0070 
0071 eth = uicontrol(mainfig,'Style','edit',...
0072                 'String','100',...
0073                 'BackgroundColor', 'w', ...
0074                 'Tag', 'LTPDA_specwin_viewer_WinSize', ...
0075                 'Position',[100 Gprops.Gheight-70 120 25]);
0076  
0077 %------------------------------------- PSLL
0078 
0079 sth = uicontrol(mainfig,'Style','text',...
0080   'String','Window PSLL',...
0081   'BackgroundColor', Gprops.Gcol, ...
0082   'Position',[10 Gprops.Gheight-100 80 25]);
0083 
0084 eth = uicontrol(mainfig,'Style','edit',...
0085                 'String','150',...
0086                 'BackgroundColor', 'w', ...
0087                 'Tag', 'LTPDA_specwin_viewer_PSLL', ...
0088                 'Position',[100 Gprops.Gheight-100 120 25]);
0089               
0090 %--------------------------- Build Time-domain Button
0091 pbh = uicontrol(mainfig,'Style','pushbutton',...
0092   'String','Plot Time-domain',...
0093   'Callback', {'ltpda_specwin_viewer_build_window', 'Time-domain'}, ...
0094   'Position',[10 Gprops.Gheight-140 100 25]);
0095               
0096 %--------------------------- Build Freq-domain Button
0097 pbh = uicontrol(mainfig,'Style','pushbutton',...
0098   'String','Plot Freq-domain',...
0099   'Callback', {'ltpda_specwin_viewer_build_window', 'Freq-domain'}, ...
0100   'Position',[120 Gprops.Gheight-140 100 25]);
0101 
0102 %------------------------- Axes
0103 
0104 M = 0.01;
0105 ax   = axes('Position', [0.5+M 0.2 0.4 0.7], ...
0106             'Parent', mainfig, ...
0107             'Tag', 'LTPDA_specwin_viewer_axes', ...
0108             'Visible', 'on', ...
0109             'Box', 'on');
0110 
0111 setappdata(mainfig, 'axes', ax);
0112 
0113 sth = uicontrol(mainfig,'Style','text',...
0114   'String','None',...
0115   'BackgroundColor', Gprops.Gcol, ...
0116   'Tag', 'LTPDA_specwin_viewer_wininfo', ...
0117   'Position',[10 10 300 Gproperties.Gheight/2 - 20], ...
0118   'FontSize', 14, 'ForegroundColor', 'b');
0119 
0120 % Constructor text field
0121 sth = uicontrol(mainfig,'Style','edit',...
0122   'String','',...
0123   'BackgroundColor', 'w', ...
0124   'Tag', 'LTPDA_specwin_viewer_cstr', ...
0125   'Position',[10 10 300 25]);
0126 
0127 
0128 % call callback for window type
0129 ltpda_specwin_viewer_wintype(mainfig);
0130 
0131 % draw window
0132 ltpda_specwin_viewer_build_window('Time-domain');
0133 
0134 
0135 
0136 
0137 %% Start the GUI
0138 
0139 % Make the GUI visible.
0140 set(mainfig,'Visible','on')
0141  
0142 
0143 %% Sub-functions
0144 
0145   %---- Window selection box
0146   function buildWindowSelectionMenu(mainfig)
0147     
0148     Gprops = getappdata(mainfig, 'Gproperties');
0149     
0150     % get window list
0151     wins = specwin('Types');
0152     
0153     % text field
0154     sth = uicontrol(mainfig,'Style','text',...
0155       'String','Window Type',...
0156                 'BackgroundColor', Gprops.Gcol, ...
0157       'Position',[10 Gprops.Gheight-40 80 25]);
0158     
0159     % pop-up dialog
0160     pmh = uicontrol(mainfig,'Style','popupmenu',...
0161                 'String', [{'Kaiser'} wins],...
0162                 'Value', 1, ...
0163                 'BackgroundColor', Gprops.Gcol, ...
0164                 'Tag', 'LTPDA_specwin_viewer_WinType', ...
0165                 'Callback', {'ltpda_specwin_viewer_wintype', mainfig}, ...
0166                 'Position',[100 Gprops.Gheight-40 120 25]);
0167     
0168   end
0169 
0170 end
0171 
0172 
0173

Generated on Fri 07-Mar-2008 15:46:43 by m2html © 2003