Index: mttroot/mtt/bin/trans/m/cbg2ese.m ================================================================== --- mttroot/mtt/bin/trans/m/cbg2ese.m +++ mttroot/mtt/bin/trans/m/cbg2ese.m @@ -14,10 +14,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.10 1996/12/07 17:37:07 peterg +% %% Now handles numbered SS ports appearing at top level. +% %% % %% Revision 1.9 1996/12/04 21:49:47 peterg % %% Compares full-name with empty string (instead of testing for zero % %% length) % %% % %% Revision 1.8 1996/08/30 16:36:08 peter @@ -115,12 +118,14 @@ % Get the component details eval([ '[comp_type,comp_name,cr,args,repetitions] = ', cmp_name, '(i);' ... ]); % Substitute positional ($1 etc) arguments - cr = subs_arg(cr,system_cr); - args = subs_arg(args,system_args); + cr = subs_arg(cr,system_cr, ... + 'lin',full_name,comp_type,comp_name,infofile); + args = subs_arg(args,system_args, ... + '1',full_name,comp_type,comp_name, infofile); % change name of 0 and 1 components -- matlab doesn't like numbers here if strcmp(comp_type,'0') comp_type = 'zero'; end; Index: mttroot/mtt/bin/trans/m/subs_arg.m ================================================================== --- mttroot/mtt/bin/trans/m/subs_arg.m +++ mttroot/mtt/bin/trans/m/subs_arg.m @@ -1,23 +1,27 @@ -function args_out = subs_arg(args,Args) +function args_out = subs_arg(args,Args, ... + default,full_name,comp_type,comp_name,infofile) % subs_arg - substitutes arguments into args from Args % FS defaults to `;'. % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %%%%% Model Transformation Tools %%%%% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Matlab function subs_arg.m -% args = subs_arg(args,Args) +% args_out = subs_arg(args,Args,default,comp_type,comp_name,infofile) % Copyright (c) P.J. Gawthrop, 1996. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.2 1996/12/04 21:47:41 peterg +% %% Skips main loop when arg is null. +% %% % %% Revision 1.1 1996/12/04 21:46:52 peterg % %% Initial revision % %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -45,9 +49,24 @@ break end; args_count = args_count+1; ch = str2ch(args,args_count); end; - args_out = [args_out, args2arg(Args,i)]; + arg_out = args2arg(Args,i); + % Test for empty argument -- replace by default and tell user + if strcmp(arg_out,'') + info = sprintf("Argument %1.0f of component %s(%s) of system %s is undefined - \n... + replacing by %s", i, comp_name, comp_type, full_name, default); + mtt_info(info,infofile); + arg_out = default; + end; + + args_out = [args_out, arg_out]; end; end; end; + + + + + +