[Doc_Dynamic] [global env; source [file join $env(MIDASBASE) TclHttpd Html settings.tml]] <! [global Httpd; upvar #0 Httpd[set Httpd(currentSocket)] data; set ClientIPAddress $data(ipaddr); set MyInfo $data(self)] > <html> <head> <title>Run Control @ [global env; set env(ComputerName)]</title> <link rel="stylesheet" type="text/css" href="/css/buttons.css"/> <script type="text/javascript" language="JavaScript" src="/js/Common.js"></script> <script type="text/javascript" language="JavaScript" src="/js/FormChek.js"></script> <script type="text/javascript" language="JavaScript" src="DataAcquisitionControl.js"></script> </head> <body> <NOSCRIPT> <hr> <h2> Your browser does not support JavaScript. This service requires a JavaScript compatible browser. </h2> <hr> </NOSCRIPT> <p align=center> <table cellpadding=0 cellspacing=0 border=0 width=100%> <tr> <td align=left> <font size=4><b>Data Acquisition Run Control @ [set MyInfo]</b></font> </td> <td align=right> <font size=4><b>client address is [set ClientIPAddress]</b></font> </td> <td align=right> <input type=image src="/images/midas.gif" name=MIDAS title="MIDAS Home Page" onClick="click_MIDAS()"> <input type=image src="/images/tclp.gif" name=TCL title="Tcl/Tk Home Page" onClick="click_TCL()"> </td> </tr> </table> </p> <hr> <! [namespace eval DataAcquisitionControl { global env source [file join $env(MIDASBASE) TclHttpd tcl Common common.tcl] cd [file join $env(MIDASBASE) TclHttpd Html DataAcquisitionControl] source DataAcquisitionControl.tcl }] > <form action=[ncgi::urlStub] name=RunControl method=post> <input type=hidden name=Widget value="undefined"> <p align=center> <table cellpadding=0 cellspacing=0 border=0 width=100%> <tr> <td width=50% align=center> [namespace eval DataAcquisitionControl { if {[llength $::DataAcquisition::ACQSERVERS] > 1} {set html "Acquisition Servers"} else {set html ""} set html }] [namespace eval DataAcquisitionControl { set html "" if {[llength $::DataAcquisition::ACQSERVERS] > 1} { append html "<select name=ACQSERVER size=1 onChange=\"click_ACQSERVER(document.RunControl, document.RunControl.ACQSERVER.value)\">" } set s 0 foreach item $::DataAcquisition::ACQSERVERS { if {$::DataAcquisition::ACQSERVER == $item} {append html "<option selected>$item</option>"; set s 1} else {append html "<option>$item</option>"} } if {$s == 0} {append html "<option selected>-</option>"} if {[llength $::DataAcquisition::ACQSERVERS] > 1} {append html "</select>"} else {set html ""} set html }] </td> <td width=50% align=center> [namespace eval DataAcquisitionControl { if {[llength $::DataAcquisition::ACQSERVERS] > 1} then { set html "Act on ALL Data Acquisition Servers?<" append html "input type=checkbox name=ALLSERVERS" if {$allservers == 1} {append html " checked"} append html " onClick=click_ALLSERVERS(document.RunControl)" set html } }] </td> </tr> </table> </p> <p align=center> [namespace eval DataAcquisitionControl { set html "<font size=6><b>Server State</b></font>" append html "<table cellpadding=4 cellspacing=4 border=1 align=center cols=8>" set k 1 for {set i 0} {$i < $NRows} {incr i} { append html "<tr>" for {set j 0} {$j < $NCols} {incr j} { if {$SState($k) == 1} { append html "<td align=center valign=middle bgcolor=Green>" } else { append html "<td align=center valign=middle bgcolor=Red>" } if {$k <= [llength $::DataAcquisition::ACQSERVERS]} { set s [lindex $::DataAcquisition::ACQSERVERS [expr $k-1]] append html "<button name=S$k onClick=\"click_SSTATE(document.RunControl,$k)\"> $s </button>" } else { append html "<button name=S$k DISABLED> $k </button>" } incr k append html "</td>" } append html "</tr>" } append html "</table>" if {$allservers == 0} {set html ""} set html }] </p> <hr> <p align="center"> [namespace eval DataAcquisitionControl { if {$allservers == 0 && [llength $::DataAcquisition::ACQSERVERS] > 1} then \ {set html "<b>Current Acquisition Server [set ::DataAcquisition::ACQSERVER]</b>"} }] </p> <p> <table cellpadding=0 cellspacing=0 border=0 width=100%> <tr> [namespace eval DataAcquisitionControl { set html "" append html "<td width=50% align=center>" append html "<input type=image name=DORESET SRC=reset.jpg onClick=\"click_doreset(document.RunControl)\"" append html "</td>" switch $AcqCode { 0 { append html "<td width=50% align=center>" append html "<input type=image name=DOGO SRC=go.jpg onClick=\"click_dogo(document.RunControl)\"" append html "</td>" } 1 { append html "<td width=50% align=center>" append html "<input type=image name=DOSTOP SRC=stop.jpg onClick=\"click_dostop(document.RunControl)\"" append html "</td>" } 2 { append html "<td width=50% align=center>" append html "<input type=image name=DOSETUP SRC=setup.jpg onClick=\"click_dosetup(document.RunControl)\"" append html "</td>" } default {} } set html }] </tr> </table> </p> [namespace eval DataAcquisitionControl { if {$allservers == 0} { ;# for selected server give graphical status set html "<p align=center>" append html "<img src=state.jpg width=250 height=38>" switch $AcqCode { 0 {append html "<img src=s0.jpg width=250 height=38> <img src=blank.jpg width=250 height=38>"} 1 {append html "<img src=s1.jpg width=250> <img src=blank.jpg width=250>"} 2 {append html "<img src=s2.jpg width=250> <img src=r2.jpg width=250>"} 3 {append html "<img src=s3.jpg width=250 height=38> <img src=wait.jpg width=250 height=38>"} 4 {append html "<img src=s4.jpg width=250> <img src=wait.jpg width=250>"} 5 {append html "<img src=s5.jpg width=250> <img src=wait.jpg width=250>"} 6 {append html "<img src=s6.jpg width=250> <img src=try.jpg width=250>"} 7 {append html "<img src=s7.jpg width=250> <img src=wait.jpg width=250>"} 8 {append html "<img src=s8.jpg width=250> <img src=try.jpg width=250>"} 9 {append html "<img src=s9.jpg width=250> <img src=wait.jpg width=250>"} default {} } append html "</p>" } else { ;# show state of all servers set html "<p align=center>" append html "<table cellpadding=0 cellspacing=0 border=1 width=100%>" set j 0 set k 0 foreach item $::DataAcquisition::ACQSERVERS { if {$j == 0} {append html "<tr>"} append html "<td width=25% align=center>" append html "<table cellpadding=0 cellspacing=0 border=0 width=100%>" append html "<tr>" append html "<td width=46% align=center>$item</td>" append html "<td width=46% align=center>$::DataAcquisition::AcqSysState($item)</td>" if {[lindex $::DataAcquisition::EnableHistogramming $k] == 1} {append html "<td width=4% align=right>H</td>"} \ else {append html "<td width=5% align=right> </td>"} if {$::DataAcquisition::DataTransferStreams == 1} { if {[lindex $::DataAcquisition::EnableDataTransfer $k] == 1} {append html "<td width=4% align=right>X</td>"} \ else {append html "<td width=5% align=right> </td>"} } if {$::DataAcquisition::DataTransferStreams == 2} { if {[lindex $::DataAcquisition::EnableDataTransfer $k] == 1} {append html "<td width=4% align=right>X</td>"} \ else {append html "<td width=5% align=right> </td>"} if {[lindex $::DataAcquisition::EnableDataTransfer2 $k] == 1} {append html "<td width=4% align=right>X</td>"} \ else {append html "<td width=5% align=right> </td>"} } append html "</tr></table>" incr j if {$j == 4} {append html "</tr>"; set j 0} incr k } append html "</tr></table></p>" } set html }] <p align=center> <table cellpadding=0 cellspacing=0 border=0 width=100%> <tr> <td width=50% align=center> [namespace eval DataAcquisitionControl { if {$allservers == 0} { ;# for selected server set html "Histogramming on  " append html "<input type=checkbox name=HIST onClick=\"click_HistEnable(document.RunControl,document.RunControl.HIST.value)\"" if {$::DataAcquisition::EnableHistogramming == 1} {append html " checked value=off"} else {set append " value=on"} append html ">" append html "</td>" if {$::DataAcquisition::DataTransferStreams == 1} { append html "<td width=50% align=center>" append html "Data Transfer on  " append html "<input type=checkbox name=XFER onClick=\"click_XferEnable(document.RunControl,document.RunControl.XFER.value)\"" if {$::DataAcquisition::EnableDataTransfer == 1} {append html " checked value=off>"} else {append html " value=on>"} append html "</td>" } if {$::DataAcquisition::DataTransferStreams == 2} { append html "<td width=25% align=center>" append html "Data Transfer #1 on  " append html "<input type=checkbox name=XFER onClick=\"click_XferEnable(document.RunControl,document.RunControl.XFER.value)\"" if {$::DataAcquisition::EnableDataTransfer == 1} {append html " checked value=off>"} else {append html " value=on>"} append html "</td>"