From 5484e1ab7e9fdddaa3ae1b140a56aa232784b65f Mon Sep 17 00:00:00 2001 From: Michael Wiebusch Date: Mon, 13 May 2013 15:49:53 +0200 Subject: [PATCH] added Raspberry Pi Slow Control Suite v0.1 including support for controlling a Huber cooling device, reading onewire temperature sensors and controlling a GW Instek power supply --- RasPi_slow_control_suite/README.txt | 50 ++++++ .../www/tools/cooling/.pwr.htm.swp | Bin 0 -> 12288 bytes .../www/tools/cooling/build_index.pl | 28 ++++ .../www/tools/cooling/cooling.conf | 2 + .../www/tools/cooling/cooling.htm | 125 ++++++++++++++ .../www/tools/cooling/cooling.pl | 133 +++++++++++++++ .../www/tools/cooling/index.html | 71 ++++++++ .../www/tools/cooling/read_conf.pl | 20 +++ .../www/tools/cooling/save_conf.pl | 19 +++ .../www/tools/cooling/scripts.js | 43 +++++ .../www/tools/cooling/styles.css | 48 ++++++ .../www/tools/cooling/test.pl | 3 + .../www/tools/cooling/testi.pl | 12 ++ .../voltage_readout.pl_bak12.10.25_17:59:26 | 136 +++++++++++++++ .../www/tools/onewire/chiptemp.htm | 130 ++++++++++++++ .../www/tools/onewire/config.conf | 14 ++ .../www/tools/onewire/delete_log.pl | 14 ++ .../www/tools/onewire/index.html | 71 ++++++++ .../www/tools/onewire/read_conf.pl | 19 +++ .../www/tools/onewire/save_conf.pl | 19 +++ .../www/tools/onewire/scripts.js | 43 +++++ .../www/tools/onewire/shm | 1 + .../www/tools/onewire/styles.css | 48 ++++++ .../www/tools/onewire/voltage_readout.pl | 140 ++++++++++++++++ .../www/tools/onewire/voltage_readout.pl_bak | 127 ++++++++++++++ .../www/tools/pwr/.pwr.pl.swp | Bin 0 -> 12288 bytes .../www/tools/pwr/build_index.pl | 28 ++++ .../www/tools/pwr/index.html | 71 ++++++++ .../www/tools/pwr/pwr.conf | 3 + .../www/tools/pwr/pwr.conf_out | 3 + .../www/tools/pwr/pwr.htm | 155 +++++++++++++++++ RasPi_slow_control_suite/www/tools/pwr/pwr.pl | 158 ++++++++++++++++++ .../www/tools/pwr/read_conf.pl | 20 +++ .../www/tools/pwr/save_conf.pl | 20 +++ .../www/tools/pwr/scripts.js | 43 +++++ .../www/tools/pwr/styles.css | 48 ++++++ 36 files changed, 1865 insertions(+) create mode 100644 RasPi_slow_control_suite/README.txt create mode 100644 RasPi_slow_control_suite/www/tools/cooling/.pwr.htm.swp create mode 100755 RasPi_slow_control_suite/www/tools/cooling/build_index.pl create mode 100644 RasPi_slow_control_suite/www/tools/cooling/cooling.conf create mode 100644 RasPi_slow_control_suite/www/tools/cooling/cooling.htm create mode 100755 RasPi_slow_control_suite/www/tools/cooling/cooling.pl create mode 100644 RasPi_slow_control_suite/www/tools/cooling/index.html create mode 100755 RasPi_slow_control_suite/www/tools/cooling/read_conf.pl create mode 100755 RasPi_slow_control_suite/www/tools/cooling/save_conf.pl create mode 100644 RasPi_slow_control_suite/www/tools/cooling/scripts.js create mode 100644 RasPi_slow_control_suite/www/tools/cooling/styles.css create mode 100755 RasPi_slow_control_suite/www/tools/cooling/test.pl create mode 100755 RasPi_slow_control_suite/www/tools/cooling/testi.pl create mode 100755 RasPi_slow_control_suite/www/tools/onewire/bak/voltage_readout.pl_bak12.10.25_17:59:26 create mode 100644 RasPi_slow_control_suite/www/tools/onewire/chiptemp.htm create mode 100644 RasPi_slow_control_suite/www/tools/onewire/config.conf create mode 100755 RasPi_slow_control_suite/www/tools/onewire/delete_log.pl create mode 100644 RasPi_slow_control_suite/www/tools/onewire/index.html create mode 100755 RasPi_slow_control_suite/www/tools/onewire/read_conf.pl create mode 100755 RasPi_slow_control_suite/www/tools/onewire/save_conf.pl create mode 100644 RasPi_slow_control_suite/www/tools/onewire/scripts.js create mode 120000 RasPi_slow_control_suite/www/tools/onewire/shm create mode 100644 RasPi_slow_control_suite/www/tools/onewire/styles.css create mode 100755 RasPi_slow_control_suite/www/tools/onewire/voltage_readout.pl create mode 100755 RasPi_slow_control_suite/www/tools/onewire/voltage_readout.pl_bak create mode 100644 RasPi_slow_control_suite/www/tools/pwr/.pwr.pl.swp create mode 100755 RasPi_slow_control_suite/www/tools/pwr/build_index.pl create mode 100644 RasPi_slow_control_suite/www/tools/pwr/index.html create mode 100644 RasPi_slow_control_suite/www/tools/pwr/pwr.conf create mode 100644 RasPi_slow_control_suite/www/tools/pwr/pwr.conf_out create mode 100644 RasPi_slow_control_suite/www/tools/pwr/pwr.htm create mode 100755 RasPi_slow_control_suite/www/tools/pwr/pwr.pl create mode 100755 RasPi_slow_control_suite/www/tools/pwr/read_conf.pl create mode 100755 RasPi_slow_control_suite/www/tools/pwr/save_conf.pl create mode 100644 RasPi_slow_control_suite/www/tools/pwr/scripts.js create mode 100644 RasPi_slow_control_suite/www/tools/pwr/styles.css diff --git a/RasPi_slow_control_suite/README.txt b/RasPi_slow_control_suite/README.txt new file mode 100644 index 0000000..f721324 --- /dev/null +++ b/RasPi_slow_control_suite/README.txt @@ -0,0 +1,50 @@ +Raspberry Pi slow control suite v0.1 +by Michael Wiebusch +mwiebusch@stud.uni-frankfurt.de + + +This package includes: + +"cooling" - a simple tool to control one or more Huber CC405 cooling devices that are connected via RS232 to the Raspberry Pi (e.g. via an RS232toUSB converter). + +"onewire" - a simple monitoring tool to display the output of several onewire temperature sensors that are read out by a MyAVR board with custom firmware by Jan Michel. + +"pwr" - a simple tool to monitor and control one or more laboratory power supplies of the type "GW Instek PSP-405" + + + +Installation: + +Step 1: + +Install an Apache2 webserver on your Raspberry Pi. + +Step 2: + +Configure the Apache thusly, that it executes perl scripts, especially outside of the "cgi-bin" directory. + +You can easily perform this task by adding the following lines to /etc/apache2/apache2.conf (/var/www/ be your default http root directory) + + +Options +ExecCGI +AddHandler cgi-script .cgi .pl + + +Step 3: + +Install the perl module "libdevice-serialport-perl". +It is necessary so perl can use serial devices in a comfortable way. +You can perform that by using the Raspbian package manager: + +"sudo apt-get install libdevice-serialport-perl" + +Step 4: + +Copy the contents of the "www"-directory included in this archive into the http root directory on your raspberry pi (default: /var/www/). + +Step 5: + +Point your browser to http://[IP of the raspberry]/tools/ +and use the tools. + +You can configure the monitoring/control tools (especially what serial device to use) on each webinterface. diff --git a/RasPi_slow_control_suite/www/tools/cooling/.pwr.htm.swp b/RasPi_slow_control_suite/www/tools/cooling/.pwr.htm.swp new file mode 100644 index 0000000000000000000000000000000000000000..692acb5e3ce2a901bd213f09eda15e7a11067f6e GIT binary patch literal 12288 zcmeI2Uu+yl9ml7kr5H$yC_+emnM@&fSKsZPZAu&a_DbS7t!bQ`;&V%}-DABwcenB0 z?q+uO{t(&{Ap}T8s(7oE0BZTCDlZ@!ium)uOW*kSfZ&1uAS5It#2exPzB7A&Y$uMv zZ=gNpW8cpF<~P6j&Tsylb6e#nmsjY+#vH-x9fYiW_D1dLzfX~CZziN;N3kkC=+#OB z$;CldggmDlny%n>C-Re)Yqq5uI*dkHxQ9s@_f8}|_M zIq(d45|ls@OoQJaCFFPDx8QZ~3U~n|K!8iY2Y-1xA%6sa0KW#m1it{Uf$QL_;49$E z;1%#PxCX9*7eE3ca1Z$T+X(qScpZEZd;z=!UId>3p9WXJWgx&M5P=W`;5;}13SbKS z>aB!)8{7b|ftSHY!CCMKFu?ubJ>UpDB4crUmc+y(9ge|-z;fdo&1 zHBbi@_{ZIZ{1ki(d=q>FTm@Ia^WZtq1}oqR@F6e*-VNRb?gRhCcQk$gJ_T05GI$(3 z28!S)_|08}dZw%eFxkC*MZ8ltKh&_#oP+rLA8P}igf%cshF`Nyhv6F zrRpEPJd$*HAdME6OFma`PYsscJZp2?^}T?zg5d=L7mwFh&QfYoRttMv(A6Z0`~hXt zxyn{GH|_Fn!*lUqswYO*oe+&2$z3YLu~p1P1D0d6O-2_;61leIbvxdM_n6CN^+lMj z?dO>jb~;JmIkxn|AYWj`)KtK{u%HM2EQUa-;4%>bb-5F|eC@*WV%Uko03*o@9w)wx z*Jm~j!6V;xc;4KYHd{r?C@a7TrQDDCPA`n9Qm;8`OD&5AiSHLs+O-8b(=HLK;4R)a zc%M7@o)@@b&+x-ERwL%NaN62`+6I@#t{~Gfe}# z!|{t*`SoXxKd|{=K}V)b;R=U1vCTu*`^^MI@`6feWmq{}T93>~k zeAjFNFHrl`;2hrMmCpin-KA=fbXKKMn&^a~G_6&SX%&Lbm2)cI9hSYe=X07LmKi<| zTCzvI(`MIRC#RUQ$ha1`MN4N;%No{fDOa(jzX&WkE z?7)qON}m+M9^~O<3S&i%+4-FMhE(J~nwuVH;_=+{&Zfr2&SE0KhEPxg6|yAp5%ro1d2R+=;c7^zDpTj7IPtNymu)p zO@_&S?7wPU7%sUT^OFuTuUx7L-a92ml*H{kTUx5AG#t-rYh7Hc6{B4>+;a$zt za&Lsq=Iz@o-J%V)k$s~ZrjJS(m6pRtwI)|<*uusch`lM{#krB4euPzIiCQ~n<_0+m9E;yt~C2kCa$|*l66xxh)VMG+(u-#I1ZTS zvVyi6?w0$Q!H4JIp0J>8ckZTWppLxpMyz_A?1riRBnKMsw5TstVkCN+K(eUu;!|jwxA~Lbld%F z-D<@PqC`?Th!DkAB4rpb8U~BL=WJUHmz4&@Wa)J2XT+zvvVCNY#e~;tOIEG(PQ-C* zNd%{>Tt+xzB&>FOm%J|-^<0bTZKBKc5pS_>=u3z&?nL*X#;g_44G@Ra`#VLkYE5ki zN4&+9TB@UwW_UMIZqj~yKG2@$%C^Pk%4G&$X9xe0m+pbpX zr>O{gTIE?9%YmrlSuVl9#_J^lcAuv?a-0;)NH(ZV&Nbo^<6(U zF2-z_#463qo$G1xfuMrx{x)q3-b6z+cd_BbXehWpDrj>KUDD;CJt+gVl5mZ*XPMCdV!<5my+9fQ;u`b8&5YMsG=NIcw*Om|yoYmG&on2m}tYn%` w%`KYdY2@jL^#__6qfFJc(~+jRbPgX1Ztk#tA?)) { + + if( $i =~ /^HUBERDEV:([^:]+):([^:]+)/g ) { + my $ser_dev=$1; + my $dev_id=$2; + +print < + +

