Mercurial > hg > ltpda
comparison m-toolbox/m/gui/ltpdalauncher/ltpdalauncher.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 = ltpdalauncher(varargin) | |
2 | |
3 % LTPDALAUNCHER presents the user with a control panel from which they can | |
4 % launch other LTPDA GUIs. | |
5 % | |
6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
7 % | |
8 % DESCRIPTION: LTPDALAUNCHER presents the user with a control panel from | |
9 % which they can launch other LTPDA GUIs. | |
10 % | |
11 % CALL: ltpdalauncher | |
12 % | |
13 % | |
14 % | |
15 % VERSION: $Id: ltpdalauncher.m,v 1.13 2009/09/28 08:12:05 hewitson Exp $ | |
16 % | |
17 % HISTORY: 07-03-08 M Hewitson | |
18 % Creation | |
19 % | |
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
21 | |
22 | |
23 %% Check if I exist already | |
24 hs = findall(0); | |
25 found = -1; | |
26 for j=1:length(hs) | |
27 h = hs(j); | |
28 if strcmp(get(h, 'Tag'), 'LTPDAlauncher') | |
29 found = h; | |
30 end | |
31 end | |
32 if found ~= -1 | |
33 figure(found); | |
34 return | |
35 end | |
36 | |
37 % id = findobj('Tag', 'LTPDAlauncher'); | |
38 % if ~isempty(id) | |
39 % figure(id) | |
40 % return | |
41 % end | |
42 | |
43 %% Some initial setup | |
44 | |
45 Gproperties.Gcol = [240 240 240]/255; | |
46 Gproperties.Gwidth = 400; | |
47 Gproperties.Gheight = 400; | |
48 Gproperties.Gborder = 10; | |
49 fontsize = getappdata(0, 'ltpda_repo_gui_fontsize'); | |
50 | |
51 Gproperties.Screen = get(0,'screensize'); | |
52 Gproperties.Gposition = [150 ... | |
53 150 ... | |
54 Gproperties.Gwidth... | |
55 Gproperties.Gheight]; | |
56 | |
57 % Initialize and hide the GUI as it is being constructed. | |
58 mainfig = figure('Name', 'LTPDA Launch Bay',... | |
59 'NumberTitle', 'off',... | |
60 'Visible','off',... | |
61 'Position',Gproperties.Gposition,... | |
62 'Color', Gproperties.Gcol,... | |
63 'Toolbar', 'none',... | |
64 'Resize', 'off',... | |
65 'ToolBar', 'none', ... | |
66 'NextPlot', 'new', ... | |
67 'HandleVisibility', 'callback', ... | |
68 'MenuBar', 'none',... | |
69 'Tag', 'LTPDAlauncher'); | |
70 | |
71 % Set mainfig callbacks | |
72 set(mainfig, 'CloseRequestFcn', {'ltpda_launcher_close', mainfig}); | |
73 | |
74 % Set Application data | |
75 setappdata(mainfig, 'Gproperties', Gproperties); | |
76 | |
77 %% Add Logo | |
78 M = 0.01; | |
79 ax = axes('Position', [M M 1-2*M 1-2*M], 'Parent', mainfig); | |
80 logo = imread('images/ltpda_blue.jpg'); | |
81 image(logo, 'Parent', ax) | |
82 set(ax,'Visible', 'on', 'Box', 'off', 'Xtick', [], 'Ytick', []); | |
83 axis(ax, 'off'); | |
84 | |
85 %% Add launch buttons | |
86 | |
87 BtnHeight = 20; | |
88 BtnWidth = Gproperties.Gwidth - 20; | |
89 BtnLeft = 10; | |
90 BtnBottom = Gproperties.Gheight - BtnHeight - 10; | |
91 | |
92 %-- LTPDA GUI | |
93 BtnBottom = BtnBottom - BtnHeight - 10; | |
94 pbh = uicontrol(mainfig,'Style','pushbutton','String','LTPDA Workbench',... | |
95 'Position',[BtnLeft BtnBottom BtnWidth BtnHeight ],... | |
96 'Tag', 'LTPDAworkbench'); | |
97 set(pbh, 'Callback', {'ltpda_launcher_workbench'}); | |
98 | |
99 %-- preferences | |
100 pos = get(pbh, 'Position'); | |
101 BtnBottom = pos(2) - BtnHeight - 10; | |
102 pbh = uicontrol(mainfig,'Style','pushbutton','String','LTPDA Preferences',... | |
103 'Position',[BtnLeft BtnBottom BtnWidth BtnHeight ],... | |
104 'Tag', 'LTPDA_preferences'); | |
105 set(pbh, 'Callback', 'LTPDAprefs'); | |
106 | |
107 | |
108 %-- workspace browser | |
109 pos = get(pbh, 'Position'); | |
110 BtnBottom = pos(2) - BtnHeight - 10; | |
111 pbh = uicontrol(mainfig,'Style','pushbutton','String','Workspace Browser',... | |
112 'Position',[BtnLeft BtnBottom BtnWidth BtnHeight ],... | |
113 'Tag', 'workspaceBrowser'); | |
114 set(pbh, 'Callback', {@start_workspaceBrowser}); | |
115 | |
116 %-- LTPDA Repogui | |
117 % pos = get(pbh, 'Position'); | |
118 % BtnBottom = pos(2) - BtnHeight - 10; | |
119 % pbh = uicontrol(mainfig,'Style','pushbutton','String','LTPDA REPO GUI',... | |
120 % 'Position',[BtnLeft BtnBottom BtnWidth BtnHeight ],... | |
121 % 'Tag', 'ltpda_launcher_repogui'); | |
122 % set(pbh, 'Callback', {'ltpda_launcher_launch_repogui'}); | |
123 | |
124 %-- PZmodel helper | |
125 pos = get(pbh, 'Position'); | |
126 BtnBottom = pos(2) - BtnHeight - 10; | |
127 pbh = uicontrol(mainfig,'Style','pushbutton','String','Pole/Zero Model Helper',... | |
128 'Position',[BtnLeft BtnBottom BtnWidth BtnHeight ],... | |
129 'Tag', 'ltpda_launcher_pzmodel'); | |
130 set(pbh, 'Callback', {'ltpda_launcher_launch_pzmodel'}); | |
131 | |
132 %-- specwin helper | |
133 pos = get(pbh, 'Position'); | |
134 BtnBottom = pos(2) - BtnHeight - 10; | |
135 pbh = uicontrol(mainfig,'Style','pushbutton','String','Spectral Windows GUI',... | |
136 'Position',[BtnLeft BtnBottom BtnWidth BtnHeight ],... | |
137 'Tag', 'ltpda_launcher_specwin'); | |
138 set(pbh, 'Callback', {'ltpda_launcher_specwinViewer'}); | |
139 | |
140 %-- constructor helper | |
141 pos = get(pbh, 'Position'); | |
142 BtnBottom = pos(2) - BtnHeight - 10; | |
143 pbh = uicontrol(mainfig,'Style','pushbutton','String','Constructor Helper',... | |
144 'Position',[BtnLeft BtnBottom BtnWidth BtnHeight ],... | |
145 'Tag', 'ltpda_constructor_helper'); | |
146 set(pbh, 'Callback', {'ltpda_launcher_constructor'}); | |
147 | |
148 %-- object explorer | |
149 pos = get(pbh, 'Position'); | |
150 BtnBottom = pos(2) - BtnHeight - 10; | |
151 pbh = uicontrol(mainfig,'Style','pushbutton','String','Object Explorer',... | |
152 'Position',[BtnLeft BtnBottom BtnWidth BtnHeight ],... | |
153 'Tag', 'ltpda_object_explorer'); | |
154 set(pbh, 'Callback', {@call_explore_ao}); | |
155 | |
156 % %-- quicklook | |
157 % pos = get(pbh, 'Position'); | |
158 % BtnBottom = pos(2) - BtnHeight - 10; | |
159 % pbh = uicontrol(mainfig,'Style','pushbutton','String','Quicklook',... | |
160 % 'Position',[BtnLeft BtnBottom BtnWidth BtnHeight ],... | |
161 % 'Tag', 'ltpdaquicklook'); | |
162 % set(pbh, 'Callback', {'ltpdaquicklook'}); | |
163 | |
164 | |
165 | |
166 %-- signal builder | |
167 pos = get(pbh, 'Position'); | |
168 BtnBottom = pos(2) - BtnHeight - 10; | |
169 pbh = uicontrol(mainfig,'Style','pushbutton','String','Signal Builder',... | |
170 'Position',[BtnLeft BtnBottom BtnWidth BtnHeight ],... | |
171 'Tag', 'SigBuilder'); | |
172 set(pbh, 'Callback', 'sigBuilder'); | |
173 | |
174 %-- version string | |
175 v = ver('LTPDA'); | |
176 | |
177 sth = uicontrol(mainfig,'Style','text',... | |
178 'String',sprintf('%s %s', v.Name, v.Version),... | |
179 'HorizontalAlignment', 'left', ... | |
180 'BackgroundColor', [130 190 250]/255, ... | |
181 'ForegroundColor', 'w', ... | |
182 'Position',[10 10 120 25]); | |
183 | |
184 | |
185 | |
186 | |
187 %% Start the GUI | |
188 | |
189 % Make the GUI visible. | |
190 set(mainfig,'Visible','on') | |
191 | |
192 | |
193 function start_workspaceBrowser(varargin) | |
194 workspaceBrowser; | |
195 end | |
196 | |
197 function call_explore_ao(varargin) | |
198 | |
199 ltpda_explorer; | |
200 | |
201 end | |
202 | |
203 end |