# 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 disk_chopper entry environment experiment 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. # Parameters and feedback should be made available in 'ilists' named after the command. # 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}. # hdb_subtree: Is a macro which returns a keyed list that describes a hdb subtree. set sobj_kind_list {command hobj script getset hdb_subtree scobj} set sobj_interfacelist [subst {drivable {$boolean} countable {$boolean} callback {$boolean} environment {$boolean} }] set privilege_list {spy user manager readonly internal} set sobj_privilege [subst {privilege {$privilege_list}}] # This is a subset of the list of attributes which the # [sicslist ] 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 chopperadapter_attlist [subst { $sobj_attlist savecmd {print} sdsinfo {print} nxalias {text} mutable [subst {{$boolean}}] }] set environment_controller_attlist [subst { $sobj_attlist mutable [subst {{$boolean}}] }] set histmem_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 motor_attlist [subst { $sobj_attlist units alpha savecmd {print} nxalias {text} mutable [subst {{$boolean}}] }] set configurablevirtualmotor_attlist [subst { $motor_attlist }] set nxscript_attlist [subst { $sobj_attlist }] set scanobject_attlist [subst { $sobj_attlist }] set sct_object_attlist [subst { $sobj_attlist }] set sicsdata_attlist [subst { $sobj_attlist mutable [subst {{$boolean}}] }] set sicsvariable_attlist [subst { $sobj_attlist mutable [subst {{$boolean}}] }] set singlecounter_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}}] } } }] }