From ae3e4bd8546db13cf0e31d8e66d5bffb95fe842e Mon Sep 17 00:00:00 2001 From: Maps Date: Thu, 12 Dec 2024 11:30:04 +0100 Subject: [PATCH] removed unneeded pulsing stuff and fixed download button --- "http/htdocs/\\" | 136 ++++++++++++++++++++++++++++++++++++ http/htdocs/getdac.pl | 17 +++-- http/htdocs/getdacfile.pl | 7 +- http/htdocs/pulse.css | 35 ---------- http/htdocs/pulse.htm | 48 ------------- http/htdocs/pulse.js | 60 ---------------- http/htdocs/pulse_region.pl | 20 ------ http/htdocs/setreg.htm | 68 +++++++----------- http/htdocs/test.pl | 23 ++++++ http/start.sh | 5 +- 10 files changed, 201 insertions(+), 218 deletions(-) create mode 100644 "http/htdocs/\\" delete mode 100644 http/htdocs/pulse.css delete mode 100644 http/htdocs/pulse.htm delete mode 100644 http/htdocs/pulse.js delete mode 100644 http/htdocs/pulse_region.pl create mode 100755 http/htdocs/test.pl diff --git "a/http/htdocs/\\" "b/http/htdocs/\\" new file mode 100644 index 0000000..beb33d6 --- /dev/null +++ "b/http/htdocs/\\" @@ -0,0 +1,136 @@ + + + + DAC Control + + + + + +

DAC Control

+
+ FPGA   + + Download + +
VCASP
+
VCASNA
+
VCASNB
+
VCASNC
+
VCASND
+
VCASN2
+
IDB
+
IBIAS
+
ITHR
+
IBUFBIAS
+
VPL
+
VPH
+
VPH_FINE
+
VRESET
+
VCLIP
+
+
+ + + + diff --git a/http/htdocs/getdac.pl b/http/htdocs/getdac.pl index cf7bd3e..fb448f1 100755 --- a/http/htdocs/getdac.pl +++ b/http/htdocs/getdac.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w use URI::Escape; -use lib '../scripts/'; +#use lib '../scripts/'; use Mimosis; use Data::Dumper; use HADES::TrbNet; @@ -14,14 +14,17 @@ eval{ my ($fpga,$reg,$value) = split('-',$ENV{'QUERY_STRING'}); -$fpga = hex($fpga) if $fpga =~ /^0x/; +$fpga = hex( $fpga ) if $fpga =~ /^0x/; +Mimosis::set_fpga( $fpga ); +#single access mode as default +Mimosis::set_singleAccess(1); my $val; -for my $i (0x40..0x4e) { - $val = Mimosis::mimosis_register_read($fpga, $i,1); #single access mode as default - $val &= 0xff; - print $val."-"; - } +for my $i (0x40 .. 0x4e) { + $val = Mimosis::mimosis_register_read($i); + $val &= 0xff; + print $val."-"; +} exit 1; diff --git a/http/htdocs/getdacfile.pl b/http/htdocs/getdacfile.pl index ff53431..5e1a2ce 100755 --- a/http/htdocs/getdacfile.pl +++ b/http/htdocs/getdacfile.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use URI::Escape; -use lib '../scripts/'; -use lib '../../scripts/'; +#use lib '../scripts/'; +#use lib '../../scripts/'; use Mimosis; use Data::Dumper; use HADES::TrbNet; @@ -35,12 +35,11 @@ my @registers = ( "], #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 = Mimosis::mimosis_register_read($i+0x40); #single access mode as default $val &= 0xff; printf("[0x00%02x, %3i%s\n",$i+0x40,$val,$registers[$i]); } diff --git a/http/htdocs/pulse.css b/http/htdocs/pulse.css deleted file mode 100644 index 30f193f..0000000 --- a/http/htdocs/pulse.css +++ /dev/null @@ -1,35 +0,0 @@ -/* Style the tab */ -.tab { - overflow: hidden; - border: 1px solid #ccc; - background-color: #f1f1f1; -} - -/* Style the buttons that are used to open the tab content */ -.tab button { - background-color: inherit; - float: left; - border: none; - outline: none; - cursor: pointer; - padding: 14px 16px; - transition: 0.3s; -} - -/* Change background color of buttons on hover */ -.tab button:hover { - background-color: #ddd; -} - -/* Create an active/current tablink class */ -.tab button.active { - background-color: #ccc; -} - -/* Style the tab content */ -.tabcontent { - display: none; - padding: 6px 12px; - border: 1px solid #ccc; - border-top: none; -} diff --git a/http/htdocs/pulse.htm b/http/htdocs/pulse.htm deleted file mode 100644 index d137735..0000000 --- a/http/htdocs/pulse.htm +++ /dev/null @@ -1,48 +0,0 @@ - - - - - Pulse Control - - - - - -

