OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [perl_gui/] [lib/] [perl/] [graph.pl] - Diff between revs 43 and 48

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 43 Rev 48
Line 1... Line 1...
#!/usr/bin/perl
#!/usr/bin/perl
use strict;
use strict;
use warnings;
use warnings;
use GD::Graph::bars3d;
use GD::Graph::bars3d;
use Glib qw/TRUE FALSE/;
use GD::Graph::linespoints;
 
use constant::boolean;
 
 
 
 
 
 
 
 
 
 
sub gen_multiple_charts{
sub gen_multiple_charts{
        my ($self,$pageref,$charts_ref)=@_;
        my ($self,$pageref,$charts_ref,$image_scale)=@_;
        my @pages=@{$pageref};
        my @pages=@{$pageref};
        my @charts=@{$charts_ref};
        my @charts=@{$charts_ref};
        my $notebook = Gtk2::Notebook->new;
        my $notebook = gen_notebook();
        $notebook->set_scrollable(TRUE);
        $notebook->set_scrollable(TRUE);
        $notebook->can_focus(FALSE);
 
 
 
        #check if we ned to save all graph results
 
 
        #check if we need to save all graph results
        my $save_all_status = $self->object_get_attribute ("graph_save","save_all_result");
        my $save_all_status = $self->object_get_attribute ("graph_save","save_all_result");
        $save_all_status=0 if (!defined $save_all_status);
        $save_all_status=0 if (!defined $save_all_status);
        $self->object_add_attribute ("graph_save","save_all_result",0);
        $self->object_add_attribute ("graph_save","save_all_result",0);
        if ($save_all_status ==1){
        if ($save_all_status ==1){
                my $save_path = $self->object_get_attribute ('sim_param','ALL_RESULT_DIR');
                my $save_path = $self->object_get_attribute ('sim_param','ALL_RESULT_DIR');
Line 45... Line 46...
                foreach my $chart (@charts){
                foreach my $chart (@charts){
                        my $graph_id= $page_id."$chart->{graph_name}";
                        my $graph_id= $page_id."$chart->{graph_name}";
 
 
                        if($active eq $chart->{graph_name} && $page->{page_num} == $chart->{page_num}){
                        if($active eq $chart->{graph_name} && $page->{page_num} == $chart->{page_num}){
 
 
                                my $p=  gen_graph  ($self,$chart,@selects);
                                my $p=  gen_graph  ($self,$chart,$image_scale,@selects);
                                $notebook->append_page ($p,Gtk2::Label->new_with_mnemonic ($page->{page_name}));
                                $notebook->append_page ($p,gen_label_with_mnemonic ($page->{page_name}));
                                $self->object_add_attribute ($graph_id,'type',$chart->{type});
                                $self->object_add_attribute ($graph_id,'type',$chart->{type});
                        }
                        }
 
 
                }
                }
 
 
Line 60... Line 61...
        }
        }
 
 
 
 
 
 
 
 
        my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef);
        my $scrolled_win = add_widget_to_scrolled_win($notebook);
        $scrolled_win->set_policy( "automatic", "automatic" );
 
        $scrolled_win->add_with_viewport($notebook);
 
        $scrolled_win->show_all;
        $scrolled_win->show_all;
 
 
        my $page_num=$self->object_get_attribute ("chart_notebook","currentpage");
        my $page_num=$self->object_get_attribute ("chart_notebook","currentpage");
        $notebook->set_current_page ($page_num) if(defined $page_num);
        $notebook->set_current_page ($page_num) if(defined $page_num);
        $notebook->signal_connect( 'switch-page'=> sub{
        $notebook->signal_connect( 'switch-page'=> sub{
Line 141... Line 140...
        }#chart 
        }#chart 
        #done saving clear the saving status
        #done saving clear the saving status
 
 
 
 
}
}
 
use Scalar::Util qw(looks_like_number);
 
sub check_numeric {
 
        my ($ref)=@_;
 
        my %r=%$ref;
 
        foreach my $p (sort keys %r){
 
                return 0 unless (looks_like_number($p));
 
        }
 
        return 1;
 
}
 
 
sub get_uniq_keys {
sub get_uniq_keys {
        my ($ref,@x)=@_;
        my ($ref,@x)=@_;
 
 
        if(defined $ref) {
        if(defined $ref) {
                                my %r=%$ref;
                                my %r=%$ref;
 
                my $n = check_numeric($ref);
 
 
 
 
                                push(@x, sort {$a<=>$b} keys %r);
                push(@x, sort {$a<=>$b} keys %r) if ($n);
 
                push(@x, sort {$a cmp $b} keys %r) unless ($n);
 
 
        my  @x2;
        my  @x2;
        @x2 =  uniq(sort {$a<=>$b} @x) if (scalar @x);
                @x2 =  uniq(sort {$a<=>$b} @x) if (scalar @x && $n == 1);
 
                @x2 =  uniq(sort {$a cmp $b} @x) if (scalar @x && $n==0);
 
 
        return @x2;
        return @x2;
        }
        }
        return @x;
        return @x;
}
}
 
 
 
 
sub gen_graph {
sub gen_graph {
        my ($self,$chart,@selects)=@_;
        my ($self,$chart,$image_scale,@selects)=@_;
        if($chart->{type} eq '2D_line') {return gen_2D_line($self,$chart,@selects);}
        if($chart->{type} eq '2D_line') {return gen_2D_line($self,$chart,@selects);}
        return  gen_3D_bar($self,$chart,@selects);
        return  gen_3D_bar($self,$chart,$image_scale,@selects);
}
}
 
 
 
 
 
 
 
 
 
 
sub gen_3D_bar{
sub gen_3D_bar{
        my ($self,$chart,@selects)=@_;
        my ($self,$chart,$image_scale,@selects)=@_;
 
   # $image_scale = .4 if (!defined $image_scale);
        my($width,$hight)=max_win_size();
        my($width,$hight)=max_win_size();
        my $page_id= "P$chart->{page_num}";
        my $page_id= "P$chart->{page_num}";
        my $graph_id= $page_id."$chart->{graph_name}";
        my $graph_id= $page_id."$chart->{graph_name}";
        #my $graph_name=$chart->{graph_name};
        #my $graph_name=$chart->{graph_name};
        my $result_name= $chart->{result_name};
        my $result_name= $chart->{result_name};
Line 212... Line 224...
  { label=>"label font size", param_name=>"x_axis_font", type=>'Combo-box', default_val=>'MediumBold', content=>$fontsize, info=>undef, param_parent=>"${graph_id}_param"    , ref_delay=>1},
  { label=>"label font size", param_name=>"x_axis_font", type=>'Combo-box', default_val=>'MediumBold', content=>$fontsize, info=>undef, param_parent=>"${graph_id}_param"    , ref_delay=>1},
);
);
 
 
my $content=join( ',', @selects);
my $content=join( ',', @selects);
 
 
my $dimention=gen_combobox_object ($self,$graph_id,"dimention","2D,3D","3D",'ref',2);
my $dimension=gen_combobox_object ($self,$graph_id,"dimension","2D,3D","3D",'ref',2);
my $active_page=gen_combobox_object ($self,$page_id,"active",$content,$selects[0],'ref',2);
my $active_page=gen_combobox_object ($self,$page_id,"active",$content,$selects[0],'ref',2);
 
 
 
 
#print "${graph_name}_${dir}_result\n";         
#print "${graph_name}_${dir}_result\n";         
                my @ratios;
                my @ratios;
Line 269... Line 281...
                        my $ref=$self->object_get_attribute ($sample,"$result_name");
                        my $ref=$self->object_get_attribute ($sample,"$result_name");
                        if(defined $ref){
                        if(defined $ref){
                                foreach my $v (@x){
                                foreach my $v (@x){
                                        my $w=$ref->{$ratio}->{$v};
                                        my $w=$ref->{$ratio}->{$v};
                                        push(@y,$w);
                                        push(@y,$w);
                                        $ymax=$w+1 if($w>$ymax);
                                        if (defined $w){$ymax=$w+1 if($w>$ymax);}
                                }
                                }
                                $results[$i]=\@y if(scalar @x);
                                $results[$i]=\@y if(scalar @x);
                                $i++;
                                $i++;
                        }
                        }
                }
                }
