0001 function [data, new_name] = project_mgr_builder_copy(data)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 if ~exist('data', 'var')
0018 error('data is specified.');
0019 end
0020
0021
0022
0023
0024 H = data.H;
0025
0026 Nbuilders = length(data.batch_builders);
0027
0028 idx = get(H.builder_popup, 'Value');
0029
0030 cbuilder = data.batch_builders{idx};
0031 name = vb_batch_mgr_get_name(cbuilder);
0032
0033 new_name = ['copied ' name];
0034 cbuilder = vb_batch_mgr_set_name(cbuilder, new_name);
0035 data.batch_builders{Nbuilders+1, 1} = cbuilder;
0036
0037
0038 batch_builders = data.batch_builders;
0039 result = vb_save(data.project_file, 'batch_builders');
0040
0041
0042
0043
0044
0045 if nargout < 1
0046 error('function caller should receive this object.');
0047 end