comparison m-toolbox/m/gui/gltpda/g_RemParamCallback.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 g_RemParamCallback(hObject, varargin)
2
3 global params selBlocks paramEnabled
4
5 currParamIndex = get(hObject,'UserData');
6 paramKey = params.params(currParamIndex).key;
7 paramVal = params.params(currParamIndex).val;
8 params = remove(params,paramKey);
9 addParamsPopup = findobj(gcf,'Tag','addparamspopup','Style','popupmenu');
10 paramTypes = get(addParamsPopup,'String');
11 switch class(paramVal)
12 case 'specwin'
13 paramTypes = [paramTypes;{'specwin'}];
14 case 'pzmodel'
15 paramTypes = [paramTypes;{'pzmodel'}];
16 end
17 set(addParamsPopup,'String',paramTypes)
18 if ~strcmp(get_param(gcbh,'Tag'),'arithmetic')
19 paramEnabled(currParamIndex)=[];
20 else
21 paramcommand = g_BuildParamCommand(params);
22 for kk=1:length(selBlocks), set_param(selBlocks(kk),'Description',paramcommand); end
23 g_UpdateInports(paramKey,-1)
24 % g_arithmetic(currPanel);
25 return;
26 end
27 if strcmp(paramVal,'-->') % it's a data from Simulink: delete the relative inport block.
28 g_UpdateInports(paramKey,-1);
29 end
30
31 set(findobj('Tag','apply'),'Enable','on');
32 set(findobj('Tag','undo'),'Enable','on');
33
34 if strcmp(get_param(gcbh,'Tag'),'arithmetic'), g_arithmetic(currPanel);
35 else ltpdagui('Redraw',2)
36 end
37 end