Index: mttroot/mtt/bin/trans/m/abg2cbg.m ================================================================== --- mttroot/mtt/bin/trans/m/abg2cbg.m +++ mttroot/mtt/bin/trans/m/abg2cbg.m @@ -15,10 +15,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.15 1997/01/05 12:25:59 peterg +% %% More informative message about port bonds incompatible with ports +% %% % %% Revision 1.14 1996/12/31 16:20:42 peterg % %% Just write causality information at top level -- it gets a bit % %% voluminous if written at deeper levels. % %% % %% Revision 1.13 1996/12/31 11:49:09 peterg @@ -176,13 +179,10 @@ % Get the bonds on this component comp = nozeros(components(i,:)); bond_list = abs(comp); direction = sign(comp)'*[1 1]; - % Convert from arrow orientated to component orientated causality - comp_bonds = bonds(bond_list,:).*direction; - % Get the component details eval([ '[comp_type,name,cr,arg] = ', system_type, '_cmp(i);' ]); % Change name of 0 and 1 components -- matlab doesn't like numbers here if strcmp(comp_type,'0') @@ -192,11 +192,14 @@ comp_type = 'one'; end; % Component causality procedure name cause_name = [comp_type, '_cause']; - + + % Bonds on this component (arrow-orientated) + comp_bonds = bonds(bond_list,:); + % Invoke the appropriate causality procedure if exist(cause_name)~=2 % Try a compound component [comp_bonds,s] = abg2cbg(name, comp_type, full_name, comp_bonds, ... typefile, infofile); @@ -210,19 +213,24 @@ status(i) = -1; end; end; else % its a simple component + % Convert from arrow orientated to component orientated causality + comp_bonds = comp_bonds.*direction; + disp(['---', name, ' (', cause_name, ') ---']); - % comp_bonds + % Evaluate the built-in causality procedure eval([ '[comp_bonds,status(i)] = ', cause_name, '(comp_bonds);' ]); - % comp_bonds + + % and convert from component orientated to arrow orientated causality + comp_bonds = comp_bonds.*direction; + end; % Update the full bonds list - % and convert from component orientated to arrow orientated causality - bonds(bond_list,:) = comp_bonds.*direction; + bonds(bond_list,:) = comp_bonds; end; end; done = sum(sum(abs(bonds)))/total*100; % mtt_info(sprintf('Causality is %3.0f%s complete.', done, pc), infofile);