3 %> @brief Properties Window to create a Cascade Block
4 %> @image html Screenshot-uip_block_cascade.png
6 %> <ol><li>Create all blocks of the cascade sequence <b>before</b> calling
this GUI</li>
7 %> <li>The popupmenu shows all blocks present in the workspace. Select among blocks and click on `Add`.</li>
8 %> <li>Click on `OK` when done</li>
14 function varargout = uip_block_cascade(varargin)
15 % Begin initialization code - DO NOT EDIT
17 gui_State =
struct(
'gui_Name', mfilename, ...
18 'gui_Singleton', gui_Singleton, ...
19 'gui_OpeningFcn', @uip_block_cascade_OpeningFcn, ...
20 'gui_OutputFcn', @uip_block_cascade_OutputFcn, ...
21 'gui_LayoutFcn', [] , ...
23 if nargin && ischar(varargin{1})
24 gui_State.gui_Callback = str2func(varargin{1});
28 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
30 gui_mainfcn(gui_State, varargin{:});
32 % End initialization code - DO NOT EDIT
34 % --- Executes just before uip_block_cascade is made visible.
35 function uip_block_cascade_OpeningFcn(hObject, eventdata, handles, varargin)
36 handles.output.flag_ok = 0;
37 handles.blocknames = {};
38 guidata(hObject, handles);
42 % --- Outputs from
this function are returned to the command line.
43 function varargout = uip_block_cascade_OutputFcn(hObject, eventdata, handles)
45 uiwait(handles.figure1);
46 handles = guidata(hObject); % Handles is not a handle(!), so gotta retrieve it again to see changes in .output
47 varargout{1} = handles.output;
52 varargout{1} = output;
56 %############################################
57 function refresh(handles)
59 v = get(handles.listbox, 'Value');
60 if sum(v > length(handles.blocknames)) > 0 && ~isempty(handles.blocknames)
61 set(handles.listbox, 'Value', 1);
63 set(handles.listbox, 'String', handles.blocknames);
64 local_show_description(handles);
66 function local_show_description(handles)
68 %
############################################
69 %############################################
72 % --- Executes on button press in pushbuttonOk.
73 function pushbuttonOk_Callback(hObject, eventdata, handles)
75 handles.output.params = {...
78 handles.output.flag_ok = 1;
79 guidata(hObject, handles);
86 % --- Executes on selection change in popupmenuBlocks.
87 function popupmenuBlocks_Callback(hObject, eventdata, handles) %#ok<*INUSD,*DEFNU>
89 % --- Executes during
object creation, after setting all properties.
90 function popupmenuBlocks_CreateFcn(hObject, eventdata, handles)
91 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
92 set(hObject,'BackgroundColor','white');
96 % --- Executes on button press in pushbuttonAdd.
97 function pushbuttonAdd_Callback(hObject, eventdata, handles) %
#ok<*INUSL>
99 if ~isempty(blockname)
100 handles.blocknames{end+1} = blockname;
101 guidata(hObject, handles);
105 % --- Executes on selection change in listbox.
106 function listbox_Callback(hObject, eventdata, handles)
107 local_show_description(handles);
109 % --- Executes during
object creation, after setting all properties.
110 function listbox_CreateFcn(hObject, eventdata, handles)
111 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
112 set(hObject,'BackgroundColor','white');
115 % --- Executes on button press in pushbuttonRemove.
116 function pushbuttonRemove_Callback(hObject, eventdata, handles)
117 if ~isempty(get(handles.listbox, 'String'))
118 idxs = get(handles.listbox, 'Value');
120 handles.blocknames(idxs) = [];
121 guidata(hObject, handles);
126 function editDescription_Callback(hObject, eventdata, handles)
128 % --- Executes during
object creation, after setting all properties.
129 function editDescription_CreateFcn(hObject, eventdata, handles)
130 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
131 set(hObject,'BackgroundColor','white');
Cascade block: final instantializable class.
function show_description(in h_list, in h_edit)
function listbox_get_selected_1stname(in h_listbox)
function params2str2(in params)
function listbox_load_from_workspace(in classname, in h_list, in flag_blank, in string_empty, in input)
function gui_set_position(in hObject)
function irerrordlg(in errorstring, in dlgname)