Index: mttroot/mtt/bin/trans/m/cbg2ese.m ================================================================== --- mttroot/mtt/bin/trans/m/cbg2ese.m +++ mttroot/mtt/bin/trans/m/cbg2ese.m @@ -21,10 +21,14 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.21 1998/07/03 18:58:58 peterg +% %% Put arg alias stuff within function alias_args +% %% Called recursively to handle arithmetic expressions +% %% % %% Revision 1.20 1998/07/03 14:39:09 peterg % %% Added info messages a bit busy now! % %% % %% Revision 1.19 1998/04/12 11:58:19 peterg % %% Rename port components by changing name_r to [name_r @@ -157,10 +161,24 @@ % Set up the counters for the labelled SS. These are, by definition, % encountered first and so the counters will not be messed up by subsystems. local_u_index = 0; local_y_index = 0; + + if (length(system_args)==0) + mtt_info(sprintf("No arguments given so no argument aliasing done for system %s(%s)",\ + system_name,system_type),infofile); + else + eval([ "alias = ", alias_name ";"]); + end; + + if (length(system_cr)==0) + mtt_info(sprintf("No cr given so no cr aliasing done for system %s(%s)",\ + system_name,system_type),infofile); + else + eval([ "alias = ", alias_name ";"]); + end; for i = 1:n_components comp = nozeros(components(i,:)); bond_list = abs(comp); direction = sign(comp)'*[1 1]; @@ -170,14 +188,20 @@ disp('---- Component ---'); % Get the component details eval([ '[comp_type,comp_name,cr,args,repetitions] = ', cmp_name, '(i)' ... ]); - % Alias the args list - eval([ "alias = ", alias_name ";"]); - message = sprintf("\tfor component %s (%s) within %s",comp_name,comp_type,full_name); - args = alias_args(args,alias,";",message); + % Alias the args list -- if not at top level + message = sprintf("\tfor component %s (%s) within %s",\ + comp_name,comp_type,full_name); + + if (length(system_args)>0) + args = alias_args(args,alias,";",message) + end; + if (length(system_cr)>0) + cr = alias_args(cr,alias,";",message) + end; % Substitute positional ($1 etc) arguments cr = subs_arg(cr,system_cr, ... 'lin',full_name,comp_type,comp_name); args = subs_arg(args,system_args, ...