From ca1da843c35221a1be20d2097bfa54e1070fdb7e Mon Sep 17 00:00:00 2001 From: Michael Wiebusch Date: Wed, 9 Dec 2015 13:51:29 +0100 Subject: [PATCH] removed unused junk from git --- user_interface/analyzer.pl | 202 ----------------------- user_interface/clear.png | Bin 2910 -> 0 bytes user_interface/deadtime_analysis.sh | 16 -- user_interface/gui.pl | 170 ------------------- user_interface/plot.png | Bin 4400 -> 0 bytes user_interface/plot.sh | 31 ---- user_interface/scan_pattern_animation.sh | 12 -- user_interface/test3.pl | 45 ----- 8 files changed, 476 deletions(-) delete mode 100755 user_interface/analyzer.pl delete mode 100644 user_interface/clear.png delete mode 100755 user_interface/deadtime_analysis.sh delete mode 100755 user_interface/gui.pl delete mode 100644 user_interface/plot.png delete mode 100755 user_interface/plot.sh delete mode 100755 user_interface/scan_pattern_animation.sh delete mode 100755 user_interface/test3.pl diff --git a/user_interface/analyzer.pl b/user_interface/analyzer.pl deleted file mode 100755 index 3e0c71e..0000000 --- a/user_interface/analyzer.pl +++ /dev/null @@ -1,202 +0,0 @@ -#!/usr/bin/perl -use strict; -use warnings; -use Device::SerialPort; -use Time::HiRes; -use Getopt::Long; -use POSIX qw/strftime/; -use POSIX; - -# plot destination -# check for tools - - - - -# defaults -my $baudrate=115200; -my $port; -my $opt_command; -my $read; -my $opt_help; -my $write; -my $clear; -my $clkdiv; -my $window; - - -my $ser_dev = "/dev/ttyUSB0"; - - - -GetOptions ( 'h|help' => \$opt_help, - 'c|cmd=s' => \$opt_command, - 'tty=s' => \$ser_dev, - 'baud=s' => \$baudrate, - 'r|read=s' => \$read, - 'w|write=s' => \$write, - 'c|clear' => \$clear, - 'd|divider=s' => \$clkdiv, - 'window=s' => \$window - ); - - -init_port(); - - -if (defined ($read)) { - - my $val = communicate("R".chr($read)); - printf("response: %d\n",$val); - - exit; -} - -if (defined($clear)){ - $write = '129_1'; -} - - -if (defined($window)){ - my $tunit=1e-3; - if($window =~ m/ms/){ - $tunit=1e-3; - } elsif($window =~ m/us/){ - $tunit=1e-6; - } elsif($window =~ m/ns/){ - $tunit=1e-9; - } elsif($window =~ m/s/){ - $tunit=1; - } - - $window =~ m/([\d\.]+)/; - my $number = $1; - printf("requested window width: %e s\n",$number*$tunit); - my $FPGAclk=133000000; - my $analyzerBins=128; - $clkdiv = floor(($number*$tunit)/$analyzerBins/(1/$FPGAclk)); - -} - -if (defined($clkdiv)){ - $write = "128_$clkdiv"; -} - -if (defined ($write)) { - - unless( $write =~ m/(\d+)_(\d+)/ ) { - die "input parameter: analyzer -w 127_1234\n"; - } - - my $addr = $1; - my $value = $2; - print "addr:$addr value:$value\n"; - - my $byte3 = chr(int($value)>>24); - my $byte2 = chr((int($value)>>16)&0xFF); - my $byte1 = chr((int($value)>>8)&0xFF); - my $byte0 = chr(int($value)&0xFF); - - my $val = communicate("W".chr($addr).$byte3.$byte2.$byte1.$byte0); - printf("response: %d\n",$val); - - exit; -} - - -for (my $i=0;$i<128;$i++){ - my $val = communicate("R".chr($i)); -# printf ("length of response: %d \n",length($rstring)); - printf("%d\t%d\n",$i,$val); -# printf("addr %d:\t%d.%d.%d.%d\n",$i,$byte3,$byte2,$byte1,$byte0); -# Time::HiRes::sleep(.01); -} - - - - -sub communicate { - - my $ack_timeout=0.5; - - my $command = $_[0]; -# print "sending command $command\n"; - my $rstring; - - - $port->are_match(""); - $port->read_char_time(1); - $port->read_const_time(0); - $port->lookclear; - #Time::HiRes::sleep(.004); - $port->write("$command\n"); - - my $ack = 0; - - - - #Time::HiRes::sleep(.004); - - my ($count, $a) = $port->read(12); - - if($a=~ m/R(.{4})/s) { - $rstring= $1; -# print "padiwa sent: $cmd_echo\n\n"; - $ack=1; - } - - - - unless($ack) { - print "no answer\n"; - return 0; - } - my $byte3 = ord(substr($rstring,0,1)); - my $byte2 = ord(substr($rstring,1,1)); - my $byte1 = ord(substr($rstring,2,1)); - my $byte0 = ord(substr($rstring,3,1)); - my $val = (($byte3<<24)|($byte2<<16)|($byte1<<8)|$byte0); - - return $val; - - - -} - - - - - - -sub init_port { - - - # talk to the serial interface - - $port = new Device::SerialPort($ser_dev); - unless ($port) - { - print "can't open serial interface $ser_dev\n"; - exit; - } - - $port->user_msg('ON'); - $port->baudrate($baudrate); - $port->parity("none"); - $port->databits(8); - $port->stopbits(1); - $port->handshake("none"); - $port->write_settings; - -} - - - -sub getValue { - my $valName=$_[0]; - my $answer = communicate($valName); - if($answer =~ m/$valName=([^=]+)/){ - return $1; - } - die "could not retrieve desired value $valName!"; -} diff --git a/user_interface/clear.png b/user_interface/clear.png deleted file mode 100644 index cffb1c1aceae9a027f803c597c06ea42cf6880ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2910 zcmeHIe@xV67=I4R4$MPy<}bXL9izPIQ5JkRI( zd_K>6yF)9}Qzt~vh$f;5*0ki+L=kTi8GOb_yorc;yaiv8dCRS9jYi|ut_&X{TDf9v z3SJX2B2FZTB$3h)W5hTyK}-@;I>{MvPFxU|#FefUj07hkNJtV&w@OBmlN2N+Nd+WQ zj1(s&NJ&x%fDLG1p&8Xm&(Vi7CK!{9DLobu=Zp)+CF4r7KvHlf1QU`8rAeVyawY|n zl1T-QXl05sC76;-VJcVy45Yylw2;GKU;`RhXjWQ~j&TI%l5?f?VJspcxR6{ZEf*}1 zl!8mirGk2pLM>N`A>Nui`r@DWbK0PsRNjD}iR2|qv+-LM0kAQ%e48ekxePS64m3S71c%yos;U#HOVc+$7!&YjJVR!Vl!-6&Cum-*S zFfFYhJPFXa4%iaRgQoB(ijR-qy?eLGWU|}sm6er#zu)O}o<4ng*REY=vpIZG@BL%i zj+!O-olySj^fjRIzdZ2zpY!hq)_5nOAZlmYhCCwE5Bg&`HqSJZXk4!~`PsFF&c3!o z+pnh4vQ@Xw?{AJ7-n{hnR~IGDxe%a>5h2^#LBr+wPp5u7a(+^8Z`4PX`y<;wAZyf- z_s1S%9^A8g&|Dg^(Qj*SyET95=*`To8|jAh+F0M5y5Jk9sG@d;FK?ue%5N2P${YQa z;|Ipq&hiDP?%mVgJ9Xe#=1sMrv3pI2*;kZk9&GZ&Ry=5F`fEl>l7Cy#;GeAr%lECz zs`}a0<|_5aOwN6GIKO3I`og4?{&{!4Zu_y}j=3qmI^c2Sx&wKhmamF?8m}wA$xt@Y zf9A`}KYjk%bi?7e?#_oBU#KrC&D|0RZCY5-=qmHGOMP8enzLHdLf_Xf>bP?4T-Vvd z)<*Y&lS^H{y6@gN^+)ILot-MK-%`_h*OJXL|$F@=JryR|V(h zC7vi*k>mI+;pK*&!MhWEp_8@;68yH*0~anm5#gyHEr}k8owe>4OJs43x=8NN9D&y1 zkUcj5I$0HUWpjrLJq4lJb=k!#XYlCUp{F{h`!bIEya#Rf4>=o3&E6(eZ0HH@JU|z| z={cKtJmB22p?r^XW==tnszY|?X3vw!wz%20aYLawTVE|OTZaK|}g|I{@NmwU2{x7K*7&pXREA0PZwgi43EI=ru(*yrlL zpiF}q4K^Y_h?Q1D*ab!O-WC#TE6M6zX2UKyxIT& diff --git a/user_interface/deadtime_analysis.sh b/user_interface/deadtime_analysis.sh deleted file mode 100755 index 6ff3e0b..0000000 --- a/user_interface/deadtime_analysis.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -file=deadtime_analysis.dat - ->$file - -echo -e "#deadtime in us\t#counts" - -for t in $(seq 0 1 40) -do -./pmt_ro.pl sub=dead_time value=$t unit=us -counts=$(./pmt_ro.pl sub=count channel=signal delay=5) - -echo -e "$t\t$counts" -echo -e "$t\t$counts" >> $file -done diff --git a/user_interface/gui.pl b/user_interface/gui.pl deleted file mode 100755 index 5e0e1e4..0000000 --- a/user_interface/gui.pl +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use Gtk2 '-init'; - -use constant TRUE => 1; -use constant FALSE => 0; - -my $save_dir = "./saved"; - -my $window = Gtk2::Window->new; -$window->set_title ('FPGA based pulse width analyzer'); -$window->signal_connect (destroy => sub { Gtk2->main_quit; }); -$window->set_border_width(3); - -my $vbox = Gtk2::VBox->new(FALSE, 6); -$window->add($vbox); - -my $actions_frame = Gtk2::Frame->new('Actions'); -$vbox->pack_start($actions_frame, TRUE, TRUE, 0); -$actions_frame->set_border_width(3); - - -my $save_frame = Gtk2::Frame->new('Save'); -$vbox->pack_start($save_frame, TRUE, TRUE, 0); -$actions_frame->set_border_width(3); - -my $save_frame_hbox = Gtk2::HBox->new(FALSE, 6); -$save_frame->add($save_frame_hbox); -$save_frame_hbox->set_border_width(3); - - -my $plot_frame = Gtk2::Frame->new('Plot'); -$vbox->pack_start($plot_frame, TRUE, TRUE, 0); -$plot_frame->set_border_width(3); - - -my $hbox = Gtk2::HBox->new(FALSE, 6); -$actions_frame->add($hbox); -$hbox->set_border_width(3); - - - -################################################## -## buttons ## -################################################## - -my $inc_button = Gtk2::Button->new('_Click Me'); -# $hbox->pack_start($inc_button, FALSE, FALSE, 0); -my $count = 1; - -my $plot_button = Gtk2::Button->new('_Plot'); -$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; -$windowLength_entry->set_text('100us'); -$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); -$quit_button->signal_connect( clicked => sub { - Gtk2->main_quit; - }); - - - - -my $filename_entry = Gtk2::Entry->new; -$filename_entry->set_text('last_aquisition'); -$save_frame_hbox->pack_start($filename_entry, FALSE, FALSE, 0); - -my $save_button = Gtk2::Button->new('_Save data and plot'); -$save_frame_hbox->pack_start($save_button, FALSE, FALSE, 0); - - - -my $image = Gtk2::Image->new_from_file ("clear.png"); -# $vbox->pack_start($image, TRUE, TRUE, 0); -$plot_frame->add($image); - - - - -my $label = Gtk2::Label->new('... debug out'); -$vbox->pack_start($label, TRUE, TRUE, 0); - - - -################################################## -## button functions ## -################################################## -# has to be done after we've created the label so we can get to it -$inc_button->signal_connect( clicked => \&update_clicks); -sub update_clicks { - -# $label->set_text("Clicked $count times."); - $count++; - -} - - -$plot_button->signal_connect( clicked => sub { - -# $label->set_text(qx%echo blah%); - execute("./plot.sh"); - show_image("plot.png"); - -}); - -$clear_button->signal_connect( clicked => sub { - - execute("./analyzer.pl --clear"); - show_image("clear.png"); - -}); - -$save_button->signal_connect( clicked => sub { - my $filename = $filename_entry->get_text(); - unless( -e $save_dir ) { - execute("mkdir -p $save_dir") - } - execute("cp out.dat $save_dir/$filename.dat"); - execute("cp plot.png $save_dir/$filename.png"); - -}); - -$setWindowLength_button->signal_connect( clicked => sub { - my $windowLength = $windowLength_entry->get_text(); - execute("./analyzer.pl --window $windowLength"); -# $label->set_text($windowLength_entry->get_text()); - execute("./analyzer.pl --clear"); - show_image("clear.png"); - -}); - - -sub execute { - my $command = shift; - print "execute:\n$command\n"; - system($command); - print "\n\n"; - -} - -sub show_image{ - my $filename = shift; - $plot_frame->remove($image); - $image->clear; - $image = Gtk2::Image->new_from_file($filename); - $plot_frame->add($image); - $window->show_all; -} - - - - - -$window->show_all; -Gtk2->main; \ No newline at end of file diff --git a/user_interface/plot.png b/user_interface/plot.png deleted file mode 100644 index 8f57cbafbb591653ec4885d3642e9a4bf3525ddf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4400 zcmeHL`BziN7k>c(HxBRSnC|@6>pK820096do^Pn@F)+99(Gi}3yZ3lQ5Txs&QmOie1ppw# z0w6#xXJLWIj{(oRAP^!$T@@QP=vcAhP92}Mwe^-QTm1a| zqN1Y6Wb&m;muhQkSuEDGXU~R)hIC6Pot@9h&sOygD}$9{2$Bo4p?Wr5E{FJlZZ+UX z-Iu&3Z;fN#z7KTXiWSFnssI2d=lK|*R}li9zksaHL*zgu2twY#446Dpl%X8XZ)u2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Ahdr}Io!JS~W`I`XF z!3DZ(<*<{0TcS${|1J&%4t8DaSkx}tZ#5D(dQ^ni<+aLOf;`?kYdW0f_4*=4Iz*ER z=2Rr>ih6Af@4u^%iid^j;z-f5Gb`P#Ms6$UE%B6?_Y6x>M3#?Nff|3Xps!VyD7qdL zBcK;Gj1#`!mD@Pynn;la?U-3Q0Kc$gtIySNI9gG3W<$LUaXX*vSo`u`+j@re;Z45cAAyE@ql`Y7s+wP;$ z_Gjicj%{3~v0Rrh>9)Fy3-gWB*xnS^=%gh5q9wK;VQwBe>ljv)TZ(+3qLDIfD6B`8LFtxv-4^nDsyFYS zD59+qz~84W(tf#bn7bP~91EPNE*yahdA zx{eUL_hi(J)P9EN3}}+1NYPiw$f={lYvXI5N)npxhZ`e6nQh6KObGOoE|biTI&Icv zUz5c!S9G`jQ5xZ9(o9?lqQAITeAHiJfBf out.dat -cat < 1; -use constant FALSE => 0; - -my $window = Gtk2::Window->new; -$window->set_title ('Widget Layout'); -$window->signal_connect (destroy => sub { Gtk2->main_quit; }); -$window->set_border_width(3); - -my $vbox = Gtk2::VBox->new(FALSE, 6); -$window->add($vbox); - -my $frame = Gtk2::Frame->new('Buttons'); -$vbox->pack_start($frame, TRUE, TRUE, 0); -$frame->set_border_width(3); - -my $hbox = Gtk2::HBox->new(FALSE, 6); -$frame->add($hbox); -$hbox->set_border_width(3); - -my $inc_button = Gtk2::Button->new('_Click Me'); -$hbox->pack_start($inc_button, FALSE, FALSE, 0); -my $count = 1; - -my $quit_button = Gtk2::Button->new('_Quit'); -$hbox->pack_start($quit_button, FALSE, FALSE, 0); -$quit_button->signal_connect( clicked => sub { - Gtk2->main_quit; - }); - -my $label = Gtk2::Label->new('Clicked 0 times.'); -$vbox->pack_start($label, TRUE, TRUE, 0); - -# has to be done after we've created the label so we can get to it -$inc_button->signal_connect( clicked => sub { - $label->set_text("Clicked $count times."); - $count++; - }); - -$window->show_all; -Gtk2->main; -- 2.43.0