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

@@ -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
}