15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.6 1996/12/05 09:49:09 peterg
% %% Explicit computation of port number from string.
% %%
% %% Revision 1.5 1996/12/04 21:27:53 peterg
% %% Replaced str2num by sprintf
% %%
% %% Revision 1.4 1996/08/18 20:06:21 peter
|
>
>
>
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.7 1996/12/07 17:17:40 peterg
% %% Added some ;
% %%
% %% Revision 1.6 1996/12/05 09:49:09 peterg
% %% Explicit computation of port number from string.
% %%
% %% Revision 1.5 1996/12/04 21:27:53 peterg
% %% Replaced str2num by sprintf
% %%
% %% Revision 1.4 1996/08/18 20:06:21 peter
|
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
% If its a numbered port:
% cr contains 'MTT_port'
% arg contains port number
effort_attribute = cr;
flow_attribute = args;
if length(effort_attribute)==0
effort_attribute = 'external';
end;
if length(flow_attribute)==0
flow_attribute = 'external';
end;
inputs = structure(3);
outputs = structure(4);
zero_outputs = structure(5);
|
|
|
|
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
% If its a numbered port:
% cr contains 'MTT_port'
% arg contains port number
effort_attribute = cr;
flow_attribute = args;
if strcmp(effort_attribute,'')
effort_attribute = 'external';
end;
if strcmp(flow_attribute,'')
flow_attribute = 'external';
end;
inputs = structure(3);
outputs = structure(4);
zero_outputs = structure(5);
|
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
if strcmp(effort_attribute, 'zero') %Zero output
zero_outputs = zero_outputs + 1;
fprintf(filenum, 'MTTyz%1.0f := %s;\n', ...
zero_outputs, varname(name, bond_number,1));
fprintf(filenum, '%s := MTTUi%1.0f;\n', ...
varname(name, bond_number,-1), zero_outputs);
else
mtt_info([effort_attribute, ' not appropriate for an output ']);
end;
end;
end;
% Flow
if strcmp(flow_attribute, 'external')
if bonds(1,2)==1 % Source
|
|
|
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
if strcmp(effort_attribute, 'zero') %Zero output
zero_outputs = zero_outputs + 1;
fprintf(filenum, 'MTTyz%1.0f := %s;\n', ...
zero_outputs, varname(name, bond_number,1));
fprintf(filenum, '%s := MTTUi%1.0f;\n', ...
varname(name, bond_number,-1), zero_outputs);
else
mtt_info([effort_attribute, ' not appropriate for an output '],filenum);
end;
end;
end;
% Flow
if strcmp(flow_attribute, 'external')
if bonds(1,2)==1 % Source
|
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
if strcmp(flow_attribute, 'zero') %Zero output
zero_outputs = zero_outputs + 1;
fprintf(filenum, 'MTTyz%1.0f := %s;\n', ...
zero_outputs, varname(name, bond_number,-1));
fprintf(filenum, '%s := MTTUi%1.0f;\n', ...
varname(name, bond_number,1), zero_outputs);
else
mtt_info([effort_attribute, ' not appropriate for an output ']);
end;
end;
end;
structure(3) = inputs;
structure(4) = outputs;
|
|
|
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
if strcmp(flow_attribute, 'zero') %Zero output
zero_outputs = zero_outputs + 1;
fprintf(filenum, 'MTTyz%1.0f := %s;\n', ...
zero_outputs, varname(name, bond_number,-1));
fprintf(filenum, '%s := MTTUi%1.0f;\n', ...
varname(name, bond_number,1), zero_outputs);
else
mtt_info([effort_attribute, ' not appropriate for an output '], filenum);
end;
end;
end;
structure(3) = inputs;
structure(4) = outputs;
|