- Added intValue writing to hdbutil.tcl
- Added threshold proecessing to el737dec.tcl
This commit is contained in:
@ -10,6 +10,7 @@
|
||||
# pause,cont, stop: el737sendcmd - el737cmdreply
|
||||
# status: el737readstatus - el737status
|
||||
# values: el737readvalues - el737val
|
||||
# threshold write: el737threshsend - el737threshrcv - el737cmdreply
|
||||
#
|
||||
# Mark Koennecke, February 2009
|
||||
#-----------------------------------------------------
|
||||
@ -192,6 +193,48 @@ proc el737val {} {
|
||||
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} {
|
||||
$controller queue $path write
|
||||
}
|
||||
@ -214,11 +257,24 @@ proc MakeSecEL737 {name netaddr} {
|
||||
hsetprop $path el737status el737status
|
||||
hsetprop $path moncount 0
|
||||
$conname poll $path 60
|
||||
$conname debug -1
|
||||
|
||||
set path /sics/${name}/control
|
||||
hsetprop $path write el737control
|
||||
hsetprop $path el737cmdreply el737cmdreply
|
||||
$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
|
||||
|
||||
}
|
||||
|
@ -89,10 +89,10 @@ proc getdataType {path} {
|
||||
}
|
||||
#----------------------------------------------------------------------
|
||||
proc make_nodes {path result indent} {
|
||||
set nodename [file tail $path];
|
||||
set type [getdataType $path]
|
||||
set prefix [string repeat " " $indent]
|
||||
set newIndent [expr $indent + 2]
|
||||
set nodename [file tail $path];
|
||||
set type [getdataType $path]
|
||||
set prefix [string repeat " " $indent]
|
||||
set newIndent [expr $indent + 2]
|
||||
#array set prop_list [ string trim [join [split [hlistprop $path] =]] ]
|
||||
set prop_list(control) true
|
||||
set we_have_control [info exists prop_list(control)]
|
||||
@ -104,6 +104,15 @@ set newIndent [expr $indent + 2]
|
||||
foreach x [hlist $path] {
|
||||
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"
|
||||
}
|
||||
return $result
|
||||
@ -147,10 +156,9 @@ proc getgumtreexml {path} {
|
||||
|
||||
if {[string compare $path "/" ] == 0} {
|
||||
foreach n [hlist $path] {
|
||||
set result [make_nodes $n $result 2]
|
||||
set result [make_nodes /$n $result 2]
|
||||
}
|
||||
} else {
|
||||
# set result [make_nodes $path $result 2]
|
||||
foreach n [hlist $path] {
|
||||
set result [make_nodes $path/$n $result 2]
|
||||
}
|
||||
|
Reference in New Issue
Block a user