Changeset 289 for trunk/klask
- Timestamp:
- Sep 26, 2017, 3:10:56 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r288 r289 2731 2731 2732 2732 my $format = 'txt'; 2733 my $modulo = 0; 2733 my $graph_modulo = 0; 2734 my $graph_shift = 1; 2734 2735 2735 2736 GetOptions( 2736 2737 'format|f=s' => \$format, 2737 'modulo|m=i' => \$modulo, 2738 'modulo|m=i' => \$graph_modulo, 2739 'shift|s=i' => \$graph_shift, 2738 2740 ); 2739 2741 … … 2745 2747 $format = 'txt' if not defined $possible_format{$format}; 2746 2748 2747 $possible_format{$format}->($ modulo, @ARGV);2749 $possible_format{$format}->($graph_modulo, $graph_shift, @ARGV); 2748 2750 return; 2749 2751 } … … 2792 2794 #--------------------------------------------------------------- 2793 2795 sub cmd_exportsw_dot { 2794 my $modulo = shift; 2796 my $graph_modulo = shift; 2797 my $graph_shift = shift; 2795 2798 2796 2799 my $switch_connection = YAML::Syck::LoadFile("$KLASK_SW_FILE"); … … 2922 2925 printf " \"%s:%s\" -> \"%s:%s\" [style=$style, color=$color];\n", $sw, $db_switch_output_port{$sw}, $sw_connect, $port_connect; 2923 2926 2924 next if $ modulo == 0; # No shift (invisible nodes) in graph2927 next if $graph_modulo == 0; # No shift (invisible nodes) in graph 2925 2928 $db_switch_line{$sw_connect}++; 2926 if ($db_switch_line{$sw_connect} % $ modulo == 0) {2929 if ($db_switch_line{$sw_connect} % $graph_modulo == 0) { 2927 2930 # Create invisible node 2928 2931 $invisible_node++; 2929 2932 my $invisible = '__Invisible_' . $invisible_node; 2930 print " $invisible [shape=none, label=\"\"];\n"; 2931 printf " \"%s:%s\" -> $invisible [style=invis];\n", $sw, $db_switch_output_port{$sw}; 2932 printf " $invisible -> \"%s:%s\" [style=invis];\n", $sw_connect, $port_connect; 2933 print " \"$invisible.a\" [shape=none, label=\"\"];\n"; 2934 printf " \"%s:%s\" -> \"$invisible.a\" [style=invis];\n", $sw, $db_switch_output_port{$sw}; 2935 if ($graph_shift == 2) { 2936 # Two invisible node 2937 print " \"$invisible.b\" [shape=none, label=\"\"];\n"; 2938 print " \"$invisible.a\" -> \"$invisible.b\" [style=invis];\n"; 2939 printf " \"$invisible.b\" -> \"%s:%s\" [style=invis];\n", $sw_connect, $port_connect; 2940 } 2941 else { 2942 # One invisible node 2943 printf " \"$invisible.a\" -> \"%s:%s\" [style=invis];\n", $sw_connect, $port_connect; 2944 } 2933 2945 } 2934 2946 }
Note: See TracChangeset
for help on using the changeset viewer.