- Fixed a bug which caused the SICServer to die when a socket was broken.
- Fixed many things in DIFRAC subsystem: * Recoded tcentr.f etc so that the course centering will work and will not go into an endless loop. * fixed boundary overwrites which occurred when yesno or alfnum where uset to get a single character and several were given. * Addeded documentation for DIFRAC - Added tcl-files which support the WWW status system
This commit is contained in:
@ -10,6 +10,7 @@ proc SplitReply { text } {
|
||||
}
|
||||
#--------------------------------------------------------------------------
|
||||
proc count { {mode NULL } { preset NULL } } {
|
||||
starttime [sicstime]
|
||||
#----- deal with mode
|
||||
set mode2 [string toupper $mode]
|
||||
set mode3 [string trim $mode2]
|
||||
@ -32,14 +33,21 @@ proc count { {mode NULL } { preset NULL } } {
|
||||
$bb $aa]
|
||||
#------- count
|
||||
banana InitVal 0
|
||||
wait 1
|
||||
banana count
|
||||
Success
|
||||
set ret [catch {Success} msg]
|
||||
#------- StoreData
|
||||
# ClientPut [StoreData]
|
||||
# StoreData
|
||||
if { $ret != 0 } {
|
||||
error [format "Counting ended with error"]
|
||||
}
|
||||
}
|
||||
#---------------- Repeat -----------------------------------------------
|
||||
proc repeat { num {mode NULL} {preset NULL} } {
|
||||
for { set i 0 } { $i < $num } { incr i } {
|
||||
count $mode $preset
|
||||
set ret [catch {count $mode $preset} msg]
|
||||
if {$ret != 0} {
|
||||
error "Counting ended with error"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -318,6 +318,7 @@ if {$ret != 0} {
|
||||
Publish sscan User
|
||||
Publish sftime Spy
|
||||
Publish scaninfo Spy
|
||||
Publish wwwsics Spy
|
||||
}
|
||||
|
||||
#*************************************************************************
|
||||
@ -359,10 +360,50 @@ proc scaninfo {} {
|
||||
append result "," [lindex $l1 1]
|
||||
return [format "scaninfo = %s" $result]
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# wwwsics is a procedure which formats the most important status
|
||||
# information for the WWW-status.
|
||||
proc wwwsics {} {
|
||||
#----- get all the data we need
|
||||
set user [GetNum [user]]
|
||||
set sample [GetNum [sample]]
|
||||
set tit [GetNum [title]]
|
||||
set ret [catch {lambda} msg]
|
||||
if {$ret != 0 } {
|
||||
set lam Undetermined
|
||||
} else {
|
||||
set lam [GetNum $msg]
|
||||
}
|
||||
set lscan [GetNum [lastscancommand]]
|
||||
set svar [GetNum [scan getvars]]
|
||||
set ind [string last -END- $svar]
|
||||
if { $ind > 2 } {
|
||||
set svar [string range $svar 0 $ind]
|
||||
} else {
|
||||
set svar " "
|
||||
}
|
||||
set res [scan info]
|
||||
set l [split $res ,]
|
||||
set fil [lindex $l 5]
|
||||
set run [GetNum [sicsdatanumber]]
|
||||
set stat [GetNum [status]]
|
||||
#------- html format the reply
|
||||
append result "<table BORDER=2>"
|
||||
append result <tr> <th>Run Number</th> <td> $run </td> </tr>
|
||||
append result <tr> <th>Title</th> <td> $tit </td> </tr>
|
||||
append result <tr> <th>User</th> <td> $user </td> </tr>
|
||||
append result <tr> <th>Sample </th> <td> $sample </td> </tr>
|
||||
append result <tr> <th>wavelength</th> <td> $lam</td> </tr>
|
||||
append result <tr> <th>Status</th> <td> $stat</td> </tr>
|
||||
append result <tr> <th>Scan Variables</th> <td> $svar</td> </tr>
|
||||
append result <tr> <th>File </th> <td> $fil</td> </tr>
|
||||
append result <tr> <th>Last Scan Command</th> <td> $lscan</td> </tr>
|
||||
append result </table>
|
||||
return $result
|
||||
}
|
||||
#===================== Syntactical sugar around scan ===================
|
||||
# center scan. A convenience scan for the one and only Daniel Clemens
|
||||
# at TOPSI. Scans around a given ceter point. Requires the scan command
|
||||
# at TOPSI. Scans around a given center point. Requires the scan command
|
||||
# for TOPSI to work.
|
||||
#
|
||||
# another convenience scan:
|
||||
|
43
tcl/wwwpulver.tcl
Normal file
43
tcl/wwwpulver.tcl
Normal file
@ -0,0 +1,43 @@
|
||||
#------------------------------------------------------------------------
|
||||
# This implements the wwwsics command which generates a listing of
|
||||
# important experiment parameters in html format for the SICS WWW Status
|
||||
# application. This version is for the powder diffractometers DMC and
|
||||
# HRPT.
|
||||
#
|
||||
# Mark Koennecke, March 2000
|
||||
#------------------------------------------------------------------------
|
||||
proc wwwsics {} {
|
||||
#----- get all the data we need
|
||||
set user [GetNum [user]]
|
||||
set sample [GetNum [sample]]
|
||||
set tit [GetNum [title]]
|
||||
set ret [catch {lambda} msg]
|
||||
if {$ret != 0 } {
|
||||
set lam Undetermined
|
||||
} else {
|
||||
set lam [GetNum $msg]
|
||||
}
|
||||
set ret [catch {temperature} msg]
|
||||
if {$ret != 0 } {
|
||||
set tem Undetermined
|
||||
} else {
|
||||
set tem [GetNum $msg]
|
||||
}
|
||||
set run [GetNum [sicsdatanumber]]
|
||||
catch {incr run} msg
|
||||
set stat [GetNum [status]]
|
||||
#------- html format the reply
|
||||
append result "<table BORDER=2>"
|
||||
append result <tr> <th>Run Number</th> <td> $run </td> </tr>
|
||||
append result <tr> <th>Title</th> <td> $tit </td> </tr>
|
||||
append result <tr> <th>User</th> <td> $user </td> </tr>
|
||||
append result <tr> <th>Sample </th> <td> $sample </td> </tr>
|
||||
append result <tr> <th>wavelength</th> <td> $lam</td> </tr>
|
||||
append result <tr> <th>Sample Temperature</th> <td> $tem</td> </tr>
|
||||
append result <tr> <th>Status</th> <td> $stat</td> </tr>
|
||||
append result </table>
|
||||
return $result
|
||||
}
|
||||
|
||||
#------------ install command
|
||||
catch {Publish wwwsics Spy} msg
|
Reference in New Issue
Block a user