use strict;
use warnings;
use lib "./libs/";
+use BN::CRC32;
use Config::Abstract::Ini;
use POSIX qw(strftime);
use FileHandle;
#use lib "/d/sugar/bneumann/vhdl/jtag_proj/trb_maps_jtag2/ui/";
#use lib "/d/sugar/bneumann/vhdl/jtag_proj/trb_maps_jtag2/ui/BN/blib/arch";
-use lib "BN/blib/arch";
-use BN::CRC32;
+use lib "libs/blib/arch";
+
#use String::CRC32;
#use feature "state";
my $gladexml = Gtk2::GladeXML->new('gui/design/window3_libglade.glade');
my $textview_msg = $gladexml->get_widget('textview_msg');
my $textview_msgdetailed = $gladexml->get_widget('textview_msgdetailed');
-my $logfilehandle = FileHandle->new('gui3log.txt', 'a');
+my $logfilehandle = FileHandle->new('gui3log.txt', 'a') or die "Can't open logfile";
sub report {
# log to logfile
reportd "regval: ". substr($regval, 8, 10). "\n";
my $resetnormal = substr($regval, 8, 10);
# my $resetinv = int_to_32bit_hex((~(0b10000000000)) & hex_to_32bit_int($resetnormal));
- my $resetinv = int_to_32bit_hex((~(1<<10)) & hex($resetnormal));
+ my $resetinv = int_to_32bit_hex((~(1 << 10 )) & hex($resetnormal));
execute_shell_command("trbcmd w $fpga_addr $conf_signals_addr 0x$resetinv 2>&1 && sleep 1 && trbcmd w $fpga_addr $conf_signals_addr $resetnormal 2>&1", "");
}
}
my $newval;
if($onoroff == 0) {
#off
- $newval = int_to_32bit_hex((~(1<<11)) & hex($before));
+ $newval = int_to_32bit_hex((~(1<< 11)) & hex($before));
}
else {
#on
- $newval = int_to_32bit_hex(((1<<11)) | hex($before));
+ $newval = int_to_32bit_hex(((1<< 11)) | hex($before));
}
execute_shell_command("trbcmd w $fpga_addr $conf_signals_addr 0x$newval", "");
}
my $newval;
if($onoroff == 0) {
#off
- $newval = int_to_32bit_hex((~(1<<13)) & hex($before));
+ $newval = int_to_32bit_hex((~(1<< 13)) & hex($before));
}
else {
#on
- $newval = int_to_32bit_hex(((1<<13)) | hex($before));
+ $newval = int_to_32bit_hex(((1<< 13)) | hex($before));
}
execute_shell_command("trbcmd w $fpga_addr $conf_signals_addr 0x$newval\n", "");
}
@drs_length = ();
my $sensorfile = $settings{$setting_name};
reportd "loading sensor file: $sensorfile\n";
- my $sensorSettingsO = new Config::Abstract::Ini("/daq/toolbox/sensors/".$sensorfile);
+ my $sensorSettingsO = new Config::Abstract::Ini("../sensors/".$sensorfile);
my %sensorSettings = $sensorSettingsO->get_all_settings;
my $this_irlen = $sensorSettingsO->get_entry_setting('General', 'IRLEN', '5');
my $bypassreg = $sensorSettingsO->get_entry_setting('General', 'BYPASSREG', '1F');
die ("Error: RAM text file \"$memfilename\" exists.");
}
reportd "Opening $memfilename...\n";
- my $handle = FileHandle->new($memfilename, 'w');
+ my $handle = FileHandle->new($memfilename, 'w') or die "Can't create memfile";
push(@memfilenames, $memfilename);
# write numregs + IRlen
my $word = scalar($this_irlen)<<16;