0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 function pan2param(varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 % This is the GUI m-file able to read the list of parameters to be set for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 % the function/block currently selected and to build the window with the
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 % parameters panel accordingly.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 % $Id: pan2param.m,v 1.64 2009/02/01 17:20:04 nicola Exp $
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 global oldparams params paramEnabled oldparamEnabled paramSets currPanel
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 global LTPDAinvar selBlocks objName noParamsReq functionName guiFontSize %#ok<NUSED>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 %%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 currPanel = varargin{1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 panelDimens = get(currPanel, 'Position');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 backColor = get(currPanel, 'BackgroundColor');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 selBlocks = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 set(gcf,'NextPlot','new');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 GUIprefs = getappdata(0, 'GUIpreferences');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 if ~isfield(GUIprefs,'CAD'), GUIprefs.CAD = 0; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 if ~isfield(GUIprefs,'Copied'), GUIprefs.Copied = 0; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 if ~isfield(GUIprefs,'Detach'), GUIprefs.Detach = 0; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 setappdata(0, 'GUIpreferences',GUIprefs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 guiFontSize = getappdata(0, 'ltpda_gui_fontsize');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 if isempty(guiFontSize), guiFontSize = 10; setappdata(0, 'ltpda_gui_fontsize',10); end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 set(gcf,'NextPlot','new')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 alltimers = timerfindall;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 stop(alltimers(1));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 set(alltimers(1),'TimerFcn',@g_ContinuousParamCheck,'Period',0.3);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 start(alltimers(1));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 %%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 %----------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 function buildplistFigureParam(varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 %----------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 panelDimens = get(currPanel, 'Position');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 lineSpacing = 25 * guiFontSize/10;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39 setappdata(0,'ltpda_gui_LineSpacing',lineSpacing);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 if ~isempty(findobj(gcf,'Tag','apply'))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 notredrawn = 0; undoStatus = get(findobj(gcf,'Tag','undo'),'enable');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42 % deletes only the dynamical part of the panel:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43 for i = 1:numel(objName), try delete(objName{i}); catch, end; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44 delete(findobj('Parent',currPanel,'TooltipString','Remove this parameter'))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 notredrawn = 1; undoStatus = 'off';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
47 % deletes all, to redraw the entire panel:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
48 delete(findobj(gcf,'Parent',currPanel));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
49 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
50 objName = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
51 close(findobj('Tag','expandedEditField'))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
52 if notredrawn % Executes the STATIC part too only if it's not just an update of the panel
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
53
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
54 % =========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
55 % =========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
56 % ========================== Build STATIC panel ===========================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
57 % =========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
58 % =========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
59
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
60 % -------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
61 % Retrieve the parameters:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
62 % -------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
63 if isempty(oldparams) && isempty(params) % the user has just selected another block
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
64 paramcommand = get_param(gcbh,'Description');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
65 noParamsReq=0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
66 if isempty(paramcommand)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
67 paramcommand = g_RetrievePlist();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
68 selBlocks = utils.prog.gcbsh;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
69 for kk=1:length(selBlocks)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
70 set_param(selBlocks(kk),'Description',paramcommand);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
71 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
72 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
73 eval(paramcommand)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
74 if ~isempty(oldparams), params = oldparams; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
75 oldparamEnabled = paramEnabled;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
76 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
77
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
78 if ~exist('paramEnabled','var') && isempty(find(params,'Sets')) && noParamsReq==0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
79 paramEnabled = zeros(1,nparams(params));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
80 oldparamEnabled = paramEnabled;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
81 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
82 childpath = find_system(gcbh,'LookUnderMasks','all','BlockType','M-S-Function');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
83 setappdata(0,'ltpda_currFunctionName',get_param(childpath,'Tag'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
84
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
85 y = nparams(params);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
86
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
87 if y==0 && ~exist('paramSets','var') && noParamsReq==0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
88 paramcommand=[paramcommand,'noParamsReq=1;'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
89 selBlocks = utils.prog.gcbsh;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
90 for kk=1:length(selBlocks), set_param(selBlocks(kk),'Description',paramcommand); end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
91 buildplistFigureParam([],[],get(findobj('Tag','paramsPage'),'UserData'))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
92 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
93
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
94 % -------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
95 % Fixed buttons:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
96 % -------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
97 % Help Button
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
98 uicontrol('Parent',currPanel,'Units','pixels','HorizontalAlignment','center','Position',[20 10 45 guiFontSize*16/10],'FontAngle','italic','FontSize',guiFontSize,'String','?','TooltipString','Open the Help associated to this function','Visible','on','Callback',@g_HelpButtonCallback,'Style','pushbutton');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
99 % Reset Parameters Button
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
100 uicontrol('Parent',currPanel,'Units','pixels','HorizontalAlignment','center','Position',[75 10 75 guiFontSize*16/10],'FontAngle','italic','FontSize',guiFontSize,'String','Reset','TooltipString','Reset the parameters for this block','Visible','on','Callback',@g_ResetButtonCallback,'Style','pushbutton');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
101 % 'Set name' checkbox:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
102 setName = get(gcbh,'UserData');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
103 if isempty(setName), setName = 0; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
104 uicontrol('Parent',currPanel,'Units','pixels','BackgroundColor',backColor,'HorizontalAlignment','left','Position',[170 10 140 guiFontSize*16/10],'FontAngle','italic','FontSize',guiFontSize-2,'String','Set name','TooltipString','Set the signal name equal to the block name','Visible','on','Callback',@g_SetNameCallback,'Value',setName,'Style','checkbox');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
105 % Keep local result
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
106 probe = get_param(gcbh,'MaskHelp');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
107 if ~isempty(probe) && isa(probe,'char') && strcmp(probe,'probe'), keepRes = 1; else keepRes = 0; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
108 uicontrol('Parent',currPanel,'Units','pixels','BackgroundColor',backColor,'HorizontalAlignment','left','Position',[250 10 220 guiFontSize*16/10],'FontAngle','italic','FontSize',guiFontSize-2,'String','Keep local result','TooltipString','Do not delete the result of this block at the end of the analysis calculation','Visible','on','Callback',@g_KeepResultCallback,'Value',keepRes,'Style','checkbox');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
109 % Number of data inputs:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
110 uicontrol('Parent',currPanel,'TooltipString','Set the number of input expected by this block','BackgroundColor',backColor,'Units','pixels','HorizontalAlignment','right','Position',[370 5 70 guiFontSize*20/10],'String','Inputs: ','FontAngle','italic','FontSize',guiFontSize-2,'Visible','on','Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
111 paramFromSimulink = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
112 for ii=1:y
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
113 paramkeys{ii} = params.params(ii).key;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
114 paramvals{ii} = params.params(ii).val;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
115 if isa(paramvals{ii},'char') && numel(paramvals{ii})>2 && strcmp(paramvals{ii},'-->'), paramFromSimulink = paramFromSimulink + 1; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
116 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
117 inports = find_system(gcb,'SearchDepth',1,'LookUnderMasks','all','BlockType','Inport');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
118 uicontrol('Parent',currPanel,'TooltipString','Set the number of input expected by this block','BackgroundColor',backColor,'Units','pixels','Position',[450 8 40 guiFontSize*20/10],'String',num2str(numel(inports)-paramFromSimulink),'FontSize',guiFontSize,'Visible','on','Enable','on','UserData',numel(inports)-paramFromSimulink,'Callback',@g_numberDataInput,'Tag','numbDataInputs','Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
119
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
120 % The function has different sets of parameters:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
121 if exist('paramSets','var') && ~isempty(paramSets)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
122 sets = find(paramSets,'sets');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
123 currSet = find(paramSets,'currSet');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
124 % Sets popup menu:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
125 uicontrol('Parent',currPanel,'BackgroundColor',backColor,'Units','pixels','HorizontalAlignment','center','Position',[40 panelDimens(4)-30 250 20],'String',sets,'Value',currSet,'Visible','on','UserData',sets,'Callback',@g_SetsUpdate,'Style','popup');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
126 panelDimens(4) = panelDimens(4)-20;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
127 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
128
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
129 % -------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
130 % Button to add user-defined params:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
131 % -------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
132 paramTypes = {'double/char','specwin','pzmodel','-->'};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
133 for kk=1:y, paramTypes(strmatch(class(params.params(kk).val),paramTypes,'exact'))=[]; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
134 paramTypes = [paramTypes(1:end-1),{'pz','unit'},paramTypes(end)];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
135 % ParamType popup
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
136 hparamType = uicontrol('Parent',currPanel,'Tag','addparamspopup','TooltipString','Add a user-defined parameter','BackgroundColor',backColor,'Units','pixels','Position',[20 40 100 20],'String',paramTypes,'Value',1,'Visible','on','Enable','on','Style','popupmenu');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
137 % Add params button
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
138 uicontrol('Parent',currPanel,'TooltipString','Add a user-defined parameter','Units','pixels','Position',[130 40 20 20],'String','+','Visible','on','Enable','on','Callback', @g_AddParamCallback,'UserData',hparamType,'Style','pushbutton');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
139
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
140 % -------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
141 % Buttons to apply or undo:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
142 % -------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
143 % Apply button
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
144 uicontrol('Parent',currPanel,'Units','pixels','Position',[panelDimens(3)-70 40 60 guiFontSize*20/10],'HorizontalAlignment','right','FontSize',guiFontSize,'String','Apply','Visible','on','Enable','off','Callback', @g_ApplyButtonCallback,'DeleteFcn',{@g_ApplyButtonCallback,0},'UserData',hparamType,'Tag','apply','Style','pushbutton');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
145 % Undo button
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
146 uicontrol('Parent',currPanel,'Units','pixels','Position',[panelDimens(3)-70 10 60 guiFontSize*20/10],'HorizontalAlignment','right','FontSize',guiFontSize,'String','Undo','Visible','on','Enable',undoStatus,'Callback', @g_UndoButtonCallback,'UserData',hparamType,'Tag','undo','Style','pushbutton');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
147
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
148
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
149 paramPagePosition = panelDimens + [3 65+guiFontSize*16/10 -6 -(80+guiFontSize*16/10)];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
150
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
151 else % The part above was executed only if it's not an update of the panel
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
152 y = nparams(params);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
153 for pp=1:y
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
154 paramkeys{pp} = params.params(pp).key;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
155 paramvals{pp} = params.params(pp).val;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
156 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
157 if exist('paramSets','var') && ~isempty(paramSets), panelDimens(4) = panelDimens(4)-20; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
158 paramPagePosition = panelDimens + [3 65+guiFontSize*16/10 -6 -(80+guiFontSize*16/10)];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
159 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
160
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
161
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
162 if nargin>2 && isa(varargin{3},'cell'), varargin{3} = varargin{3}{1}; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
163 if nargin<3, currPage = 1; else currPage = varargin{3}; if isa(currPage,'cell'), currPage = currPage{1}; end; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
164 uipanel('Parent',currPanel,'BackgroundColor',backColor,'FontSize',7,'Units','pixels','Position',paramPagePosition,'Tag','paramsPage','UserData',currPage);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
165
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
166 GUIprefs = getappdata(0, 'GUIpreferences');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
167 % Check if the parameters panel has to be drawn detached:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
168 if GUIprefs.Detach
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
169 drawn = g_drawParPanel();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
170 if drawn, return; end;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
171 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
172
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
173
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
174
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
175 % =========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
176 % =========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
177 % ========================= Build DYNAMIC panel ===========================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
178 % =========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
179 % =========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
180
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
181 totalGaps = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
182 paramThisPage = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
183 lastParamGap = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
184 paramPages = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
185 for ii=1:y
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
186 paramThisPage = paramThisPage+1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
187 % -------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
188 % Cycle to verify whether gaps (= extra lines for complex params, such as
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
189 % pzmodels) are necessary or not:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
190 switch class(paramvals{ii})
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
191 case 'pzmodel'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
192 if numel(paramvals{ii}.poles)>1 || numel(paramvals{ii}.zeros)>1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
193 totalGaps = totalGaps+1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
194 lastParamGap = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
195 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
196 case 'pz'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
197 if numel(paramvals{ii})>1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
198 totalGaps = totalGaps+1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
199 lastParamGap = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
200 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
201 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
202 % -------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
203 % Check if it's necessary to draw multiple parameters pages:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
204 if (paramThisPage+totalGaps)*lineSpacing > paramPagePosition(4)-20
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
205 paramPages = [paramPages , paramThisPage-1];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
206 if ii==y, paramPages = [paramPages,1]; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
207 paramThisPage = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
208 totalGaps = lastParamGap;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
209 lastParamGap = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
210 elseif ii==y
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
211 paramPages = [paramPages , paramThisPage];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
212 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
213 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
214
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
215 currGap = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
216 % The vector 'paramPages' contains how many params are contained into every page.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
217 if numel(paramPages) > 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
218 set(findobj('Tag','paramsPage'),'Title',['Page number ', num2str(currPage)] );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
219 uicontrol('Parent',currPanel,'BackgroundColor',backColor,'Tag','gotoparamspage','HorizontalAlignment','left','Position',[200 39 100 20],'String','Go to page: ','FontName','Times New Roman','FontSize',guiFontSize+2,'FontWeight','bold','Visible','on','Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
220 for ii = 0:numel(paramPages)-1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
221 uicontrol('Parent',currPanel,'Tag','gotoparamspage','Units','pixels','Position',[300+ii*(30) 40 20 20],'String',num2str(ii+1),'Visible','on','Enable','on','Callback', {@buildplistFigureParam,ii+1},'Style','pushbutton');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
222 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
223 elseif numel(paramPages) == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
224 delete(findobj('Tag','gotoparamspage'))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
225 elseif isempty(paramPages)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
226 paramPages = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
227 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
228 firstParam = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
229 if nargin>1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
230 if varargin{3}>numel(paramPages), varargin{3} = numel(paramPages); end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
231 for ii = 1:varargin{3}-1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
232 firstParam = firstParam + paramPages(ii);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
233 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
234 lastParam = firstParam + paramPages(varargin{3})-1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
235 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
236 lastParam = paramPages(1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
237 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
238 currParam = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
239
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
240 for ii = firstParam:lastParam
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
241 currParam = currParam + 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
242 addedPar = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
243 % Checkbox to enable input setting:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
244 objName{ii,1} = uicontrol('Parent',currPanel,'Units','pixels','Position',[10,panelDimens(4)-lineSpacing*(currParam+1+currGap),14,14],'Value',paramEnabled(ii),'Visible','on','Enable','on','Callback', @g_EnableCallback,'Tag',paramkeys{ii},'UserData',ii,'Style','checkbox');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
245 % Remove Param Button:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
246 try %#ok<ALIGN>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
247 if strcmpi(paramkeys{ii}(1:7),'addPar_')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
248 uicontrol('Parent',currPanel,'Units','pixels','Position',[panelDimens(3)-30 panelDimens(4)-lineSpacing*(currParam+1+currGap) 20 20],'String','-','TooltipString','Remove this parameter','Visible','on','Enable','on','UserData',ii,'Callback', @g_RemParamCallback,'Style','pushbutton');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
249 addedPar = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
250 paramkeys{ii}(1:7) = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
251 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
252 catch, end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
253
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
254 switch class(paramvals{ii})
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
255
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
256 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
257 case {'double'}
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
258 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
259 % Key value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
260 objName{ii,2} = uicontrol('Parent',currPanel,'TooltipString','Key (name of the parameter)','Units','pixels','Position',[50 panelDimens(4)-lineSpacing*(currParam+1+currGap) 120 guiFontSize*20/10],'String',paramkeys{ii},'FontSize',guiFontSize+1,'Visible','on','Enable','off','UserData',ii,'Callback',@g_editNameCallback,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
261 if ~noParamsReq && ~addedPar
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
262 set(objName{ii,2},'Style','text','BackgroundColor',backColor,'Position',[50 panelDimens(4)-(4+lineSpacing*(currParam+1+currGap)) 120 20]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
263 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
264 % Val value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
265 data = mat2str(paramvals{ii});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
266 objName{ii,3} = uicontrol('Parent',currPanel,'TooltipString','Val (value of the parameter)','Units','pixels','Position',[200 panelDimens(4)-lineSpacing*(currParam+1+currGap) 200 guiFontSize*20/10],'String',data,'Fontsize',guiFontSize+1,'Visible','on','Enable','off','UserData',ii,'Callback',@g_editValueCallback,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
267 objName{ii,4} = uicontrol('UserData',objName{ii,3},'TooltipString','Expand the edit field','Parent',currPanel,'BackgroundColor',[0.7 0.7 0.7],'HorizontalAlignment','left','Position',[405 panelDimens(4)+3-lineSpacing*(currParam+1+currGap) 13 13],'Visible','on','Callback',@g_ExpandEdit,'Style','pushbutton');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
268 % Enable parameters from Simulink:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
269 objName{ii,10} = uicontrol('TooltipString','Retrieve from Simulink','String','From Simulink','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','left','Position',[450 panelDimens(4)-lineSpacing*(currParam+1+currGap) 120 20],'Max',1,'Min',0,'Value',0,'Visible','on','Tag',num2str(ii),'UserData',[],'Callback',@g_fromSimulinkCallback,'Style','checkbox');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
270 if strcmp(paramvals{ii},'-->')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
271 set(objName{ii,3},'Visible','off');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
272 set(objName{ii,4},'Visible','off');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
273 set(objName{ii,10},'Value',1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
274 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
275
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
276 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
277 case {'char'}
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
278 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
279 % Key value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
280 objName{ii,2} = uicontrol('Parent',currPanel,'Units','pixels','Position',[120 panelDimens(4)-lineSpacing*(currParam+1+currGap) 60 20],'String',paramkeys{ii},'FontSize',guiFontSize+1,'Visible','on','Enable','off','UserData',ii,'Callback',@g_editNameCallback,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
281 if ~noParamsReq && ~addedPar
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
282 set(objName{ii,2},'Style','text','BackgroundColor',backColor,'Position',[50 panelDimens(4)-(4+lineSpacing*(currParam+1+currGap)) 120 20]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
283 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
284 if strcmpi(paramkeys{ii},'filename')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
285 % Browse button:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
286 currFilename = paramvals{ii};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
287 if isempty(currFilename), currFilename = 'Browse'; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
288 if numel(currFilename)>30, currFilename = ['...',currFilename(end-29:end)]; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
289 objName{ii,3} = uicontrol('Parent',currPanel,'Units','pixels','Position',[200 panelDimens(4)-lineSpacing*(currParam+1+currGap) 300 20],'String',currFilename,'Visible','on','Enable','off','Callback',@g_browseCallback,'Style','pushbutton');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
290 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
291 % Val value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
292 objName{ii,3} = uicontrol('Parent',currPanel,'Units','pixels','Position',[200 panelDimens(4)-lineSpacing*(currParam+1+currGap) 200 20],'String',['''',strrep(paramvals{ii},'''',''''''),''''],'Fontsize',guiFontSize+1,'Visible','on','Enable','off','UserData',ii,'Callback',@g_editValueCallback,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
293 objName{ii,4} = uicontrol('UserData',objName{ii,3},'TooltipString','Expand the edit field','Parent',currPanel,'BackgroundColor',[0.7 0.7 0.7],'HorizontalAlignment','left','Position',[405 panelDimens(4)+3-lineSpacing*(currParam+1+currGap) 13 13],'Visible','on','Callback',@g_ExpandEdit,'Style','pushbutton');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
294 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
295 objName{ii,10} = uicontrol('TooltipString','Retrieve from Simulink','String','From Simulink','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','left','Position',[450 panelDimens(4)-lineSpacing*(currParam+1+currGap) 120 20],'Max',1,'Min',0,'Value',0,'Visible','on','Tag',num2str(ii),'UserData',[],'Callback',@fromSimulinkCallback,'Style','checkbox');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
296 if strcmp(paramvals{ii},'-->')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
297 set(objName{ii,3},'Visible','off');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
298 set(objName{ii,4},'Visible','off');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
299 set(objName{ii,10},'Value',1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
300 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
301 set(objName{ii,10},'Visible','off');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
302 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
303
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
304 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
305 case {'unit'}
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
306 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
307 % Key value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
308 objName{ii,2} = uicontrol('Parent',currPanel,'Units','pixels','Position',[120 panelDimens(4)-lineSpacing*(currParam+1+currGap) 60 20],'String',paramkeys{ii},'FontSize',guiFontSize+1,'Visible','on','Enable','off','UserData',ii,'Callback',@g_editNameCallback,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
309 if ~noParamsReq && ~addedPar
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
310 set(objName{ii,2},'Style','text','BackgroundColor',backColor,'Position',[50 panelDimens(4)-(4+lineSpacing*(currParam+1+currGap)) 120 20]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
311 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
312 % Val value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
313 unitVal = paramvals{ii}.strs; if isempty(unitVal), unitVal = {''}; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
314 allunits = unit.supportedUnits;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
315 unitsTooltip = 'Supported units: ';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
316 for kk=1:numel(allunits), unitsTooltip = [unitsTooltip,allunits{kk},',']; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
317 unitsTooltip(end)=[];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
318 objName{ii,3} = uicontrol('Parent',currPanel,'TooltipString',unitsTooltip,'Units','pixels','Position',[200 panelDimens(4)-lineSpacing*(currParam+1+currGap) 200 20],'String',['''',unitVal{1},''''],'Fontsize',guiFontSize+1,'Visible','on','Enable','off','UserData',ii,'Callback',@g_unitValCallback,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
319
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
320 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
321 case {'logical'}
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
322 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
323 % Key value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
324 objName{ii,2} = uicontrol('Parent',currPanel,'Units','pixels','Position',[120 panelDimens(4)-lineSpacing*(currParam+1+currGap) 60 20],'String',paramkeys{ii},'FontSize',guiFontSize+1,'Visible','on','Enable','off','UserData',ii,'Callback',@g_editNameCallback,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
325 if ~noParamsReq && ~addedPar
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
326 set(objName{ii,2},'Style','text','BackgroundColor',backColor,'Position',[50 panelDimens(4)-(4+lineSpacing*(currParam+1+currGap)) 120 20]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
327 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
328 % Val value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
329 objName{ii,3} = uicontrol('Parent',currPanel,'Units','pixels','Position',[200 panelDimens(4)-lineSpacing*(currParam+1+currGap) 100 20],'String',{'false','true'},'Value',paramvals{ii}+1,'Fontsize',guiFontSize+1,'Visible','on','Enable','off','UserData',ii,'Callback',@g_logicValCallback,'Style','popupmenu');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
330
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
331 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
332 case 'specwin'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
333 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
334 selectWind = paramvals{ii}.type;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
335 listWindows = ['Kaiser',specwin.getTypes];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
336 selectWindValue = strmatch(selectWind,listWindows,'exact');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
337 % Window text:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
338 objName{ii,2} = uicontrol('Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','center','Position',[40 panelDimens(4)-lineSpacing*(currParam+1+currGap)-5 60 20],'String','Window:','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Visible','on','Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
339 % Window type popup:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
340 objName{ii,3} = uicontrol('Parent',currPanel,'Units','pixels','Position',[105 panelDimens(4)-lineSpacing*(currParam+1+currGap)-2 90 20],'String',listWindows,'TooltipString','Window names','Value',selectWindValue,'Visible','on','Enable','off','Tag',paramkeys{ii},'UserData',ii,'Callback', @g_WindListCallback,'Style','popupmenu');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
341 % Length value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
342 currLength = num2str(length(params.params(ii).val.win));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
343 objName{ii,4} = uicontrol('Parent',currPanel,'Units','pixels','Position',[200 panelDimens(4)-lineSpacing*(currParam+1+currGap)-2 70 20],'String',num2str(currLength),'TooltipString','Window Length','Visible','on','Enable','off','UserData',ii,'Callback', @g_WindlengthCallback,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
344 if strcmp(selectWind,'Kaiser')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
345 % PSL value if Kaiser:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
346 currPSL = params.params(ii).val.psll;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
347 objName{ii,5} = uicontrol('Parent',currPanel,'Units','pixels','Position',[275 panelDimens(4)-lineSpacing*(currParam+1+currGap)-2 60 20],'String',num2str(currPSL),'TooltipString','Peak Sidelobe','Visible','on','Enable','off','UserData',ii,'Callback',@g_WindPSLCallback,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
348 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
349 % Simulink checkbox:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
350 objName{ii,10} = uicontrol('TooltipString','Retrieve from Simulink','String','From Simulink','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','left','Position',[450 panelDimens(4)-lineSpacing*(currParam+1+currGap) 120 20],'Max',1,'Min',0,'Value',0,'Visible','on','Tag',num2str(ii),'UserData',paramvals{ii},'Callback',@g_fromSimulinkCallback,'Style','checkbox');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
351
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
352 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
353 case 'pzmodel'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
354 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
355 % Simulink checkbox:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
356 objName{ii,10} = uicontrol('TooltipString','Retrieve from Simulink','String','From Simulink','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','left','Position',[500 panelDimens(4)-lineSpacing*(currParam+1+currGap) 120 20],'Max',1,'Min',0,'Value',0,'Visible','on','Tag',num2str(ii),'UserData',paramvals{ii},'Callback',@g_fromSimulinkCallback,'Style','checkbox');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
357
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
358 clear pzObj currPoles poleFreqs poleQs poleFQs currZeros zeroFreqs zeroQs zeroFQs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
359 pzObj = params.params(ii).val;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
360 currPoles = pzObj.poles;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
361 currZeros = pzObj.zeros;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
362 % Load button:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
363 objName{ii,3} = uicontrol('Parent',currPanel,'HorizontalAlignment','left','Position',[50 panelDimens(4)-(3+lineSpacing*(currParam+1+currGap)) 50 20],'String','Load','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Visible','on','UserData',ii,'Callback',@g_pzmodelLoad,'enable','off','Style','pushbutton');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
364 % Gain text:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
365 objName{ii,4} = uicontrol('Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','left','Position',[120 panelDimens(4)-lineSpacing*(currParam+1+currGap)-5 40 20*guiFontSize/10],'String','Gain:','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Visible','on','Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
366 % Gain value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
367 currGain = pzObj.gain;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
368 objName{ii,5} = uicontrol('Parent',currPanel,'Units','pixels','Position',[155 panelDimens(4)-(2+lineSpacing*(currParam+1+currGap)) 60 20],'String',num2str(currGain),'FontSize',guiFontSize+1,'Visible','on','Enable','off','UserData',ii,'Callback',@g_pzmodelGainEdit,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
369 % Poles text:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
370 objName{ii,6} = uicontrol('Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','left','Position',[240 panelDimens(4)-lineSpacing*(currParam+1+currGap)-5 40 20],'String','Poles:','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Visible','on','Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
371 % Zeros text:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
372 objName{ii,7} = uicontrol('Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','left','Position',[355 panelDimens(4)-lineSpacing*(currParam+1+currGap)-5 40 20],'String','Zeros:','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Visible','on','Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
373 % Poles value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
374 for kk=1:numel(currPoles)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
375 poleFreqs(kk,1) = currPoles(kk).f;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
376 poleQs(kk,1) = currPoles(kk).q;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
377 if ~isnan(poleQs(kk,1))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
378 poleFQs{kk,1}=strcat(num2str(poleFreqs(kk,1)),',',num2str(poleQs(kk,1)));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
379 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
380 poleFQs{kk,1}=num2str(poleFreqs(kk,1));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
381 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
382 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
383 if numel(currPoles)>1 || numel(currZeros)>1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
384 currGap=currGap+1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
385 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
386 if isempty(currPoles)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
387 poleFQs = '';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
388 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
389 poleFQs=char(poleFQs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
390 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
391 objName{ii,8} = uicontrol('Parent',currPanel,'Units','pixels','Position',[280 panelDimens(4)-(2+lineSpacing*(currParam+1+currGap))-(lineSpacing-30)*(max(numel(currPoles),numel(currZeros))>1) 60 (20+(max(numel(currPoles),numel(currZeros))>1)*lineSpacing)*guiFontSize/10],'Max',2,'String',poleFQs,'FontSize',guiFontSize+1,'TooltipString','Insert ''freq'' or ''freq,q'' on multiple lines','Visible','on','Enable','off','UserData',ii,'Callback',{@g_pzmodelPZEdit,1},'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
392 % Zeros value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
393 for kk=1:numel(currZeros)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
394 zeroFreqs(kk,1) = currZeros(kk).f;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
395 zeroQs(kk,1) = currZeros(kk).q;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
396 if ~isnan(zeroQs(kk,1))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
397 zeroFQs{kk,1}=strcat(num2str(zeroFreqs(kk,1)),',',num2str(zeroQs(kk,1)));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
398 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
399 zeroFQs{kk,1}=num2str(zeroFreqs(kk,1));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
400 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
401 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
402 if isempty(currZeros)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
403 zeroFQs = '';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
404 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
405 zeroFQs = char(zeroFQs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
406 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
407 objName{ii,9} = uicontrol('Parent',currPanel,'Units','pixels','Position',[395 panelDimens(4)-(2+lineSpacing*(currParam+1+currGap))-(lineSpacing-30)*(max(numel(currPoles),numel(currZeros))>1) 60 (20+(max(numel(currPoles),numel(currZeros))>1)*lineSpacing)*guiFontSize/10],'Max',2,'String',zeroFQs,'FontSize',guiFontSize+1,'TooltipString','Insert ''freq'' or ''freq,q'' on multiple lines','Visible','on','Enable','off','UserData',ii,'Callback',{@g_pzmodelPZEdit,0},'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
408
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
409 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
410 case 'pz'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
411 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
412 % Simulink checkbox:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
413 objName{ii,10} = uicontrol('TooltipString','Retrieve from Simulink','String','From Simulink','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','left','Position',[500 panelDimens(4)-lineSpacing*(currParam+1+currGap) 120 20],'Max',1,'Min',0,'Value',0,'Visible','on','Tag',num2str(ii),'UserData',paramvals{ii},'Callback',@g_fromSimulinkCallback,'Style','checkbox');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
414
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
415 currPoles = params.params(ii).val;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
416 clear poleFreqs poleQs poleFQs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
417 for kk=1:numel(currPoles)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
418 poleFreqs(kk,1) = currPoles(kk).f;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
419 poleQs(kk,1) = currPoles(kk).q;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
420 if isnan(poleQs(kk,1))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
421 poleFQs{kk,1}=num2str(poleFreqs(kk,1));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
422 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
423 poleFQs{kk,1}=strcat(num2str(poleFreqs(kk,1)),',',num2str(poleQs(kk,1)));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
424 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
425
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
426 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
427 poleFQs=char(poleFQs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
428 % Poles text:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
429 objName{ii,2} = uicontrol('Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','center','Position',[50 panelDimens(4)-(4+lineSpacing*(currParam+1+currGap)) 120 20],'String','PZ','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Visible','on','Enable','off','Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
430 if numel(currPoles)>1, currGap=currGap+1; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
431 % Poles value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
432 objName{ii,3} = uicontrol('Parent',currPanel,'Units','pixels','Position',[250 panelDimens(4)-(2+lineSpacing*(currParam+1+currGap))-(lineSpacing-30)*(numel(currPoles)>1) 100 (20+(numel(currPoles)>1)*lineSpacing)*guiFontSize/10],'String',poleFQs,'Max',2,'FontSize',guiFontSize,'TooltipString','Insert ''freq'' or ''freq,q''','Visible','on','Enable','on','UserData',ii,'Callback',@g_poleEdit,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
433
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
434 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
435 case 'cell'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
436 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
437 if isa(paramvals{ii}{1},'char') && strcmp(paramvals{ii}{1},'-->')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
438 % Key value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
439 objName{ii,2} = uicontrol('Parent',currPanel,'BackgroundColor',backColor,'Units','pixels','Position',[50 panelDimens(4)-5-lineSpacing*(currParam+1+currGap) 120 20],'String',paramkeys{ii},'Visible','on','Enable','on','UserData',ii,'Callback',@g_editNameCallback,'Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
440 % Text: from Simulink environment:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
441 objName{ii,3} = uicontrol('TooltipString','Retrieve from Simulink','Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','left','Position',[230 panelDimens(4)-6-lineSpacing*(currParam+1+currGap) 200 20],'String','From Simulink environment','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Visible','on','Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
442 fromSimulink = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
443 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
444 % Key value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
445 objName{ii,2} = uicontrol('Parent',currPanel,'Units','pixels','Position',[120 panelDimens(4)-lineSpacing*(currParam+1+currGap) 60 20],'String',paramkeys{ii},'Visible','on','Enable','off','UserData',ii,'Callback',@g_editNameCallback,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
446 if ~noParamsReq && ~addedPar
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
447 set(objName{ii,2},'Style','text','BackgroundColor',backColor,'Position',[50 panelDimens(4)-5-lineSpacing*(currParam+1+currGap) 120 20]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
448 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
449 % Val value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
450 data = utils.prog.cell2str(paramvals{ii});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
451 objName{ii,3} = uicontrol('Parent',currPanel,'Units','pixels','Position',[250 panelDimens(4)-lineSpacing*(currParam+1+currGap) 130 20],'String',data,'Visible','on','Enable','on','UserData',ii,'Callback',@g_editValueCallback,'Style','edit');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
452 fromSimulink = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
453 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
454
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
455 % Simulink checkbox:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
456 objName{ii,10} = uicontrol('TooltipString','Retrieve from Simulink','String','From Simulink','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','left','Position',[500 panelDimens(4)-lineSpacing*(currParam+1+currGap) 120 20],'Max',1,'Min',0,'Value',fromSimulink,'Visible','on','Tag',num2str(ii),'UserData',paramvals{ii},'Callback',@g_fromSimulinkCallback,'Style','checkbox');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
457
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
458
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
459 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
460 otherwise % Other types of param?
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
461 % ==========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
462 % Key value:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
463 objName{ii,3} = uicontrol('Parent',currPanel,'BackgroundColor',backColor,'Units','pixels','Position',[50 panelDimens(4)-5-lineSpacing*(currParam+1+currGap) 120 20],'String',paramkeys{ii},'FontSize',guiFontSize+1,'Visible','on','Enable','off','UserData',ii,'Callback',@g_editNameCallback,'Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
464 % Text: input not supported. Please construct by proper block.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
465 objName{ii,4} = uicontrol('Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','left','Position',[250 panelDimens(4)-4-lineSpacing*(currParam+1+currGap) 200 20],'String','Unsupported yet','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Visible','on','Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
466 fromSimulink = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
467
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
468 % Simulink checkbox:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
469 objName{ii,10} = uicontrol('TooltipString','Retrieve from Simulink','String','From Simulink','FontName','Times New Roman','FontSize',guiFontSize+1,'FontWeight','normal','Parent',currPanel,'BackgroundColor',backColor,'HorizontalAlignment','left','Position',[450 panelDimens(4)-lineSpacing*(currParam+1+currGap) 120 20],'Max',1,'Min',0,'Value',fromSimulink,'Visible','on','Tag',num2str(ii),'UserData',paramvals{ii},'Callback',@g_fromSimulinkCallback,'Style','checkbox');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
470
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
471 % ==============================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
472 end % of SWITCH the param type
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
473 % Cycle to activate enabled params:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
474 if paramEnabled(ii) || noParamsReq==1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
475 [xx,yy] = size(objName);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
476 jj=2;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
477 while jj<=yy && ~isempty(objName{ii,jj})
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
478 try set(objName{ii,jj},'Enable','on'); set(objName{ii,jj},'ForegroundColor',[0 0 0]); catch, end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
479 jj=jj+1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
480 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
481 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
482
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
483 end % of cycle among params
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
484
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
485 end % of buildplistFigureParam function
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
486 %----------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
487
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
488 %% ========================= Selection Check ==============================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
489 % =========================================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
490 %----------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
491 function g_ContinuousParamCheck(varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
492 % This is the function to execute a continuous check on the status
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
493 % of the current selection (system and block).
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
494
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
495 currSelection = utils.prog.gcbsh;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
496 % set(findobj('Tag','LTPDAGUI'),'Name',[strtok(get(findobj('Tag','LTPDAGUI'),'Name'),' - '),' - ',bdroot]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
497 if isnan(selBlocks), buildplistFigureParam([],[],get(findobj('Tag','paramsPage'),'UserData')); end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
498
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
499 % Clear the figure if nothing is and was selected OR nothing is and something was selected OR is selected a library
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
500 if (isempty(selBlocks) && isempty(currSelection)) || (~isempty(selBlocks) && isempty(currSelection)) || strcmp(get_param(bdroot,'BlockDiagramType'),'library')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
501 delete(findobj(gcf,'Parent',currPanel))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
502 try close(findobj('Tag','parampanelFigure')); catch, end;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
503 selBlocks = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
504 uicontrol('Parent',currPanel,'BackgroundColor',backColor,'Units','pixels','HorizontalAlignment','center','Position',[0 (panelDimens(4)+30)/2 panelDimens(3) 30],'String','Nothing currently selected','Visible','on','Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
505 return
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
506 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
507
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
508 % Check that it's selected a ltpda simulink analysis diagram:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
509 if ~isempty(bdroot) && ~isempty(find_system(bdroot,'FindAll','on','Type','Annotation','Tag','ltpda model'))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
510
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
511 if ((numel(selBlocks)==1 && selBlocks~=gcbh) || length(selBlocks)~=length(currSelection)) || selBlocks(1)~=currSelection(1) && ~isempty(currSelection)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
512 delete(findobj(gcf,'Parent',currPanel))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
513 try close(findobj('Tag','parampanelFigure')); catch, end;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
514 GUIprefs = getappdata(0, 'GUIpreferences');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
515 if GUIprefs.CAD
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
516 if GUIprefs.Copied
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
517 if length(currSelection)<1, return; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
518 currSelection = g_copyfcnCallback(selBlocks,currSelection);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
519 GUIprefs.Copied = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
520 setappdata(0, 'GUIpreferences',GUIprefs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
521 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
522 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
523 for i=1:length(currSelection)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
524 set_param(currSelection(i),'LinkStatus','inactive');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
525 currentTags{i}=get_param(currSelection(i),'Tag');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
526 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
527
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
528 if strcmp(currentTags{1},'')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
529 delete(findobj(gcf,'Parent',currPanel))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
530 selBlocks = currSelection;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
531 uicontrol('Parent',currPanel,'BackgroundColor',backColor,'Units','pixels','HorizontalAlignment','center','Position',[0 (panelDimens(4)+30)/2 panelDimens(3) 30],'String','Not a valid LTPDA block','Visible','on','Style','text');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
532 return
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
533 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
534
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
536 if numel(currSelection)>1 % then the user has selected multiple blocks
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
537 % Check for consistency: all methods? same class?
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
538 for i=1:numel(currentTags)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
539 if ~strcmp(currentTags{i},currentTags{1})
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
540 g_ErrorSelectionInconsistent(currPanel);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
541 selBlocks = currSelection;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
542 return;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
543 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
544 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
545 % Check for consistency: same method?:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
546 for i=1:numel(currSelection)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
547 childpath = find_system(currSelection(i),'LookUnderMasks','all','BlockType','M-S-Function');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
548 functionname{i}=get_param(childpath,'Tag');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
549 if ~strcmp(functionname{i},functionname{1}) % different functions, inconsistent selection
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
550 g_ErrorSelectionInconsistent(currPanel);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
551 selBlocks = currSelection;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
552 return;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
553 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
554 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
555 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
556 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
557
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
558 delete(findobj(gcf,'Parent',currPanel))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
559 selBlocks = currSelection;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
560 oldparams = []; params = []; paramEnabled = []; oldparamEnabled = []; functionName = ''; paramSets = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
561
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
562 % Get the new functionName:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
563 childpath = find_system(gcbh,'LookUnderMasks','all','BlockType','M-S-Function');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
564 functionName = get_param(childpath,'Tag');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
565 if isempty(functionName)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
566 description = get_param(gcbh,'Description');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
567 funcname = findstr('functionName=',description);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
568 if funcname
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
569 i = funcname+14;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
570 while ~strcmp(description(i),';'), i=i+1; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
571 functionName = description(funcname+14:i-2);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
572 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
573 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
574 funcType = strtok(get(gcbh,'Tag'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
575 if isempty(functionName) && strcmp(funcType,'method')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
576 functionName = g_setmethod();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
577 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
578
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
579 switch funcType
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
580 % =========================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
581 case {'function','freepl','method'}
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
582 buildplistFigureParam()
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
583 % =========================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
584 case 'arithmetic'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
585 g_arithmetic(currPanel);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
586 % =========================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
587 case 'input'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
588 g_LoadInputParamCallback(currPanel);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
589 % =========================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
590 case {'mux','demux'}
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
591 g_LoadMuxParamCallback();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
592 % =========================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
593 case 'from'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
594 g_LoadFromBlockCallback(currPanel);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
595 % =========================================================
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
596 end % of switch
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
597
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
598 end % end of blocks selection
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
599 end % end of system selection check
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
600
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
601 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
602 %----------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
603
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
604 end |