-
-
+Power Supply $dev_id [connected to $ser_dev]
+
+
EOF
}
diff --git a/powersupplies/web/htdocs/index.html b/powersupplies/web/htdocs/index.html
index a3b834c..4f167ec 100644
--- a/powersupplies/web/htdocs/index.html
+++ b/powersupplies/web/htdocs/index.html
@@ -24,6 +24,7 @@ function update(data) {
getdata('build_index.pl',update);
+Configuration File
Note that you need to have libdevice-serialport-perl or perl-Device-SerialPort
installed and that the /dev/ttyUSBn need to be accessible by normal users.
diff --git a/powersupplies/web/htdocs/pwr.conf b/powersupplies/web/htdocs/pwr.conf
index 578af96..bb515a2 100644
--- a/powersupplies/web/htdocs/pwr.conf
+++ b/powersupplies/web/htdocs/pwr.conf
@@ -4,12 +4,14 @@
//PWRSPLY:/dev/ttyUSB0:9600:PST3202:PST:3
//PWRSPLY:/dev/ttyUSB0:115200:HMP4030:HMP:3
//PWRSPLY:IP192.168.0.56:5050:HMP4040:HMP:4
-PWRSPLY:/dev/FTDI_FT232R_USB_UART_AH02HFZW:2400:PSP2010:PSP:1
//PWRSPLY:/dev/FTDI_FT232R_USB_UART_A702HE33:2400:PSP405:PSP:1
//PWRSPLY:IP192.168.0.56:5050:HMP4040 DiRich:HMP:4:LP1:LP2:LP3:DCDC
-PWRSPLY:/dev/FTDI_Xmatter_TTL_ALR1AJS:57600:Desk:PWRSW:6:TestAdrian:Pulser:::TrgDistr:ADC
//PWRSPLY:SERpi@192.168.0.230/dev/FTDI_FT232R_USB_UART_AH02HFZW:2400:PSP2010:PSP:1
//PWRSPLY:SERpi@192.168.0.230/dev/TRB3_Power48_00002:0:Rack48:PWRSW:4:Crate:::
-//PWRSPLY:/dev/HAMEG_HO732_VCP023842636:0:HMP4040:HMP:4
-//PWRSPLY:IP192.168.0.56:5050:HMP4040 DiRich:HMP:4:LP1:LP2:LP3:DCDC
//PWRSPLY:/dev/TRB3_Power48_00002:0:Rack48:PWRSW:4:Desk:::
+
+PWRSPLY:/dev/FTDI_FT232R_USB_UART_AH02HFZW:2400:PSP2010:PSP:1
+PWRSPLY:/dev/FTDI_Xmatter_TTL_ALR1AJS:57600:Desk:PWRSW:6:TestAdrian:Pulser:::TrgDistr:ADC
+PWRSPLY:/dev/HAMEG_HO732_VCP023842636:0:HMP4040:HMP:4
+PWRSPLY:IP192.168.0.56:5050:HMP4040 DiRich:HMP:4:LP1:LP2:LP3:DCDC
+PWRSPLY:IP192.168.0.139:5025:HMC8043:HMC:3:::
diff --git a/powersupplies/web/htdocs/pwr.pl b/powersupplies/web/htdocs/pwr.pl
index aa6c0bc..561678d 100755
--- a/powersupplies/web/htdocs/pwr.pl
+++ b/powersupplies/web/htdocs/pwr.pl
@@ -186,7 +186,6 @@ sub HMP_ethernet {
my $port = IO::Socket::INET->new(PeerAddr => $ser_dev, PeerPort => $ser_speed, Proto => "tcp", Type => SOCK_STREAM, Timeout => 1)
or (print("Device not found") && return);
-
while ( my $command = shift(@new_command) ) {
$command = uri_unescape($command);
my $x = getValue($port,$command,$cnt++);
@@ -202,6 +201,7 @@ sub serial_rw {
my $x = "";
if ($ser_type eq 'PSP') {$command .= "\r";} else {$command .= "\n";}
print $fh "$command";
+# print $command;
if($ser_type eq 'PWRSW' || $forceread || $command =~ /\?/) {
for my $i (0..500) {
$x .= <$fh>;
@@ -212,13 +212,16 @@ sub serial_rw {
usleep(1000);
}
}
+ else {
+ usleep(1000);
+ }
return $x;
}
sub getValue {
my ($fh,$cmd,$cnt,$forceread) = @_;
- if (defined $db->{$cmd.$cnt}{tim} && $db->{$cmd.$cnt}{tim} > time()-2) {
+ if (0 && defined $db->{$cmd.$cnt}{tim} && $db->{$cmd.$cnt}{tim} > time()-2) {
return $db->{$cmd.$cnt}{val};
}
else {
diff --git a/powersupplies/web/htdocs/pwr_hmp.htm b/powersupplies/web/htdocs/pwr_hmp.htm
index edf020f..8b840dc 100644
--- a/powersupplies/web/htdocs/pwr_hmp.htm
+++ b/powersupplies/web/htdocs/pwr_hmp.htm
@@ -2,14 +2,14 @@
-
-
+
+
Power Supply Monitor and Access
-Power Supply Access
+
@@ -226,7 +226,7 @@ function readSettings() {
}
updateTask = setTimeout("update()",updaterate);
-document.getElementById("headline").innerHTML = "Power Supply "+''+dev_id+''+" [connected to "+''+ser_dev+''+"]" ;
+//document.getElementById("headline").innerHTML = "Power Supply "+''+dev_id+''+" [connected to "+''+ser_dev+''+"]" ;
for(i=1;i<=channels;i++) {
if(typeof Vnames[i-1] !== 'undefined')
diff --git a/powersupplies/web/htdocs/pwr_psp.htm b/powersupplies/web/htdocs/pwr_psp.htm
index 004d682..2dcb1e4 100644
--- a/powersupplies/web/htdocs/pwr_psp.htm
+++ b/powersupplies/web/htdocs/pwr_psp.htm
@@ -2,14 +2,14 @@
-
-
+
+
Power Supply Monitor and Access
-Power Supply Access
+
'+dev_id+''+" [connected to "+''+ser_dev+''+"]" ;
+//document.getElementById("headline").innerHTML = "Power Supply "+''+dev_id+''+" [connected to "+''+ser_dev+''+"]" ;
diff --git a/powersupplies/web/htdocs/pwr_switch.htm b/powersupplies/web/htdocs/pwr_switch.htm
index 3b84c0b..c06486b 100644
--- a/powersupplies/web/htdocs/pwr_switch.htm
+++ b/powersupplies/web/htdocs/pwr_switch.htm
@@ -2,14 +2,14 @@
-
-
+
+
Power Supply Monitor and Access
-
+
@@ -152,7 +152,7 @@ function readSettings() {
}
updateTask = setTimeout("communication()",updaterate);
-document.getElementById("headline").innerHTML = "Power Switch "+''+dev_id+''+" [connected to "+''+ser_dev+''+"]" ;
+//document.getElementById("headline").innerHTML = "Power Switch "+''+dev_id+''+" [connected to "+''+ser_dev+''+"]" ;
maketable();
diff --git a/powersupplies/web/htdocs/scripts.js b/powersupplies/web/htdocs/scripts.js
index 3e2a5c1..e0faa62 100644
--- a/powersupplies/web/htdocs/scripts.js
+++ b/powersupplies/web/htdocs/scripts.js
@@ -17,7 +17,25 @@ function getdata(command,callback,option) {
xmlhttp.open("GET",command,true);
xmlhttp.send(null);
}
+
+
+function Enable(ob) {
+ frob = "iframe"+ob;
+ var frame = document.getElementById(frob);
+ var h = document.getElementById(ob);
+
+ if(frame.getAttribute("height") == 0) {
+ frame.setAttribute("height", frame.getAttribute("data-height"));
+ frame.setAttribute("src",frame.getAttribute("data-src"));
+ h.style.color = "black";
+ }
+ else {
+ frame.setAttribute("height", "0");
+ frame.setAttribute("src","");
+ h.style.color = "darkblue";
+ }
+ }
// function reload() {
// xmlhttp=new XMLHttpRequest();
@@ -41,4 +59,4 @@ function getdata(command,callback,option) {
// 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/powersupplies/web/htdocs/styles.css b/powersupplies/web/htdocs/styles.css
index 7d6a735..4ee34db 100644
--- a/powersupplies/web/htdocs/styles.css
+++ b/powersupplies/web/htdocs/styles.css
@@ -54,4 +54,12 @@ tfoot>tr:first-child {
.powerswitch td {
border-left:1px solid black;
text-align:center;
-}
\ No newline at end of file
+}
+
+h3 {
+ cursor : pointer;
+ margin-bottom:5px;
+ padding-bottom:5px;
+ font-weight:normal;
+ color:darkblue;
+}
--
2.43.0