Commit 8c75c7e3 authored by Christian Fibich's avatar Christian Fibich Committed by Stefan Tauner
Browse files

Fixed the Canvas' tooltips

parent fd9b5f32
......@@ -267,10 +267,10 @@ sub _draw() {
$fic_base_x,$fic_base_y+$fic_height*0.4+2.5,-fill=>"white");
$self->{'TXtxt'} = $self->createText($diag_base_x*1.05,$fic_base_y+$fic_height*0.6, -text=>"RX", -anchor=>"sw");
$self->{'TXtxt'} = $self->createText($diag_base_x*1.05,$fic_base_y+$fic_height*0.6, -text=>"TX", -anchor=>"sw");
$self->{'RXtxt'} = $self->createText($diag_base_x*1.05,$fic_base_y+$fic_height*0.8, -text=>"TX", -anchor=>"sw");
$self->{'RXtxt'} = $self->createText($diag_base_x*1.05,$fic_base_y+$fic_height*0.8, -text=>"RX", -anchor=>"sw");
......@@ -281,6 +281,7 @@ sub update {
my $fiu_num = @{${$self->{'settings_ref'}}->{'fius'}};
my $design_ref = ${$self->{'settings_ref'}}->{'design'};
$self->{'helphash'} = {};
#---------------------------------------------------------------------------
# FIUS
......@@ -299,9 +300,13 @@ sub update {
}
if($fiu_num > 0) {
$self->{'helphash'}->{$self->{'FIU'}->{'0'}->{'main'}} = @{${$self->{'settings_ref'}}->{'fius'}}[0]->{'FIU_NET_NAME'};
for my $k (keys(%{$self->{'FIU'}->{'0'}})) {
$self->itemconfigure($self->{'FIU'}->{'0'}->{$k},-state => "normal");
if(defined @{${$self->{'settings_ref'}}->{'fius'}}[0]->{'FIU_NET_NAME'}) {
$self->{'helphash'}->{$self->{'FIU'}->{'0'}->{$k}} = "Net ".@{${$self->{'settings_ref'}}->{'fius'}}[0]->{'FIU_NET_NAME'};
} else {
$self->{'helphash'}->{$self->{'FIU'}->{'0'}->{$k}} = "Net not defined";
}
}
}
......@@ -311,16 +316,28 @@ sub update {
}
if ($fiu_num > 3) {
$self->{'helphash'}->{$self->{'FIU'}->{'1'}->{'main'}} = undef;
my $helptxt = "FIUs 1 ... ".($fiu_num-2);
for (my $fi = 1; $fi < $fiu_num-1; $fi++) {
if (defined @{${$self->{'settings_ref'}}->{'fius'}}[$fi]->{'FIU_NET_NAME'}) {
$helptxt .= "\n $fi: Net ".@{${$self->{'settings_ref'}}->{'fius'}}[$fi]->{'FIU_NET_NAME'};
} else {
$helptxt .= "\n $fi: Net not defined";
}
}
for my $k (keys(%{$self->{'FIU'}->{'1'}})) {
$self->{'helphash'}->{$self->{'FIU'}->{'1'}->{$k}} = $helptxt;
eval { $self->itemconfigure($self->{'FIU'}->{'1'}->{$k},-dash => [1,2]); }
}
# $self->itemconfigure($self->{'FIU'}->{'1'}->{'main'},-dash=>[2,4]);
$self->itemconfigure($self->{'FIU'}->{'1'}->{'txt'},-text=>"");
} else {
$self->{'helphash'}->{$self->{'FIU'}->{'1'}->{'main'}} = @{${$self->{'settings_ref'}}->{'fius'}}[1]->{'FIU_NET_NAME'};
for my $k (keys(%{$self->{'FIU'}->{'1'}})) {
if (defined @{${$self->{'settings_ref'}}->{'fius'}}[1]->{'FIU_NET_NAME'}) {
$self->{'helphash'}->{$self->{'FIU'}->{'1'}->{$k}} = "Net ".@{${$self->{'settings_ref'}}->{'fius'}}[1]->{'FIU_NET_NAME'};
} else {
$self->{'helphash'}->{$self->{'FIU'}->{'1'}->{$k}} = "Net not defined";
}
eval { $self->itemconfigure($self->{'FIU'}->{'1'}->{$k},-dash => []); }
}
......@@ -331,7 +348,11 @@ sub update {
if($fiu_num > 2) {
for my $k (keys(%{$self->{'FIU'}->{'2'}})) {
$self->{'helphash'}->{$self->{'FIU'}->{'2'}->{'main'}} = @{${$self->{'settings_ref'}}->{'fius'}}[2]->{'FIU_NET_NAME'};
if(defined @{${$self->{'settings_ref'}}->{'fius'}}[$fiu_num-1]->{'FIU_NET_NAME'}) {
$self->{'helphash'}->{$self->{'FIU'}->{'2'}->{$k}} = "Net ".@{${$self->{'settings_ref'}}->{'fius'}}[$fiu_num-1]->{'FIU_NET_NAME'};
} else {
$self->{'helphash'}->{$self->{'FIU'}->{'2'}->{$k}} = "Net not defined";
}
$self->itemconfigure($self->{'FIU'}->{'2'}->{$k},-state => "normal");
}
$self->itemconfigure($self->{'FIU'}->{'2'}->{'txt'},-text=>($fiu_num-1));
......@@ -346,7 +367,7 @@ sub update {
}
#---------------------------------------------------------------------------
# FICxDUT
# FIC <-> DUT
#---------------------------------------------------------------------------
......@@ -378,6 +399,12 @@ sub update {
$self->itemconfigure($self->{'faultdetect'},-state=> ($design_ref->{'FAULT_DETECT_1_EN'} == 1 || $design_ref->{'FAULT_DETECT_2_EN'} == 1) ? "normal" : "hidden");
$self->itemconfigure($self->{'faultdetecttxt'},-state=> ($design_ref->{'FAULT_DETECT_1_EN'} == 1 || $design_ref->{'FAULT_DETECT_2_EN'} == 1) ? "normal" : "hidden");
my $fd_helptxt = "1: ".$design_ref->{'FAULT_DETECT_1_NAME'} if $design_ref->{'FAULT_DETECT_1_EN'};
$fd_helptxt .= "\n" if $design_ref->{'FAULT_DETECT_1_EN'} && $design_ref->{'FAULT_DETECT_2_EN'};
$fd_helptxt .= "2: ".$design_ref->{'FAULT_DETECT_2_NAME'} if $design_ref->{'FAULT_DETECT_2_EN'};
$self->{'helphash'}->{$self->{'faultdetect'}} = $self->{'helphash'}->{$self->{'faultdetecttxt'}} = $fd_helptxt;
$self->itemconfigure($self->{'faultdetect'},-width=> ($design_ref->{'FAULT_DETECT_1_EN'} == 1 && $design_ref->{'FAULT_DETECT_2_EN'} == 1) ? "2" : "1");
$self->itemconfigure($self->{'faultdetect1'},-state=> ($design_ref->{'FAULT_DETECT_1_EN'} == 1) ? "normal" : "hidden");
$self->itemconfigure($self->{'faultdetect1inv'},-state=> ($design_ref->{'FAULT_DETECT_1_EN'} == 1 && $design_ref->{'FAULT_DETECT_1_INVERT'} == 1) ? "normal" : "hidden");
......@@ -386,9 +413,9 @@ sub update {
$self->itemconfigure($self->{'faultdetecttxt'},-text=> ($design_ref->{'FAULT_DETECT_1_EN'} == 1 && $design_ref->{'FAULT_DETECT_2_EN'} == 1) ? "Fault Detect [1:0]" : "Fault Detect");
$self->{'helphash'}->{$self->{'RXtxt'}} = $design_ref->{'RX_IN_NAME'};
$self->{'helphash'}->{$self->{'RX'}} = $self->{'helphash'}->{$self->{'RXtxt'}} = $design_ref->{'RX_IN_NAME'};
# $self->itemconfigure($self->{'RXtxt'},-text=>$design_ref->{'RX_IN_NAME'});
$self->{'helphash'}->{$self->{'TXtxt'}} = $design_ref->{'RX_IN_NAME'};
$self->{'helphash'}->{$self->{'TX'}} = $self->{'helphash'}->{$self->{'TXtxt'}} = $design_ref->{'TX_OUT_NAME'};
# $self->itemconfigure($self->{'TXtxt'},-text=>$design_ref->{'TX_OUT_NAME'});
my $exttriggername = $design_ref->{'TRIGGER_EXT_IN_NAME'};
......@@ -397,7 +424,7 @@ sub update {
$self->itemconfigure($self->{'exttrigger'},-state=>($design_ref->{'TRIGGER_EXT_EN'} == 1) ? "normal" : "hidden");
$self->itemconfigure($self->{'exttriggertxt'},-state=>($design_ref->{'TRIGGER_EXT_EN'} == 1) ? "normal" : "hidden");
$self->{'helphash'}->{$self->{'exttriggertxt'}} = $exttriggername;
$self->{'helphash'}->{$self->{'exttrigger'}} = $self->{'helphash'}->{$self->{'exttriggertxt'}} = $exttriggername;
# $self->itemconfigure($self->{'exttriggertxt'},-text=>$exttriggername);
$self->itemconfigure($self->{'exttrigger_ni'},-state=>($design_ref->{'TRIGGER_EXT_ACTIVE'} == 1 && $design_ref->{'TRIGGER_EXT_EN'} == 1) ? "normal" : "hidden");
$self->itemconfigure($self->{'exttrigger'},-arrow=>($design_ref->{'TRIGGER_EXT_ACTIVE'} == 0 && $design_ref->{'TRIGGER_EXT_EN'} == 1) ? "last" : "none");
......@@ -409,9 +436,19 @@ sub update {
$self->itemconfigure($self->{'extrst'},-state=>($design_ref->{'RESET_EXT_EN'} == 1) ? "normal" : "hidden");
$self->itemconfigure($self->{'extrsttxt'},-state=>($design_ref->{'RESET_EXT_EN'} == 1) ? "normal" : "hidden");
$self->{'helphash'}->{$self->{'extrsttxt'}} = $extrstname;
$self->{'helphash'}->{$self->{'extrst'}} = $self->{'helphash'}->{$self->{'extrsttxt'}} = $extrstname;
# $self->itemconfigure($self->{'extrsttxt'},-text=>$extrstname);
$self->itemconfigure($self->{'extrst_ni'},-state=>($design_ref->{'RESET_EXT_ACTIVE'} == 1 && $design_ref->{'RESET_EXT_EN'} == 1) ? "normal" : "hidden");
$self->itemconfigure($self->{'extrst'},-arrow=>($design_ref->{'RESET_EXT_ACTIVE'} == 0 && $design_ref->{'RESET_EXT_EN'} == 1) ? "last" : "none");
$self->itemconfigure($self->{'extrstinv'},-state=>($design_ref->{'RESET_EXT_ACTIVE'} == 0 && $design_ref->{'RESET_EXT_EN'} == 1) ? "normal" : "hidden");
$self->{'helphash'}->{$self->{'clock'}} = $self->{'helphash'}->{$self->{'clocktxt'}} = "Clock frequency: ".$design_ref->{'FREQUENCY'}." Hz";
$self->{'helphash'}->{$self->{'FIC'}} = $self->{'helphash'}->{$self->{'FICtxt'}} = "Clock frequency: \t".$design_ref->{'FREQUENCY'}." Hz\n".
"Baud rate: \t".$design_ref->{'BAUDRATE'}." bps\n".
"Timer width: \t".$design_ref->{'TIMER_WIDTH'}." bytes";
$self->{'balloon'}->attach($self, -balloonposition => 'mouse',
-msg => $self->{'helphash'});
}
\ No newline at end of file
......@@ -292,7 +292,7 @@ sub update {
## Calc resource estimate
my $rh = FIJI::Settings::estimate_resources($self->{'settings'});
# $self->{'resources'} = "~".$rh->{'regs'}." Registers, ".$rh->{'comb_min'}." - ".$rh->{'comb_max'}." LUTs (tech-dependent)";
$self->{'resources'} = "~".$rh->{'regs'}." Registers, ~".$rh->{'lut_calc'}." Virtex5 LUTs";
$self->{'resources'} = "Virtual resource factor: \x{00D7}".$rh->{'regs'}." Registers, \x{00D7}".$rh->{'lut_calc'}." Combinational Resources";
$settings_canvas->configure(-settings_ref=>\($self->{'settings'})) if defined $settings_canvas;
return 1;
......@@ -409,16 +409,14 @@ sub _populate_widget {
$settings_canvas->packForget() if defined $settings_canvas;
$settings_canvas->destroy if defined $settings_canvas;
$settings_canvas = $description_frame->FIJISettingsCanvas(-relief=>"solid",-borderwidth=>"1",-settings_ref=>\($self->{'settings'}))->pack(-fill=>"both");
$balloon->attach($settings_canvas, -balloonposition => 'mouse',
-msg => "Implementation Overview") ;
});
# let entries eat up all the remaining space
$config_frame->gridColumnconfigure(2,-weight=>1);
# add tooltip the entire notebook page
# add tooltip the config frame
if (defined DISPLAYGROUPS->{$displaygroup}->{'description'}) {
$balloon->attach($page, -balloonposition => 'mouse',
$balloon->attach($config_frame, -balloonposition => 'mouse',
-msg => DISPLAYGROUPS->{$displaygroup}->{'description'});
}
......@@ -572,8 +570,6 @@ sub _populate_widget {
$settings_canvas->packForget() if defined $settings_canvas;
$settings_canvas->destroy if defined $settings_canvas;
$settings_canvas = $description_frame->FIJISettingsCanvas(-relief=>"solid",-borderwidth=>"1",-settings_ref=>\($self->{'settings'}))->pack(-fill=>"both");
$balloon->attach($settings_canvas, -balloonposition => 'mouse',
-msg => "Implementation Overview") ;
});
$self->_add_fiu_panel($config_frame);
......@@ -810,7 +806,7 @@ sub _update_fields {
####
## Calc resource estimate
my $rh = FIJI::Settings::estimate_resources($self->{'settings'});
$self->{'resources'} = "~".$rh->{'regs'}." Registers, ~".$rh->{'lut_calc'}." Virtex5 LUTs";
$self->{'resources'} = "Virtual resource factor: \x{00D7}".$rh->{'regs'}." Registers, \x{00D7}".$rh->{'lut_calc'}." Combinational Resources";
return $rv;
}
......@@ -1045,7 +1041,7 @@ sub _validate_entry {
## Calc resource estimate
my $rh = FIJI::Settings::estimate_resources($self->{'settings'});
# $self->{'resources'} = "~".$rh->{'regs'}." Registers, ".$rh->{'comb_min'}." - ".$rh->{'comb_max'}." LUTs (tech-dependent)";
$self->{'resources'} = "~".$rh->{'regs'}." Registers, ~".$rh->{'lut_calc'}." Virtex5 LUTs";
$self->{'resources'} = "Virtual resource factor: \x{00D7}".$rh->{'regs'}." Registers, \x{00D7}".$rh->{'lut_calc'}." Combinational Resources";
return 1; # always allow the new value and show the user what happened.
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment