0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 function g_functionNameSet(hObject, varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 % Setting the name of the function in the 'generic' block.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 functionName2 = get(hObject,'String');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 classes = utils.helper.ltpda_userclasses;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 for i=1:numel(classes)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 if ismethod(eval(classes{i}),functionName2)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 currSel = utils.prog.gcbsh;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 for j=1:numel(currSel), set(currSel(j),'Tag',['method ',classes{i}]); end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 break
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 currSel = utils.prog.gcbsh;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 for j=1:numel(currSel), set(currSel(j),'Tag','function'); end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 paramcommand = g_RetrievePlist(functionName2);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 if ~isempty(paramcommand)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 functionName = functionName2;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 paramcommand = strcat(paramcommand,'functionName=''',functionName2,''';');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 for i=1:1000
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 try
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 for kk=1:length(selBlocks), set_param(selBlocks(kk),'Name',functionName2); end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 break;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 catch
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 functionName2 = strcat(functionName,'_',num2str(i));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 for kk=1:length(selBlocks), set_param(selBlocks(kk),'Description',paramcommand); end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 delete(findobj(gcf,'Parent',currPanel))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 buildplistFigureParam([],[],get(findobj('Tag','paramsPage'),'UserData'))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 else % the functionName inserted it's not valid
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 description = get_param(gcbh,'Description');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 funcname = findstr('functionName=',description);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 if funcname
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 i = funcname+14;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 while ~strcmp(description(i),';'), i=i+1; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39 functionName = description(funcname+14:i-2);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 set(hObject,'String',functionName);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44 ltpdagui('Redraw',2)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 end
|