sub makemasterkel {
- my ($data,$outp) = @_;
+ my ($data,$outp,$type) = @_;
my $o = "";
- my $val = ($data->{$outp*4}>>22) | ($data->{$outp*4+1} << 10);
- my $act = ($data->{0x8c}>>22) | ($data->{0x8d} << 10);
-
+ my $val; my $act;
+ if($type eq 'trb3sc') {
+ $val = ($data->{$outp*4} >> 22) | ($data->{$outp*4+1} << 10);
+ $act = ($data->{0x8c} >> 22) | ($data->{0x8d} << 10);
+ }
+ if ($type eq 'trb3sc_cts') {
+ $val = ($data->{$outp*4} >> 2) | ($data->{$outp*4+1} << 30);
+ $act = ($data->{0x8c} >> 2) | ($data->{0x8d} << 30);
+ }
+
my $tmp = sprintf("%016b",$val & 0xFFFF);
- $tmp = convbox($tmp,0,0,0,$act,16);
+ $tmp = convbox($tmp,0,0,0,$act,16);
$o .= $tmp."<br>";
- $tmp = sprintf("%016b",$val>>16 & 0xFFFF);
- $tmp = convbox($tmp,0,0,0,$act>>16,16);
+ $tmp = sprintf("%016b",$val>>16 & 0xFFFF);
+ $tmp = convbox($tmp,0,0,0,$act>>16,16);
$o .= $tmp;
+ return $o;
}
sub makemasterbits {
my ($d,$i,$s,$t) = @_; #data,slot,output,type
my $o = "";
+
+ if($t eq 'trb3sc_cts') {
+ $s += 36 - 32; #starting in 36, but shifted to second register
+ $o .= "<font style=\"color:red\" title=\"for output 1\">".(($d->{1} & (1<<($i*2+$s)))?'➊':'◻')."</font> ";
+ $o .= "<font style=\"color:blue\" title=\"for output 2\">".(($d->{5} & (1<<($i*2+$s)))?'➋':'◻')."</font><br>";
+ $o .= "<font style=\"color:#0a0\" title=\"for mult 0\">".(($d->{0x35} & (1<<($i*2+$s)))?'◼':'◻')."</font>";
+ $o .= "<font style=\"color:#0da\" title=\"for mult 1\">".(($d->{0x39} & (1<<($i*2+$s)))?'◼':'◻')."</font>";
+ $o .= "<font style=\"color:#aa0\" title=\"for mult 2\">".(($d->{0x3b} & (1<<($i*2+$s)))?'◼':'◻')."</font>";
+ }
if($t eq 'trb3sc') {
$o .= "<font style=\"color:red\" title=\"for output 1\">".(($d->{0} & (1<<($i*2+$s)))?'➊':'◻')."</font> ";
$o .= "<font style=\"color:blue\" title=\"for output 2\">".(($d->{4} & (1<<($i*2+$s)))?'➋':'◻')."</font><br>";
$o .= "<font style=\"color:#0a0\" title=\"for mult 0\">".(($d->{0x33} & (1<<($i*2+$s)))?'◼':'◻')."</font>";
- $o .= "<font style=\"color:#0da\" title=\"for mult 1\">".(($d->{0x33} & (1<<($i*2+$s)))?'◼':'◻')."</font>";
- $o .= "<font style=\"color:#aa0\" title=\"for mult 2\">".(($d->{0x33} & (1<<($i*2+$s)))?'◼':'◻')."</font>";
+ $o .= "<font style=\"color:#0da\" title=\"for mult 1\">".(($d->{0x38} & (1<<($i*2+$s)))?'◼':'◻')."</font>";
+ $o .= "<font style=\"color:#aa0\" title=\"for mult 2\">".(($d->{0x3a} & (1<<($i*2+$s)))?'◼':'◻')."</font>";
}
+
if($t eq 'trb3') {
$o .= "<font style=\"color:red\" title=\"for output 1\">".(($d->{0} & (1<<($i*4+$s)))?'➊':'◻')."</font> ";
$o .= "<font style=\"color:blue\" title=\"for output 2\">".(($d->{4} & (1<<($i*4+$s)))?'➋':'◻')."</font><br>";
my $pos = getposition(@{$boards});
my $out = "";
- if($type eq 'trb3sc') {
+ if($type =~ /^trb3sc/) {
$out .= "<table class=\"triggermap\">";
$out .= "<tr><th>Board
if($i==4) {
$out .= sprintf("<tr class=\"master\"><td><a href=\"../tdc/inputmonitor.pl?Trb3scTrigger#&address=0x%04x&period=1000&cache=false&rate=false&inline=false\" target=\"_blank\">0x%04x</a>",$b,$b);
- $out .= "<td colspan=\"2\"><font style=\"color:red\">".makemasterkel($data->{$b},0);
- $out .= "<td colspan=\"2\"><font style=\"color:blue\">".makemasterkel($data->{$b},1);
+ $out .= "<td colspan=\"2\"><font style=\"color:red\">".makemasterkel($data->{$b},0,$type);
+ $out .= "<td colspan=\"2\"><font style=\"color:blue\">".makemasterkel($data->{$b},1,$type);
$out .= "<td colspan=\"2\"> <td colspan=\"2\"> ";
$out .= "<td >";
my $masterstring = shift @_;
$masterstring =~ /0x(\w\w\w\w)/;
my $master = hex($1);
- my $o = trb_register_read(0xffff,0x42);
+ my $o = trb_register_read(0xffff,0x42);
+ my $if = trb_register_read(0xffff,0x41);
unless ($o->{$master}) {print "Master not found.\n"; return;}
if (($o->{$master}>>24 & 0xff) == 0x90) {$types->{$masterstring} = 'trb3';}
- if (($o->{$master}>>24 & 0xff) == 0x95) {$types->{$masterstring} = 'trb3sc';}
+ if (($o->{$master}>>24 & 0xff) == 0x95) {
+ $types->{$masterstring} = 'trb3sc';
+ if($if->{$master} & 0x10000000) { #if USE_BACKPLANE
+ $types->{$masterstring} = 'trb3sc_cts';
+ }
+ }
push(@{$setups->{$masterstring}},$master);
return if $types->{$masterstring} eq 'rjkel';