19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# Structure matrix [states,nonstates,inputs,outputs,zero_outputs]
# ###############################################################
# ## Version control history
# ###############################################################
# ## $Id$
# ## $Log$
# ## Revision 1.29 1998/08/25 09:22:34 peterg
# ## Correctely recognises port SSs its now easy -- they are in there own
# ## field
# ##
# ## Revision 1.28 1998/08/25 08:31:42 peterg
# ## Fixed bug - didn't find the ports - use deblank
# ##
|
>
>
>
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# Structure matrix [states,nonstates,inputs,outputs,zero_outputs]
# ###############################################################
# ## Version control history
# ###############################################################
# ## $Id$
# ## $Log$
# ## Revision 1.30 1998/09/02 11:14:23 peterg
# ## Revised to use ordered lists of subsystems and ports
# ##
# ## Revision 1.29 1998/08/25 09:22:34 peterg
# ## Correctely recognises port SSs its now easy -- they are in there own
# ## field
# ##
# ## Revision 1.28 1998/08/25 08:31:42 peterg
# ## Fixed bug - didn't find the ports - use deblank
# ##
|
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
# 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), infofilenum);
endif;
if (length(system_cr)==0)
mtt_info(sprintf("No cr given so no cr aliasing done for system %s(%s)",\
system_name,system_type), infofilenum);
endif;
fields=["ports";"subsystems"]; # Do for both ports and subsystems -
# ports first
lists=["portlist";"subsystemlist"];
for i=1:2
field=deblank(fields(i,:));
|
>
>
>
>
>
|
|
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
# 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), infofilenum);
AliasingArguments=0;
else
AliasingArguments=1;
endif;
if (length(system_cr)==0)
mtt_info(sprintf("No cr given so no cr aliasing done for system %s(%s)",\
system_name,system_type), infofilenum);
AliasingCRs=0;
else
AliasingCRs=1; endif;
fields=["ports";"subsystems"]; # Do for both ports and subsystems -
# ports first
lists=["portlist";"subsystemlist"];
for i=1:2
field=deblank(fields(i,:));
|
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
bond_list = abs(comp);
direction = sign(comp)'*[1 1];
# Convert from arrow orientated to component orientated causality
comp_bonds = CBG.bonds(bond_list,:).*direction;
disp(["---- ", field, " ---"]);
# Alias the args list -- if not at top level
message = sprintf("\tfor component %s (%s) within %s",\
comp_name,subsystem.type,full_name);
if struct_contains(CBG,"alias")
subsystem.arg = alias_args(subsystem.arg,CBG.alias,";",message,infofilenum)
subsystem.cr = alias_args(subsystem.cr,CBG.alias,";",message,infofilenum)
endif;
# Substitute positional ($1 etc) arguments
subsystem.cr = subs_arg(subsystem.cr,system_cr, ...
"lin",full_name,subsystem.type,comp_name,infofilenum);
subsystem.arg = subs_arg(subsystem.arg,system_args, ...
"1",full_name,subsystem.type,comp_name,infofilenum);
|
|
|
|
|
|
>
>
>
>
>
>
>
|
|
|
|
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
|
bond_list = abs(comp);
direction = sign(comp)'*[1 1];
# Convert from arrow orientated to component orientated causality
comp_bonds = CBG.bonds(bond_list,:).*direction;
disp(["---- ", field, " ---"]);
if AliasingArguments # Alias the args list if appropriate
message = sprintf("\tfor component %s (%s) within %s",\
comp_name,subsystem.type,full_name);
if struct_contains(CBG,"alias")
subsystem.arg = alias_args(subsystem.arg,CBG.alias,";",message,infofilenum)
endif;
endif;
if AliasingCRs # Alias the CR list if appropriate
message = sprintf("\tfor component %s (%s) within %s",\
comp_name,subsystem.type,full_name);
if struct_contains(CBG,"alias")
subsystem.cr = alias_args(subsystem.cr,CBG.alias,";",message,infofilenum)
endif;
endif;
# Substitute positional ($1 etc) arguments
subsystem.cr = subs_arg(subsystem.cr,system_cr, ...
"lin",full_name,subsystem.type,comp_name,infofilenum);
subsystem.arg = subs_arg(subsystem.arg,system_args, ...
"1",full_name,subsystem.type,comp_name,infofilenum);
|