Line 305... Line 317...
                        $graphs_info->{$d->{param_name}}= $d->{default_val};
                        $graphs_info->{$d->{param_name}}= $d->{default_val};
                        $self->object_add_attribute( "${graph_id}_param"    ,$d->{param_name},$d->{default_val} );
                        $self->object_add_attribute( "${graph_id}_param"    ,$d->{param_name},$d->{default_val} );
                }
                }
        }
        }
 
 
        my $graph_w=$width/2.5;
        my $graph_w=$width*$image_scale;
        my $graph_h=$hight/2.5;
        my $graph_h=$hight*$image_scale;
        my $graph = new GD::Graph::bars3d($graph_w, $graph_h);
        my $graph = new GD::Graph::bars3d($graph_w, $graph_h);
        my $dim = $self->object_get_attribute (${graph_id},"dimention");
        my $dim = $self->object_get_attribute (${graph_id},"dimension");
        #my $dir = $self->object_get_attribute ($graph_name,"direction"); 
        #my $dir = $self->object_get_attribute ($graph_name,"direction"); 
        my $over= ($dim eq "2D")? 0 : 1;
        my $over= ($dim eq "2D")? 0 : 1;
        $graph->set(
        $graph->set(
            overwrite => $over,
            overwrite => $over,
            x_label => $graphs_info->{X_Title},
            x_label => $graphs_info->{X_Title},
Line 340... Line 352...
                legendclr         =>  'black',
                legendclr         =>  'black',
            #cycle_clrs        => '1',
            #cycle_clrs        => '1',
 
 
                 # Draw bars with width 3 pixels
                 # Draw bars with width 3 pixels
    bar_width   => 3,
    bar_width   => 3,
    # Sepearte the bars with 4 pixels
    # Separate the bars with 4 pixels
    bar_spacing => 10,
    bar_spacing => 10,
    # Show the grid
    # Show the grid
    #long_ticks  => 1,
    #long_ticks  => 1,
    # Show values on top of each bar
    # Show values on top of each bar
    #show_values => 1,
    #show_values => 1,
Line 367... Line 379...
        $graph->set_y_axis_font(GD::Font->$font);
        $graph->set_y_axis_font(GD::Font->$font);
 
 
        #@results=reorder_result(@results);
        #@results=reorder_result(@results);
 
 
        my $gd =  $graph->plot( \@results );
        my $gd =  $graph->plot( \@results );
        my $loader = Gtk2::Gdk::PixbufLoader->new;
        my $image =open_inline_image($gd->png);
        $loader->write ($gd->png);
 
        $loader->close;
 
        my $image = Gtk2::Image->new_from_pixbuf($loader->get_pixbuf);
 
 
 
        write_image ($self,$graph_id,$gd);
        write_image ($self,$graph_id,$gd);
        write_image_result      ($self,$graph_id,$graph,$result_name,$chart->{type},\@results);
        write_image_result      ($self,$graph_id,$graph,$result_name,$chart->{type},\@results);
   # my $image = my_get_image($self,$graph,$data,$graph_name);
 
 
 
 
 
 
 
      # print  Data::Dumper->Dump ([\@results],['ttt']); 
 
 
 
 
 
 
 
 
        my $table = def_table (25, 10, FALSE);
 
    my $filename;
 
        my $align= add_frame_to_image($image);
 
 
        my $table = Gtk2::Table->new (25, 10, FALSE);
 
 
 
 
 
                my $box = Gtk2::HBox->new (TRUE, 2);
 
                my $filename;
 
                $box->set_border_width (4);
 
                my   $align = Gtk2::Alignment->new (0.5, 0.5, 0, 0);
 
                my $frame = Gtk2::Frame->new;
 
                $frame->set_shadow_type ('in');
 
                $frame->add ($image);
 
                $align->add ($frame);
 
 
 
 
 
                my $plus = def_image_button('icons/plus.png',undef,TRUE);
                my $plus = def_image_button('icons/plus.png',undef,TRUE);
                my $minues = def_image_button('icons/minus.png',undef,TRUE);
                my $minues = def_image_button('icons/minus.png',undef,TRUE);
                my $setting = def_image_button('icons/setting.png',undef,TRUE);
                my $setting = def_image_button('icons/setting.png',undef,TRUE);
                my $save = def_image_button('icons/save.png',undef,TRUE);
                my $save = def_image_button('icons/save.png',undef,TRUE);
Line 418... Line 416...
                        get_graph_setting ($self,\@ginfo);
                        get_graph_setting ($self,\@ginfo);
                });
                });
                set_tip($setting, "Setting");
                set_tip($setting, "Setting");
 
 
                $save-> signal_connect("clicked" => sub{
                $save-> signal_connect("clicked" => sub{
                        # my $G = $graph->{graph};
                        # my @imags=$graph->export_format();
                         my @imags=$graph->export_format();
                         my @imags=('png');
                         save_graph_as ($self,\@imags,$graph_id);
                         save_graph_as ($self,\@imags,$graph_id);
                });
                });
                set_tip($save, "Save graph");
                set_tip($save, "Save graph");
 
 
 
 
 
 
                $table->attach_defaults ($align , 0, 9, 0, 25);
                $table->attach_defaults ($align , 0, 9, 0, 25);
                my $row=0;
                my $row=0;
                $table->attach (gen_label_in_center('Injection-Ratio'), 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
        $table->attach (gen_label_in_center("Injection-Ratio/"), 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
 
        $table->attach (gen_label_in_center("Task-file index"), 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($ratio_combx, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($ratio_combx, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($active_page, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($active_page, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($dimention, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
        $table->attach ($dimension, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
 
 
                #$table->attach ($plus , 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                #$table->attach ($plus , 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                #$table->attach ($minues, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                #$table->attach ($minues, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($setting, 9, 10, $row,  $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($setting, 9, 10, $row,  $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($save, 9, 10, $row,  $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($save, 9, 10, $row,  $row+1,'shrink','shrink',2,2); $row++;
 
 
                while ($row<10){
                while ($row<10){
 
 
                        my $tmp=gen_label_in_left('');
                        my $tmp=gen_label_in_left('');
                        $table->attach_defaults ($tmp, 9, 10, $row,  $row+1);$row++;
                        $table->attach_defaults ($tmp, 9, 10, $row,  $row+1);$row++;
                }
                }
 
 
        return $table;
        return $table;
Line 591... Line 589...
                }
                }
        }
        }
 
 
        my $graph_w=$width/2.5;
        my $graph_w=$width/2.5;
        my $graph_h=$hight/2.5;
        my $graph_h=$hight/2.5;
        my $graph = Gtk2::Ex::Graph::GD->new($graph_w, $graph_h, 'linespoints');
        my $graph = GD::Graph::linespoints->new($graph_w, $graph_h);
 
 
        $graph->set (
        $graph->set (
                x_label         => $graphs_info->{X_Title},
                x_label         => $graphs_info->{X_Title},
                y_label         => $graphs_info->{Y_Title},
                y_label         => $graphs_info->{Y_Title},
                y_max_value     => $max_y,
                y_max_value     => $max_y,
Line 648... Line 646...
      # print  Data::Dumper->Dump ([\@results],['ttt']); 
      # print  Data::Dumper->Dump ([\@results],['ttt']); 
 
 
 
 
 
 
 
 
        my $table = Gtk2::Table->new (25, 10, FALSE);
        my $table = def_table (25, 10, FALSE);
 
 
 
 
 
 
                my $box = Gtk2::HBox->new (TRUE, 2);
 
                my $filename;
                my $filename;
                $box->set_border_width (4);
 
                my   $align = Gtk2::Alignment->new (0.5, 0.5, 0, 0);
                my   $align = add_frame_to_image($image);
                my $frame = Gtk2::Frame->new;
 
                $frame->set_shadow_type ('in');
 
                $frame->add ($image);
 
                $align->add ($frame);
 
 
 
 
 
                my $plus = def_image_button('icons/plus.png',undef,TRUE);
                my $plus = def_image_button('icons/plus.png',undef,TRUE);
                my $minues = def_image_button('icons/minus.png',undef,TRUE);
                my $minues = def_image_button('icons/minus.png',undef,TRUE);
                my $setting = def_image_button('icons/setting.png',undef,TRUE);
                my $setting = def_image_button('icons/setting.png',undef,TRUE);
                my $save = def_image_button('icons/save.png',undef,TRUE);
                my $save = def_image_button('icons/save.png',undef,TRUE);
 
 
 
 
                $minues -> signal_connect("clicked" => sub{
                $minues -> signal_connect("clicked" => sub{
                        $self->object_add_attribute("${graph_id}_graph_scale",undef,$scale*1.05);
                        $scale*=1.05;
                        set_gui_status($self,"ref",1);
                        $self->object_add_attribute("${graph_id}_graph_scale",undef,$scale);
 
                        set_gui_status($self,"ref",5);
                });
                });
                set_tip($minues, "Zoom out");
                set_tip($minues, "Zoom out");
 
 
                $plus  -> signal_connect("clicked" => sub{
                $plus  -> signal_connect("clicked" => sub{
                        $self->object_add_attribute("${graph_id}_graph_scale",undef,$scale*0.95) if( $scale>0.5);
                        $scale*=0.95  if( $scale>0.5);
 
                        $self->object_add_attribute("${graph_id}_graph_scale",undef,$scale);
                        set_gui_status($self,"ref",5);
                        set_gui_status($self,"ref",5);
                });
                });
                set_tip($plus, "Zoom in");
                set_tip($plus, "Zoom in");
 
 
                $setting -> signal_connect("clicked" => sub{
                $setting -> signal_connect("clicked" => sub{
                        get_graph_setting ($self,\@ginfo);
                        get_graph_setting ($self,\@ginfo);
                });
                });
                set_tip($setting, "Setting");
                set_tip($setting, "Setting");
 
 
                $save-> signal_connect("clicked" => sub{
                $save-> signal_connect("clicked" => sub{
                         my $G = $graph->{graph};
                        # my $G = $graph->{graph};
                         my @imags=$G->export_format();
                        # my @imags=$G->export_format(); 
 
                        my @imags=('png');
                        save_graph_as ($self,\@imags,$graph_id);
                        save_graph_as ($self,\@imags,$graph_id);
                });
                });
                set_tip($save, "Save graph");
                set_tip($save, "Save graph");
 
 
 
 
 
 
                $table->attach_defaults ($align , 0, 9, 0, 25);
                $table->attach_defaults ($align , 0, 9, 0, 24);
                my $row=0;
                my $row=0;
                $table->attach ($active_page, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($active_page, 0, 9, 24, 25,'shrink','shrink',2,2);# $row++;
                $table->attach ($plus , 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($plus , 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($minues, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($minues, 9, 10, $row, $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($setting, 9, 10, $row,  $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($setting, 9, 10, $row,  $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($save, 9, 10, $row,  $row+1,'shrink','shrink',2,2); $row++;
                $table->attach ($save, 9, 10, $row,  $row+1,'shrink','shrink',2,2); $row++;
                while ($row<10){
                while ($row<10){
Line 720... Line 717...
sub save_graph_as {
sub save_graph_as {
        my ($self,$ref,$graph_name)=@_;
        my ($self,$ref,$graph_name)=@_;
 
 
        my $file;
        my $file;
        my $title ='Save as';
        my $title ='Save as';
 
 
 
 
 
 
        my @extensions=@$ref;
        my @extensions=@$ref;
        my $open_in=undef;
        my $open_in=undef;
        my $dialog = Gtk2::FileChooserDialog->new(
        my $dialog=save_file_dialog  ($title, @extensions);
                'Save file', undef,
 
                'save',
 
                'gtk-cancel' => 'cancel',
 
                'gtk-ok'     => 'ok',
 
                );
 
        # if(defined $extension){
 
 
 
                foreach my $ext (@extensions){
        $dialog->set_current_folder ($open_in) if(defined  $open_in);
                        my $filter = Gtk2::FileFilter->new();
 
                        $filter->set_name($ext);
 
                        $filter->add_pattern("*.$ext");
 
                        $dialog->add_filter ($filter);
 
                }
 
 
 
        # }
 
          if(defined  $open_in){
 
                $dialog->set_current_folder ($open_in);
 
                # print "$open_in\n";
 
 
 
        }
 
 
 
        if ( "ok" eq $dialog->run ) {
        if ( "ok" eq $dialog->run ) {
                        $file = $dialog->get_filename;
                        $file = $dialog->get_filename;
                        my $ext = $dialog->get_filter;
                        my $ext = $dialog->get_filter;
                        $ext=$ext->get_name;
                        $ext=$ext->get_name;
Line 770... Line 747...
 
 
 
 
sub my_get_image {
sub my_get_image {
        my ($self,$exgraph, $data, $graph_name, $result_name,$charttype) = @_;
        my ($self,$exgraph, $data, $graph_name, $result_name,$charttype) = @_;
        $exgraph->{graphdata} = $data;
        $exgraph->{graphdata} = $data;
        my $graph = $exgraph->{graph};
        my $graph = $exgraph;#->{graph};
        my $font;
        my $font;
 
 
        $font=  $self->object_get_attribute( "${graph_name}_param"    ,'label_font');
        $font=  $self->object_get_attribute( "${graph_name}_param"    ,'label_font');
        $graph->set_x_label_font(GD::Font->$font);
        $graph->set_x_label_font(GD::Font->$font);
        $graph->set_y_label_font(GD::Font->$font);
        $graph->set_y_label_font(GD::Font->$font);
Line 785... Line 762...
        #$graph->set_values_font(GD::gdGiantFont);
        #$graph->set_values_font(GD::gdGiantFont);
        $graph->set_x_axis_font(GD::Font->$font);
        $graph->set_x_axis_font(GD::Font->$font);
        $graph->set_y_axis_font(GD::Font->$font);
        $graph->set_y_axis_font(GD::Font->$font);
 
 
        my $gd2=$graph->plot($data) or warn $graph->error;
        my $gd2=$graph->plot($data) or warn $graph->error;
        my $loader = Gtk2::Gdk::PixbufLoader->new;
 
 
 
 
 
        #cut the upper side of the image to remove the stright line created by chaanging large results to ymax
 
 
 
 
        #cut the upper side of the image to remove the straight line created by changing large results to ymax       
 
 
        my $gd1=  GD::Image->new($gd2->getBounds);
        my $gd1=  GD::Image->new($gd2->getBounds);
        my $white= $gd1->colorAllocate(255,255,254);
        my $white= $gd1->colorAllocate(255,255,254);
        my ($x,$h)=$gd2->getBounds;
        my ($x,$h)=$gd2->getBounds;
        $gd1->transparent($white);
        $gd1->transparent($white);
        $gd1->copy( $gd2, 0, 0, 0, ,$h*0.05, $x ,$h*.95 );
        $gd1->copy( $gd2, 0, 0, 0, ,$h*0.05, $x ,$h*.95 );
 
 
 
 
        $loader->write ($gd1->png);
 
        $loader->close;
 
 
 
 
 
        write_image ($self,$graph_name,$gd1);
        write_image ($self,$graph_name,$gd1);
        write_image_result      ($self,$graph_name,$graph,$result_name,$charttype);
        write_image_result      ($self,$graph_name,$graph,$result_name,$charttype);
 
 
        my $image = Gtk2::Image->new_from_pixbuf($loader->get_pixbuf);
        my $image  =open_inline_image($gd1->png);
 
 
 
 
        $exgraph->{graphimage} = $image;
 
        my $hotspotlist;
 
        if ($exgraph->{graphtype} eq 'bars' or
 
                $exgraph->{graphtype} eq 'lines' or
 
                $exgraph->{graphtype} eq 'linespoints') {
 
                foreach my $hotspot ($graph->get_hotspot) {
 
                        push @$hotspotlist, $hotspot if $hotspot;
 
                }
 
        }
 
        $exgraph->{hotspotlist} = $hotspotlist;
 
        my $eventbox = $exgraph->{eventbox};
 
        my @children = $eventbox->get_children;
 
        foreach my $child (@children) {
 
                $eventbox->remove($child);
 
        }
 
 
 
 
 
 
 
 
 
#       $eventbox->add ($image);
 
 
 
 
 
#       $eventbox->show_all;
 
        return $image;
        return $image;
 
 
}
}
 
 
 
 
 
 
############
############
Line 857... Line 804...
}
}
 
 
 
 
 
 
 
 
        my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef);
        my $scrolled_win = add_widget_to_scrolled_win($table);
        $scrolled_win->set_policy( "automatic", "automatic" );
 
        $scrolled_win->add_with_viewport($table);
 
        my $ok = def_image_button('icons/select.png',' OK ');
        my $ok = def_image_button('icons/select.png',' OK ');
 
 
 
 
        my $mtable = def_table(10, 1, FALSE);
        my $mtable = def_table(10, 1, FALSE);
        $mtable->attach_defaults($scrolled_win,0,1,0,9);
        $mtable->attach_defaults($scrolled_win,0,1,0,9);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.