+EOF + } +} + +#print "CWD: ".$pwd."
(for debug)\n"; + + +return true; diff --git a/RasPi_slow_control_suite/www/tools/cooling/cooling.conf b/RasPi_slow_control_suite/www/tools/cooling/cooling.conf new file mode 100644 index 0000000..953ebae --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/cooling/cooling.conf @@ -0,0 +1,2 @@ +//HUBERDEV:/path/to/device:Device_ID +HUBERDEV:/dev/ttyUSB3:HUBER_DUTY diff --git a/RasPi_slow_control_suite/www/tools/cooling/cooling.htm b/RasPi_slow_control_suite/www/tools/cooling/cooling.htm new file mode 100644 index 0000000..726fe3e --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/cooling/cooling.htm @@ -0,0 +1,125 @@ + + + + + + +Power Supply Monitor and Access + + + + +

HUBER Cooling System Control

+ + + + + + + + + + + + + + + + +
Readings: Settings:
+ + +
+
+ +
+ + + + +
Temperature Setpoint + +

+

+ +
+
+ +
+ + + + + + diff --git a/RasPi_slow_control_suite/www/tools/cooling/cooling.pl b/RasPi_slow_control_suite/www/tools/cooling/cooling.pl new file mode 100755 index 0000000..b404313 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/cooling/cooling.pl @@ -0,0 +1,133 @@ +#!/usr/bin/perl +print "Content-type: text/html\n\n"; + +use strict; +use warnings; +use Device::SerialPort; +use Time::HiRes; +use feature 'state'; + +my $envstring = $ENV{'QUERY_STRING'}; +$envstring =~ s/%20/ /g; + + +my @new_command = split('&',$envstring); +my $ser_dev = shift(@new_command); + + + +my $port = new Device::SerialPort($ser_dev); +unless ($port) +{ + print "can't open serial interface $ser_dev\n"; + exit; +} + +$port->user_msg('ON'); +$port->baudrate(9600); +$port->parity("none"); +$port->databits(8); +$port->stopbits(1); +$port->handshake("xoff"); +$port->write_settings; + +# debug output +#print "attempting to communicate with power supply connected to interface:\n$ser_dev\n\n"; + + +transmit_command(); #if new command, send it! +receive_answer(); # always called +Time::HiRes::sleep(1); +#transmit_command(); # send relais off in case current maximum is reached! + + + + + + + + + + + + + + + + +sub transmit_command { + +$port->lookclear; + +while ( my $command = shift(@new_command) ) { + + $port->write("$command\r\n"); + print "i sent the command: $command
"; + print "\n\nokay.\n
"; + Time::HiRes::sleep(.1); + } +} + + + + +sub receive_answer { + + + + + my %state_lookup = ( + 0 => 'off', + 1 => 'on' ); + + my $found = 0; + + + + # clear buffers, then send the "list"-command to the power supply + #$port->lookclear; + $port->write("IN_SP_00\r\n"); + $port->write("TI?\r\n"); + # sleep a second to give the supply time to react + #sleep 1; + Time::HiRes::sleep(.1); + + # read what has accumulated in the serial buffer + for (my $i = 0; ($i<200) && ($found < 2);$i++) { + while(my $a = $port->lookfor) { + #print $a."
\n"; # debug output + if ( $a =~ m/^TI (.+)/ ) { + my $value = $1/100; + print "Internal Sensor: $value °C
\n"; + $found++; + } + if ( $a =~ m/^(.[\d]+\.[\d]+)/) { + print "Set Point: $1 °C
\n"; + $found++; + } + Time::HiRes::sleep(.01); + } + + } + + + + + if($found) { + + print "connection ok
"; + } else { + print "!!! cooling device not responding !!!
"; + } + + print " \n"; + + + + + + + +} + +exit 1; diff --git a/RasPi_slow_control_suite/www/tools/cooling/index.html b/RasPi_slow_control_suite/www/tools/cooling/index.html new file mode 100644 index 0000000..05a87c4 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/cooling/index.html @@ -0,0 +1,71 @@ + + + + + + Huber Remote + + + + + +

+Platzhalter +

+ + + +

+Feel free to alter the config file to accommodate your needs!
+Please don't use the # character to comment out lines
+ +
+ + + + + +

+ + + + + + + + + + + + + diff --git a/RasPi_slow_control_suite/www/tools/cooling/read_conf.pl b/RasPi_slow_control_suite/www/tools/cooling/read_conf.pl new file mode 100755 index 0000000..054090a --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/cooling/read_conf.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl -w +print "Content-type: text/html\n\n"; + +use Cwd; + +my $pwd = &Cwd::cwd(); + + +open(LESEN,"cooling.conf") + or print "Fehler beim oeffnen von : $!\n"; + +while(defined(my $i = )) { + +print $i; + + } + + + +return true; diff --git a/RasPi_slow_control_suite/www/tools/cooling/save_conf.pl b/RasPi_slow_control_suite/www/tools/cooling/save_conf.pl new file mode 100755 index 0000000..0b979ac --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/cooling/save_conf.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl +print "Content-type: text/html\n\n"; + +my $envstring = $ENV{'QUERY_STRING'}; +$envstring =~ s/%20/ /g; +$envstring =~ s/&/\n/g; +##$envstring =~ s/&/\n/g; + + +open(SCHREIBEN,">cooling.conf") + or print "Fehler beim oeffnen von : $!\n"; + +print SCHREIBEN $envstring; +close(SCHREIBEN); + +print "saved!"; + + +return true; diff --git a/RasPi_slow_control_suite/www/tools/cooling/scripts.js b/RasPi_slow_control_suite/www/tools/cooling/scripts.js new file mode 100644 index 0000000..930d429 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/cooling/scripts.js @@ -0,0 +1,43 @@ + + +function getdata(command,callback) { + var xmlhttp = null; + var cb = null; + xmlhttp=new XMLHttpRequest(); + cb = callback; + + xmlhttp.onreadystatechange = function() { + if(xmlhttp.readyState == 4) { + if(cb) + cb(xmlhttp.responseText); + } + } + xmlhttp.open("GET",command,true); + xmlhttp.send(null); + } + + + +// function reload() { +// xmlhttp=new XMLHttpRequest(); +// xmlhttp.onreadystatechange = function() { +// if(xmlhttp.readyState == 4) { +// document.getElementById("content").innerHTML=xmlhttp.responseText; +// if(document.getElementById('logbox')) { +// if(saveScrollTop) { +// document.getElementById('logbox').scrollTop = saveScrollTop; +// } +// } +// +// document.getElementById("stop").style.background="#444"; +// reloadevery = setTimeout('reload()',$.($delay*1000).qq$); +// } +// }; +// if(document.getElementById('logbox')) { +// saveScrollTop = document.getElementById('logbox').scrollTop; +// if (saveScrollTop == 0) {saveScrollTop = 0.1;} +// } +// xmlhttp.open("GET","get.cgi?$.$ENV{'QUERY_STRING'}.qq$",true); +// xmlhttp.send(null); +// document.getElementById("stop").style.background="#111"; +// } \ No newline at end of file diff --git a/RasPi_slow_control_suite/www/tools/cooling/styles.css b/RasPi_slow_control_suite/www/tools/cooling/styles.css new file mode 100644 index 0000000..db44aa0 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/cooling/styles.css @@ -0,0 +1,48 @@ +body { + background:#def; +} + + +table#content, table#contentregs { + border:1px solid #aaa; + border-collapse:collapse; +} + + +table#content td, table#content th, table#contentregs td, table#contentregs th{ + border:1px solid #aaa; + width:100px; + text-align:right; + padding-right:15px; +} + +table#content, table#contentregs { + border:1px solid #aaa; +} + + +div#bar1 { + width:900px; + overflow-x:scroll; + } + +div#bar1 div { + width:66500px; + height:0px; +} + +div#bar2 { + width:900px; + overflow-x:scroll; + } + +div#bar2 div { + width:65536px; + height:0px; +} + + +#total { + text-align:center; + font-weight:bold; + } \ No newline at end of file diff --git a/RasPi_slow_control_suite/www/tools/cooling/test.pl b/RasPi_slow_control_suite/www/tools/cooling/test.pl new file mode 100755 index 0000000..5e8ec31 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/cooling/test.pl @@ -0,0 +1,3 @@ +#!/usr/bin/perl +print "Content-type: text/html\n\n"; +print "Hello, World."; diff --git a/RasPi_slow_control_suite/www/tools/cooling/testi.pl b/RasPi_slow_control_suite/www/tools/cooling/testi.pl new file mode 100755 index 0000000..bb6c092 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/cooling/testi.pl @@ -0,0 +1,12 @@ +#!/usr/bin/perl -w + +my $envstring = $ENV{'QUERY_STRING'}; +$envstring =~ s/%20/ /g; + +my @argum = split('-',$envstring); + +for (@argum) { +print "$_\n"; +} +sleep 1; +#print "fertig!!!\n"; diff --git a/RasPi_slow_control_suite/www/tools/onewire/bak/voltage_readout.pl_bak12.10.25_17:59:26 b/RasPi_slow_control_suite/www/tools/onewire/bak/voltage_readout.pl_bak12.10.25_17:59:26 new file mode 100755 index 0000000..8789972 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/onewire/bak/voltage_readout.pl_bak12.10.25_17:59:26 @@ -0,0 +1,136 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; +use Device::SerialPort; +use feature 'state'; + + + + + + + + +sub adc2mV { + my $adc = $_[0]; + my $voltage = ($adc -(-0.904714))/0.936225; + return $voltage; +} + + + +#default device +my $ser_dev = "/dev/ttyUSB0"; + + + +# read config file + +open(LESEN,"htdocs/chiptemp/config.conf") + or die "Fehler beim oeffnen von : $!\n"; + +while(defined(my $i = )) { + + if( $i =~ /^SER_DEV=([^=]+)/g ) { + $ser_dev=$1; + $ser_dev =~ s/\n//g; + $ser_dev =~ s/\r//g; + } + +} + + + + + + + + + + + + + + + + + + + +my $port = new Device::SerialPort($ser_dev); +unless ($port) +{ + print "can't open serial interface $ser_dev\n"; + exit; +} + +$port->user_msg('ON'); +$port->baudrate(19200); +$port->parity("none"); +$port->databits(8); +$port->stopbits(1); +$port->handshake("xoff"); +$port->write_settings; + + + +my $nmax = 10; +my $n = 0; +my @data; + + + + + + # clear buffers, then send the "list"-command to the power supply + $port->lookclear; + + # read what has accumulated in the serial buffer + +while ($n < $nmax) { + sleep 1; + while(my $a = $port->lookfor) { + #print $a."\n"; # debug output + if ($a =~ m/(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t(\d\d\d\d)\t/) { + push(@data,[$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16]); + $n++; + #print $data[0]->[0]."\n"; + if($n == $nmax) { + last; + } + + } + } +} + +#print $data[9]->[15]."\n"; + +my @mean; +for (my $j=0; $j<$nmax;$j++){ + for (my $i=0; $i<16;$i++) { + $mean[$i] += $data[$j]->[$i]; + } +} + +for my $j (0..15) { + $mean[$j] = sprintf("%6.1f mV",adc2mV($mean[$j]/$nmax)); +} + + +#$mean = $mean/$nmax; +#my $voltage=adc2mV($mean); +#print $mean."\n"; +#printf("this corresponds to %6.1f mV\n",$voltage); + +print join("\n",@mean); + + +#open(SCHREIBEN,">> calib_data.dat") +# or die "Fehler beim oeffnen von file: $!\n"; +# +#print SCHREIBEN $ARGV[0]."\t".$mean."\n"; + + + + diff --git a/RasPi_slow_control_suite/www/tools/onewire/chiptemp.htm b/RasPi_slow_control_suite/www/tools/onewire/chiptemp.htm new file mode 100644 index 0000000..4593a79 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/onewire/chiptemp.htm @@ -0,0 +1,130 @@ + + + + + + +One Wire Temperature Sensors + + + + +

