Home > vbmeg > functions > gui > project_mgr_dir > project_mgr_builder_copy.m

project_mgr_builder_copy

PURPOSE ^

Copy batch builder

SYNOPSIS ^

function [data, new_name] = project_mgr_builder_copy(data)

DESCRIPTION ^

 Copy batch builder
 [USAGE]
    [data] = project_mgr_builder_copy(data);
 [IN]
        data : project_mgr data
 [OUT]
        data : project_mgr data(updated)
    new_name : copied builder name

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [data, new_name] = project_mgr_builder_copy(data)
0002 % Copy batch builder
0003 % [USAGE]
0004 %    [data] = project_mgr_builder_copy(data);
0005 % [IN]
0006 %        data : project_mgr data
0007 % [OUT]
0008 %        data : project_mgr data(updated)
0009 %    new_name : copied builder name
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 %
0015 % --- Previous check
0016 %
0017 if ~exist('data', 'var')
0018     error('data is specified.');
0019 end
0020 
0021 %
0022 % --- Main Procedure
0023 %
0024 H = data.H;
0025 
0026 Nbuilders   = length(data.batch_builders);
0027 % get selected batch builder
0028 idx = get(H.builder_popup, 'Value');
0029 % copy instance
0030 cbuilder = data.batch_builders{idx};
0031 name        = vb_batch_mgr_get_name(cbuilder);
0032 % change name
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 % Save builders to file
0038 batch_builders = data.batch_builders;
0039 result = vb_save(data.project_file, 'batch_builders');
0040 
0041 
0042 %
0043 % --- After check
0044 %
0045 if nargout < 1
0046     error('function caller should receive this object.');
0047 end

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005