Index: mttroot/mtt/bin/trans/m/abg2cbg.m ================================================================== --- mttroot/mtt/bin/trans/m/abg2cbg.m +++ mttroot/mtt/bin/trans/m/abg2cbg.m @@ -18,10 +18,13 @@ ## ############################################################### ## ## Version control history ## ############################################################### ## ## $Id$ ## ## $Log$ + ## ## Revision 1.47 2000/03/20 16:45:26 peterg + ## ## *** empty log message *** + ## ## ## ## Revision 1.46 2000/02/17 16:14:49 peterg ## ## *** empty log message *** ## ## ## ## Revision 1.45 1999/11/01 03:17:45 peterg ## ## Added extra info - current subsystem @@ -209,29 +212,24 @@ ## Are we at the top level of the heirarchy? at_top_level = strcmp(full_name, ''); ## Create a file to contain shell commands which map subsystem types ## onto components - if at_top_level # Then at top level - fprintf(typefile, "# Commands to map types onto subsystems\n"); - fprintf(typefile, "# File %s_type.sh\n", system_name); - fprintf(typefile, "# Generated by MTT at %s\n\n", ctime(time)); - end; +# if at_top_level # Then at top level +# fprintf(typefile, "# Commands to map types onto subsystems\n"); +# fprintf(typefile, "# File %s_type.sh\n", system_name); +# fprintf(typefile, "# Generated by MTT at %s\n\n", ctime(time)); +# end; ## Create the (full) system name if at_top_level full_name = system_name; system_type = system_name; else full_name = [full_name, "_", system_name]; end; - - ## Add to file to contain shell commands which map subsystem types - ## onto components - fprintf(typefile, "$1%s$2%s$3\n", system_type, full_name); - fun_name = [system_type, "_abg"]; disp("===================================="); disp(["BEGIN: ", full_name, " (", fun_name, ")"]); disp("===================================="); @@ -486,12 +484,11 @@ mtt_error(sprintf("Unable to complete causality"),errorfile); end; endif # at_top_level - disp(["Writing ", full_name]); - write_cbg(full_name,system_type,ABG,Flipped); + ## Return the port bonds - arrow orientated causality - and the direction status=0; if !at_top_level # Not at top level port_bonds = ABG.bonds(port_bond_index,:); # Return port bonds @@ -506,19 +503,21 @@ status=-1; mtt_info(sprintf("Component %s (%s) is overcausal", name, subsystem.type), ... infofile); endif; endfor; # [subsystem,name] = ABG.subsystems + + if (status==0) # write out the component .cbg file + disp(["Writing ", full_name]); + write_cbg(full_name,system_type,ABG,Flipped); + fprintf(typefile, "$1%s$2%s$3\n", system_type, full_name); + endif + + status, port_bonds disp("===================================="); disp(["END: ", full_name, " (", fun_name, ")"]); disp("===================================="); -endfunction; - - - - - - - + +endfunction;