0001 function [result, errmsg] = project_mgr_builder_close(bmgr)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 if ~exist('bmgr', 'var')
0020 error('bmgr is a required parameter.');
0021 end
0022
0023
0024
0025
0026
0027
0028 current_hidden_state = get(0, 'ShowHiddenHandles');
0029 set(0, 'ShowHiddenHandles', 'on');
0030 pmgr = findobj('Tag', 'project_mgr');
0031 set(0, 'ShowHiddenHandles', current_hidden_state);
0032 if isempty(pmgr) || ~ishandle(pmgr)
0033 error('project_mgr cannot be found.');
0034 end
0035
0036
0037 data = guidata(pmgr);
0038
0039 H = data.H;
0040
0041 result = SUCCESS;
0042 errmsg = '';
0043
0044 if ~isempty(bmgr)
0045
0046 idx = get(H.builder_popup, 'Value');
0047 data.batch_builders{idx, 1} = bmgr;
0048
0049
0050 batch_builders = data.batch_builders;
0051 try
0052 vb_save(data.project_file, 'batch_builders');
0053 catch
0054 result = FAILURE;
0055 err = lasterror;
0056 errmsg = err.message;
0057 return;
0058 end
0059 end
0060
0061
0062 set(H.builder_popup, 'Enable', 'on');
0063 set(H.open_builder_push, 'Enable', 'on');
0064
0065 data.batch_fig = -1;
0066
0067
0068 guidata(pmgr, data);
0069
0070
0071
0072
0073 project_mgr_view_update_builders(pmgr);