One Wire Temperature Sensors

+ + + + + + + + + + + + + + +
Readings:
+ +
+
+ + + + + + diff --git a/RasPi_slow_control_suite/www/tools/onewire/config.conf b/RasPi_slow_control_suite/www/tools/onewire/config.conf new file mode 100644 index 0000000..b011460 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/onewire/config.conf @@ -0,0 +1,14 @@ +//define serial interface here +//example: +//SER_DEV=/dev/ttyUSB0 + +SER_DEV=/dev/ttyUSB2 + +//you can define sensor renaming rules here +//example: +//ID:284CFD41030000D7=Lieblingssensor +//ID:284CFD41030000D7=kleiner Tobi +ID:284EFC4103000074=Prototyp_heat_sink +ID:281B28E20200007A=Cleanroom_air +ID:28CF43E202000003=Plane_f +ID:284037E2020000BF=Plane_e \ No newline at end of file diff --git a/RasPi_slow_control_suite/www/tools/onewire/delete_log.pl b/RasPi_slow_control_suite/www/tools/onewire/delete_log.pl new file mode 100755 index 0000000..2c3ed0a --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/onewire/delete_log.pl @@ -0,0 +1,14 @@ +#!/usr/bin/perl + +print "content-type: text/html \n\n"; #The header +$file = "shm/onewirelog.txt"; +if (unlink($file) == 1) { + print "File deleted successfully."; +} else { + print "File was not deleted."; +} + + + + +return true; diff --git a/RasPi_slow_control_suite/www/tools/onewire/index.html b/RasPi_slow_control_suite/www/tools/onewire/index.html new file mode 100644 index 0000000..c0613d9 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/onewire/index.html @@ -0,0 +1,71 @@ + + + + + + One Wire Temperature Sensors + + + + + +

