]> jspc29.x-matter.uni-frankfurt.de Git - mimosis_chain.git/commitdiff
add download link for config file
authorMaps <maps@ikf>
Tue, 1 Aug 2023 20:09:15 +0000 (22:09 +0200)
committerMaps <maps@ikf>
Tue, 1 Aug 2023 20:09:15 +0000 (22:09 +0200)
http/htdocs/getdacfile.pl [new file with mode: 0755]
http/htdocs/setreg.htm

diff --git a/http/htdocs/getdacfile.pl b/http/htdocs/getdacfile.pl
new file mode 100755 (executable)
index 0000000..ff53431
--- /dev/null
@@ -0,0 +1,48 @@
+#!/usr/bin/perl -w
+use URI::Escape;
+use lib '../scripts/';
+use lib '../../scripts/';
+use Mimosis;
+use Data::Dumper;
+use HADES::TrbNet;
+
+trb_init_ports() or die trb_strerror();
+
+eval{
+        htsponse(200,"OK");
+        print "Content-type: text/html\r\n\r\n";
+        };
+
+my ($fpga,$reg,$value) = split('-',$ENV{'QUERY_STRING'});
+
+$fpga = hex($fpga) if $fpga =~ /^0x/;
+
+my $val;
+my @registers = (
+"], #IBIAS       0 - 80 nA      ,  312 pA     Pixel current                                   ",
+"], #ITHR        0 - 2.5 nA     ,  9.8 pA     Pixel current                                   ",
+"], #IDB         0 - 40 nA      ,  157 pA     Pixel current                                   ",
+"], #VRESET      0.37 - 1.79 V  ,  6 mV       Pixel input amplifier reset voltage             ",
+"], #VPL         0.37 - 1.79 V  ,  6 mV       Pixel voltage for charge injection (low  value) ",
+"], #VPH         0.37 - 1.79 V  ,  6 mV       Pixel voltage for charge injection (high        ",
+"], #VPH_FINE    0 - 256 mV     ,  1 mV           value) VPH+VPH_FINE                         ",
+"], #VCASP       0 - 1.54 V     ,  6 mV       Pixel voltage                                   ",
+"], #VCASNA      0 - 1.54 V     ,  6 mV       Pixel threshold voltage for submatrix A         ",
+"], #VCASNB      0 - 1.54 V     ,  6 mV       Pixel threshold voltage for submatrix B         ",
+"], #VCASNC      0 - 1.54 V     ,  6 mV       Pixel threshold voltage for submatrix C         ",
+"], #VCASND      0 - 1.54 V     ,  6 mV       Pixel threshold voltage for submatrix D         ",
+"], #VCASN2      0 - 1.54 V     ,  6 mV       Pixel voltage                                   ",
+"], #VCLIP       0 - 1.54 V     ,  6 mV       Pixel clipping amplifier voltage                ",
+"], #IBUFBIAS    0 - 10 μA      ,  312 pA     Internal buffer bias (not in pixel)             ",
+
+
+);
+
+
+for my $i (0..14) {
+  $val = Mimosis::mimosis_register_read($fpga, $i+0x40,1); #single access mode as default
+  $val &= 0xff;
+  printf("[0x00%02x, %3i%s\n",$i+0x40,$val,$registers[$i]);
+  }
+
+exit 1;
index 43b8e8f563c25f5f3893d8dc2301a8653b0d88da..1cf9381187a52d96789c9a5080c8fe5e261fc66a 100644 (file)
@@ -93,7 +93,7 @@
     <body>
         <h1>DAC Control</h1>
         <div class="dac_container">
-            FPGA <input class="dac_input" type="text" id="fpga" onChange="loadvalues()">
+            FPGA <input class="dac_input" type="text" id="fpga" onChange="loadvalues()">&nbsp;<a id="DownloadLink" href="getdacfile.pl" download="CONF_dac.pl" target="_blank">Download</a>
             <div class="slider_container"> <div class="slider_name">VCASP</div> <input class="dac_input" id="VCASP" type="range" min="0" max="255" step="1.0" value="67" onChange="send('VCASP')"><div class="slider_value" id="VCASPtxt"></div></div>
             <div class="slider_container"> <div class="slider_name">VCASNA</div> <input class="dac_input" id="VCASA" type="range" min="0" max="255" step="1.0" value="100" onChange="send('VCASA')"><div class="slider_value" id="VCASAtxt"></div></div>
             <div class="slider_container"> <div class="slider_name">VCASNB</div> <input class="dac_input" id="VCASB" type="range" min="0" max="255" step="1.0" value="100" onChange="send('VCASB')"><div class="slider_value" id="VCASBtxt"></div></div>
      loadvalues();
 
      function loadvalues() {
+         document.getElementById("DownloadLink").href="getdacfile.pl?"+document.getElementById("fpga").value;
          getData("getdac.pl?"+document.getElementById("fpga").value,"",showDacs);
      }