##################################
SICS-226 util/utility.tcl Added set_chopper_attributes to set hdb metadata on chopperadapters server_config.tcl Set hdb metadata on chopperadapters hipadaba_configuration_common.tcl :hdb::sobjadd can now add chopperadapters to the hdb tree ::hdb::cmd_par now preserves case when adding command parameters. instdict_specification.tcl Added chopperadapter sicstype and disk_chopper class nxscripts_common_1.tcl Added chopperadapter save and sdsinfo commands. reflectometer/config/chopper/chopper.tcl Set units on chopperadapters. ################################## hipd,hrpd,rsd, /config/commands.tcl Add instrument specific initialisation procedure for commands reflectometer/config/commands.tcl Created omega_2theta and set_mode commands from Andrew Nelson's procs in extraconfig.tcl reflectometer/.../motor_configuration.tcl Added ds and rs prefix to the two_theta drive and read scripts to prevent name collision with the two_theta procs in commans.tcl SICS-108 reflectometer/../parameters.tcl Added parameters for guide, slit and chopper distances and elements. SICS-108 common_instrument_dictionary.tcl Make parameters saveable r2678 | ffr | 2008-08-18 13:01:29 +1000 (Mon, 18 Aug 2008) | 40 lines
This commit is contained in:
committed by
Douglas Clowes
parent
348bd3aed1
commit
8090104407
@@ -36,13 +36,13 @@ set instrument_dictionary [subst {
|
||||
privilege spy
|
||||
sobj {@any parameter}
|
||||
datatype @none
|
||||
property {data false control true nxsave false klass @none type part}
|
||||
property {data true control true nxsave true klass NXparameter type part}
|
||||
}
|
||||
instrument/parameters/derived_parameters {
|
||||
privilege spy
|
||||
sobj {@any derived_parameter}
|
||||
datatype @none
|
||||
property {data false control true nxsave false klass @none type part}
|
||||
property {data true control true nxsave true klass NXderived_parameter type part}
|
||||
}
|
||||
instrument/aperture {
|
||||
privilege spy
|
||||
|
||||
@@ -435,7 +435,7 @@ proc ::hdb::add_hpath {basePath path {priv spy} {dtype none} {dlen ""}} {
|
||||
# @see command
|
||||
proc ::hdb::add_cmd_par {hpath sobj name} {
|
||||
hattach $hpath $sobj $name
|
||||
foreach {prop pval} [attlist $sobj] {
|
||||
foreach {prop pval} [::utility::normalattlist $sobj] {
|
||||
hsetprop $hpath/$name $prop $pval
|
||||
}
|
||||
hsetprop $hpath/$name data false
|
||||
@@ -756,6 +756,23 @@ proc ::hdb::sobjadd {hpath sobj args} {
|
||||
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
|
||||
}
|
||||
}
|
||||
chopperadapter {
|
||||
if {[info exists sobjatt(group)]} {
|
||||
set hpath [add_hpath $hpath $sobjatt(group)]
|
||||
hsetprop $hpath type part
|
||||
}
|
||||
if {[lsearch [hlist $hpath] $sobjatt(long_name)] == -1} {
|
||||
set node_path [add_node $hpath node $sobj long_name [normalgetatt $sobj long_name] kind $sobjatt(kind)]
|
||||
hsetprop $node_path sicsdev $sobj
|
||||
hsetprop $node_path nxalias $sobj
|
||||
hsetprop $node_path savecmd $sobjatt(savecmd)
|
||||
hsetprop $node_path sdsinfo $sobjatt(sdsinfo)
|
||||
hsetprop $node_path mutable $sobjatt(mutable)
|
||||
hsetprop $node_path privilege $sobjatt(privilege)
|
||||
} else {
|
||||
clientput "ERROR: $hpath/$sobjatt(long_name) for $sobj exists" error
|
||||
}
|
||||
}
|
||||
nxscript {
|
||||
# TODO
|
||||
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
|
||||
@@ -771,6 +788,9 @@ proc ::hdb::sobjadd {hpath sobj args} {
|
||||
environment_controller {
|
||||
todo_msg "$sobjatt(type) case, add $sobj to $hpath"
|
||||
}
|
||||
default {
|
||||
error "ERROR: Unknown sics object type $sobjatt(type)"
|
||||
}
|
||||
}
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
|
||||
@@ -11,18 +11,18 @@ set boolean {true false}
|
||||
#}
|
||||
|
||||
# SICS OBJECTS MUST PROVIDE THE FOLLOWING INFORMATION
|
||||
set sobj_klass_list {@none aperture attenuator collimator command crystal data detector entry environment experiment graphics instrument monitor monochromator parameter derived_parameter plc sample scan sensor user}
|
||||
set sobj_sicstype_list {environment_controller sicsvariable macro motor configurablevirtualmotor singlecounter histmem nxscript sicsdata scanobject}
|
||||
set sobj_klass_list {@none aperture attenuator collimator command crystal data detector disk_chopper entry environment experiment graphics instrument monitor monochromator parameter derived_parameter plc sample scan sensor source user}
|
||||
set sobj_sicstype_list {chopperadapter 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.
|
||||
# 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 hdb_subtree}
|
||||
set sobj_kind_list {command hobj script getset hdb_subtree}
|
||||
set sobj_interfacelist [subst {drivable {$boolean} countable {$boolean} callback {$boolean} environment {$boolean} }]
|
||||
|
||||
set privilege_list {spy user manager read_only internal}
|
||||
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
|
||||
@@ -93,6 +93,13 @@ set sicsdata_attlist [subst {
|
||||
mutable [subst {{$boolean}}]
|
||||
}]
|
||||
|
||||
set chopperadapter_attlist [subst {
|
||||
$sobj_attlist
|
||||
savecmd {print}
|
||||
sdsinfo {print}
|
||||
nxalias {text}
|
||||
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}
|
||||
|
||||
@@ -744,6 +744,10 @@ proc ::nexus::gen_nxdict {nexusdic} {
|
||||
sicslist setatt $sobj savecmd ::nexus::environment_controller::save
|
||||
sicslist setatt $sobj sdsinfo ::nexus::environment_controller::sdsinfo
|
||||
}
|
||||
foreach sobj [sicslist type chopperadapter] {
|
||||
sicslist setatt $sobj savecmd ::nexus::chopperadapter::save
|
||||
sicslist setatt $sobj sdsinfo ::nexus::chopperadapter::sdsinfo
|
||||
}
|
||||
foreach sobj [sicslist kind script] {
|
||||
sicslist setatt $sobj savecmd ::nexus::script::save
|
||||
sicslist setatt $sobj sdsinfo ::nexus::script::sdsinfo
|
||||
@@ -975,6 +979,41 @@ proc ::nexus::sicsvariable::sdsinfo {svar data_type args} {
|
||||
}
|
||||
}
|
||||
|
||||
namespace eval ::nexus::chopperadapter { }
|
||||
proc ::nexus::chopperadapter::save {sobj nxalias data_type args} {
|
||||
array set attribute [attlist $sobj]
|
||||
set val [SplitReply [$sobj]]
|
||||
if {[lindex $args 0] == "point"} {
|
||||
set index [lindex $args 1]
|
||||
nxscript_data clear
|
||||
switch $data_type {
|
||||
int {nxscript_data putint 0 $val}
|
||||
float {nxscript_data putfloat 0 $val}
|
||||
default {error "ERROR: [info level -1]->::nexus::chopperadapter::save, unknown type $data_type"}
|
||||
}
|
||||
nxscript putslab $nxalias [list $index] [list 1] nxscript_data
|
||||
} else {
|
||||
switch $data_type {
|
||||
int {nxscript putint $nxalias $val}
|
||||
float {nxscript putfloat $nxalias $val}
|
||||
text {nxscript puttext $nxalias $val}
|
||||
default {error "ERROR: [info level -1]->::nexus::chopperadapter::save, unknown type $data_type"}
|
||||
}
|
||||
}
|
||||
if {[info exists attribute(units)]} {
|
||||
nxscript putattribute $nxalias units $attribute(units)
|
||||
}
|
||||
}
|
||||
|
||||
proc ::nexus::chopperadapter::sdsinfo {sobj data_type args} {
|
||||
array set param $args
|
||||
set dtype [::nexus::hdb2nx_type $data_type]
|
||||
if {$param(mutable) == true} {
|
||||
return " -type $dtype -rank 1 -dim {-1}"
|
||||
} else {
|
||||
return " -type $dtype"
|
||||
}
|
||||
}
|
||||
proc ::nexus::singlecounter::save {counter nxalias data_type args} {
|
||||
todo_msg "Save counter: $counter"
|
||||
}
|
||||
@@ -1060,7 +1099,7 @@ foreach expt $::nexus::exports {
|
||||
|
||||
set tmpstr [string map {"$" ""} {$Name: not supported by cvs2svn $}]
|
||||
set nx_content_release_tag [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
||||
set tmpstr [string map {"$" ""} {$Revision: 1.41 $}]
|
||||
set tmpstr [string map {"$" ""} {$Revision: 1.42 $}]
|
||||
set nx_content_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
||||
|
||||
#namespace eval data {
|
||||
|
||||
Reference in New Issue
Block a user