Mercurial > hg > ltpda
comparison m-toolbox/m/gui/ltpdv/callbacks/ltpdv_get_params_from_panel.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 % LTPDV_GET_PARAMS_FROM_PANEL get a plist from the parameters on a | |
2 % parameters panel | |
3 % | |
4 % M Hewitson 26-08-08 | |
5 % | |
6 % $Id: ltpdv_get_params_from_panel.m,v 1.1 2008/09/02 07:51:47 hewitson Exp $ | |
7 % | |
8 function pl = ltpdv_get_params_from_panel(parampanh) | |
9 | |
10 | |
11 % Get params | |
12 pancomps = getappdata(parampanh, 'pancomps'); | |
13 | |
14 % loop over params | |
15 pl = plist(); | |
16 for j=1:size(pancomps,1) | |
17 | |
18 % handles | |
19 keyf = pancomps{j,1}; | |
20 valf = pancomps{j,2}; | |
21 actf = pancomps{j,3}; | |
22 | |
23 % Get activate status | |
24 if get(actf, 'Value') | |
25 % Get key name | |
26 key = get(keyf, 'String'); | |
27 | |
28 % Get param value | |
29 valclass = getappdata(valf, 'valClass'); | |
30 | |
31 switch valclass | |
32 case 'char' | |
33 val = get(valf, 'String'); | |
34 case 'double' | |
35 val = get(valf, 'String'); | |
36 try | |
37 val = eval(val); | |
38 end | |
39 case 'sym' | |
40 val = get(valf, 'String'); | |
41 val = sym(val); | |
42 case 'specwin' | |
43 strs = get(valf, 'String'); | |
44 idx = get(valf, 'Value'); | |
45 val = strs{idx}; | |
46 if strcmp(val, 'Kaiser') | |
47 val = specwin(val, 10, 150); | |
48 else | |
49 val = specwin(val, 10); | |
50 end | |
51 case 'time' | |
52 val = get(valf, 'String'); | |
53 val = time(val); | |
54 otherwise | |
55 error(['### Unsupported value class: ' valclass]); | |
56 end | |
57 | |
58 % Add to plist | |
59 pl = append(pl, key, val); | |
60 end | |
61 end | |
62 | |
63 end |