Added environment controller as a sics object type to the new hdb/nexus code.
r2137 | ffr | 2007-08-21 08:52:25 +1000 (Tue, 21 Aug 2007) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
9d9bf24775
commit
c4fd7a4d9f
@@ -263,17 +263,14 @@ proc sobjadd {hpath sobj args} {
|
||||
motor - configurablevirtualmotor {
|
||||
if {[info exists sobjatt(group)]} {
|
||||
set hpath [add_hpath $hpath $sobjatt(group)]
|
||||
hsetprop $hpath type part
|
||||
if {[catch {hsetprop $hpath type part} err]} {clientput $err error}
|
||||
}
|
||||
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} {
|
||||
# hattach $hpath $sobj $sobjatt(long_name)
|
||||
# hsetprop $hpath/$sobjatt(long_name) units $sobjatt(units)
|
||||
# hsetprop $hpath/$sobjatt(long_name) long_name $sobjatt(long_name)
|
||||
set node_path [add_node $hpath node $sobj long_name $sobjatt(long_name) kind $sobjatt(kind)]
|
||||
hsetprop $node_path savecmd $sobjatt(savecmd)
|
||||
hsetprop $node_path sdsinfo $sobjatt(sdsinfo)
|
||||
hsetprop $node_path nxalias $sobjatt(nxalias)
|
||||
hsetprop $node_path mutable $sobjatt(mutable)
|
||||
if {[catch {hsetprop $node_path savecmd $sobjatt(savecmd)} err]} {clientput $err error}
|
||||
if {[catch {hsetprop $node_path sdsinfo $sobjatt(sdsinfo)} err]} {clientput $err error}
|
||||
if {[catch {hsetprop $node_path nxalias $sobjatt(nxalias)} err]} {clientput $err error}
|
||||
if {[catch {hsetprop $node_path mutable $sobjatt(mutable)} err]} {clientput $err error}
|
||||
} else {
|
||||
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
|
||||
}
|
||||
@@ -282,7 +279,7 @@ proc sobjadd {hpath sobj args} {
|
||||
# access attribute = ro,rw
|
||||
if {[info exists sobjatt(group)]} {
|
||||
set hpath [add_hpath $hpath $sobjatt(group)]
|
||||
hsetprop $hpath type part
|
||||
if {[catch {hsetprop $hpath type part} err]} {clientput $err error}
|
||||
}
|
||||
if {[lsearch [hlist $hpath] $sobjatt(long_name)] != -1} {
|
||||
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
|
||||
@@ -293,16 +290,16 @@ proc sobjadd {hpath sobj args} {
|
||||
sicsvariable {
|
||||
if {[info exists sobjatt(group)]} {
|
||||
set hpath [add_hpath $hpath $sobjatt(group)]
|
||||
hsetprop $hpath type part
|
||||
if {[catch {hsetprop $hpath type part} err]} {clientput $err error}
|
||||
}
|
||||
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} {
|
||||
set node_path [add_node $hpath node $sobj long_name $sobjatt(long_name) kind $sobjatt(kind)]
|
||||
hsetprop $node_path sicsdev $sobj
|
||||
hsetprop $node_path nxalias $sobj
|
||||
hsetprop $node_path savecmd $sobjatt(savecmd)
|
||||
hsetprop $node_path sdsinfo $sobjatt(sdsinfo)
|
||||
hsetprop $node_path mutable $sobjatt(mutable)
|
||||
hsetprop $node_path privilege $sobjatt(privilege)
|
||||
if {[catch {hsetprop $node_path sicsdev $sobj} err]} {clientput $err error}
|
||||
if {[catch {hsetprop $node_path nxalias $sobj} err]} {clientput $err error}
|
||||
if {[catch {hsetprop $node_path savecmd $sobjatt(savecmd)} err]} {clientput $err error}
|
||||
if {[catch {hsetprop $node_path sdsinfo $sobjatt(sdsinfo)} err]} {clientput $err error}
|
||||
if {[catch {hsetprop $node_path mutable $sobjatt(mutable)} err]} {clientput $err error}
|
||||
if {[catch {hsetprop $node_path privilege $sobjatt(privilege)} err]} {clientput $err error}
|
||||
} else {
|
||||
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
|
||||
}
|
||||
@@ -314,19 +311,17 @@ proc sobjadd {hpath sobj args} {
|
||||
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
|
||||
}
|
||||
histmem {
|
||||
# TODO
|
||||
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
|
||||
if {[info exists sobjatt(group)]} {
|
||||
set hpath [add_hpath $hpath $sobjatt(group)]
|
||||
hsetprop $hpath type part
|
||||
if {[catch {hsetprop $hpath type part} err]} {clientput $err error}
|
||||
}
|
||||
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} {
|
||||
set node_path [add_node $hpath node $sobj long_name $sobjatt(long_name) kind $sobjatt(kind)]
|
||||
hsetprop $node_path savecmd $sobjatt(savecmd)
|
||||
hsetprop $node_path sdsinfo $sobjatt(sdsinfo)
|
||||
hsetprop $node_path nxalias $sobjatt(nxalias)
|
||||
hsetprop $node_path mutable $sobjatt(mutable)
|
||||
hsetprop $node_path sicsdev $sobj
|
||||
if {[catch {hsetprop $node_path savecmd $sobjatt(savecmd)} err]} {clientput $err error}
|
||||
if {[catch {hsetprop $node_path sdsinfo $sobjatt(sdsinfo)} err]} {clientput $err error}
|
||||
if {[catch {hsetprop $node_path nxalias $sobjatt(nxalias)} err]} {clientput $err error}
|
||||
if {[catch {hsetprop $node_path mutable $sobjatt(mutable)} err]} {clientput $err error}
|
||||
if {[catch {hsetprop $node_path sicsdev $sobj} err]} {clientput $err error}
|
||||
} else {
|
||||
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
|
||||
}
|
||||
@@ -343,6 +338,21 @@ proc sobjadd {hpath sobj args} {
|
||||
# TODO
|
||||
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
|
||||
}
|
||||
environment_controller {
|
||||
if {[info exists sobjatt(group)]} {
|
||||
set hpath [add_hpath $hpath $sobjatt(group)]
|
||||
if {[catch {hsetprop $hpath type part} err]} {clientput $err error}
|
||||
}
|
||||
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} {
|
||||
set node_path [add_node $hpath node $sobj long_name $sobjatt(long_name) kind $sobjatt(kind)]
|
||||
if {[catch { hsetprop $node_path savecmd $sobjatt(savecmd)} err]} {clientput $err error}
|
||||
if {[catch { hsetprop $node_path sdsinfo $sobjatt(sdsinfo)} err]} {clientput $err error}
|
||||
if {[catch { hsetprop $node_path nxalias $sobjatt(nxalias)} err]} {clientput $err error}
|
||||
if {[catch { hsetprop $node_path mutable $sobjatt(mutable)} err]} {clientput $err error}
|
||||
} else {
|
||||
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ set boolean {true false}
|
||||
|
||||
# SICS OBJECTS MUST PROVIDE THE FOLLOWING INFORMATION
|
||||
set sobj_klass_list {@none aperture attenuator collimator command crystal data detector experiment graphics instrument monitor monochromator plc sample scan user}
|
||||
set sobj_sicstype_list {sicsvariable macro motor configurablevirtualmotor singlecounter histmem nxscript sicsdata scanobject}
|
||||
set sobj_sicstype_list {environment_controller sicsvariable macro motor configurablevirtualmotor singlecounter histmem nxscript sicsdata scanobject}
|
||||
# Different kinds of things are added to the hdb in different ways.
|
||||
# command: This is something a client can run with hset /a/b/c start, it may have parameters and feedback.
|
||||
# Parameters and feedback should be made available in 'ilists' named after the command.
|
||||
@@ -76,6 +76,11 @@ set sicsvariable_attlist [subst {
|
||||
mutable [subst {{$boolean}}]
|
||||
}]
|
||||
|
||||
set environment_controller_attlist [subst {
|
||||
$sobj_attlist
|
||||
mutable [subst {{$boolean}}]
|
||||
}]
|
||||
|
||||
# A macro can be attached to an hdb node as a command or a script
|
||||
set macro_attlist [subst {
|
||||
$sobj_attlist
|
||||
|
||||
Reference in New Issue
Block a user