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.html,v 1.3 2008/03/31 10:27:46 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.html,v 1.3 2008/03/31 10:27:46 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   'NextPlot',     'new',            ...
0049   'MenuBar', 'none',...
0050   'Resize', 'off',...
0051   'Tag', 'LTPDAspecwin_viewer');
0052 
0053 % Set mainfig callbacks
0054 set(mainfig, 'CloseRequestFcn', {'ltpda_specwin_viewer_close', mainfig});
0055 
0056 % Set Application data
0057 setappdata(mainfig, 'Gproperties', Gproperties);
0058 
0059 
0060 %% Window selection dialog
0061 
0062 %----------------------------------- Window selection box
0063 buildWindowSelectionMenu(mainfig);
0064 
0065 %----------------------------------- Window size
0066 
0067 sth = uicontrol(mainfig,'Style','text',...
0068   'String','Window Size',...
0069   'BackgroundColor', Gprops.Gcol, ...
0070   'Position',[10 Gprops.Gheight-70 80 25]);
0071 
0072 eth = uicontrol(mainfig,'Style','edit',...
0073                 'String','100',...
0074                 'BackgroundColor', 'w', ...
0075                 'Tag', 'LTPDA_specwin_viewer_WinSize', ...
0076                 'Position',[100 Gprops.Gheight-70 120 25]);
0077  
0078 %------------------------------------- PSLL
0079 
0080 sth = uicontrol(mainfig,'Style','text',...
0081   'String','Window PSLL',...
0082   'BackgroundColor', Gprops.Gcol, ...
0083   'Position',[10 Gprops.Gheight-100 80 25]);
0084 
0085 eth = uicontrol(mainfig,'Style','edit',...
0086                 'String','150',...
0087                 'BackgroundColor', 'w', ...
0088                 'Tag', 'LTPDA_specwin_viewer_PSLL', ...
0089                 'Position',[100 Gprops.Gheight-100 120 25]);
0090               
0091 %--------------------------- Build Time-domain Button
0092 pbh = uicontrol(mainfig,'Style','pushbutton',...
0093   'String','Plot Time-domain',...
0094   'Callback', {'ltpda_specwin_viewer_build_window', 'Time-domain'}, ...
0095   'Position',[10 Gprops.Gheight-140 100 25]);
0096               
0097 %--------------------------- Build Freq-domain Button
0098 pbh = uicontrol(mainfig,'Style','pushbutton',...
0099   'String','Plot Freq-domain',...
0100   'Callback', {'ltpda_specwin_viewer_build_window', 'Freq-domain'}, ...
0101   'Position',[120 Gprops.Gheight-140 100 25]);
0102 
0103 %------------------------- Axes
0104 
0105 M = 0.01;
0106 ax   = axes('Position', [0.5+M 0.2 0.4 0.7], ...
0107             'Parent', mainfig, ...
0108             'Tag', 'LTPDA_specwin_viewer_axes', ...
0109             'Visible', 'on', ...
0110             'Box', 'on');
0111 
0112 setappdata(mainfig, 'axes', ax);
0113 
0114 sth = uicontrol(mainfig,'Style','text',...
0115   'String','None',...
0116   'BackgroundColor', Gprops.Gcol, ...
0117   'Tag', 'LTPDA_specwin_viewer_wininfo', ...
0118   'Position',[10 10 300 Gproperties.Gheight/2 - 20], ...
0119   'FontSize', 14, 'ForegroundColor', 'b');
0120 
0121 % Constructor text field
0122 sth = uicontrol(mainfig,'Style','edit',...
0123   'String','',...
0124   'BackgroundColor', 'w', ...
0125   'Tag', 'LTPDA_specwin_viewer_cstr', ...
0126   'Position',[10 10 300 25]);
0127 
0128 
0129 % call callback for window type
0130 ltpda_specwin_viewer_wintype(mainfig);
0131 
0132 % draw window
0133 ltpda_specwin_viewer_build_window('Time-domain');
0134 
0135 
0136 
0137 
0138 %% Start the GUI
0139 
0140 % Make the GUI visible.
0141 set(mainfig,'Visible','on')
0142  
0143 
0144 %% Sub-functions
0145 
0146   %---- Window selection box
0147   function buildWindowSelectionMenu(mainfig)
0148     
0149     Gprops = getappdata(mainfig, 'Gproperties');
0150     
0151     % get window list
0152     wins = specwin('Types');
0153     
0154     % text field
0155     sth = uicontrol(mainfig,'Style','text',...
0156       'String','Window Type',...
0157                 'BackgroundColor', Gprops.Gcol, ...
0158       'Position',[10 Gprops.Gheight-40 80 25]);
0159     
0160     % pop-up dialog
0161     pmh = uicontrol(mainfig,'Style','popupmenu',...
0162                 'String', [{'Kaiser'} wins],...
0163                 'Value', 1, ...
0164                 'BackgroundColor', Gprops.Gcol, ...
0165                 'Tag', 'LTPDA_specwin_viewer_WinType', ...
0166                 'Callback', {'ltpda_specwin_viewer_wintype', mainfig}, ...
0167                 'Position',[100 Gprops.Gheight-40 120 25]);
0168     
0169   end
0170 
0171 end
0172 
0173 
0174

Generated on Mon 31-Mar-2008 12:20:24 by m2html © 2003