From 6692a1a2bba5d25ba89bff12936f89b9188a0a44 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Thu, 14 Nov 2013 20:38:02 +1100 Subject: [PATCH] SICS-699 Provide a hipadaba "control" group for special hdb nodes like environment setpoints and sensor readings --- .../hipadaba/common_instrument_dictionary.tcl | 6 ++++++ .../hipadaba/hipadaba_configuration_common.tcl | 17 +++++++++++++++++ .../config/hipadaba/instdict_specification.tcl | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/site_ansto/instrument/config/hipadaba/common_instrument_dictionary.tcl b/site_ansto/instrument/config/hipadaba/common_instrument_dictionary.tcl index c2d4e2bb..fe01c09c 100644 --- a/site_ansto/instrument/config/hipadaba/common_instrument_dictionary.tcl +++ b/site_ansto/instrument/config/hipadaba/common_instrument_dictionary.tcl @@ -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} diff --git a/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl b/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl index d1713c59..3f116246 100644 --- a/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl +++ b/site_ansto/instrument/config/hipadaba/hipadaba_configuration_common.tcl @@ -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 } diff --git a/site_ansto/instrument/config/hipadaba/instdict_specification.tcl b/site_ansto/instrument/config/hipadaba/instdict_specification.tcl index 0952d7e3..0eaa8488 100644 --- a/site_ansto/instrument/config/hipadaba/instdict_specification.tcl +++ b/site_ansto/instrument/config/hipadaba/instdict_specification.tcl @@ -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.