comparison m-toolbox/m/gui/specwin_viewer/specwin_viewer.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 function varargout = specwin_viewer(varargin)
2
3 % SPECWIN_VIEWER allows the user to explore spectral windows.
4 %
5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 %
7 % DESCRIPTION: SPECWIN_VIEWER allows the user to explore spectral windows.
8 %
9 % CALL: specwin_viewer
10 %
11 %
12 % VERSION: $Id: specwin_viewer.m,v 1.4 2008/08/04 18:23:04 hewitson Exp $
13 %
14 % HISTORY: 07-03-08 M Hewitson
15 % Creation
16 %
17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18
19
20 %% Check if I exist already
21 id = findobj('Tag', 'LTPDAspecwin_viewer');
22 if ~isempty(id)
23 figure(id)
24 return
25 end
26
27 %% Some initial setup
28
29 Gproperties.Gcol = [240 240 240]/255;
30 Gproperties.Gwidth = 800;
31 Gproperties.Gheight = 400;
32 Gproperties.Gborder = 10;
33 fontsize = getappdata(0, 'ltpda_repo_gui_fontsize');
34
35 Gproperties.Screen = get(0,'screensize');
36 Gproperties.Gposition = [150 ...
37 150 ...
38 Gproperties.Gwidth...
39 Gproperties.Gheight];
40
41 % Initialize and hide the GUI as it is being constructed.
42 mainfig = figure('Name', 'LTPDA Spectral Window Viewer',...
43 'NumberTitle', 'off',...
44 'Visible','off',...
45 'Position',Gproperties.Gposition,...
46 'Color', Gproperties.Gcol,...
47 'ToolBar', 'none', ...
48 'NextPlot', 'new', ...
49 'MenuBar', 'none',...
50 'Resize', 'off',...
51 'Tag', 'LTPDAspecwin_viewer');
52
53 % Set mainfig callbacks
54 set(mainfig, 'CloseRequestFcn', {'ltpda_specwin_viewer_close', mainfig});
55
56 % Set Application data
57 setappdata(mainfig, 'Gproperties', Gproperties);
58
59
60 %% Window selection dialog
61
62 %----------------------------------- Window selection box
63 buildWindowSelectionMenu(mainfig);
64
65 %----------------------------------- Window size
66
67 sth = uicontrol(mainfig,'Style','text',...
68 'String','Window Size',...
69 'BackgroundColor', Gprops.Gcol, ...
70 'Position',[10 Gprops.Gheight-70 80 25]);
71
72 eth = uicontrol(mainfig,'Style','edit',...
73 'String','100',...
74 'BackgroundColor', 'w', ...
75 'Tag', 'LTPDA_specwin_viewer_WinSize', ...
76 'Position',[100 Gprops.Gheight-70 120 25]);
77
78 %------------------------------------- PSLL
79
80 sth = uicontrol(mainfig,'Style','text',...
81 'String','Window PSLL',...
82 'BackgroundColor', Gprops.Gcol, ...
83 'Position',[10 Gprops.Gheight-100 80 25]);
84
85 eth = uicontrol(mainfig,'Style','edit',...
86 'String','150',...
87 'BackgroundColor', 'w', ...
88 'Tag', 'LTPDA_specwin_viewer_PSLL', ...
89 'Position',[100 Gprops.Gheight-100 120 25]);
90
91 %--------------------------- Build Time-domain Button
92 pbh = uicontrol(mainfig,'Style','pushbutton',...
93 'String','Plot Time-domain',...
94 'Callback', {'ltpda_specwin_viewer_build_window', 'Time-domain'}, ...
95 'Position',[10 Gprops.Gheight-140 100 25]);
96
97 %--------------------------- Build Freq-domain Button
98 pbh = uicontrol(mainfig,'Style','pushbutton',...
99 'String','Plot Freq-domain',...
100 'Callback', {'ltpda_specwin_viewer_build_window', 'Freq-domain'}, ...
101 'Position',[120 Gprops.Gheight-140 100 25]);
102
103 %------------------------- Axes
104
105 M = 0.01;
106 ax = axes('Position', [0.5+M 0.2 0.4 0.7], ...
107 'Parent', mainfig, ...
108 'Tag', 'LTPDA_specwin_viewer_axes', ...
109 'Visible', 'on', ...
110 'Box', 'on');
111
112 setappdata(mainfig, 'axes', ax);
113
114 sth = uicontrol(mainfig,'Style','text',...
115 'String','None',...
116 'BackgroundColor', Gprops.Gcol, ...
117 'Tag', 'LTPDA_specwin_viewer_wininfo', ...
118 'Position',[10 10 300 Gproperties.Gheight/2 - 20], ...
119 'FontSize', 14, 'ForegroundColor', 'b');
120
121 % Constructor text field
122 sth = uicontrol(mainfig,'Style','edit',...
123 'String','',...
124 'BackgroundColor', 'w', ...
125 'Tag', 'LTPDA_specwin_viewer_cstr', ...
126 'Position',[10 10 300 25]);
127
128
129 % call callback for window type
130 ltpda_specwin_viewer_wintype(mainfig);
131
132 % draw window
133 ltpda_specwin_viewer_build_window('Time-domain');
134
135
136
137
138 %% Start the GUI
139
140 % Make the GUI visible.
141 set(mainfig,'Visible','on')
142
143
144 %% Sub-functions
145
146 %---- Window selection box
147 function buildWindowSelectionMenu(mainfig)
148
149 Gprops = getappdata(mainfig, 'Gproperties');
150
151 % get window list
152 wins = specwin.getTypes;
153
154 % text field
155 sth = uicontrol(mainfig,'Style','text',...
156 'String','Window Type',...
157 'BackgroundColor', Gprops.Gcol, ...
158 'Position',[10 Gprops.Gheight-40 80 25]);
159
160 % pop-up dialog
161 pmh = uicontrol(mainfig,'Style','popupmenu',...
162 'String', [{'Kaiser'} wins],...
163 'Value', 1, ...
164 'BackgroundColor', Gprops.Gcol, ...
165 'Tag', 'LTPDA_specwin_viewer_WinType', ...
166 'Callback', {'ltpda_specwin_viewer_wintype', mainfig}, ...
167 'Position',[100 Gprops.Gheight-40 120 25]);
168
169 end
170
171 end
172
173
174