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,14 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.9 1996/12/04 21:49:47 peterg +% %% Compares full-name with empty string (instead of testing for zero +% %% length) +% %% % %% Revision 1.8 1996/08/30 16:36:08 peter % %% More info written to ese files. % %% % %% Revision 1.7 1996/08/30 11:23:13 peter % %% Argument substitution implemented. @@ -50,12 +54,15 @@ end; if nargin<4 infofile = 'stdout'; end; +% Are we at the top level of the heirarchy? +at_top_level = strcmp(full_name, ''); + % Create the (full) system name -if strcmp(full_name,'') +if at_top_level full_name = system_name; full_name_repetition = system_name; system_type = system_name; else full_name = [full_name, '_', system_name]; @@ -171,12 +178,10 @@ % Link up the bonds fprintf(filenum, ... '\n\t%s Equations linking up subsystem %s (%s)\n\n', ... pc, comp_name, comp_type); - % $$$ name_comp_name = sprintf('%s_%s_%1.0f', ... - % $$$ full_name_repetition, comp_name, k); name_comp_name = sprintf('%s_%s_%1.0f', ... full_name_repetition, comp_name, k); for port_number=1:length(bond_list) % Effort @@ -204,11 +209,23 @@ disp('---POP---'); else % its a simple component fprintf(filenum, '\n\t%s Equations for component %s (%s), repetition %1.0f\n\n', ... pc, comp_name, comp_type,k); - eval(['structure = ', ... +% Take port SS to be ordinary SS at top level +if at_top_level & strcmp(comp_type, 'SS') + effort_attribute = cr; + flow_attribute = args; + if strcmp(effort_attribute, 'MTT_port') % Its a numbered port + effort_attribute = 'external'; + flow_attribute = 'external'; + cr = effort_attribute; + args = flow_attribute; + end; +end; + +eval(['structure = ', ... eqn_name, ... '(name_r,bond_list,comp_bonds,direction,cr,args,structure,filenum);' ]); end; end; end;