?? dec_display.tcl.in
字號(hào):
#! @TCL@ -f# File : dec_display.tcl## This file sets up the display for the trace passing demo## import globals#global p# withdraw the existing top level so that a new one can be set#wm withdraw .# if required the top level may be destroyed#catch {destroy $p}# now set up the new top level#toplevel $p# set window manager geometry#wm title $p $decoder_titlewm geometry $p "+0+0"wm minsize $p 800 600# if the window is deleted the program should quit#wm protocol $p WM_DELETE_WINDOW { quit_proc exit}# create the two major frames#frame $p.display_f -borderwidth 1 -relief flat -height 600 -width 600frame $p.control_f -borderwidth 1 -relief flat -height 600 -width 200# pack the two major frames#pack $p.display_f -side left -fill both -expand truepack $p.control_f -side right -fill both# subframes for display#frame $p.words_f -borderwidth 0 -relief flat -height 360 -width 600frame $p.phones_f -borderwidth 0 -relief flat -height 150 -width 600frame $p.stats_f -borderwidth 0 -relief flat -height 90 -width 600pack $p.words_f -side top -padx 1 -pady 1 -fill both -expand true \ -in $p.display_fpack $p.phones_f $p.stats_f -side top -padx 1 -pady 1 -fill both \ -in $p.display_f# subframes for control#frame $p.logo_f -borderwidth 0 -relief flat -height 40 -width 200frame $p.prm1_f -borderwidth 0 -relief flat -height 40 -width 200frame $p.prm2_f -borderwidth 0 -relief flat -height 40 -width 200frame $p.prm3_f -borderwidth 0 -relief flat -height 160 -width 200frame $p.val1_f -borderwidth 0 -relief flat -height 40 -width 200frame $p.val2_f -borderwidth 0 -relief flat -height 40 -width 200frame $p.ctr1_f -borderwidth 0 -relief flat -height 40 -width 200frame $p.ctr2_f -borderwidth 0 -relief flat -height 40 -width 200frame $p.ctr3_f -borderwidth 0 -relief flat -height 40 -width 200pack $p.logo_f $p.prm1_f $p.prm2_f $p.prm3_f -side top -padx 1 \ -pady 5 -fill both -in $p.control_fpack $p.val1_f -side top -padx 1 -pady 5 -fill both -expand true \ -in $p.control_fpack $p.val2_f -side top -padx 1 -pady 5 -fill both -in $p.control_fpack $p.ctr3_f $p.ctr2_f $p.ctr1_f -side bottom -padx 1 -pady 5 \ -fill both -in $p.control_f# set up the isip logo#image create photo isip_logo -file "$trace_bmp/isip_main_logo.gif" \ -format gif -palette 255/255/255label $p.isip_logo1 -text "ISIP Decoder"label $p.isip_logo2 -image isip_logopack $p.isip_logo1 $p.isip_logo2 -side left -fill both -expand true \ -in $p.logo_f# set up the parameters display#frame $p.cr1 -borderwidth 0 -relief flat -height 40 -width 200frame $p.cr2 -borderwidth 0 -relief flat -height 40 -width 200pack $p.cr1 $p.cr2 -side top -padx 1 -pady 1 -fill both -expand true \ -in $p.prm1_f# title label#label $p.par -text "Parameters" -width 18 -relief raised -bg grey -fg blackpack $p.par -side left -padx 1 -pady 1 -fill both -expand true -in $p.cr1# set up the n-best entry#label $p.n_best -text "N-best:" -width 18entry $p.n_best_entry -width 6 -relief sunken -textvariable num_n_best \ -justify rightbutton $p.up_n_best -bitmap "@$trace_bmp/incr.xbm" -command { incr num_n_best 1 if {$num_n_best > $max_n_best} { set num_n_best $max_n_best } reset_proc}button $p.dn_n_best -bitmap "@$trace_bmp/decr.xbm" -command { incr num_n_best -1 if {$num_n_best < $min_n_best} { set num_n_best $min_n_best } reset_proc}pack $p.n_best -padx 1 -pady 1 -side left -fill both -expand true -in $p.cr2pack $p.up_n_best $p.n_best_entry $p.dn_n_best -side right -padx 1 -pady 1 \ -fill both -expand true -in $p.cr2# set up the the step size entry#label $p.step -text "Step size:" -width 18entry $p.step_entry -width 6 -relief sunken -textvariable num_step \ -justify rightbutton $p.up_step -bitmap "@$trace_bmp/incr.xbm" -command { incr num_step 1}button $p.dn_step -bitmap "@$trace_bmp/decr.xbm" -command { incr num_step -1 if {$num_step < 0} { set num_step 0 }}pack $p.step -side left -padx 1 -pady 1 -fill both -expand true -in $p.prm2_fpack $p.up_step $p.step_entry $p.dn_step -padx 1 -pady 1 -side right \ -fill both -expand true -in $p.prm2_f# set up the scale factors for beam pruning#frame $p.pr1 -borderwidth 0 -relief flat -height 40 -width 200frame $p.pr2 -borderwidth 0 -relief flat -height 40 -width 200frame $p.pr3 -borderwidth 0 -relief flat -height 40 -width 200frame $p.pr4 -borderwidth 0 -relief flat -height 40 -width 200frame $p.pr5 -borderwidth 0 -relief flat -height 40 -width 200pack $p.pr1 $p.pr2 $p.pr3 $p.pr4 $p.pr5 -side top -padx 1 -pady 1 \ -fill both -expand true -in $p.prm3_f# title label#label $p.prune -text "Pruning" -width 18 -relief raised -bg grey -fg blackpack $p.prune -side left -padx 1 -pady 1 -fill both -expand true -in $p.pr1# state-level beam pruning#label $p.stprune -text "State beam:" -width 18entry $p.st_ent -width 6 -relief sunken -textvariable st_beam -justify rightbutton $p.st_inc -bitmap "@$trace_bmp/incr.xbm" -command { set st_beam [expr $st_beam + $beam_step]}button $p.st_dec -bitmap "@$trace_bmp/decr.xbm" -command { set st_beam [expr $st_beam - $beam_step] if {$st_beam < $beam_min} { set st_beam $beam_min }}pack $p.stprune -side left -padx 1 -pady 1 -fill both -expand true -in $p.pr2pack $p.st_inc $p.st_ent $p.st_dec -side right -padx 1 -pady 1 -fill both \ -expand true -in $p.pr2# phone-level beam pruning#label $p.phprune -text "Phone beam:" -width 18entry $p.ph_ent -width 6 -relief sunken -textvariable ph_beam -justify rightbutton $p.ph_inc -bitmap "@$trace_bmp/incr.xbm" -command { set ph_beam [expr $ph_beam + $beam_step]}button $p.ph_dec -bitmap "@$trace_bmp/decr.xbm" -command { set ph_beam [expr $ph_beam - $beam_step] if {$ph_beam < $beam_min} { set ph_beam $beam_min }}pack $p.phprune -side left -padx 1 -pady 1 -fill both -expand true -in $p.pr3pack $p.ph_inc $p.ph_ent $p.ph_dec -side right -padx 1 -pady 1 -fill both \ -expand true -in $p.pr3# word-level beam pruning#label $p.wdprune -text "Word beam:" -width 18entry $p.wd_ent -width 6 -relief sunken -textvariable wd_beam -justify rightbutton $p.wd_inc -bitmap "@$trace_bmp/incr.xbm" -command { set wd_beam [expr $wd_beam + $beam_step]}button $p.wd_dec -bitmap "@$trace_bmp/decr.xbm" -command { set wd_beam [expr $wd_beam - $beam_step] if {$wd_beam < $beam_min} { set wd_beam $beam_min }}pack $p.wdprune -side left -padx 1 -pady 1 -fill both -expand true -in $p.pr4pack $p.wd_inc $p.wd_ent $p.wd_dec -side right -padx 1 -pady 1 -fill both \ -expand true -in $p.pr4# maximum active trace pruning#label $p.matprune -text "MAPMI:" -width 18entry $p.mat_ent -width 6 -relief sunken -textvariable mapmi -justify rightbutton $p.mat_inc -bitmap "@$trace_bmp/incr.xbm" -command { set mapmi [expr $mapmi + $mat_step]}button $p.mat_dec -bitmap "@$trace_bmp/decr.xbm" -command { set mapmi [expr $mapmi - $mat_step] if {$mapmi < $mat_min} { set mapmi $mat_min }}pack $p.matprune -side left -padx 1 -pady 1 -fill both -expand true -in $p.pr5pack $p.mat_inc $p.mat_ent $p.mat_dec -side right -padx 1 -pady 1 -fill both \ -expand true -in $p.pr5# create the message display area#frame $p.v1 -borderwidth 0 -relief flat -height 40 -width 200frame $p.v2 -borderwidth 0 -relief flat -height 40 -width 200pack $p.v1 -side top -padx 1 -pady 1 -fill both -in $p.val1_fpack $p.v2 -side top -padx 1 -pady 1 -fill both -expand true -in $p.val1_f# title label#label $p.msg -text "Messages" -width 18 -relief raised -bg grey -fg blackpack $p.msg -side left -padx 1 -pady 1 -fill both -expand true -in $p.v1# set up a display message area#message $p.message -width 180 -justify left -anchor nw -relief sunkenpack $p.message -padx 1 -pady 1 -fill both -expand true -in $p.v2# set up the current frame display#label $p.curr_f -text "Current Frame:" -width 18 -relief flat -anchor wlabel $p.curr_f_ind -textvariable current_frame -relief sunken -width 12pack $p.curr_f -side left -padx 1 -pady 1 -fill both -in $p.val2_fpack $p.curr_f_ind -side right -padx 1 -pady 1 -fill both -in $p.val2_f# set up the control buttons#frame $p.bt1 -borderwidth 0 -relief flat -height 40 -width 200frame $p.bt2 -borderwidth 0 -relief flat -height 40 -width 200pack $p.bt1 $p.bt2 -side top -padx 1 -pady 1 -fill both -expand true \ -in $p.ctr1_f# title label#label $p.bt -text "Controls" -width 18 -relief raised -bg grey -fg blackpack $p.bt -side left -padx 1 -pady 1 -fill both -expand true -in $p.bt1button $p.reset -text "Reset" -width 10 -command { reset_proc set num_step 1 set num_n_best 1}button $p.config -text "Configure" -width 10 -command { config_proc}pack $p.reset -side left -padx 1 -pady 1 -fill both -expand true \ -in $p.bt2pack $p.config -side right -padx 1 -pady 1 -fill both -expand true \ -in $p.bt2button $p.run -text "Run" -width 10 -command { run_proc}button $p.next -text "Next Frame" -width 10 -command { next_frame_proc message_proc "Please press next or run to continue"}pack $p.run -side left -padx 1 -pady 1 -fill both -expand true \ -in $p.ctr2_fpack $p.next -side right -padx 1 -pady 1 -fill both -expand true \ -in $p.ctr2_fbutton $p.stop -text "Stop" -width 10 -state disabled -command { if {$stop_flag == 0} { set stop_flag 1 } else { set stop_flag 0 }}button $p.quit -text "Quit" -width 10 -command { quit_proc}pack $p.stop -side left -padx 1 -pady 1 -fill both -expand true \ -in $p.ctr3_fpack $p.quit -side right -padx 1 -pady 1 -fill both -expand true \ -in $p.ctr3_f# the canvas widget to draw the graph of connections#frame $p.wd1 -borderwidth 0 -relief flat -height 30 -width 600frame $p.wd2 -borderwidth 0 -relief flat -height 300 -width 600frame $p.wd2a -borderwidth 0 -relief flat -height 300 -width 570frame $p.wd2b -borderwidth 0 -relief flat -height 300 -width 30frame $p.wd3 -borderwidth 0 -relief flat -height 30 -width 600pack $p.wd1 -side top -padx 1 -pady 1 -fill x -in $p.words_fpack $p.wd2 -side top -padx 1 -pady 1 -fill both -expand true -in $p.words_fpack $p.wd2a -side left -padx 1 -pady 1 -fill both -expand true -in $p.wd2pack $p.wd2b -side right -padx 1 -pady 1 -fill y -in $p.wd2pack $p.wd3 -side top -padx 1 -pady 1 -fill x -in $p.words_flabel $p.word_label -text "Word Network" -relief raised -bg grey -fg blackcanvas $p.words -height $word_height -width $canvas_width -relief sunken \ -yscrollcommand "$p.y1scroll set" -xscrollcommand "$p.x1scroll set" \ -borderwidth 1scrollbar $p.y1scroll -command "$p.words yview" -borderwidth 1scrollbar $p.x1scroll -command "$p.words xview" -orient horizontal \ -borderwidth 1pack $p.word_label -fill both -expand true -in $p.wd1pack $p.y1scroll -fill both -expand true -in $p.wd2bpack $p.words -fill both -expand true -in $p.wd2apack $p.x1scroll -fill both -expand true -in $p.wd3# the canvas widget to draw the phone sequences#frame $p.ph1 -borderwidth 0 -relief flat -height 30 -width 600frame $p.ph2 -borderwidth 0 -relief flat -height 300 -width 600frame $p.ph2a -borderwidth 0 -relief flat -height 300 -width 570frame $p.ph2b -borderwidth 0 -relief flat -height 300 -width 30frame $p.ph3 -borderwidth 0 -relief flat -height 30 -width 600pack $p.ph1 -side top -padx 1 -pady 1 -fill x -in $p.phones_fpack $p.ph2 -side top -padx 1 -pady 1 -fill both -expand true -in $p.phones_fpack $p.ph2a -side left -padx 1 -pady 1 -fill both -expand true -in $p.ph2pack $p.ph2b -side right -padx 1 -pady 1 -fill y -in $p.ph2pack $p.ph3 -side top -padx 1 -pady 1 -fill x -in $p.phones_flabel $p.phone_label -text "Phone Sequence" -relief raised -bg grey -fg blackcanvas $p.phones -height $phone_height -width $canvas_width -relief sunken \ -yscrollcommand "$p.y2scroll set" -xscrollcommand "$p.x2scroll set" \ -borderwidth 1scrollbar $p.y2scroll -command "$p.phones yview" -borderwidth 1scrollbar $p.x2scroll -command "$p.phones xview" -orient horizontal \ -borderwidth 1pack $p.phone_label -fill both -expand true -in $p.ph1pack $p.y2scroll -fill both -expand true -in $p.ph2bpack $p.phones -fill both -expand true -in $p.ph2apack $p.x2scroll -fill both -expand true -in $p.ph3# the text widget to display the stat sequences#frame $p.tr1 -borderwidth 0 -relief flat -height 30 -width 600frame $p.tr2 -borderwidth 0 -relief flat -height 300 -width 600frame $p.tr2a -borderwidth 0 -relief flat -height 300 -width 570frame $p.tr2b -borderwidth 0 -relief flat -height 300 -width 30frame $p.tr3 -borderwidth 0 -relief flat -height 30 -width 600pack $p.tr1 -side top -padx 1 -pady 1 -fill x -in $p.stats_fpack $p.tr2 -side top -padx 1 -pady 1 -fill both -expand true -in $p.stats_fpack $p.tr2a -side left -padx 1 -pady 1 -fill both -expand true -in $p.tr2pack $p.tr2b -side right -padx 1 -pady 1 -fill y -in $p.tr2pack $p.tr3 -side top -padx 1 -pady 1 -fill x -in $p.stats_flabel $p.stat_label -text "Path Statistics" -relief raised -bg grey -fg blacktext $p.stats -height 7 -width 10 -relief sunken \ -yscrollcommand "$p.y3scroll set" -xscrollcommand "$p.x3scroll set" \ -borderwidth 1 -font $font_2 -state disabledscrollbar $p.y3scroll -command "$p.stats yview" -borderwidth 1scrollbar $p.x3scroll -command "$p.stats xview" -orient horizontal \ -borderwidth 1pack $p.stat_label -fill both -expand true -in $p.tr1pack $p.y3scroll -fill both -expand true -in $p.tr2bpack $p.stats -fill both -expand true -in $p.tr2apack $p.x3scroll -fill both -expand true -in $p.tr3# define key bindings#bind $p <Alt-n> { $p config -cursor watch next_frame_proc $p config -cursor top_left_arrow}bind $p <Alt-c> {config_proc}bind $p <Alt-q> {quit_proc}bind $p <Alt-r> {reset_proc}bind $p <Alt-z> { for {set fr $current_frame} {$fr < $num_frames} {incr fr} { next_frame_proc }}## end of file
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -