From 66baf6f871d5e9500880f6aa5936b4ad29f8821e Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Wed, 12 Apr 2023 14:03:41 +0200 Subject: [PATCH] add downscale register to CTS GUI --- web/CtsPlugins/CtsMod10.pm | 21 ++++++++++++++++++++- web/htdocs/cts/cts.htm | 3 ++- web/htdocs/layout/cts.css | 6 +++++- web/htdocs/scripts/cts.js | 10 ++++++++-- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/web/CtsPlugins/CtsMod10.pm b/web/CtsPlugins/CtsMod10.pm index 232d829..fa6cce5 100755 --- a/web/CtsPlugins/CtsMod10.pm +++ b/web/CtsPlugins/CtsMod10.pm @@ -40,7 +40,7 @@ sub init { 'label' => "Trigger Input Module Configuration $i" }); } - } else { + } elsif ($cprop->{'trb_compiletime'} < 1680610367) { for(my $i = 0; $i < $header->{'len'}; $i++) { my $key = "trg_input_config$i"; @@ -58,6 +58,25 @@ sub init { 'label' => "Trigger Input Module Configuration $i" }); } + } else { + for(my $i = 0; $i < $header->{'len'}; $i++) { + my $key = "trg_input_config$i"; + + $regs->{$key} = new TrbRegister($address + 1 + $i, $trb, { + 'delay' => {'lower' => 0, 'len' => 6}, + 'spike_rej' => {'lower' => 8, 'len' => 4}, + 'invert' => {'lower' => 12, 'len' => 1, 'type' => 'bool'}, + 'override' => {'lower' => 13, 'len' => 2, 'type' => 'enum', 'enum' => + {0 => 'off', 1 => 'to_low', 3 => 'to_high'} + }, + 'downscale' => {'lower' => 16, 'len' => 4}, + }, { + 'accessmode' => "rw", + 'export' => 1, + 'monitor' => '1', + 'label' => "Trigger Input Module Configuration $i" + }); + } } for(my $i = 0; $i < $header->{'itc_len'}; $i++) { diff --git a/web/htdocs/cts/cts.htm b/web/htdocs/cts/cts.htm index fa46640..e881752 100644 --- a/web/htdocs/cts/cts.htm +++ b/web/htdocs/cts/cts.htm @@ -169,6 +169,7 @@ Delay Spike Rej. Override + Downscale @@ -434,4 +435,4 @@ - \ No newline at end of file + diff --git a/web/htdocs/layout/cts.css b/web/htdocs/layout/cts.css index 8a3107a..ab1c97f 100644 --- a/web/htdocs/layout/cts.css +++ b/web/htdocs/layout/cts.css @@ -320,4 +320,8 @@ border: 2px solid #ffff00; margin-bottom: 20px; display: none; - } \ No newline at end of file + } + + .noavail input{ + visibility:hidden; + } diff --git a/web/htdocs/scripts/cts.js b/web/htdocs/scripts/cts.js index b53f540..59533e5 100644 --- a/web/htdocs/scripts/cts.js +++ b/web/htdocs/scripts/cts.js @@ -439,7 +439,9 @@ var CTS = new Class({ renderTriggerInputs: function() { var source_from = this.defs.properties.trg_input_count - this.defs.properties.trg_inp_mux_count; var to = this.defs.properties.trg_input_count; - + var noavail = ""; + if(this.defs.properties.trb_compiletime < 1680610367) + noavail = " noavail"; for(var i=0; i < to; i++) { var reg = 'trg_input_config' + i; var areg = 'trg_input_mux' + (i-source_from); @@ -478,7 +480,11 @@ var CTS = new Class({ new Element('option', {'value': 'to_low', 'text': '-> 0'}), new Element('option', {'value': 'to_high', 'text': '-> 1'}), ]) - ) + ), + new Element('td', {'class': 'downscale'+noavail}) + .adopt([ + new Element('input', {'class': 'text autocommit autoupdate', 'slice': reg + '.downscale'}) + ]), ]) ); -- 2.43.0