Pulse Control

-

FPGA

- -
- - - - -
- -
-

Row Divider:

-

Col Divider:

-

-

-

-

-
- -
-

Row Divider:

-

Row

-
- -
-

Row

-

Col

-
- -
-

-
- - - - diff --git a/http/htdocs/pulse.js b/http/htdocs/pulse.js deleted file mode 100644 index 064b07e..0000000 --- a/http/htdocs/pulse.js +++ /dev/null @@ -1,60 +0,0 @@ - -function send_reg(reg) { - colDiv = document.getElementById("region_col_divider_input").value; - rowDiv = document.getElementById("region_row_divider_input").value; - fpga = document.getElementById("fpga").value; - - var url = "pulse_region.pl?"; - url += "-" + fpga; - url += "-" + colDiv; - url += "-" + rowDiv; - url += "-" + reg; - - getData(url); -} - -function send_line(row) {} - -function send_pix(row,col) {} - -function getData(command,dId,callback) { - - var xmlhttp = null; - var cb = null; - xmlhttp=new XMLHttpRequest(); - cb = callback; - var destId = dId; - var cmd = command; - - xmlhttp.onreadystatechange = function() { - if(xmlhttp.readyState == 4) { - if(destId && document.getElementById(destId)){ - document.getElementById(destId).innerHTML = xmlhttp.responseText; - } - if(cb) { - cb(xmlhttp.responseText); - } - } - } - - xmlhttp.open("GET",command,1); - xmlhttp.send(null); -} - -function opentab(evt, name) { - - var i, tabcontent, tablinks; - - tabcontent = document.getElementsByClassName("tabcontent"); - for (i = 0; i < tabcontent.length; i++) { - tabcontent[i].style.display = "none"; - } - - tablinks = document.getElementsByClassName("tablinks"); - for (i = 0; i < tablinks.length; i++) { - tablinks[i].className = tablinks[i].className.replace(" active", ""); - } - - document.getElementById(name).style.display = "block"; - evt.currentTarget.className += " active"; -} diff --git a/http/htdocs/pulse_region.pl b/http/htdocs/pulse_region.pl deleted file mode 100644 index b8c4bb3..0000000 --- a/http/htdocs/pulse_region.pl +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/perl - -use warnings; -no warnings "portable"; -use URI::Escape; - - -eval{ - htsponse(200,"OK"); - print "Content-type: text/html\r\n\r\n"; -# print "Location: index.html\r\n\r\n"; - }; - - -my ($fpga,$colDiv,$rowDiv,$region) = split('-',$ENV{'QUERY_STRING'}); - - -if(!defined $region) {exit 1;} -system("cd ../scripts/sensor_check; ./inject.pl --fpga $fpga --coldiv $colDiv --rowdiv $rowDiv --region $region"); -exit 1; diff --git a/http/htdocs/setreg.htm b/http/htdocs/setreg.htm index 44783e9..c74dba0 100644 --- a/http/htdocs/setreg.htm +++ b/http/htdocs/setreg.htm @@ -31,39 +31,9 @@ document.getElementById(reg+"txt").innerHTML = value; - if(reg == "VPH" || reg == "VPL") - { - vpl = document.getElementById("VPL").value - vph = document.getElementById("VPH").value - diff = vph - vpl; - mean = diff%2 == 0 ? parseInt(vpl) + diff/2 : parseInt(vpl) + (diff-1)/2; - document.getElementById("DIFFtxt").innerHTML = diff; - document.getElementById("MEANtxt").innerHTML = mean; - document.getElementById("DIFF").value = diff; - document.getElementById("MEAN").value = mean; - } - getData(url); } - - function send_diff() - { - - diff = document.getElementById("DIFF").value; - mean = document.getElementById("MEAN").value; - - vph = diff%2 == 0 ? parseInt(mean) + diff/2 : parseInt(mean) + (diff-1)/2; - vpl = diff%2 == 0 ? parseInt(mean) - diff/2 : parseInt(mean) - (diff+1)/2; - - document.getElementById("VPL").value = vpl; - document.getElementById("VPH").value = vph; - - send("VPH"); - send("VPL"); - } - - function getData(command,dId,callback) { var xmlhttp = null; @@ -94,7 +64,9 @@

DAC Control

FPGA   - Download + + Download +
VCASP
VCASNA
@@ -112,8 +84,6 @@
VRESET
VCLIP

-
DIFF
-
MEAN
@@ -121,9 +91,10 @@ loadvalues(); function loadvalues() { - document.getElementById("DownloadLink").href="getdacfile.pl?"+document.getElementById("fpga").value; + // document.getElementById("DownloadLink").href="getdacfile.pl?"+document.getElementById("fpga").value; getData("getdac.pl?"+document.getElementById("fpga").value,"",showDacs); } + function setfilename() { document.getElementById("DownloadLink").download=document.getElementById("filename").value; } @@ -145,10 +116,6 @@ document.getElementById("VCASNtxt").innerHTML = vals[12]; document.getElementById("VCLIPtxt").innerHTML = vals[13]; document.getElementById("IBUFBIAStxt").innerHTML = vals[14]; - diff = vals[5] - vals[4]; - mean = parseInt(vals[4]) + diff/2; - document.getElementById("DIFFtxt").innerHTML = diff; - document.getElementById("MEANtxt").innerHTML = mean; document.getElementById("IBIAS").value = vals[0]; document.getElementById("ITHR").value = vals[1]; @@ -165,11 +132,26 @@ document.getElementById("VCASN").value = vals[12]; document.getElementById("VCLIP").value = vals[13]; document.getElementById("IBUFBIAS").value = vals[14]; - - document.getElementById("DIFF").value = diff - document.getElementById("MEAN").value = mean; } - - + function set_href() { + document.getElementById("DownloadLink").href="data:application/octet-stream;charset=utf-8;base64," + + btoa("[ 0x40, 0x" + ("00" + parseInt(document.getElementById("IBIAS").value).toString(16)).slice(-2) + " ], #IBIAS 0 - 80 nA , 312 pA Pixel current \n" + + "[ 0x41, 0x" + ("00" + parseInt(document.getElementById("ITHR").value).toString(16)).slice(-2) + " ], #ITHR 0 - 2.5 nA , 9.8 pA Pixel current \n" + + "[ 0x42, 0x" + ("00" + parseInt(document.getElementById("IDB").value).toString(16)).slice(-2) + " ], #IDB 0 - 40 nA , 157 pA Pixel current \n" + + "[ 0x43, 0x" + ("00" + parseInt(document.getElementById("VRESET").value).toString(16)).slice(-2) + " ], #VRESET 0.37 - 1.79 V , 6 mV Pixel input amplifier reset voltage \n" + + "[ 0x44, 0x" + ("00" + parseInt(document.getElementById("VPL").value).toString(16)).slice(-2) + " ], #VPL 0.37 - 1.79 V , 6 mV Pixel voltage for charge injection (low value) \n" + + "[ 0x45, 0x" + ("00" + parseInt(document.getElementById("VPH").value).toString(16)).slice(-2) + " ], #VPH 0.37 - 1.79 V , 6 mV Pixel voltage for charge injection (high \n" + + "[ 0x46, 0x" + ("00" + parseInt(document.getElementById("VPH_FINE").value).toString(16)).slice(-2) + " ], #VPH_FINE 0 - 256 mV , 1 mV value) VPH+VPH_FINE \n" + + "[ 0x47, 0x" + ("00" + parseInt(document.getElementById("VCASP").value).toString(16)).slice(-2) + " ], #VCASP 0 - 1.54 V , 6 mV Pixel voltage \n" + + "[ 0x48, 0x" + ("00" + parseInt(document.getElementById("VCASA").value).toString(16)).slice(-2) + " ], #VCASNA 0 - 1.54 V , 6 mV Pixel threshold voltage for submatrix A \n" + + "[ 0x49, 0x" + ("00" + parseInt(document.getElementById("VCASB").value).toString(16)).slice(-2) + " ], #VCASNB 0 - 1.54 V , 6 mV Pixel threshold voltage for submatrix B \n" + + "[ 0x4a, 0x" + ("00" + parseInt(document.getElementById("VCASC").value).toString(16)).slice(-2) + " ], #VCASNC 0 - 1.54 V , 6 mV Pixel threshold voltage for submatrix C \n" + + "[ 0x4b, 0x" + ("00" + parseInt(document.getElementById("VCASD").value).toString(16)).slice(-2) + " ], #VCASND 0 - 1.54 V , 6 mV Pixel threshold voltage for submatrix D \n" + + "[ 0x4c, 0x" + ("00" + parseInt(document.getElementById("VCASN").value).toString(16)).slice(-2) + " ], #VCASN2 0 - 1.54 V , 6 mV Pixel voltage \n" + + "[ 0x4d, 0x" + ("00" + parseInt(document.getElementById("VCLIP").value).toString(16)).slice(-2) + " ], #VCLIP 0 - 1.54 V , 6 mV Pixel clipping amplifier voltage \n" + + "[ 0x4e, 0x" + ("00" + parseInt(document.getElementById("IBUFBIAS").value).toString(16)).slice(-2) + " ], #IBUFBIAS 0 - 10 μA , 312 pA Internal buffer bias (not in pixel) "); + } + + diff --git a/http/htdocs/test.pl b/http/htdocs/test.pl new file mode 100755 index 0000000..370faa4 --- /dev/null +++ b/http/htdocs/test.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w +use URI::Escape; +#use lib '../scripts/'; +use Mimosis; +use Data::Dumper; +use HADES::TrbNet; + +trb_init_ports() or die trb_strerror(); + +my $fpga = 0xa000; + +Mimosis::set_fpga( $fpga ); +Mimosis::set_singleAccess(1); + + +my $val; + +for my $i (0x40 .. 0x4e) { + $val = Mimosis::mimosis_register_read( $i ); #single access mode as default + printf(STDERR "%x $val\n", $i); + $val &= 0xff; + print $val."-"; +} diff --git a/http/start.sh b/http/start.sh index 19c14f1..07d4c73 100755 --- a/http/start.sh +++ b/http/start.sh @@ -9,7 +9,10 @@ elif [[ -z "$DAQOPSERVER" ]]; then elif [[ "$DAQOPSERVER" == "jspc29:150" ]]; then echo "start http server for Lab317." ./httpi localhost 3333 -elif [[ "$DAQOPSERVER" == "jspc29:31" ]]; then +elif [[ "$DAQOPSERVER" == "jspc29:7" ]]; then + echo "start http server for Lab318." + ./httpi localhost 3332 +elif [[ "$DAQOPSERVER" == "jspc29:109" ]]; then echo "start http server for Probestation." ./httpi localhost 3331 else -- 2.43.0