Index: mttroot/mtt/bin/trans/dia2abg.pl ================================================================== --- mttroot/mtt/bin/trans/dia2abg.pl +++ mttroot/mtt/bin/trans/dia2abg.pl @@ -350,11 +350,10 @@ $connections = join(" ",@clist); output_component($NM,$type,$cr,$arg,$rep,$stat,$connections,$subsys_or_port); } - print OUT "# Ordered list of subsystem names\n"; # order component id's so that entries found in _lbl.txt file are # in _lbl file order, and other entries follow. my (@id_list); @id_list = keys(%component_id_tag); @id_list = sort by_label_file @id_list; @@ -364,16 +363,32 @@ foreach my $compname (@id_list) { my $name = id_to_name($compname); $strlength = length($name) if length($name) > $strlength; }; + print OUT "# Ordered list of Port names\n"; my $i=1; foreach my $id (@id_list) { - my $name = id_to_name($id); - print OUT " " . $diagram_name . ".subsystemlist($i,:)" . ' = "' - . $name . " " x ($strlength - length($name)) . '";' . "\n"; - $i++; + my ($subsys_or_port,$name) = id_to_name($id); + if ($subsys_or_port eq "ports") { + $_ = $name; remove_brackets(); $name = $_; + print OUT " " . $diagram_name . ".portlist($i,:)" . ' = "' + . $name . " " x ($strlength - length($name)) . '";' . "\n"; + $i++; + } + } + print OUT "\n"; + + print OUT "# Ordered list of subsystem names\n"; + $i=1; + foreach my $id (@id_list) { + my ($subsys_or_port,$name) = id_to_name($id); + if ($subsys_or_port eq "subsystems") { + print OUT " " . $diagram_name . ".subsystemlist($i,:)" . ' = "' + . $name . " " x ($strlength - length($name)) . '";' . "\n"; + $i++; + } } print OUT "\n"; } sub output_bond_causality {