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/] [ProNoC.pl] - Diff between revs 48 and 54

Show entire file | Details | Blame | View Log

Rev 48 Rev 54
Line 1... Line 1...
#!/usr/bin/perl -w
#!/usr/bin/perl 
package ProNOC;
package ProNOC;
 
 
 
 
 
 
 
 
Line 20... Line 20...
 
 
 
 
use Getopt::Long;
use Getopt::Long;
use base 'Class::Accessor::Fast';
use base 'Class::Accessor::Fast';
 
 
 
our %glob_setting;
our $FONT_SIZE='default';
$glob_setting{'FONT_SIZE'}='default';
our $ICON_SIZE='default';
$glob_setting{'ICON_SIZE'}='default';
 
$glob_setting{'DSPLY_X'}  ='default';
 
$glob_setting{'DSPLY_Y'}  ='default';
 
 
BEGIN {
BEGIN {
    my $module = (Consts::GTK_VERSION==2) ? 'Gtk2' : 'Gtk3';
    my $module = (Consts::GTK_VERSION==2) ? 'Gtk2' : 'Gtk3';
    my $file = $module;
    my $file = $module;
    $file =~ s[::][/]g;
    $file =~ s[::][/]g;
Line 65... Line 66...
$| = 1;
$| = 1;
 
 
 
 
 
 
sub main{
sub main{
        # check if envirement variables are defined
        # check if environment variables are defined
 
        #STDERR->autoflush ;
        my $project_dir   = get_project_dir(); #mpsoc dir addr
        my $project_dir   = get_project_dir(); #mpsoc dir addr
        my $paths_file= "$project_dir/mpsoc/perl_gui/lib/Paths";
        my $paths_file= "$project_dir/mpsoc/perl_gui/lib/Paths";
        if (-f  $paths_file){#} && defined $ENV{PRONOC_WORK} ) {
        if (-f  $paths_file){#} && defined $ENV{PRONOC_WORK} ) {
                my $paths= do $paths_file;
                my $paths= do $paths_file;
                my %p=%{$paths};
 
                $FONT_SIZE= $p{'GUI_SETTING'}{'FONT_SIZE'} if (defined $p{'GUI_SETTING'}{'FONT_SIZE'});
                set_gui_setting($paths);
                $ICON_SIZE= $p{'GUI_SETTING'}{'ICON_SIZE'} if (defined $p{'GUI_SETTING'}{'ICON_SIZE'});
 
                main_window();
                main_window();
        }
        }
        else{
        else{
                show_setting(1);
                show_setting(1);
        }
        }
Line 89... Line 91...
sub main_window{
sub main_window{
 
 
        set_path_env();
        set_path_env();
 
 
        my($width,$hight)=max_win_size();
        my($width,$hight)=max_win_size();
 
        #print "($width,$hight)\n";
 
 
        set_defualt_font_size();
        set_defualt_font_size();
 
 
        if ( !defined $ENV{PRONOC_WORK} ) {
        if ( !defined $ENV{PRONOC_WORK} ) {
        my $message;
        my $message;
        if ( !defined $ENV{PRONOC_WORK}) {
        if ( !defined $ENV{PRONOC_WORK}) {
Line 343... Line 347...
                }
                }
 
 
                my  ($file_path,$text)=@_;
                my  ($file_path,$text)=@_;
                $set_win->destroy;
                $set_win->destroy;
 
 
                my $new_fontsize = $self->object_get_attribute('GUI_SETTING', 'FONT_SIZE');
                my %new_setting = %{$self->object_get_attribute('GUI_SETTING')};
                my $new_icon_size= $self->object_get_attribute('GUI_SETTING', 'ICON_SIZE');
                my $eq=1;
                if($new_fontsize ne $FONT_SIZE || $new_icon_size ne $ICON_SIZE){
                foreach my $k (sort keys %new_setting){
 
                        $eq= 0 if        $new_setting{$k} ne $glob_setting{$k};
 
                }
 
 
 
                if($eq ==0){
                        restart_Pronoc ();
                        restart_Pronoc ();
                }
                }
 
 
                main_window() if($reset);
                main_window() if($reset);
 
 
Line 536... Line 544...
 
 
sub get_gui_setting{
sub get_gui_setting{
        my ($self,$set_win,$reset)=@_;
        my ($self,$set_win,$reset)=@_;
        my $table = def_table(10, 1, FALSE);
        my $table = def_table(10, 1, FALSE);
 
 
 
        my $w="default";
 
        for (my $i=100;$i<3000;$i+=100) {$w.= ",$i";}
 
 
        my @gui=(
        my @gui=(
        { label=>'Font size:', param_name=>'FONT_SIZE', type=>'Combo-box', default_val=> $FONT_SIZE,
        { label=>'Font size:', param_name=>'FONT_SIZE', type=>'Combo-box', default_val=> $glob_setting{'FONT_SIZE'},
          content=>"default,5,6,7,8,9,10,11,12,13,14,15", info=>undef,
          content=>"default,5,6,7,8,9,10,11,12,13,14,15", info=>undef,
          param_parent=>"GUI_SETTING", ref_delay=> undef, new_status=>undef},
          param_parent=>"GUI_SETTING", ref_delay=> undef, new_status=>undef},
          { label=>'ICON size:', param_name=>'ICON_SIZE', type=>'Combo-box', default_val=> $ICON_SIZE,
 
 
        { label=>'ICON size:', param_name=>'ICON_SIZE', type=>'Combo-box', default_val=> $glob_setting{'ICON_SIZE'},
          content=>"default,11,14,17,20,23,26,29,32,35,38,41", info=>undef,
          content=>"default,11,14,17,20,23,26,29,32,35,38,41", info=>undef,
          param_parent=>"GUI_SETTING", ref_delay=> undef, new_status=>undef},
          param_parent=>"GUI_SETTING", ref_delay=> undef, new_status=>undef},
 
 
 
 
 
        { label=>'Display width:', param_name=>'DSPLY_X', type=>'Combo-box', default_val=> $glob_setting{'DSPLY_X'},
 
          content=>"$w", info=>undef,
 
          param_parent=>"GUI_SETTING", ref_delay=> undef, new_status=>undef},
 
 
 
 
 
        { label=>'Display height:', param_name=>'DSPLY_Y', type=>'Combo-box', default_val=> $glob_setting{'DSPLY_Y'},
 
          content=>"$w", info=>undef,
 
          param_parent=>"GUI_SETTING", ref_delay=> undef, new_status=>undef},
 
 
        );
        );
 
 
        my $row=0;
        my $row=0;
        my $col=0;
        my $col=0;
        foreach my $d ( @gui) {
        foreach my $d ( @gui) {

powered by: WebSVN 2.1.0

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