+ +

+ + + +

+Feel free to alter the config file to accommodate your needs!
+Please don't use the # character to comment out lines
+ +
+ + +

+Download Logfile
+ + + + +

+ + + + + + + + + + + + + diff --git a/RasPi_slow_control_suite/www/tools/onewire/read_conf.pl b/RasPi_slow_control_suite/www/tools/onewire/read_conf.pl new file mode 100755 index 0000000..9e2c2bd --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/onewire/read_conf.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl -w +print "Content-type: text/html\n\n"; +use Cwd; + +my $pwd = &Cwd::cwd(); + + +open(LESEN,"config.conf") + or print "Fehler beim oeffnen von : $!\n"; + +while(defined(my $i = )) { + +print $i; + + } + + + +return true; diff --git a/RasPi_slow_control_suite/www/tools/onewire/save_conf.pl b/RasPi_slow_control_suite/www/tools/onewire/save_conf.pl new file mode 100755 index 0000000..d405d79 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/onewire/save_conf.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl -w +print "Content-type: text/html\n\n"; + +my $envstring = $ENV{'QUERY_STRING'}; +$envstring =~ s/%20/ /g; +$envstring =~ s/&/\n/g; +##$envstring =~ s/&/\n/g; + + +open(SCHREIBEN,">config.conf") + or print "Fehler beim oeffnen von : $!\n"; + +print SCHREIBEN $envstring; +close(SCHREIBEN); + +print "saved!"; + + +return true; diff --git a/RasPi_slow_control_suite/www/tools/onewire/scripts.js b/RasPi_slow_control_suite/www/tools/onewire/scripts.js new file mode 100644 index 0000000..930d429 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/onewire/scripts.js @@ -0,0 +1,43 @@ + + +function getdata(command,callback) { + var xmlhttp = null; + var cb = null; + xmlhttp=new XMLHttpRequest(); + cb = callback; + + xmlhttp.onreadystatechange = function() { + if(xmlhttp.readyState == 4) { + if(cb) + cb(xmlhttp.responseText); + } + } + xmlhttp.open("GET",command,true); + xmlhttp.send(null); + } + + + +// function reload() { +// xmlhttp=new XMLHttpRequest(); +// xmlhttp.onreadystatechange = function() { +// if(xmlhttp.readyState == 4) { +// document.getElementById("content").innerHTML=xmlhttp.responseText; +// if(document.getElementById('logbox')) { +// if(saveScrollTop) { +// document.getElementById('logbox').scrollTop = saveScrollTop; +// } +// } +// +// document.getElementById("stop").style.background="#444"; +// reloadevery = setTimeout('reload()',$.($delay*1000).qq$); +// } +// }; +// if(document.getElementById('logbox')) { +// saveScrollTop = document.getElementById('logbox').scrollTop; +// if (saveScrollTop == 0) {saveScrollTop = 0.1;} +// } +// xmlhttp.open("GET","get.cgi?$.$ENV{'QUERY_STRING'}.qq$",true); +// xmlhttp.send(null); +// document.getElementById("stop").style.background="#111"; +// } \ No newline at end of file diff --git a/RasPi_slow_control_suite/www/tools/onewire/shm b/RasPi_slow_control_suite/www/tools/onewire/shm new file mode 120000 index 0000000..0d99fd7 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/onewire/shm @@ -0,0 +1 @@ +/dev/shm \ No newline at end of file diff --git a/RasPi_slow_control_suite/www/tools/onewire/styles.css b/RasPi_slow_control_suite/www/tools/onewire/styles.css new file mode 100644 index 0000000..db44aa0 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/onewire/styles.css @@ -0,0 +1,48 @@ +body { + background:#def; +} + + +table#content, table#contentregs { + border:1px solid #aaa; + border-collapse:collapse; +} + + +table#content td, table#content th, table#contentregs td, table#contentregs th{ + border:1px solid #aaa; + width:100px; + text-align:right; + padding-right:15px; +} + +table#content, table#contentregs { + border:1px solid #aaa; +} + + +div#bar1 { + width:900px; + overflow-x:scroll; + } + +div#bar1 div { + width:66500px; + height:0px; +} + +div#bar2 { + width:900px; + overflow-x:scroll; + } + +div#bar2 div { + width:65536px; + height:0px; +} + + +#total { + text-align:center; + font-weight:bold; + } \ No newline at end of file diff --git a/RasPi_slow_control_suite/www/tools/onewire/voltage_readout.pl b/RasPi_slow_control_suite/www/tools/onewire/voltage_readout.pl new file mode 100755 index 0000000..532dd62 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/onewire/voltage_readout.pl @@ -0,0 +1,140 @@ +#!/usr/bin/perl -w +print "Content-type: text/html\n\n"; + +use strict; +use warnings; +use Device::SerialPort; +use feature 'state'; + + + + + + + +my %idhash; + + +#default device +my $ser_dev = "/dev/ttyUSB0"; +my $logfile = "onewirelog.txt"; + + +# read config file + +open(LESEN,"config.conf") + or die "Fehler beim oeffnen von : $!\n"; + +while(defined(my $i = )) { + + if( $i =~ /^SER_DEV=([^=]+)/g ) { + $ser_dev=$1; + $ser_dev =~ s/\n//g; + $ser_dev =~ s/\r//g; + } + + if( $i =~ /^(ID:[^=]+)=([^=]+)/g ) { + my $id = $1; + my $designator = $2; + $id =~ s/[\n\r\s]//g; + $designator =~ s/[\n\r\s]//g; + $idhash{$id} = $designator; + } + +} + + + +#### date and time + +my $seconds = (localtime)[0]; +my $date = sprintf "%02d.%02d.%02d",(localtime)[3],((localtime)[4] +1),((localtime)[5] -100); +my $hour = sprintf "%02d",(localtime)[2]; +my $now = sprintf "%02d.%02d.%02d %02d:%02d:%02d",(localtime)[3],((localtime)[4] +1),((localtime)[5] -100),(localtime)[2],(localtime)[1],(localtime)[0]; + + + + + +print "now: $now
\n"; + + + +my $port = new Device::SerialPort($ser_dev); +unless ($port) +{ + print "can't open serial interface $ser_dev\n"; + exit; +} + +$port->user_msg('ON'); +$port->baudrate(19200); +$port->parity("none"); +$port->databits(8); +$port->stopbits(1); +$port->handshake("xoff"); +$port->write_settings; + + + +my $nmax = 20; +my $n = 0; +my @data; +my $found = 0; + +my %reporthash; + + + # clear buffers, then send the "list"-command to the power supply + $port->lookclear; + + # read what has accumulated in the serial buffer + +while ($n < $nmax) { + sleep 1; + $n++; + while(my $a = $port->lookfor) { + $found = 1; + #print $a."\n"; # debug output + if ($a =~ /^(ID:[^T]+)T:\s+\S+\s+=\s+([-+\d.]+)/ ) { + + my $rawid = $1; + my $temp = $2; + my $id = $rawid; + $id =~ s/[\s\r\n]//g; + $temp =~ s/[\s\r\n]//g; + + + # print $id."\n".$temp."\n"; + + if(defined($idhash{$id})) { + # print "match!\n"; + $reporthash{$idhash{$id}} = $temp; + } else { + $reporthash{$rawid} = $temp; + } + + } + } +} + + +unless($found){ + print "!!! no data / no sensors ? !!!
\n"; +} + +open(SCHREIBEN,">> shm/$logfile") + or die "Fehler beim oeffnen von $ARGV[0].c: $!\n"; + while( my ($k, $v) = each %reporthash ) { + print "Sensor $k => $v °C\n"; + print SCHREIBEN "$now:\t$k\t$v Deg.C\n"; + } +close(SCHREIBEN); + + + +print "\n"; + + + + diff --git a/RasPi_slow_control_suite/www/tools/onewire/voltage_readout.pl_bak b/RasPi_slow_control_suite/www/tools/onewire/voltage_readout.pl_bak new file mode 100755 index 0000000..1768bd9 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/onewire/voltage_readout.pl_bak @@ -0,0 +1,127 @@ +#!/usr/bin/perl -w +print "Content-type: text/html\n\n"; + +use strict; +use warnings; +use Device::SerialPort; +use feature 'state'; + + + + + + + +my %idhash; + + +#default device +my $ser_dev = "/dev/ttyUSB0"; + + + +# read config file + +open(LESEN,"config.conf") + or die "Fehler beim oeffnen von : $!\n"; + +while(defined(my $i = )) { + + if( $i =~ /^SER_DEV=([^=]+)/g ) { + $ser_dev=$1; + $ser_dev =~ s/\n//g; + $ser_dev =~ s/\r//g; + } + + if( $i =~ /^(ID:[^=]+)=([^=]+)/g ) { + my $id = $1; + my $designator = $2; + $id =~ s/[\n\r\s]//g; + $designator =~ s/[\n\r\s]//g; + $idhash{$id} = $designator; + } + +} + + + + + + + + + + + +my $port = new Device::SerialPort($ser_dev); +unless ($port) +{ + print "can't open serial interface $ser_dev\n"; + exit; +} + +$port->user_msg('ON'); +$port->baudrate(19200); +$port->parity("none"); +$port->databits(8); +$port->stopbits(1); +$port->handshake("xoff"); +$port->write_settings; + + + +my $nmax = 2; +my $n = 0; +my @data; +my $found = 0; + +my %reporthash; + + + # clear buffers, then send the "list"-command to the power supply + $port->lookclear; + + # read what has accumulated in the serial buffer + +while ($n < $nmax) { + sleep 1; + $n++; + while(my $a = $port->lookfor) { + $found = 1; + #print $a."\n"; # debug output + if ($a =~ /^(ID:[^T]+)T:\s+\S+\s+=\s+([\d.]+)/ ) { + + my $rawid = $1; + my $temp = $2; + my $id = $rawid; + $id =~ s/[\s\r\n]//g; + $temp =~ s/[\s\r\n]//g; + + + # print $id."\n".$temp."\n"; + + if(defined($idhash{$id})) { + # print "match!\n"; + $reporthash{$idhash{$id}} = $temp; + } else { + $reporthash{$rawid} = $temp; + } + + } + } +} + + +unless($found){ + print "!!! no data / no sensors ? !!!
\n"; +} + + while( my ($k, $v) = each %reporthash ) { + print "Sensor $k => $v °C\n"; + } + +print "\n"; + + + + diff --git a/RasPi_slow_control_suite/www/tools/pwr/.pwr.pl.swp b/RasPi_slow_control_suite/www/tools/pwr/.pwr.pl.swp new file mode 100644 index 0000000000000000000000000000000000000000..f35773162d6806ccf47e3293c6fc7de90ba53a4f GIT binary patch literal 12288 zcmeI2ONZm9JlIX$I&dxeLI=eHoi-P-#Jba+?5ZE=CHItg|>X~+Xy4&vR z9X6ZAL_PR8850i@PvTwSV!Zk`AP5pY`9$ym-tc+Qe^qz0GXp}1CzBrX+nN5V>Z|Yj zSJhXuS!(6UjhpD|fgys|QbKM&^xD=d^VgA?wS+V+y}_jYBCj2r)(ow#T%;44cPodb z_3Ji0;MPip&so#6!@5yw2*cHblGpMj1D<_xUuln2fmDG@P#_d$|C%LaXs}Y2qk6MF zbosK0OK^~OO%+HLNEJvGNEJvGNEJvGNEJvG_`fS4yhY?mBym}s$e#FpQP+F?n7*Y7 zqza@8qza@8qza@8qza@8qza@8qza@8qze2G6<`J-YcD6{qs0gwfB#Q@|37^_A*aCC z;0Smdybkt)-GBoF=-@7}65I$@faT!Cb%cBlj)A@4Rj>!V0-geogKc08XkZEWbqOJ7 zzzOg?cn&-Z9tHT*CHduALQaEI;Aij?_!0a7PJ$EQdvF|l2fhX0fUm(<;7jlUcpvNs z`@l2cX~4lK$bp-{O0WVf2g|?>U@7?P8bbaAe}Lb?Z{Qnn6ub-G0sFx|@FsWzG{H`= z9xMe{fW_eG)#wLa1pVL^kO5~h@Cgopx4>TTJh&f>f(j^rzpujl;2?Mp>;W%<7r+GA z1Xh4+!53E&au|FFo(3~u16T+8!KYUc@-k?FCx8tapb8!XJHaHF06V~T@Gw{p)`1+j z8JxsEIu5=CpMfLbQ*am@0-u0`-~jj-$bEMVq_0$gRDu7ZzCl#?AH zc%CPj#MaZ(Lp`^}eHw(GXU|f{71ZZ}=Q@Vv)G69WYyP+#H&3}8a5}dzSa%(V>%wv! z>Q2+RAIVszmNVVZF$%J?3`5O`Sur$Yvp~RGMm@+#GO87CUKljAyB*%D>Ta{i9HW?h zaLa~lLG|v4SPy-lBPH8vS~6UwH@H!Z6LC$mJ#09Z0qIo?qT^J{+3M46v^;QEfg(iO zOEFxZrj|+n#W7j}w@5|kI}4Na$k^eUp7mXh5{9`5+l*@q`3|4*4gZs^h`A%Hia|cY z8s#@y60BzP@vQVZDh$eOtL}{XR=pv{-B5U;Ow?vpFuc%eb5o4dTx72Xf(cIH$QX~D z_+9UvPNQX45)RWoquc8vojy9pcIbrBm4QLC+riokIgm22I*(THeA7>Mj!shP45M#o zpmNT<7YrPc4xKaNf|2$Oo+r1i=+w%|fYnJeHMNMeIoq`~V>GAMsA{|Jbm+|mVJ#4T zV#G(BxFRhVEAu1jbVvu$fT)ea!D@9Hly9|rr0vdjo80EG-O+B7YD?p)1*6)K(l*p? ziw6(3+mgW*WsFWX2C7FK3@yj#*lyY^O=?pH{td{Vg|+fQeZ<2fQHwGZCe%Y=ohtPB-3hGHrJ$92!!T5*BAZcQeo5e zm4{wgAq?7TFhLtEpiI}pW@zKE7}Rp8XmA>E-(ohcg{H}U)T_Ye+*2v`(&#foAJjX8 z3YXTc86FLbYNoK7cy?7G5+oCc(DE(8wd_MvzA9mDf$279{s<)*R37;;o;N^+X>bP< z$!QQ(*0utX?T@RWoIzUK%e5-5GIdpNk$!mu(Pt`jY@Fs@C!bNpr5rt)X1+)==-t=8 z3o%HOZU}ZGGSE4at1>5$cfy=%K#`VpdO?$9Nw6MMjyug}2cnzhtlg412o-G{{4lCy zRMh2F(j`&S6e&g2f>KTG@g(;#8Z<0ZbX*UrdgH6+!ip!ts$7JREO0+0w@I9hN-6%) z-9;1|wT}LR9Q0>@iz=fPG7)i_xT*X0yO=C0ff*#n-G-(Qi>(wj~Xq7gj z!ElvHx~tZv`2ZR6(q^79A?+E9}-d>!F5ug-FQL>bRbB(k@d??g)~hsscN W=tz2dN@3uaYL-*-xNp<`7WoH2x00R! literal 0 HcmV?d00001 diff --git a/RasPi_slow_control_suite/www/tools/pwr/build_index.pl b/RasPi_slow_control_suite/www/tools/pwr/build_index.pl new file mode 100755 index 0000000..c6db061 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/pwr/build_index.pl @@ -0,0 +1,28 @@ +#!/usr/bin/perl -w +use Cwd; +print "Content-type: text/html\n\n"; + +my $pwd = &Cwd::cwd(); + + +open(LESEN,"pwr.conf") + or die "Fehler beim oeffnen von : $!\n"; + +while(defined(my $i = )) { + + if( $i =~ /^PWRSPLY:([^:]+):([^:]+)/g ) { + my $ser_dev=$1; + my $dev_id=$2; + +print < + +

