135 lines
4.4 KiB
Tcl
135 lines
4.4 KiB
Tcl
# The attributes and values for sics objects and instrument dictionaries must comply
|
|
# with the following lists.
|
|
|
|
set boolean {true false}
|
|
# INSTRUMENT DICTIONARIES MUST PROVIDE THE FOLLOWING INFORMATION
|
|
#set dict_property_list {
|
|
# data [subst {{$boolean}}]
|
|
# control [subst {{$boolean}}]
|
|
# nxsave [subst {{$boolean}}]
|
|
# nxtype [subst {{$nexus_classes}}]
|
|
#}
|
|
|
|
# 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 {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.
|
|
# ilist: An intelligent list, it's like a list comprehension that takes a closure as the mapping function.
|
|
# event: This is an associative array which can be watched for modifications. You can use the array index
|
|
# to choose an action.
|
|
# script: Supplies an rscript and a wscript to attach to a node for hgets and hsets.
|
|
# hobj: Something that can be hattached to a node. {motor sicsvariable histmem}.
|
|
set sobj_kind_list {command event hobj ilist script}
|
|
set sobj_interfacelist [subst {drivable {$boolean} countable {$boolean} callback {$boolean} environment {$boolean} }]
|
|
|
|
set privilege_list {spy user manager read_only internal}
|
|
set sobj_privilege [subst {privilege {$privilege_list}}]
|
|
|
|
# This is a subset of the list of attributes which the
|
|
# [sicslist <sobj>] command must return for the hdbbuilder
|
|
# The 'data' and 'control' attributes need to be part of the metadata for
|
|
# a sics object because you know how it could/should be used when you
|
|
# create it.
|
|
set sobj_attlist [subst {
|
|
$sobj_interfacelist
|
|
type [subst {{$sobj_sicstype_list}}]
|
|
klass [subst {{$sobj_klass_list}}]
|
|
long_name {text}
|
|
data [subst {{$boolean}}]
|
|
control [subst {{$boolean}}]
|
|
kind [subst {{$sobj_kind_list}}]
|
|
nxsave [subst {{$boolean}}]
|
|
$sobj_privilege
|
|
}]
|
|
|
|
# OBJECT SPECIFIC ATTRIBUTES
|
|
set motor_attlist [subst {
|
|
$sobj_attlist
|
|
units alpha
|
|
savecmd {print}
|
|
nxalias {text}
|
|
mutable [subst {{$boolean}}]
|
|
}]
|
|
|
|
set configurablevirtualmotor_attlist [subst {
|
|
$motor_attlist
|
|
}]
|
|
|
|
set singlecounter_attlist [subst {
|
|
$sobj_attlist
|
|
mutable [subst {{$boolean}}]
|
|
}]
|
|
|
|
set histmem_attlist [subst {
|
|
$sobj_attlist
|
|
mutable [subst {{$boolean}}]
|
|
}]
|
|
|
|
set scanobject_attlist [subst {
|
|
$sobj_attlist
|
|
}]
|
|
|
|
set sicsvariable_attlist [subst {
|
|
$sobj_attlist
|
|
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
|
|
}]
|
|
|
|
set nxscript_attlist [subst {
|
|
$sobj_attlist
|
|
}]
|
|
|
|
set sicsdata_attlist [subst {
|
|
$sobj_attlist
|
|
mutable [subst {{$boolean}}]
|
|
}]
|
|
|
|
# INSTRUMENT DICTIONARIES MUST PROVIDE THE FOLLOWING INFORMATION
|
|
if 1 {
|
|
set nexus_classes { NXaperture NXattenuator NXbeam_stop NXbeam NXbending_magnet NXcharacterizations NXcollimator NXcrystal NXdata NXdetector NXdisk_chopper NXentry NXenvironment NXevent_data NXfermi_chopper NXfilter NXflipper NXgeometry NXguide NXinsertion_device NXinstrument NXlog NXmirror NXmoderator NXmonitor NXnote NXorientation NXpositioner NXprocess NXroot NXsample NXsensor NXshape NXsource NXtranslation NXuser NXvelocity_selector}
|
|
|
|
set dict_privilege_list {
|
|
}
|
|
# datatype can include rank and dimensions
|
|
# @none is included to allow subtree nodes and leaves to be handled
|
|
# uniformly.
|
|
set dict_datatype_list { @none NX_CHAR NX_FLOAT32 NX_INT32 }
|
|
|
|
# link = name of an nxalias
|
|
set dict_property_list [subst {
|
|
{data control nxsave} {$boolean}
|
|
klass {@none $nexus_classes}
|
|
type {commandset graphset instrument part nxvgroup}
|
|
nxalias text
|
|
link {@none text}
|
|
savecmd text
|
|
}]
|
|
|
|
|
|
# hpath looks like /a/b/c/
|
|
set regex_hpath {^(/)$|^([_a-z0-9]+)(/[_a-z0-9]+)*$}
|
|
set instrument_dictionary_spec [subst {
|
|
regex_hpath {
|
|
optional {
|
|
sobj {{@any $sobj_sicstype_list} {$sobj_klass_list}}
|
|
}
|
|
required {
|
|
privilege {$privilege_list}
|
|
datatype [subst {{$dict_datatype_list}}]
|
|
property [subst {{$dict_property_list}}]
|
|
}
|
|
}
|
|
}]
|
|
}
|