SICS-699 Provide a hipadaba "control" group for special hdb nodes like environment setpoints and sensor readings

This commit is contained in:
Ferdi Franceschini
2013-11-14 20:38:02 +11:00
committed by Ferdi Franceschini
parent 58e35efba3
commit 6692a1a2bb
3 changed files with 24 additions and 1 deletions

View File

@@ -211,6 +211,12 @@ set instrument_dictionary [subst {
datatype @none
property {data true control true nxsave false klass @none type part}
}
control {
privilege spy
sobj {@any control}
datatype @none
property {data false control true nxsave false klass @none type nxvgroup}
}
data {
privilege spy
sobj {@any data}

View File

@@ -888,6 +888,16 @@ proc ::hdb::prune {instdict} {
return
}
proc ::hdb::alias {parent linkpath NXtarget name } {
set catch_status [ catch {
if {$NXtarget != "data_set"} {
return -code error "Unhandled target alias $NXtarget"
}
hfactory $parent/$name alias $linkpath
} message ]
handle_exception $catch_status $message
}
##
# @brief Traverse the instrument dictionary and construct the hipadaba database.
#
@@ -913,6 +923,13 @@ upvar #0 $instDict dictionary
}
}
}
foreach node [hmatchprop / permlink *] {
set plink [hgetpropval $node permlink]
set target [lindex $plink 0]
if {$target == "data_set" && [hgetpropval $node control]} {
::hdb::alias "/control" $node {*}$plink
}
}
} message ]
handle_exception $catch_status $message
}

View File

@@ -11,7 +11,7 @@ set boolean {true false}
#}
# SICS OBJECTS MUST PROVIDE THE FOLLOWING INFORMATION
set sobj_klass_list {@none aperture attenuator collimator command crystal data detector disk_chopper entry environment experiment fermi_chopper graphics instrument slits monitor monochromator parameter plc reduce sample scan sensor source user}
set sobj_klass_list {@none aperture attenuator collimator command control crystal data detector disk_chopper entry environment experiment fermi_chopper graphics instrument slits monitor monochromator parameter plc reduce sample scan sensor source user}
set sobj_sicstype_list {chopperadapter environment_controller sicsvariable macro motor configurablevirtualmotor tasmot singlecounter histmem nxscript sicsdata scanobject sct_object}
# 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.