+EOF + } +} + +#print "CWD: ".$pwd."
(for debug)\n"; + + +return true; diff --git a/RasPi_slow_control_suite/www/tools/pwr/index.html b/RasPi_slow_control_suite/www/tools/pwr/index.html new file mode 100644 index 0000000..5ed6b33 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/pwr/index.html @@ -0,0 +1,71 @@ + + + + + + Access all POWER! + + + + + +

+Platzhalter +

+ + + +

+Feel free to alter the config file to accommodate your needs!
+Please don't use the # character to comment out lines
+ +
+ + + + + +

+ + + + + + + + + + + + + diff --git a/RasPi_slow_control_suite/www/tools/pwr/pwr.conf b/RasPi_slow_control_suite/www/tools/pwr/pwr.conf new file mode 100644 index 0000000..96661f6 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/pwr/pwr.conf @@ -0,0 +1,3 @@ +//PWRSPLY:/path/to/device:Device_ID +PWRSPLY:/dev/ttyUSB1:PWR_DUT +PWRSPLY:/dev/ttyUSB0:PWR_REF \ No newline at end of file diff --git a/RasPi_slow_control_suite/www/tools/pwr/pwr.conf_out b/RasPi_slow_control_suite/www/tools/pwr/pwr.conf_out new file mode 100644 index 0000000..8f4bdb9 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/pwr/pwr.conf_out @@ -0,0 +1,3 @@ +PWRSPLY:/dev/ttyUSB0:Device_1 +PWRSPLY:/dev/ttyUSB1:Device_2 +PWRSPLY:/dev/ttyUSB2:Device_3 diff --git a/RasPi_slow_control_suite/www/tools/pwr/pwr.htm b/RasPi_slow_control_suite/www/tools/pwr/pwr.htm new file mode 100644 index 0000000..06c6698 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/pwr/pwr.htm @@ -0,0 +1,155 @@ + + + + + + +Power Supply Monitor and Access + + + + +

