X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4e15af19d133f86002870e5f7879a78c9f9f5d70..52c6c77a17e2e89dd48b64f27fc31688fd0bd0bb:/tools/MSG_visualization/trace2fig.pl diff --git a/tools/MSG_visualization/trace2fig.pl b/tools/MSG_visualization/trace2fig.pl index 8067874385..26303f131c 100755 --- a/tools/MSG_visualization/trace2fig.pl +++ b/tools/MSG_visualization/trace2fig.pl @@ -4,7 +4,7 @@ use strict; use XFig; my($grid_Y_size)=225; # xfig -my($grid_X_size)=225; # xfig +my($grid_X_size)=100550; # xfig sub read_cat { my(%Cat); @@ -60,12 +60,12 @@ sub read_link { while (defined($line=)) { chomp $line; if($line =~ /^16\s/) { - my($event,$date,$type,$father,$channel,$src,$key) = split(/\s+/,$line); + my($event,$date,$type,$father,$channel,$src,$key) = split(/\t+/,$line); $link{$key}{src}=$src; $link{$key}{src_date}=$date; } if($line =~ /^17\s/) { - my($event,$date,$type,$father,$channel,$dst,$key) = split(/\s+/,$line); + my($event,$date,$type,$father,$channel,$dst,$key) = split(/\t+/,$line); $link{$key}{dst}=$dst; $link{$key}{dst_date}=$date; } @@ -109,9 +109,11 @@ sub set_cat_position { my($i)=0; my($cat); foreach $cat (@$cat_list) { - $$Cat{$cat}{Y_min} = $i; - $$Cat{$cat}{Y_max} = $i+1; - $i++; + if(defined($$Cat{$cat}{state})) { + $$Cat{$cat}{Y_min} = $i; + $$Cat{$cat}{Y_max} = $i+1; + $i++; + } } } @@ -141,7 +143,7 @@ sub draw_cat { next unless (defined($$Cat{$cat}{Y_min}) && defined($$Cat{$cat}{Y_max})); my($text) = new XFig ('text'); - $text->{'text'} = $$Cat{$cat}{name}; + $text->{'text'} = "$$Cat{$$Cat{$cat}{father}}{name}"."$$Cat{$cat}{name}"; $text->{'y'} = ($$Cat{$cat}{Y_min}+$$Cat{$cat}{Y_max})/2*$grid_Y_size+68; $fig->add ($text); } @@ -161,6 +163,7 @@ sub draw_cat { my($line) = new XFig ('polyline'); + $line->{'depth'} = 50; # line $line->{'subtype'} = 1; # line $line->{'points'} = [ [$old_date*$grid_X_size, $$Cat{$cat}{Y_min}*$grid_Y_size], [$new_date*$grid_X_size, $$Cat{$cat}{Y_min}*$grid_Y_size], @@ -189,6 +192,9 @@ sub draw_cat { my($dst)=$$Link{$link}{dst}; $line->{'subtype'} = 1; # line + print STDERR "$link: $src ($src_date) -> $dst ($dst_date)\n"; + + print STDERR "$$Cat{$src}{name} -> $$Cat{$dst}{name}\n"; $line->{'points'} = [ [$src_date*$grid_X_size, ($$Cat{$src}{Y_min}+$$Cat{$src}{Y_max})/2*$grid_Y_size], [$dst_date*$grid_X_size,