Index: mttroot/mtt/bin/trans/m/cbg2ese.m ================================================================== --- mttroot/mtt/bin/trans/m/cbg2ese.m +++ mttroot/mtt/bin/trans/m/cbg2ese.m @@ -14,10 +14,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.12 1997/04/15 09:17:26 peterg +% %% Added the structure file - contains details of states etc. +% %% % %% Revision 1.11 1996/12/07 18:20:11 peterg % %% Replaces null argument by a default and tells user. % %% % %% Revision 1.10 1996/12/07 17:37:07 peterg % %% Now handles numbered SS ports appearing at top level. @@ -245,23 +248,27 @@ '(name_r,bond_list,comp_bonds, ... direction,cr,args,structure,ese_file);' ]); % If structure has changed, write info to structure file. structure_change = structure-old_structure; + + % The following line is to avoid probs with multiport C or I + % it needs changing to handle multi ports correctly structure_changes = sum(structure_change); - if structure_changes>0 - which_indices = getindex(structure_change,1); - which_indices = which_indices(:,2)'; - for which_index=which_indices - value = structure(which_index); - fprintf(structure_file, ... - '%s\t%1.0f\t%s\t%s\t%1.0f\n', ... - structure_name(which_index,:), value, ... - comp_name, full_name, repetition); - end; - end; + structure_change = structure_change>zeros(size(structure_change)); + if structure_changes>0 + which_indices = getindex(structure_change,1); + which_indices = which_indices(:,2)'; + for which_index=which_indices + value = structure(which_index); + fprintf(structure_file, ... + '%s\t%1.0f\t%s\t%s\t%1.0f\n', ... + structure_name(which_index,:), value, ... + comp_name, full_name, repetition); + end; + end; end; end; end;