- Added intValue writing to hdbutil.tcl

- Added threshold proecessing to el737dec.tcl
This commit is contained in:
koennecke
2009-02-17 08:35:29 +00:00
parent ee49c5b56a
commit 41690a681b
2 changed files with 72 additions and 8 deletions

View File

@ -10,6 +10,7 @@
# pause,cont, stop: el737sendcmd - el737cmdreply # pause,cont, stop: el737sendcmd - el737cmdreply
# status: el737readstatus - el737status # status: el737readstatus - el737status
# values: el737readvalues - el737val # values: el737readvalues - el737val
# threshold write: el737threshsend - el737threshrcv - el737cmdreply
# #
# Mark Koennecke, February 2009 # Mark Koennecke, February 2009
#----------------------------------------------------- #-----------------------------------------------------
@ -192,6 +193,48 @@ proc el737val {} {
return idle return idle
} }
#---------------------------------------------- #----------------------------------------------
proc el737threshsend {} {
set val [string trim [sct target]]
set root [sctroot]
set cter [string trim [hval $root/thresholdcounter]]
sct send [format "DL %1.1d %f" $cter $val]
return el737threshrecv
}
#---------------------------------------------
proc el737threshrecv {} {
set reply [sct result]
set status [catch {el737error $reply} err]
if {$status != 0} {
sct geterror $err
sct print "ERROR: $err"
}
set root [sctroot]
set cter [string trim [hval $root/thresholdcounter]]
sct send [format "DR %1.1d" $cter]
set sctcon [sct controller]
$sctcon queue [sct] progress read
return el737cmdreply
}
#---------------------------------------------
proc el737threshread {} {
set root [sctroot]
set cter [string trim [hval $root/thresholdcounter]]
sct send [format "DL %1.1d" $cter]
return el737thresh
}
#----------------------------------------------
proc el737thresh {} {
set reply [sct result]
set status [catch {el737error $reply} err]
if {$status != 0} {
sct geterror $err
sct print "ERROR: $err"
}
stscan $reply "%f" val
sct update $val
return idle
}
#----------------------------------------------
proc el737func {controller path} { proc el737func {controller path} {
$controller queue $path write $controller queue $path write
} }
@ -214,11 +257,24 @@ proc MakeSecEL737 {name netaddr} {
hsetprop $path el737status el737status hsetprop $path el737status el737status
hsetprop $path moncount 0 hsetprop $path moncount 0
$conname poll $path 60 $conname poll $path 60
$conname debug -1
set path /sics/${name}/control set path /sics/${name}/control
hsetprop $path write el737control hsetprop $path write el737control
hsetprop $path el737cmdreply el737cmdreply hsetprop $path el737cmdreply el737cmdreply
$conname write $path $conname write $path
hfactory /sics/${name}/thresholdcounter plain mugger int
hseprop /sics/${name}/thresholdcounter __save true
set path /sics/${name}/threshold
hfactory $path plain mugger float
hsetprop $path write el737threshsend
hsetprop $path el737threshrcv el737threshrcv
hsetprop $path el737cmdreply el737cmdreply
$conname write $path
hsetprop $path read el737threshread
hsetprop $path el737thresh el737thresh
$conname poll $path 60
$conname debug -1
} }

View File

@ -104,6 +104,15 @@ set newIndent [expr $indent + 2]
foreach x [hlist $path] { foreach x [hlist $path] {
set result [make_nodes [string map {// /} "$path/$x"] $result $newIndent] set result [make_nodes [string map {// /} "$path/$x"] $result $newIndent]
} }
if {[string compare $type none] != 0 && [string compare $type func] != 0} {
set test [catch {hgetprop $path transfer} msg]
set tst [catch {hval $path} val]
if {$test != 0 && $tst == 0} {
append result "$prefix <initValue>\n"
append result "$prefix $val\n"
append result "$prefix </initValue>\n"
}
}
append result "$prefix</component>\n" append result "$prefix</component>\n"
} }
return $result return $result
@ -147,10 +156,9 @@ proc getgumtreexml {path} {
if {[string compare $path "/" ] == 0} { if {[string compare $path "/" ] == 0} {
foreach n [hlist $path] { foreach n [hlist $path] {
set result [make_nodes $n $result 2] set result [make_nodes /$n $result 2]
} }
} else { } else {
# set result [make_nodes $path $result 2]
foreach n [hlist $path] { foreach n [hlist $path] {
set result [make_nodes $path/$n $result 2] set result [make_nodes $path/$n $result 2]
} }