MIMOSA26 Prototype Power Supply Access

+ + + + + + + + + + + + + + + + +
Readings: Settings:
+ + +
+
+ +
+ + + + +
Voltage [V] + +

+
Voltage limit [V] + +
Current limit [A] + +
Power limit [W] + +
Save settings to EEPROM +

+ +
Output Relais +
+
+ +
+ + + + + + diff --git a/RasPi_slow_control_suite/www/tools/pwr/pwr.pl b/RasPi_slow_control_suite/www/tools/pwr/pwr.pl new file mode 100755 index 0000000..7ad6e8b --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/pwr/pwr.pl @@ -0,0 +1,158 @@ +#!/usr/bin/perl -w +print "Content-type: text/html\n\n"; + + +use strict; +use warnings; +use Device::SerialPort; +use feature 'state'; + +my $envstring = $ENV{'QUERY_STRING'}; +$envstring =~ s/%20/ /g; + + +my @new_command = split('&',$envstring); +my $ser_dev = shift(@new_command); +$ser_dev = "/dev/ttyUSB0" unless defined $ser_dev; + + + +my $port = new Device::SerialPort($ser_dev); +unless ($port) +{ + print "can't open serial interface $ser_dev\n"; + exit; +} + +$port->user_msg('ON'); +$port->baudrate(2400); +$port->parity("none"); +$port->databits(8); +$port->stopbits(1); +$port->handshake("xoff"); +$port->write_settings; + +# debug output +#print "attempting to communicate with power supply connected to interface:\n$ser_dev\n\n"; + + +transmit_command(); #if new command, send it! +receive_answer(); # always called +transmit_command(); # send relais off in case current maximum is reached! + + + + + + + + + + + + + + + + +sub transmit_command { + +$port->lookclear; + +while ( my $command = shift(@new_command) ) { + + $port->write("$command\r"); + #print "i sent the command: $command"; + #print "\n\nokay.\n"; + sleep 1; + } +} + + + + +sub receive_answer { + + + + + my %state_lookup = ( + 0 => 'off', + 1 => 'on' ); + + my $found = 0; + + + + # clear buffers, then send the "list"-command to the power supply + $port->lookclear; + $port->write("L\r"); + # sleep a second to give the supply time to react + sleep 1; + + # read what has accumulated in the serial buffer + while(my $a = $port->lookfor) { + #print $a."\n"; # debug output + if ($a =~ m/V(\d\d\.\d\d)A(\d\.\d\d\d)W(\d\d\d\.\d)U(\d\d)I(\d\.\d\d)P(\d\d\d)F(\d\d\d\d\d\d)/) { + $found = 1; + my $c_volt = $1; + my $c_cur = $2; + my $c_pwr = $3; + my $l_volt = $4; + my $l_cur = $5; + my $l_pwr = $6; + my $state_string = $7; + my $relais_state = $state_lookup{substr $state_string, 0,1}; + printf(" + + + + + + + + + + + +
%2.2f V +
%1.3f A +
%3.1f W +
voltage limit: %d V +
current limit: %1.2f A +
power limit: %d W +
output relais: $relais_state
" + ,$c_volt,$c_cur,$c_pwr,$l_volt,$l_cur,$l_pwr); + + if( $c_cur > 0) { + if($c_cur > ($l_cur * 0.9) ) { # check if current limit reached, if so, turn power off! + print "!!! current limit reached, power off !!!
"; + push(@new_command,"KOD"); + } + } + + last; + + } + } + + + + + if($found) { + + print "connection ok
"; + } else { + print "!!! power supply not responding !!!
"; + } + + print " \n"; + + + + + + + +} +exit 1; diff --git a/RasPi_slow_control_suite/www/tools/pwr/read_conf.pl b/RasPi_slow_control_suite/www/tools/pwr/read_conf.pl new file mode 100755 index 0000000..dab1f38 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/pwr/read_conf.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl -w +print "Content-type: text/html\n\n"; + +use Cwd; + +my $pwd = &Cwd::cwd(); + + +open(LESEN,"pwr.conf") + or print "Fehler beim oeffnen von : $!\n"; + +while(defined(my $i = )) { + +print $i; + + } + + + +return true; diff --git a/RasPi_slow_control_suite/www/tools/pwr/save_conf.pl b/RasPi_slow_control_suite/www/tools/pwr/save_conf.pl new file mode 100755 index 0000000..efb7af1 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/pwr/save_conf.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl -w +print "Content-type: text/html\n\n"; + + +my $envstring = $ENV{'QUERY_STRING'}; +$envstring =~ s/%20/ /g; +$envstring =~ s/&/\n/g; +##$envstring =~ s/&/\n/g; + + +open(SCHREIBEN,">pwr.conf") + or print "Fehler beim oeffnen von : $!\n"; + +print SCHREIBEN $envstring; +close(SCHREIBEN); + +print "saved!"; + + +return true; diff --git a/RasPi_slow_control_suite/www/tools/pwr/scripts.js b/RasPi_slow_control_suite/www/tools/pwr/scripts.js new file mode 100644 index 0000000..930d429 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/pwr/scripts.js @@ -0,0 +1,43 @@ + + +function getdata(command,callback) { + var xmlhttp = null; + var cb = null; + xmlhttp=new XMLHttpRequest(); + cb = callback; + + xmlhttp.onreadystatechange = function() { + if(xmlhttp.readyState == 4) { + if(cb) + cb(xmlhttp.responseText); + } + } + xmlhttp.open("GET",command,true); + xmlhttp.send(null); + } + + + +// function reload() { +// xmlhttp=new XMLHttpRequest(); +// xmlhttp.onreadystatechange = function() { +// if(xmlhttp.readyState == 4) { +// document.getElementById("content").innerHTML=xmlhttp.responseText; +// if(document.getElementById('logbox')) { +// if(saveScrollTop) { +// document.getElementById('logbox').scrollTop = saveScrollTop; +// } +// } +// +// document.getElementById("stop").style.background="#444"; +// reloadevery = setTimeout('reload()',$.($delay*1000).qq$); +// } +// }; +// if(document.getElementById('logbox')) { +// saveScrollTop = document.getElementById('logbox').scrollTop; +// if (saveScrollTop == 0) {saveScrollTop = 0.1;} +// } +// xmlhttp.open("GET","get.cgi?$.$ENV{'QUERY_STRING'}.qq$",true); +// xmlhttp.send(null); +// document.getElementById("stop").style.background="#111"; +// } \ No newline at end of file diff --git a/RasPi_slow_control_suite/www/tools/pwr/styles.css b/RasPi_slow_control_suite/www/tools/pwr/styles.css new file mode 100644 index 0000000..db44aa0 --- /dev/null +++ b/RasPi_slow_control_suite/www/tools/pwr/styles.css @@ -0,0 +1,48 @@ +body { + background:#def; +} + + +table#content, table#contentregs { + border:1px solid #aaa; + border-collapse:collapse; +} + + +table#content td, table#content th, table#contentregs td, table#contentregs th{ + border:1px solid #aaa; + width:100px; + text-align:right; + padding-right:15px; +} + +table#content, table#contentregs { + border:1px solid #aaa; +} + + +div#bar1 { + width:900px; + overflow-x:scroll; + } + +div#bar1 div { + width:66500px; + height:0px; +} + +div#bar2 { + width:900px; + overflow-x:scroll; + } + +div#bar2 div { + width:65536px; + height:0px; +} + + +#total { + text-align:center; + font-weight:bold; + } \ No newline at end of file -- 2.43.0