Mercurial > hg > ltpda
comparison m-toolbox/m/gui/ltpdv/callbacks/ltpdv_buildImportPanel.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 ltpdv_buildImportPanel(ph, mainfig) | |
2 | |
3 Gproperties = getappdata(mainfig, 'Gproperties'); | |
4 | |
5 pmarg = 0.025; | |
6 % Build a panel to contain this tab | |
7 % panh = uipanel('Parent', ph, 'Position', [pmarg pmarg 1-2*pmarg 1-2*pmarg]); | |
8 | |
9 %% Add new sub tabbed panel | |
10 | |
11 Hmargin = 0.025; | |
12 Vmargin = 0.025; | |
13 | |
14 PanLeft = Hmargin; | |
15 Tleft = Hmargin; | |
16 Theight = 1-2*Vmargin; | |
17 Tbottom = (1 - Theight - Vmargin); | |
18 Twidth = 1-2*Hmargin; | |
19 | |
20 Pcol = [1 1 0.9]; | |
21 | |
22 htab = uitabgroup('Parent', ph, ... | |
23 'Units','normalized',... | |
24 'Tag', 'LTPDVimportTabPanel', ... | |
25 'Position',[Tleft Tbottom Twidth Theight], 'SelectionChangeFcn', {@ltpdv_tabChanged}); | |
26 mt1 = uitab(htab, 'title', 'Server'); | |
27 mt2 = uitab(htab, 'title', 'Workspace'); | |
28 mt3 = uitab(htab, 'title', 'Build'); | |
29 | |
30 %-------------- Build Server Panel | |
31 buildServerPanel(mt1, mainfig); | |
32 %-------------- Build Workspace Panel | |
33 h = buildWorkspacePanel(mt2, mainfig); | |
34 %-------------- Build Build Panel | |
35 buildBuildPanel(mt3, mainfig); | |
36 end | |
37 | |
38 %-------------------------------------------------------------------------- | |
39 % Build import from server panel | |
40 function buildBuildPanel(hp, mainfig) | |
41 | |
42 | |
43 EditFontSize = 11; | |
44 vmarg = 0.03; | |
45 pmarg = 0.01; | |
46 CommHeight = EditFontSize/400; | |
47 ph = 1; | |
48 htab = uipanel('Parent', hp, 'Position', [pmarg 1-ph-pmarg 1-2*pmarg ph]); | |
49 set(htab, 'Units', 'Normalized') | |
50 set(htab, 'Title', '') | |
51 set(htab, 'BackgroundColor', [0.6 0.6 0.8]); | |
52 set(htab, 'ForegroundColor', 'w'); | |
53 | |
54 | |
55 %----- Class selector | |
56 bh = CommHeight; | |
57 bl = pmarg; | |
58 bw = 0.15; | |
59 bb = 1-bh-1*vmarg; | |
60 sth = uicontrol(htab, 'Style','text',... | |
61 'String', 'Object Class',... | |
62 'Units', 'normalized', ... | |
63 'BackgroundColor', 'w', ... | |
64 'Fontsize', EditFontSize, ... | |
65 'Position',[bl bb bw bh]); | |
66 bl = bl+bw+pmarg; | |
67 bw = 0.2; | |
68 clsh = uicontrol(htab, ... | |
69 'Style', 'popupmenu', ... | |
70 'Units', 'normalized',... | |
71 'Fontsize', EditFontSize, ... | |
72 'BackgroundColor', 'w', ... | |
73 'String', utils.helper.ltpda_userclasses, ... | |
74 'Position', [bl bb bw bh],... | |
75 'Tag', 'LTPDVbuildObjectClass', ... | |
76 'Callback', {@ltpdv_build_class_select, mainfig}); | |
77 | |
78 %----- Set selector | |
79 bl = bl+bw+pmarg; | |
80 bw = 0.15; | |
81 sth = uicontrol(htab, 'Style','text',... | |
82 'String', 'Parameter Set',... | |
83 'Units', 'normalized', ... | |
84 'BackgroundColor', 'w', ... | |
85 'Fontsize', EditFontSize, ... | |
86 'Position',[bl bb bw bh]); | |
87 bl = bl+bw+pmarg; | |
88 bw = 0.3; | |
89 dtypeh = uicontrol(htab, ... | |
90 'Style', 'popupmenu', ... | |
91 'Units', 'normalized',... | |
92 'Fontsize', EditFontSize, ... | |
93 'BackgroundColor', 'w', ... | |
94 'String', ' ', ... | |
95 'Position', [bl bb bw bh],... | |
96 'Tag', 'LTPDVbuildSetSelect', ... | |
97 'Callback', {@ltpdv_build_set_select, mainfig}); | |
98 | |
99 % Parameter panel | |
100 ph = 0.8; | |
101 ppan = uipanel('Parent', htab, 'Position', [pmarg 0.08+vmarg 1-2*pmarg ph]); | |
102 set(ppan, 'Units', 'Normalized') | |
103 set(ppan, 'Title', 'Parameters') | |
104 set(ppan, 'BackgroundColor', [0.7 0.7 0.8]); | |
105 set(ppan, 'ForegroundColor', 'w'); | |
106 set(ppan, 'Tag', 'LTPDVbuildParamsPanel'); | |
107 | |
108 pbh = uicontrol(htab,'Style','pushbutton',... | |
109 'String','Build object',... | |
110 'Callback', {@ltpdv_build_buildobject, mainfig}, ... | |
111 'Units', 'normalized', ... | |
112 'Fontsize', EditFontSize, ... | |
113 'Position',[pmarg vmarg 0.15 2*bh]); | |
114 | |
115 % call back | |
116 ltpdv_build_class_select(clsh, mainfig) | |
117 | |
118 % | |
119 % bh = CommHeight; | |
120 % bl = pmarg; | |
121 % bw = 1-2*pmarg; | |
122 % bb = vmarg; | |
123 % sth = uicontrol(hp, 'Style','text',... | |
124 % 'String', 'Build objects with the ''constructor helper'' then import from workspace.',... | |
125 % 'Units', 'normalized', ... | |
126 % 'BackgroundColor', 'w', ... | |
127 % 'Fontsize', EditFontSize, ... | |
128 % 'Position',[bl bb bw bh]); | |
129 | |
130 end | |
131 %-------------------------------------------------------------------------- | |
132 % Build import from server panel | |
133 function buildServerPanel(hp, mainfig) | |
134 | |
135 % Data type | |
136 EditFontSize = 11; | |
137 vmarg = 0.03; | |
138 pmarg = 0.01; | |
139 CommHeight = EditFontSize/80; | |
140 | |
141 % Import button | |
142 bw = 0.12; | |
143 bh = 0.05; | |
144 bl = pmarg; | |
145 bb = pmarg; | |
146 pbh = uicontrol(hp,'Style','pushbutton',... | |
147 'String','Import',... | |
148 'Callback', {@ltpdv_server_import, mainfig}, ... | |
149 'Units', 'normalized', ... | |
150 'Fontsize', EditFontSize, ... | |
151 'Position',[bl bb bw bh]); | |
152 | |
153 %======== New tab panel | |
154 Tleft = pmarg; | |
155 Theight = 0.8; | |
156 Tbottom = 1-Theight - pmarg; | |
157 Twidth = 1-2*pmarg; | |
158 % htab = uitabgroup('Parent', hp, ... | |
159 % 'Units','normalized',... | |
160 % 'Position',[Tleft Tbottom Twidth Theight], 'SelectionChangeFcn', {@ltpdv_tabChanged}); | |
161 % t1 = uitab(htab, 'title', 'Server Details'); | |
162 % t2 = uitab(htab, 'title', 'Times'); | |
163 % t3 = uitab(htab, 'title', 'Channels'); | |
164 | |
165 % ======= Server Details | |
166 | |
167 ph = 0.3; | |
168 htab = uipanel('Parent', hp, 'Position', [pmarg 1-ph-pmarg 1-2*pmarg ph]); | |
169 set(htab, 'Units', 'Normalized') | |
170 set(htab, 'Title', 'Server settings') | |
171 set(htab, 'BackgroundColor', [0.3 0.7 0.3]); | |
172 set(htab, 'ForegroundColor', 'w'); | |
173 | |
174 bh = CommHeight; | |
175 bl = pmarg; | |
176 bw = 0.1; | |
177 bb = 1-bh-3*vmarg; | |
178 sth = uicontrol(htab, 'Style','text',... | |
179 'String', 'Data type',... | |
180 'Units', 'normalized', ... | |
181 'BackgroundColor', 'w', ... | |
182 'Fontsize', EditFontSize, ... | |
183 'Position',[bl bb bw bh]); | |
184 bl = bl+bw+pmarg; | |
185 bw = 0.17; | |
186 dtypeh = uicontrol(htab, ... | |
187 'Style', 'popupmenu', ... | |
188 'Units', 'normalized',... | |
189 'Fontsize', EditFontSize, ... | |
190 'BackgroundColor', 'w', ... | |
191 'String', {'frame data','h(t) frames', 'raw data', 'hour trends', 'day trends'}, ... | |
192 'Position', [bl bb bw bh],... | |
193 'Tag', 'LTPDVserverDataType', ... | |
194 'Callback', {@ltpdv_server_datatype_select, mainfig}); | |
195 | |
196 % Statistic | |
197 bl = bl + bw + pmarg; | |
198 bw = 0.1; | |
199 sth = uicontrol(htab, 'Style','text',... | |
200 'String', 'Statistic',... | |
201 'Units', 'normalized', ... | |
202 'BackgroundColor', 'w', ... | |
203 'Fontsize', EditFontSize, ... | |
204 'Position',[bl bb bw bh]); | |
205 bl = bl+bw+pmarg; | |
206 bw = 0.12; | |
207 th = uicontrol(htab, ... | |
208 'Style', 'popupmenu', ... | |
209 'Units', 'normalized',... | |
210 'BackgroundColor', 'w', ... | |
211 'Fontsize', EditFontSize, ... | |
212 'String', {'rms','min', 'max', 'avg'}, ... | |
213 'Position', [bl bb bw bh],... | |
214 'Tag', 'LTPDVserverStat'); | |
215 | |
216 % Server drop-down box | |
217 bl = pmarg; | |
218 bw = 0.1; | |
219 bb = bb - bh - vmarg; | |
220 sth = uicontrol(htab, 'Style','text',... | |
221 'String', 'Server',... | |
222 'Units', 'normalized', ... | |
223 'BackgroundColor', 'w', ... | |
224 'Fontsize', EditFontSize, ... | |
225 'Position',[bl bb bw bh]); | |
226 bl = bl+bw+pmarg; | |
227 bw = 0.25; | |
228 th = uicontrol(htab, ... | |
229 'Style', 'popupmenu', ... | |
230 'Units', 'normalized',... | |
231 'BackgroundColor', 'w', ... | |
232 'String', {'130.75.117.159','130.75.117.73', '130.75.117.164', 'localhost'}, ... | |
233 'Fontsize', EditFontSize, ... | |
234 'Position', [bl bb bw bh],... | |
235 'Tag', 'LTPDVserverServer', ... | |
236 'Callback', {@ltpdv_server_server_select, mainfig}); | |
237 | |
238 % Server entry box | |
239 bl = bl+bw+pmarg; | |
240 bw = 0.22; | |
241 th = uicontrol(htab, ... | |
242 'Style', 'edit', ... | |
243 'Units', 'normalized',... | |
244 'BackgroundColor', 'w', ... | |
245 'Fontsize', EditFontSize, ... | |
246 'String', '', ... | |
247 'Position', [bl bb bw bh],... | |
248 'Tag', 'LTPDVserverServerEdit'); | |
249 | |
250 % Port entry | |
251 bl = bl+bw+pmarg; | |
252 bw = 0.07; | |
253 sth = uicontrol(htab, 'Style','text',... | |
254 'String', 'Port',... | |
255 'Units', 'normalized', ... | |
256 'BackgroundColor', 'w', ... | |
257 'Fontsize', EditFontSize, ... | |
258 'Position',[bl bb bw bh]); | |
259 bl = bl+bw+pmarg; | |
260 bw = 0.1; | |
261 th = uicontrol(htab, ... | |
262 'Style', 'edit', ... | |
263 'Units', 'normalized',... | |
264 'BackgroundColor', 'w', ... | |
265 'Fontsize', EditFontSize, ... | |
266 'String', '', ... | |
267 'Position', [bl bb bw bh],... | |
268 'Tag', 'LTPDVserverPortEdit'); | |
269 | |
270 % RDS | |
271 bl = pmarg; | |
272 bw = 0.1; | |
273 bb = bb - bh - vmarg; | |
274 sth = uicontrol(htab, 'Style','text',... | |
275 'String', 'RDS Level',... | |
276 'Units', 'normalized', ... | |
277 'BackgroundColor', 'w', ... | |
278 'Fontsize', EditFontSize, ... | |
279 'Position',[bl bb bw bh]); | |
280 bl = bl+bw+pmarg; | |
281 bw = 0.05; | |
282 th = uicontrol(htab, ... | |
283 'Style', 'edit', ... | |
284 'Units', 'normalized',... | |
285 'BackgroundColor', 'w', ... | |
286 'Fontsize', EditFontSize, ... | |
287 'String', '', ... | |
288 'Position', [bl bb bw bh],... | |
289 'Tag', 'LTPDVserverRdsEdit'); | |
290 | |
291 % CAL | |
292 bl = pmarg + bl + bw; | |
293 bw = 0.1; | |
294 sth = uicontrol(htab, 'Style','text',... | |
295 'String', 'Cal Ver',... | |
296 'Units', 'normalized', ... | |
297 'BackgroundColor', 'w', ... | |
298 'Fontsize', EditFontSize, ... | |
299 'Position',[bl bb bw bh]); | |
300 bl = bl+bw+pmarg; | |
301 bw = 0.05; | |
302 th = uicontrol(htab, ... | |
303 'Style', 'edit', ... | |
304 'Units', 'normalized',... | |
305 'BackgroundColor', 'w', ... | |
306 'Fontsize', EditFontSize, ... | |
307 'String', '', ... | |
308 'Position', [bl bb bw bh],... | |
309 'Tag', 'LTPDVserverCalEdit'); | |
310 | |
311 | |
312 % call callbacks | |
313 ltpdv_server_server_select(0, mainfig); | |
314 ltpdv_server_datatype_select(dtypeh, mainfig); | |
315 | |
316 % Query server button | |
317 bw = 0.13; | |
318 bb = vmarg; | |
319 bl = pmarg; | |
320 pbh = uicontrol(htab,'Style','pushbutton',... | |
321 'String','Query Server',... | |
322 'Callback', {@ltpdv_server_queryServer, mainfig}, ... | |
323 'Units', 'normalized', ... | |
324 'Fontsize', EditFontSize, ... | |
325 'Position',[bl bb bw 1.4*CommHeight]); | |
326 | |
327 % Get latest button | |
328 bl = bl + bw + pmarg; | |
329 pbh = uicontrol(htab,'Style','pushbutton',... | |
330 'String','Get latest',... | |
331 'Callback', {@ltpdv_server_getLatest, mainfig}, ... | |
332 'Units', 'normalized', ... | |
333 'Fontsize', EditFontSize, ... | |
334 'Position',[bl bb bw 1.4*CommHeight]); | |
335 | |
336 | |
337 %---------------- Time entry | |
338 | |
339 ph = 0.3; | |
340 htab = uipanel('Parent', hp, 'Position', [pmarg 1-2*ph-2*pmarg 1-2*pmarg ph]); | |
341 set(htab, 'Units', 'Normalized') | |
342 set(htab, 'Title', 'Times settings') | |
343 set(htab, 'BackgroundColor', [0.7 0.3 0.3]); | |
344 set(htab, 'ForegroundColor', 'w'); | |
345 | |
346 % time and channel lists | |
347 bb = 1-0.7*bh-pmarg; | |
348 bl = pmarg+0.4; | |
349 bw = 0.5; | |
350 timesH = uicontrol(htab, 'Style','text',... | |
351 'String', 'Times',... | |
352 'Units', 'normalized', ... | |
353 'BackgroundColor', 'w', ... | |
354 'Fontsize', EditFontSize, ... | |
355 'Position',[bl bb bw 0.7*bh]); | |
356 | |
357 bl = pmarg + 0.4; | |
358 bh = 0.7; | |
359 bb = bb - bh; | |
360 lh = uicontrol(htab, 'Style', 'listbox', ... | |
361 'String', '',... | |
362 'BackgroundColor', 'w', ... | |
363 'Value',1, 'Units', 'normalized', ... | |
364 'Fontsize', EditFontSize, ... | |
365 'Max', 1000, ... | |
366 'Tag', 'LTPDVtimesList', ... | |
367 'Position',[bl bb bw bh], ... | |
368 'Callback', {@ltpdv_server_timeslist, mainfig}); | |
369 | |
370 % delete times | |
371 bw = (0.5 - 3*pmarg)/ 4; | |
372 bh = CommHeight; | |
373 bb = bb - bh - vmarg; | |
374 pbh = uicontrol(htab,'Style','pushbutton',... | |
375 'String','Delete times',... | |
376 'Callback', {@ltpdv_server_deleteTimes, mainfig}, ... | |
377 'Units', 'normalized', ... | |
378 'Fontsize', EditFontSize, ... | |
379 'Position',[bl bb bw bh]); | |
380 % clear list | |
381 bl = bl + pmarg + bw; | |
382 pbh = uicontrol(htab,'Style','pushbutton',... | |
383 'String','Clear list',... | |
384 'Callback', {@ltpdv_server_clearTimes, mainfig}, ... | |
385 'Units', 'normalized', ... | |
386 'Fontsize', EditFontSize, ... | |
387 'Position',[bl bb bw bh]); | |
388 % save list | |
389 bl = bl + pmarg + bw; | |
390 pbh = uicontrol(htab,'Style','pushbutton',... | |
391 'String','Save list',... | |
392 'Callback', {@ltpdv_server_saveTimes, mainfig}, ... | |
393 'Units', 'normalized', ... | |
394 'Fontsize', EditFontSize, ... | |
395 'Position',[bl bb bw bh]); | |
396 % load list | |
397 bl = bl + pmarg + bw; | |
398 pbh = uicontrol(htab,'Style','pushbutton',... | |
399 'String','Load list',... | |
400 'Callback', {@ltpdv_server_loadTimes, mainfig}, ... | |
401 'Units', 'normalized', ... | |
402 'Fontsize', EditFontSize, ... | |
403 'Position',[bl bb bw bh]); | |
404 | |
405 % start time | |
406 pos = get(timesH, 'Position'); | |
407 bl = pmarg; | |
408 bw = 0.1; | |
409 bh = CommHeight; | |
410 bb = pos(2)-2*vmarg; | |
411 sth = uicontrol(htab, 'Style','text',... | |
412 'String', 'Start',... | |
413 'Units', 'normalized', ... | |
414 'BackgroundColor', 'w', ... | |
415 'Fontsize', EditFontSize, ... | |
416 'Position',[bl bb bw bh]); | |
417 bl = bl+bw+pmarg; | |
418 bw = 0.25; | |
419 th = uicontrol(htab, ... | |
420 'Style', 'edit', ... | |
421 'Units', 'normalized',... | |
422 'BackgroundColor', 'w', ... | |
423 'Fontsize', EditFontSize, ... | |
424 'String', '', ... | |
425 'Position', [bl bb bw bh],... | |
426 'Callback', {@ltpdv_server_start_edit, mainfig}, ... | |
427 'Tag', 'LTPDVserverStartEdit'); | |
428 % stop time | |
429 bl = pmarg; | |
430 bw = 0.1; | |
431 bb = bb - bh - vmarg; | |
432 sth = uicontrol(htab, 'Style','text',... | |
433 'String', 'Stop',... | |
434 'Units', 'normalized', ... | |
435 'BackgroundColor', 'w', ... | |
436 'Fontsize', EditFontSize, ... | |
437 'Position',[bl bb bw bh]); | |
438 bl = bl+bw+pmarg; | |
439 bw = 0.25; | |
440 th = uicontrol(htab, ... | |
441 'Style', 'edit', ... | |
442 'Units', 'normalized',... | |
443 'BackgroundColor', 'w', ... | |
444 'String', '', ... | |
445 'Fontsize', EditFontSize, ... | |
446 'Position', [bl bb bw bh],... | |
447 'Callback', {@ltpdv_server_stop_edit, mainfig}, ... | |
448 'Tag', 'LTPDVserverStopEdit'); | |
449 | |
450 % duration display | |
451 bw = 0.1; | |
452 bl = pmarg; | |
453 bb = bb - bh - vmarg; | |
454 sth = uicontrol(htab, 'Style','text',... | |
455 'String', 'Duration',... | |
456 'Units', 'normalized', ... | |
457 'BackgroundColor', 'w', ... | |
458 'Fontsize', EditFontSize, ... | |
459 'Position',[bl bb bw bh]); | |
460 bl = bl + bw + pmarg; | |
461 bw = 0.25; | |
462 sth = uicontrol(htab, 'Style','text',... | |
463 'String', '',... | |
464 'Units', 'normalized', ... | |
465 'BackgroundColor', 'w', ... | |
466 'Fontsize', EditFontSize, ... | |
467 'Tag', 'LTPDVserverDurationDisplay', ... | |
468 'Position',[bl bb bw bh]); | |
469 | |
470 % comment | |
471 pos = get(sth, 'Position'); | |
472 bl = pmarg; | |
473 bw = pos(1) + pos(3) - pmarg; | |
474 bb = bb - 0.7*bh - vmarg; | |
475 sth = uicontrol(htab, 'Style','text',... | |
476 'String', 'Comment',... | |
477 'Units', 'normalized', ... | |
478 'BackgroundColor', 'w', ... | |
479 'Fontsize', EditFontSize, ... | |
480 'Position',[bl bb bw bh*0.7]); | |
481 bb = bb - bh - pmarg; | |
482 bl = pmarg; | |
483 th = uicontrol(htab, ... | |
484 'Style', 'edit', ... | |
485 'Units', 'normalized',... | |
486 'BackgroundColor', 'w', ... | |
487 'String', '', ... | |
488 'Fontsize', EditFontSize, ... | |
489 'Position', [bl bb bw bh],... | |
490 'Tag', 'LTPDVserverCommentEdit'); | |
491 | |
492 % Add time button | |
493 bl = pmarg; | |
494 bb = bb - bh - vmarg; | |
495 pbh = uicontrol(htab,'Style','pushbutton',... | |
496 'String','Add to list',... | |
497 'Fontsize', EditFontSize, ... | |
498 'Callback', {@ltpdv_server_addTime, mainfig}, ... | |
499 'Units', 'normalized', ... | |
500 'Position',[bl bb bw bh]); | |
501 | |
502 | |
503 % ----------------- Channel list | |
504 ph = 0.3; | |
505 htab = uipanel('Parent', hp, 'Position', [pmarg pmarg+2*vmarg 1-2*pmarg ph]); | |
506 set(htab, 'Units', 'Normalized') | |
507 set(htab, 'Title', 'Channel settings') | |
508 set(htab, 'BackgroundColor', [0.3 0.3 0.7]); | |
509 set(htab, 'ForegroundColor', 'w'); | |
510 | |
511 bw = 0.5; | |
512 bb = 1 - vmarg - 0.7*bh; | |
513 bl = pmarg; | |
514 sth = uicontrol(htab, 'Style','text',... | |
515 'String', 'Channels',... | |
516 'Units', 'normalized', ... | |
517 'BackgroundColor', 'w', ... | |
518 'Fontsize', EditFontSize, ... | |
519 'Position',[bl bb bw 0.7*bh]); | |
520 bh = 0.8; | |
521 bb = bb - bh; | |
522 lh = uicontrol(htab, 'Style', 'listbox', ... | |
523 'String', '',... | |
524 'BackgroundColor', 'w', ... | |
525 'Value',1, 'Units', 'normalized', ... | |
526 'Fontsize', EditFontSize, ... | |
527 'Max', 1000, ... | |
528 'Tag', 'LTPDVchannelList', ... | |
529 'Position',[bl bb bw bh], ... | |
530 'Callback', {@ltpdv_server_channellist, mainfig}); | |
531 | |
532 % include control chans | |
533 % bw = 0.3; | |
534 % bh = CommHeight; | |
535 % bb = bb - bh - pmarg; | |
536 % th = uicontrol(htab, ... | |
537 % 'Style', 'checkbox', ... | |
538 % 'Units', 'normalized',... | |
539 % 'BackgroundColor', 'w', ... | |
540 % 'String', 'Include control', ... | |
541 % 'Fontsize', EditFontSize, ... | |
542 % 'Position', [bl bb bw bh],... | |
543 % 'ForegroundColor', 'w',... | |
544 % 'Tag', 'LTPDVchannelIncludeControl'); | |
545 | |
546 % search box | |
547 bl = 0.55; | |
548 bw = 0.08; | |
549 bh = CommHeight; | |
550 bb = 1 - vmarg - bh; | |
551 sth = uicontrol(htab, 'Style','text',... | |
552 'String', 'Search',... | |
553 'Units', 'normalized', ... | |
554 'BackgroundColor', 'w', ... | |
555 'Fontsize', EditFontSize, ... | |
556 'Position',[bl bb bw bh]); | |
557 bl = bl+bw+pmarg; | |
558 bw = 0.17; | |
559 th = uicontrol(htab, ... | |
560 'Style', 'edit', ... | |
561 'Units', 'normalized',... | |
562 'BackgroundColor', 'w', ... | |
563 'String', '', ... | |
564 'Fontsize', EditFontSize, ... | |
565 'Position', [bl bb bw bh],... | |
566 'Callback', {@ltpdv_search_channels, mainfig}, ... | |
567 'Tag', 'LTPDVchannelSearchEdit'); | |
568 pos = get(sth, 'Position'); | |
569 bl = pos(1); | |
570 bb = bb - bh - vmarg; | |
571 pbh = uicontrol(htab,'Style','pushbutton',... | |
572 'String','Get channels',... | |
573 'Fontsize', EditFontSize, ... | |
574 'Callback', {@ltpdv_server_getChannels, mainfig}, ... | |
575 'Units', 'normalized', ... | |
576 'Position',[bl bb bw bh]); | |
577 end | |
578 %-------------------------------------------------------------------------- | |
579 % Build import from workspace panel | |
580 function th = buildWorkspacePanel(hp, mainfig) | |
581 | |
582 % Object list | |
583 pmarg = 0.025; | |
584 Lleft = pmarg; | |
585 Lbottom = 0.4+pmarg; | |
586 Lwidth = 1-2*pmarg; | |
587 Lheight = 1-Lbottom-pmarg; | |
588 th = uitable(hp, ... | |
589 'Units', 'normalized',... | |
590 'ColumnName', {'Name','Type', 'Size', 'kB'}, ... | |
591 'Position', [Lleft Lbottom Lwidth Lheight],... | |
592 'Tag', 'LTPDVworkspaceList', ... | |
593 'CellSelectionCallback', {@ltpdv_workspaceList_select, mainfig}); | |
594 | |
595 % set data | |
596 ltpdv_workspaceList_set_data(th); | |
597 | |
598 % Make refresh button | |
599 pl = pmarg; | |
600 ph = 0.05; | |
601 pb = Lbottom - ph - pmarg; | |
602 pw = 0.1; | |
603 pbh = uicontrol(hp,'Style','pushbutton',... | |
604 'String','Refresh',... | |
605 'Callback', {@ltpdv_workspaceList_set_data, th}, ... | |
606 'Units', 'normalized', ... | |
607 'Position',[pl pb pw ph]); | |
608 | |
609 % Make import button | |
610 pl = pmarg + pw + pmarg; | |
611 ph = 0.05; | |
612 pb = Lbottom - ph - pmarg; | |
613 pw = 0.1; | |
614 pbh = uicontrol(hp,'Style','pushbutton',... | |
615 'String','Import',... | |
616 'Callback', {@ltpdv_importObjs, mainfig, th}, ... | |
617 'Units', 'normalized', ... | |
618 'Position',[pl pb pw ph]); | |
619 | |
620 % Selection box for renamin with var names | |
621 pl = pl + pw + pmarg; | |
622 ph = 0.05; | |
623 pb = Lbottom - ph - pmarg; | |
624 pw = 0.3; | |
625 ch = uicontrol(hp, 'Style', 'checkbox', ... | |
626 'String', 'use var name', ... | |
627 'TooltipString', 'Set object name to workspace variable name.', ... | |
628 'Units', 'normalized', ... | |
629 'Position', [pl pb pw ph], ... | |
630 'Value', 1, ... | |
631 'Tag', 'LTPDVusevarnameChk'); | |
632 | |
633 end | |
634 | |
635 | |
636 | |
637 | |
638 |