Differences From Artifact [48d9bf68c8]:
- Executable file mttroot/mtt/bin/trans/m/abg2cbg.m — part of check-in [626aa26982] at 1998-08-25 08:33:29 on branch origin/master — Now does ports as well - fixed string prob by using deblank (user: gawthrop@users.sourceforge.net, size: 15449) [annotate] [blame] [check-ins using]
To Artifact [d3bc550e93]:
- Executable file
mttroot/mtt/bin/trans/m/abg2cbg.m
— part of check-in
[53d7f1424c]
at
1998-08-25 09:15:28
on branch origin/master
— Fixed couple of problems with using two copies of the one data
stucture:ABG_field and ABG.field
Maybe this is conceptually wrong? (user: gawthrop@users.sourceforge.net, size: 15658) [annotate] [blame] [check-ins using]
︙ | |||
15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | + + + | # [bonds,status] = abg2cbg(system_name, system_type, full_name, port_bonds, infofile) # ############################################################### # ## Version control history # ############################################################### # ## $Id$ # ## $Log$ # ## Revision 1.37 1998/08/25 08:33:29 peterg # ## Now does ports as well - fixed string prob by using deblank # ## # ## Revision 1.36 1998/08/25 06:44:40 peterg # ## Furhter revisions # ## # ## Revision 1.35 1998/08/24 10:16:32 peterg # ## Coverted to new structure - still needs status sorting. # ## # ## Revision 1.34 1998/08/24 07:35:03 peterg |
︙ | |||
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | + + | fields=["ports";"subsystems"]; # Do for both ports and subsystems - # ports first for i=1:2 field=deblank(fields(i,:)); if struct_contains(ABG,field); eval(["ABG_field = ABG.",field, ";"]); field,ABG_field # Outer while loop sets preferred causality ci_index=1; for [subsystem,name] = ABG_field# Set new status field to -1 eval(["ABG_field.",name,".status=-1;"]); endfor; while( ci_index>0) old_done = inf; while done!=old_done # Inner loop propagates causality old_done = done; for [subsystem,name] = ABG_field name,subsystem if subsystem.status != 0 # only do this if causality not yet complete comp = subsystem.connections; # Get the bonds on this component bond_list = abs(comp); direction = sign(comp)'*[1 1]; n_bonds = length(bond_list); if strcmp(subsystem.type,"0") # Change names |
︙ | |||
388 389 390 391 392 393 394 | 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | - + - + - - + + - + | # and convert from component orientated to arrow orientated causality comp_bonds = comp_bonds.*direction; comp_bonds_out = comp_bonds end; ABG.bonds(bond_list,:) = comp_bonds;# Update the full bonds list |
︙ |