- Fixed a bug in el737sec which made scans fail badly

- Enhanced phytron driver with another parameter
This commit is contained in:
koennecke
2009-10-30 13:53:26 +00:00
parent 91aa9c538c
commit b136700f39
3 changed files with 61 additions and 3 deletions

View File

@@ -172,6 +172,16 @@ proc el737readvalues {} {
sct send RA
return el737val
}
#--------------------------------------------------
proc swapFirst {l} {
set m1 [lindex $l 0]
set cts [lindex $l 1]
lappend res $cts $m1
for {set i 2} {$i < [llength $l]} {incr i} {
lappend res [lindex $l $i]
}
return $res
}
#---------------------------------------------------
# There are two types of reponses to the RA command:
# the old form with 5 values and the new one
@@ -189,12 +199,14 @@ proc el737val {} {
set root [sctroot]
if {[llength $l] > 5} {
set l2 [lrange $l 1 end]
set l2 [swapFirst $l2]
hupdate ${root}/values [join $l2]
set time [lindex $l 0]
hupdate ${root}/time $time
} else {
set last [expr [llength $l] - 1]
set l2 [lrange $l 0 $last]
set l2 [swapFirst $l2]
hupdate ${root}/values [join $l2]
set time [lindex $l $last]
hupdate ${root}/time $time
@@ -295,7 +307,7 @@ proc MakeSecEL737 {name netaddr} {
$conname write $path
hsetprop $path read el737threshread
hsetprop $path el737thresh el737thresh
$conname poll $path 60
# $conname poll $path 60
$conname debug -1