From 6cfe3e1ad1b475f83e70d7b57500135b2bd35dc6 Mon Sep 17 00:00:00 2001 From: Michael Wiebusch Date: Thu, 21 Aug 2014 14:27:02 +0200 Subject: [PATCH] window length feature --- user_interface/gui.pl | 30 +++++++++++++++++++++++------- user_interface/plot.sh | 17 +++++++++++++++++ 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/user_interface/gui.pl b/user_interface/gui.pl index 8a6d441..7539697 100755 --- a/user_interface/gui.pl +++ b/user_interface/gui.pl @@ -34,7 +34,7 @@ $hbox->set_border_width(3); ################################################## my $inc_button = Gtk2::Button->new('_Click Me'); -$hbox->pack_start($inc_button, FALSE, FALSE, 0); +# $hbox->pack_start($inc_button, FALSE, FALSE, 0); my $count = 1; my $plot_button = Gtk2::Button->new('_Plot'); @@ -43,11 +43,22 @@ $hbox->pack_start($plot_button, FALSE, FALSE, 0); my $clear_button = Gtk2::Button->new('_Clear'); $hbox->pack_start($clear_button, FALSE, FALSE, 0); +my $windowLength_entry = Gtk2::Entry->new; +$hbox->pack_start($windowLength_entry, FALSE, FALSE, 0); + +my $setWindowLength_button = Gtk2::Button->new('_Set window length'); +$hbox->pack_start($setWindowLength_button, FALSE, FALSE, 0); + + + my $quit_button = Gtk2::Button->new('_Quit'); -$hbox->pack_start($quit_button, FALSE, FALSE, 0); +# $hbox->pack_start($quit_button, FALSE, FALSE, 0); $quit_button->signal_connect( clicked => sub { - Gtk2->main_quit; - }); + Gtk2->main_quit; + }); + + + my $image = Gtk2::Image->new_from_file ("plot.png"); @@ -57,8 +68,8 @@ $plot_frame->add($image); -# my $label = Gtk2::Label->new('Clicked 0 times.'); -# $vbox->pack_start($label, TRUE, TRUE, 0); +my $label = Gtk2::Label->new('... debug out'); +$vbox->pack_start($label, TRUE, TRUE, 0); @@ -93,7 +104,12 @@ $clear_button->signal_connect( clicked => sub { }); - +$setWindowLength_button->signal_connect( clicked => sub { + my $windowLength = $windowLength_entry->get_text(); + execute("./analyzer.pl --window $windowLength"); +# $label->set_text($windowLength_entry->get_text()); + +}); sub execute { diff --git a/user_interface/plot.sh b/user_interface/plot.sh index a2f5b8f..772bac3 100755 --- a/user_interface/plot.sh +++ b/user_interface/plot.sh @@ -9,6 +9,23 @@ set terminal png # set terminal postscript enhanced solid color set output "plot.png" #set xrange [$left:$right] + + +set style line 1 lc rgb '#8b1a0e' pt 1 ps 1 lt 1 lw 2 # --- red +set style line 2 lc rgb '#5e9c36' pt 6 ps 1 lt 1 lw 2 # --- green + +set style line 11 lc rgb '#808080' lt 1 +set border 3 back ls 11 +set tics nomirror + +set style line 12 lc rgb '#808080' lt 0 lw 1 +set grid back ls 12 + +set xlabel "bins" +set ylabel "counts" + + plot "out.dat" using 1:2 + EOF #display plot.png -- 2.43.0