Overview
Comment:Replaces null argument by a default and tells user.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 67395c4bd434449959ef07e9bbef234eb1742616ca50ac2e661058214a169bca
User & Date: gawthrop@users.sourceforge.net on 1996-12-07 18:20:11
Other Links: branch diff | manifest | tags
Context
1996-12-07
18:21:57
Now uses fopen + file number check-in: 539321e0af user: gawthrop@users.sourceforge.net tags: origin/master, trunk
18:20:11
Replaces null argument by a default and tells user. check-in: 67395c4bd4 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
18:06:50
Now detects symbolic args ($1 etc) and ignores them. check-in: a9384aee7d user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/cbg2ese.m from [437f2f0d2d] to [ec8e3ba297].

12
13
14
15
16
17
18



19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28







+
+
+







% Structure matrix [states,nonstates,inputs,outputs,zero_outputs]

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% 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
% %% More info written to ese files.
% %%
113
114
115
116
117
118
119
120
121




122
123
124
125
126
127
128
116
117
118
119
120
121
122


123
124
125
126
127
128
129
130
131
132
133







-
-
+
+
+
+







    comp_bonds = bonds(bond_list,:).*direction;
    
    % 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;
    if strcmp(comp_type,'1')
      comp_type = 'one';

Modified mttroot/mtt/bin/trans/m/subs_arg.m from [922774af5e] to [8665903de4].

1


2
3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
18



19
20
21
22
23
24
25

1
2
3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-
+
+








-
+








+
+
+







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
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Symbolic argument sign
S = '$';
43
44
45
46
47
48
49









50

51
52
53






47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

63
64
65
66
67
68
69
70
71
72







+
+
+
+
+
+
+
+
+
-
+



+
+
+
+
+
+
	if args_count==L
	  args_count = args_count+1;
	  break
	end;
	args_count = args_count+1;
	ch = str2ch(args,args_count);
      end;
      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, args2arg(Args,i)];
      args_out = [args_out, arg_out];
    end;
  end;
end;







MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]