diff --git a/sicshdbadapter.c b/sicshdbadapter.c index 6de76d1e..4de4e94f 100644 --- a/sicshdbadapter.c +++ b/sicshdbadapter.c @@ -137,8 +137,7 @@ static pHdb MakeMotParNode(char *name, pMotor pMot){ static int AddStdMotorPar(pHdb motorNode, pMotor pMot){ int i; pHdb parNode = NULL; - char *addPar[] = {"position", - "target", + char *addPar[] = {"target", "hardlowerlim", "hardupperlim", NULL}; diff --git a/tcl/gumxml.tcl b/tcl/gumxml.tcl new file mode 100644 index 00000000..a19125b6 --- /dev/null +++ b/tcl/gumxml.tcl @@ -0,0 +1,181 @@ +#------------------------------------------------------------------------------- +# This file contains the implementation of the routines which generate the +# XML file as required by GumTree from a SICS Hipadaba. +# +# Mark Koennecke, Tony Lam, Ferdi Franceccini, January 2007 +#------------------------------------------------------------------------------ +proc makeGumHeader {} { + return "\n" +} +#--------------------------------------------------------------------------- +proc sicssplit {txt} { + set l [split $txt =] + return [string trim [lindex $l 1]] +} +#--------------------------------------------------------------------------- +proc getNodePriv {nodepath} { + set status [catch {hgetprop $nodepath priv} msg] + if {$status != 0} { + set priv user + } else { + set priv [sicssplit $msg] + } + if {[string length $priv] < 2} { + set priv user + } + set priv [string toupper $priv] + if {[string compare $priv INTERNAL] == 0} { + set priv READ_ONLY + } + return $priv +} +#-------------------------------------------------------------------------- +proc getNodeNumType {nodepath} { + set txt [hinfo $nodepath] + set l [split $txt ,] + set numtype [lindex $l 0] + set numType [string totitle $numtype] + return $numType +} +#---------------------------------------------------------------------------- +proc makeXMLHeader {nodepath indent} { + set status [catch {hgetprop $nodepath type} msg] + if {$status != 0} { + set nodetype UNSPECIFIED + } else { + set nodetype [string tolower [sicssplit $msg]] + } + set nodename [file tail $nodepath] + set prefix [string repeat " " $indent] + switch $nodetype { + instrument { + append result "$prefix \n" + } + part { + set numtype [getNodeNumType $nodepath] + if {[string compare $numtype None] == 0} { + append result "$prefix\n" + } else { + set priv [getNodePriv $nodepath] + append result "$prefix\n" + } + } + motor { + set priv [getNodePriv $nodepath] + append result "$prefix\n" + } + drivable { + set priv [getNodePriv $nodepath] + append result "$prefix\n" + } + graphset { + append result "$prefix \n" + } + commandset { + append result "$prefix \n" + } + graphdata { + set status [catch {hgetprop $nodepath viewer} msg] + if {$status == 0} { + set view [sicssplit $msg] + append result "$prefix\n" + } else { + append result "$prefix\n" + } + } + command { + set priv [getNodePriv $nodepath] + append result "$prefix\n" + } + axis { + set status [catch {hgetprop $nodepath dim} msg] + if {$status == 0} { + set dim [sicssplit $msg] + } else { + set dim 0 + } + set numtype [getNodeNumType $nodepath] + append result "$prefix\n" + } + data { + set numtype [getNodeNumType $nodepath] + append result "$prefix\n" + } + default { + set numtype [getNodeNumType $nodepath] + set priv [getNodePriv $nodepath] + append result "$prefix\n" + } + } + return $result +} +#---------------------------------------------------------------------------- +proc makeXMLClose {nodepath indent} { + set status [catch {hgetprop $nodepath type} msg] + if {$status != 0} { + set nodetype UNSPECIFIED + } else { + set nodetype [string tolower [sicssplit $msg]] + } + set nodename [file tail $nodepath] + set prefix [string repeat " " $indent] + switch $nodetype { + instrument { + append result "$prefix\n" + } + part { + append result "$prefix\n" + } + drivable - + motor { + append result "$prefix\n" + } + graphset { + append result "$prefix\n" + } + commandset { + append result "$prefix\n" + } + graphdata { + append result "$prefix\n" + } + command { + append result "$prefix\n" + } + default { + append result "" + } + } + return $result +} +#----------------------------------------------------------------------------- +proc scanHdbDir {path indent} { + set txl [hlist $path] + if {[string compare $path "/"] == 0} { + set path "" + } + set nodelist [split $txl \n] + set result "" + foreach node $nodelist { + if {[string length $node] < 1} { + continue + } + set nodepath $path/$node + append result [makeXMLHeader $nodepath $indent] + append result [scanHdbDir $nodepath [expr $indent + 2]] + append result [makeXMLClose $nodepath $indent] + } + return $result +} +#----------------------------------------------------------------------------- +proc getgumtreexml {path } { + append result [makeGumHeader] + append result [scanHdbDir $path 0] +} diff --git a/tmp/hdbscan.tcl b/tmp/hdbscan.tcl new file mode 100644 index 00000000..aadb0277 --- /dev/null +++ b/tmp/hdbscan.tcl @@ -0,0 +1,9 @@ +hset /commands/scan/scan_variables som +hset /commands/scan/scan_start 5 +hset /commands/scan/scan_increments .5 +hset /commands/scan/NP 10 +hset /commands/scan/mode Timer +hset /commands/scan/preset 2 + + +