Don't set plottable data links and data save policy here, this is now taken care of when setting the data file policy with the 'newfile' command.
Use common interface for hmm server TABLE configuration commands. Remove obsolete code. r2160 | ffr | 2007-09-26 16:11:40 +1000 (Wed, 26 Sep 2007) | 4 lines
This commit is contained in:
committed by
Douglas Clowes
parent
39fd5d2a4a
commit
baaeb44fc3
@@ -1,5 +1,5 @@
|
||||
# $Revision: 1.16 $
|
||||
# $Date: 2007-08-16 04:50:04 $
|
||||
# $Revision: 1.17 $
|
||||
# $Date: 2007-09-26 06:11:40 $
|
||||
# Author: Mark Lesha (mle@ansto.gov.au)
|
||||
# Last revision by: $Author: ffr $
|
||||
|
||||
@@ -29,8 +29,6 @@ namespace eval histogram_memory {
|
||||
::utility::mkVar hmm_dim0 Int user dim0 true detector true true
|
||||
::utility::mkVar hmm_dim1 Int user dim1 true detector true true
|
||||
::utility::mkVar hmm_dim2 Int user dim2 true detector true true
|
||||
::utility::mkVar hmm_histmode Text user histmode true detector true true
|
||||
::utility::mkVar hmm_bank Int user bank false detector false false
|
||||
::utility::mkVar hmm_rank Int user rank true detector false true
|
||||
::utility::mkVar hmm_start Int user start false detector false false
|
||||
::utility::mkVar hmm_length Int user length false detector false false
|
||||
@@ -82,11 +80,9 @@ namespace eval histogram_memory {
|
||||
debug_msg $configuration
|
||||
|
||||
hmm configure statuscheck true
|
||||
hmm configure histmode transparent
|
||||
hmm stop
|
||||
hmm configure statuscheck false
|
||||
hmm configure hmaddress http://localhost:8080
|
||||
hmm configure username spy
|
||||
hmm configure password 007
|
||||
hmm configure hmDataPath ../HMData
|
||||
hmm configure hmconfigscript $configuration
|
||||
|
||||
@@ -120,26 +116,6 @@ namespace eval histogram_memory {
|
||||
return $retn
|
||||
}
|
||||
|
||||
# Configure histogram dimensions, mode, etc. using the dictionary variables.
|
||||
# For the dimensions, set the 'effective' OAT dimensions which are the
|
||||
# histogram period dimensions. Do an init after to cause memory to be allocated.
|
||||
proc hmm_setup {mode bankNum rankNum nyc nxc ntc} {
|
||||
hmm_histmode $mode
|
||||
hmm_bank $bankNum
|
||||
hmm_rank $rankNum
|
||||
hmm configure histmode $mode
|
||||
hmm configure bank $bankNum
|
||||
hmm configure rank $rankNum
|
||||
hmm_dim0 [hmmdictitemval hmm $nyc]
|
||||
hmm_dim1 [hmmdictitemval hmm $nxc]
|
||||
hmm_length [expr {[SplitReply [hmm_dim0]] * [SplitReply [hmm_dim1]]} ]
|
||||
hmm_dim2 [hmmdictitemval hmm $ntc]
|
||||
hmm configure dim0 [SplitReply [hmm_dim0]]
|
||||
hmm configure dim1 [SplitReply [hmm_dim1]]
|
||||
hmm configure dim2 [SplitReply [hmm_dim2]]
|
||||
hmm init
|
||||
}
|
||||
|
||||
##############################################
|
||||
# Create beam monitor counter
|
||||
# and histogram memory control object
|
||||
@@ -339,13 +315,6 @@ namespace eval histogram_memory {
|
||||
blockctr count 0
|
||||
#clientput "Exit count" value
|
||||
::histogram_memory::count -set feedback status IDLE
|
||||
array set param [::data::gumtree_save -list param]
|
||||
data axis 1 $param(run_number)
|
||||
data axis 2 ::histogram_memory::vertical_axis
|
||||
data axis 3 ::histogram_memory::horizontal_axis
|
||||
data axis 4 ::histogram_memory::time_channel
|
||||
data data_set hmm
|
||||
::hdb::set_save / true
|
||||
return
|
||||
}
|
||||
|
||||
@@ -436,47 +405,7 @@ namespace eval histogram_memory {
|
||||
proc experiment_hpath_setup {parent} {
|
||||
}
|
||||
|
||||
proc save {point } {
|
||||
#TODO maybe add nxobj and point parameters.
|
||||
set hor_axis [SplitReply [_hmm_hor_axis]]
|
||||
set vert_axis [SplitReply [_hmm_vert_axis]]
|
||||
# set point 0
|
||||
if {$point == 0} {
|
||||
nxcreatefile nexus_hmscan.dic;
|
||||
} else {
|
||||
nxreopenfile
|
||||
}
|
||||
nxscript putattribute program_name run_mode hmmcount
|
||||
hmm_save nxscript entry1 $point;
|
||||
nxscript_data clear;
|
||||
nxscript_data putint 0 $point;
|
||||
nxscript putslab erun [list $point] [list 1] nxscript_data;
|
||||
nxscript makelink scanvar erun;
|
||||
nxscript putattribute erun axis 1;
|
||||
nxscript putattribute hmcounts signal 1;
|
||||
nxscript putattribute hmcounts axes run_number:$vert_axis:$hor_axis;
|
||||
nxclosefile;
|
||||
}
|
||||
proc set_sobj_attributes {} {
|
||||
# set_sicsobj_atts sobj klass group name control data
|
||||
if 0 {
|
||||
set_sicsobj_atts hmm_user_configpath detector hmm user_configpath true false;
|
||||
set_sicsobj_atts hmm_dim0 detector hmm dim0 true true;
|
||||
set_sicsobj_atts hmm_dim1 detector hmm dim1 true true;
|
||||
set_sicsobj_atts hmm_dim2 detector hmm dim2 true true;
|
||||
set_sicsobj_atts hmm_histmode detector hmm histmode true true;
|
||||
set_sicsobj_atts hmm_bank detector hmm bank true false;
|
||||
set_sicsobj_atts hmm_rank detector hmm rank true true;
|
||||
set_sicsobj_atts hmm_start detector hmm start true false;
|
||||
set_sicsobj_atts hmm_length detector hmm length false false;
|
||||
set_sicsobj_atts hmm_mode detector hmm mode true true;
|
||||
set_sicsobj_atts _hmm_vert_axis detector hmm vert_axis false true;
|
||||
set_sicsobj_atts _hmm_hor_axis detector hmm hor_axis false true;
|
||||
set_sicsobj_atts _hmm_hor_axis_alias detector hmm hor_axis_alias false true;
|
||||
set_sicsobj_atts _hmm_vert_axis_alias detector hmm vert_axis_alias false true;
|
||||
set_sicsobj_atts _hmm_hor_channel_name detector hmm hor_channel_name false true;
|
||||
}
|
||||
|
||||
# SICS commands
|
||||
sicslist setatt blockctr privilege internal;
|
||||
|
||||
@@ -492,10 +421,12 @@ if 0 {
|
||||
sicslist setatt ::histogram_memory::count_withbm privilege internal;
|
||||
sicslist setatt ::histogram_memory::save privilege internal;
|
||||
|
||||
set_sicsobj_atts hmm detector @none data true true;
|
||||
sicslist setatt hmm privilege user
|
||||
sicslist setatt hmm kind hobj
|
||||
sicslist setatt hmm nxsave true
|
||||
foreach hm_obj [sicslist type histmem] {
|
||||
set_sicsobj_atts $hm_obj detector @none $hm_obj true true;
|
||||
sicslist setatt $hm_obj privilege user
|
||||
sicslist setatt $hm_obj kind hobj
|
||||
sicslist setatt $hm_obj nxsave false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -572,20 +503,20 @@ if 0 {
|
||||
}
|
||||
"-arrayname" {
|
||||
set det_height_mm [SplitReply [detector_active_height_mm]]
|
||||
set max_b [OAT_TABLE -get Y_max]
|
||||
set min_b [OAT_TABLE -get Y_min]
|
||||
set max_b [OAT_TABLE -get Y_MAX]
|
||||
set min_b [OAT_TABLE -get Y_MIN]
|
||||
set scale_factor [expr {$det_height_mm / ($max_b - $min_b)}]
|
||||
return [calc_axis $proc_name 1.0 0.0 [OAT_TABLE -get Y_boundaries] $opt $arglist]
|
||||
return [calc_axis $proc_name 1.0 0.0 [OAT_TABLE -get Y_BOUNDARIES] $opt $arglist]
|
||||
}
|
||||
"-units" {
|
||||
return "mm"
|
||||
}
|
||||
default {
|
||||
set det_height_mm [SplitReply [detector_active_height_mm]]
|
||||
set max_b [OAT_TABLE -get Y_max]
|
||||
set min_b [OAT_TABLE -get Y_min]
|
||||
set max_b [OAT_TABLE -get Y_MAX]
|
||||
set min_b [OAT_TABLE -get Y_MIN]
|
||||
set scale_factor [expr {$det_height_mm / ($max_b - $min_b)}]
|
||||
return [calc_axis $proc_name 1.0 0.0 [OAT_TABLE -get Y_boundaries] $args]
|
||||
return [calc_axis $proc_name 1.0 0.0 [OAT_TABLE -get Y_BOUNDARIES] $args]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -613,22 +544,22 @@ if 0 {
|
||||
}
|
||||
"-arrayname" {
|
||||
set det_width_mm [SplitReply [detector_active_width_mm]]
|
||||
set max_b [OAT_TABLE -get X_max]
|
||||
set min_b [OAT_TABLE -get X_min]
|
||||
set max_b [OAT_TABLE -get X_MAX]
|
||||
set min_b [OAT_TABLE -get X_MIN]
|
||||
set scale_factor [expr {$det_width_mm / ($max_b - $min_b)}]
|
||||
set offset 0.0
|
||||
return [calc_axis $proc_name $scale_factor $offset [OAT_TABLE -get X_boundaries] $opt $arglist]
|
||||
return [calc_axis $proc_name $scale_factor $offset [OAT_TABLE -get X_BOUNDARIES] $opt $arglist]
|
||||
}
|
||||
"-units" {
|
||||
return "mm"
|
||||
}
|
||||
default {
|
||||
set det_width_mm [SplitReply [detector_active_width_mm]]
|
||||
set max_b [OAT_TABLE -get X_max]
|
||||
set min_b [OAT_TABLE -get X_min]
|
||||
set max_b [OAT_TABLE -get X_MAX]
|
||||
set min_b [OAT_TABLE -get X_MIN]
|
||||
set scale_factor [expr {$det_width_mm / ($max_b - $min_b)}]
|
||||
set offset 0.0
|
||||
return [calc_axis $proc_name $scale_factor $offset [OAT_TABLE -get X_boundaries] $args]
|
||||
return [calc_axis $proc_name $scale_factor $offset [OAT_TABLE -get X_BOUNDARIES] $args]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -654,10 +585,10 @@ if 0 {
|
||||
return [calc_axis $proc_name @none @none @none $opt $args]
|
||||
}
|
||||
"-arrayname" {
|
||||
return [calc_axis $proc_name [::histogram_memory::clock_scale] 0.0 [OAT_TABLE -get T_boundaries] $opt $arglist]
|
||||
return [calc_axis $proc_name [::histogram_memory::clock_scale] 0.0 [OAT_TABLE -get T_BOUNDARIES] $opt $arglist]
|
||||
}
|
||||
default {
|
||||
return [calc_axis $proc_name [::histogram_memory::clock_scale] 0.0 [OAT_TABLE -get T_boundaries] $args]
|
||||
return [calc_axis $proc_name [::histogram_memory::clock_scale] 0.0 [OAT_TABLE -get T_BOUNDARIES] $args]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -674,122 +605,221 @@ if 0 {
|
||||
sicslist setatt $script_name units [::histogram_memory::clock_scale units]
|
||||
}
|
||||
|
||||
set hmm_xml(BAT_TABLE) ""
|
||||
proc BAT_TABLE {args} {
|
||||
##
|
||||
# @brief Provides a standard set of subcommands for the histogram server table
|
||||
# configuration commands.
|
||||
#
|
||||
# @param tag Table identifier, one of BAT CAT FAT NAT OAT SAT SRV
|
||||
# @param attributes Defines the list of attributes which you will be allowed to set.
|
||||
# @param element_list Defines the list of elements which you will be allowed to set.
|
||||
# Use "" if your table doesn't contain any elements.
|
||||
# @param args This can be empty, or a list of name value pairs for the attributes
|
||||
# and elements which you want to set or one of the subcommands listed below.
|
||||
# If args is empty this function will simply return an xml fragment for the named table,
|
||||
#
|
||||
# Subcommands\n
|
||||
# -clear clears the table\n
|
||||
# -init A list of name value pairs. If you use attribute or element names then
|
||||
# the corresponding table entries will be initilised to the given values, any
|
||||
# attributes or elements which aren't specified will be cleared. You can also
|
||||
# specify extra parameters to store in the table which might be required to
|
||||
# specify limits or constants which may be necessary for deriving configuration
|
||||
# parameters.\n
|
||||
# -get return the value for the named attribute or element\n
|
||||
# -attlist list all of the attributes with their values.\n
|
||||
# TODO Allow for top level content in tables and attributes in sub-elements
|
||||
proc XXX_TABLE {tag attributes element_list args} {
|
||||
global hmm_xml
|
||||
set table_name [lindex [info level 0] 0]
|
||||
switch -- $args {
|
||||
"" {return $hmm_xml($table_name)}
|
||||
-clear {set hmm_xml($table_name) ""}
|
||||
default {}
|
||||
if {[llength $args] == 1} {
|
||||
set arguments [lindex $args 0]
|
||||
} else {
|
||||
set arguments $args
|
||||
}
|
||||
}
|
||||
set hmm_xml(CAT_TABLE) ""
|
||||
proc CAT_TABLE {args} {
|
||||
global hmm_xml
|
||||
set table_name [lindex [info level 0] 0]
|
||||
switch -- $args {
|
||||
"" {return $hmm_xml($table_name)}
|
||||
-clear {set hmm_xml($table_name) ""}
|
||||
default {}
|
||||
}
|
||||
}
|
||||
set hmm_xml(FAT_TABLE) ""
|
||||
proc FAT_TABLE {args} {
|
||||
global hmm_xml
|
||||
set table_name [lindex [info level 0] 0]
|
||||
set opt [lindex $args 0]
|
||||
set arglist [lrange $args 1 end]
|
||||
set opt [lindex $arguments 0]
|
||||
set arglist [lrange $arguments 1 end]
|
||||
switch -- $opt {
|
||||
"" {return $hmm_xml($table_name)}
|
||||
"-clear" {set hmm_xml($table_name) ""}
|
||||
"" {
|
||||
foreach att $attributes {
|
||||
if {$hmm_xml($tag,[string toupper $att]) != ""} {
|
||||
append table "$att=\"$hmm_xml($tag,$att)\"\n"
|
||||
}
|
||||
}
|
||||
set content ""
|
||||
foreach name $element_list {
|
||||
append content "\n<$name>\n$hmm_xml($tag,$name)\n</$name>"
|
||||
}
|
||||
if {[info exists table]} {
|
||||
return "<$tag\n$table>$content\n</$tag>"
|
||||
}
|
||||
}
|
||||
"-clear" {
|
||||
foreach att $attributes {
|
||||
set hmm_xml($tag,[string toupper $att]) ""
|
||||
}
|
||||
foreach element $element_list {
|
||||
set hmm_xml($tag,[string toupper $element]) ""
|
||||
}
|
||||
}
|
||||
"-init" {
|
||||
foreach att $attributes {
|
||||
set hmm_xml($tag,[string toupper $att]) ""
|
||||
}
|
||||
foreach element $element_list {
|
||||
set hmm_xml($tag,[string toupper $element]) ""
|
||||
}
|
||||
foreach {par val} $arglist {
|
||||
set hmm_xml(FAT_TABLE,$par) $val
|
||||
set hmm_xml($tag,[string toupper $par]) $val
|
||||
}
|
||||
}
|
||||
"-get" {
|
||||
set par [lindex $arglist 0]
|
||||
if {[info exists hmm_xml(FAT_TABLE,$par)]} {
|
||||
return $hmm_xml(FAT_TABLE,$par)
|
||||
set par [string toupper [lindex $arglist 0]]
|
||||
if {[info exists hmm_xml($tag,$par)]} {
|
||||
return $hmm_xml($tag,$par)
|
||||
} else {
|
||||
foreach name [array names hmm_xml FAT_TABLE,* ] {
|
||||
foreach name [array names hmm_xml $tag,* ] {
|
||||
lappend valid_params [lindex [split $name ,] 1]
|
||||
}
|
||||
error_msg "$par should be one of $valid_params"
|
||||
}
|
||||
}
|
||||
"-list" {
|
||||
clientput [array get hmm_xml $table_name,*]
|
||||
"-attlist" {
|
||||
# List attributes
|
||||
foreach att $attributes {
|
||||
if {$hmm_xml($tag,$att) != ""} {
|
||||
lappend table $att $hmm_xml($tag,[string toupper $att])
|
||||
}
|
||||
}
|
||||
if {[info exists table]} {
|
||||
clientput $table
|
||||
}
|
||||
}
|
||||
default {
|
||||
array set param [string toupper $args]
|
||||
set hmm_xml(FAT_TABLE) "<FAT\n"
|
||||
foreach att {SIZE_PERIOD COUNT_METHOD COUNT_SIZE READ_DATA_TYPE} {
|
||||
array set param [string toupper $arguments]
|
||||
foreach att [string toupper $attributes] {
|
||||
if {[info exists param($att)]} {
|
||||
if {[info exists hmm_xml(FAT_TABLE,${att}_MIN)]} {
|
||||
if {$param($att) <= $hmm_xml(FAT_TABLE,${att}_MIN)} {
|
||||
error_msg "$att must be greater than $hmm_xml(FAT_TABLE,${att}_MIN)"
|
||||
if {[info exists hmm_xml($tag,${att}_MIN)]} {
|
||||
if {$param($att) <= $hmm_xml($tag,${att}_MIN)} {
|
||||
error_msg "$att must be greater than $hmm_xml($tag,${att}_MIN)"
|
||||
}
|
||||
}
|
||||
if {[info exists hmm_xml(FAT_TABLE,${att}_MAX)]} {
|
||||
if {$param($att) >= $hmm_xml(FAT_TABLE,${att}_MAX)} {
|
||||
error_msg "$att must be less than $hmm_xml(FAT_TABLE,${att}_MAX)"
|
||||
if {[info exists hmm_xml($tag,${att}_MAX)]} {
|
||||
if {$param($att) >= $hmm_xml($tag,${att}_MAX)} {
|
||||
error_msg "$att must be less than $hmm_xml($tag,${att}_MAX)"
|
||||
}
|
||||
}
|
||||
append hmm_xml(FAT_TABLE) "$att=\"$param($att)\"\n"
|
||||
set hmm_xml($tag,$att) $param($att)
|
||||
}
|
||||
}
|
||||
foreach element [string toupper $element_list] {
|
||||
if {[info exists param($element)]} {
|
||||
set hmm_xml($tag,$element) $param($element)
|
||||
}
|
||||
}
|
||||
append hmm_xml(FAT_TABLE) "></FAT>"
|
||||
}
|
||||
}
|
||||
}
|
||||
set hmm_xml(NAT_TABLE) ""
|
||||
proc NAT_TABLE {args} {
|
||||
|
||||
##
|
||||
# @brief Base Address Table configuration parameters as maintained by SICS
|
||||
#
|
||||
# @see XXX_TABLE for subcommands.
|
||||
proc BAT_TABLE {args} {
|
||||
set attributes {FRAME_FREQUENCY SIZE_PERIOD COUNT_METHOD COUNT_SIZE READ_DATA_TYPE}
|
||||
set elements ""
|
||||
set tag BAT
|
||||
global hmm_xml
|
||||
set table_name [lindex [info level 0] 0]
|
||||
switch -- $args {
|
||||
"" {return $hmm_xml($table_name)}
|
||||
-clear {set hmm_xml($table_name) ""}
|
||||
default {}
|
||||
|
||||
switch -glob -- [lindex $args 0] {
|
||||
"" {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
"-*" {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
default {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
}
|
||||
}
|
||||
set hmm_xml(OAT_TABLE) ""
|
||||
## \brief Initialize and setup OAT_TABLE
|
||||
BAT_TABLE -clear
|
||||
|
||||
##
|
||||
# @brief CAlibration Table configuration parameters as maintained by SICS
|
||||
#
|
||||
# \param -clear clears OAT_TABLE XML fragment
|
||||
# \param -init x_min <x0> x_max <x1> y_min <y0> y_max <y1>
|
||||
# @see XXX_TABLE for subcommands.
|
||||
proc CAT_TABLE {args} {
|
||||
set attributes {FRAME_FREQUENCY SIZE_PERIOD COUNT_METHOD COUNT_SIZE READ_DATA_TYPE}
|
||||
set elements ""
|
||||
set tag CAT
|
||||
global hmm_xml
|
||||
|
||||
switch -glob -- [lindex $args 0] {
|
||||
"" {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
"-*" {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
default {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
}
|
||||
}
|
||||
CAT_TABLE -clear
|
||||
|
||||
##
|
||||
# @brief Frequency Address Table configuration parameters as maintained by SICS
|
||||
#
|
||||
# @see XXX_TABLE for subcommands.
|
||||
proc FAT_TABLE {args} {
|
||||
set attributes {FRAME_FREQUENCY SIZE_PERIOD COUNT_METHOD COUNT_SIZE READ_DATA_TYPE}
|
||||
set elements ""
|
||||
set tag FAT
|
||||
global hmm_xml
|
||||
|
||||
switch -glob -- [lindex $args 0] {
|
||||
"" {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
"-*" {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
default {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
}
|
||||
}
|
||||
FAT_TABLE -clear
|
||||
|
||||
##
|
||||
# @brief Offset Address Table configuration parameters as maintained by SICS
|
||||
#
|
||||
# @param -clear clears OAT_TABLE XML fragment
|
||||
# @param -init X_MIN <x0> X_MAX <x1> Y_MIN <y0> Y_MAX <y1>
|
||||
# Initialise minimum and maximum bin boundaries.
|
||||
# \param -get
|
||||
# \param -list
|
||||
# @param -get
|
||||
# @param -attlist
|
||||
# @param -clear clears the oat table and the fat table SIZE_PERIOD
|
||||
#
|
||||
# Sets X_boundaries, Y_boundaries and T_boundaries
|
||||
# Sets X_BOUNDARIES, Y_BOUNDARIES and T_BOUNDARIES
|
||||
# @see XXX_TABLE for subcommands.
|
||||
proc OAT_TABLE {args} {
|
||||
global hmm_xml
|
||||
set table_name [lindex [info level 0] 0]
|
||||
set attributes {NO_OAT_X_CHANNELS NO_OAT_Y_CHANNELS NO_OAT_T_CHANNELS}
|
||||
set tag OAT
|
||||
set coord_list {X Y T}
|
||||
set elements $coord_list
|
||||
|
||||
switch -- [lindex $args 0] {
|
||||
"" {return $hmm_xml(OAT_TABLE)}
|
||||
"-clear" {set hmm_xml(OAT_TABLE) ""}
|
||||
"-init" {
|
||||
foreach {par val} [lrange $args 1 end] {
|
||||
set hmm_xml(OAT_TABLE,$par) $val
|
||||
}
|
||||
switch -glob -- [lindex $args 0] {
|
||||
"" {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
"-get" {
|
||||
set par [lindex $args 1]
|
||||
if {[info exists hmm_xml(OAT_TABLE,$par)]} {
|
||||
return $hmm_xml(OAT_TABLE,$par)
|
||||
} else {
|
||||
foreach name [array names hmm_xml OAT_TABLE,* ] {
|
||||
lappend valid_params [lindex [split $name ,] 1]
|
||||
}
|
||||
error_msg "$par should be one of $valid_params"
|
||||
}
|
||||
"-*" {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
"-list" {
|
||||
clientput [array get hmm_xml $table_name,*]
|
||||
"-clear" {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
FAT_TABLE SIZE_PERIOD ""
|
||||
}
|
||||
default {
|
||||
array set param $args
|
||||
@@ -801,39 +831,32 @@ proc OAT_TABLE {args} {
|
||||
set NOXCH [SplitReply [hmm configure dim0]]
|
||||
set NOYCH [SplitReply [hmm configure dim1]]
|
||||
set NOTCH [SplitReply [hmm configure dim2]]
|
||||
set hmm_xml(OAT_TABLE) {
|
||||
<OAT NO_OAT_X_CHANNELS=\"$NOXCH\" NO_OAT_Y_CHANNELS=\"$NOYCH\" NO_OAT_T_CHANNELS=\"$NOTCH\">
|
||||
$XTAG
|
||||
$YTAG
|
||||
$TTAG
|
||||
</OAT>
|
||||
}
|
||||
foreach coord $coord_list {
|
||||
if {[info exists param($coord)]} {
|
||||
set bbnum [llength $param($coord)]
|
||||
set hmm_xml(OAT_TABLE,${coord}_boundaries) ""
|
||||
set hmm_xml(OAT,${coord}_BOUNDARIES) ""
|
||||
if {$bbnum > 2} {
|
||||
set NO${coord}CH [expr $bbnum - 1]
|
||||
if {[info exists param(N${coord}C)]} {
|
||||
set NO${coord}CH $param(N${coord}C)
|
||||
}
|
||||
set hmm_xml(OAT_TABLE,${coord}_boundaries) [lrange $param($coord) 0 [set NO${coord}CH]]
|
||||
set ${coord}TAG "<$coord>$hmm_xml(OAT_TABLE,${coord}_boundaries)</$coord>"
|
||||
set hmm_xml(OAT,${coord}_BOUNDARIES) [lrange $param($coord) 0 [set NO${coord}CH]]
|
||||
set hmm_xml(OAT,$coord) ${coord}_BOUNDARIES
|
||||
} elseif {$bbnum == 2} {
|
||||
set ${coord}TAG "<$coord>$param($coord)</$coord>"
|
||||
set hmm_xml(OAT,$coord) $param($coord)
|
||||
set b0 [lindex $param($coord) 0]
|
||||
set bstep [expr {[lindex $param($coord) 1] - $b0}]
|
||||
if {[info exists param(N${coord}C)]} {
|
||||
set NO${coord}CH $param(N${coord}C)
|
||||
for {set bb $b0; set i 0} {$i <= [set NO${coord}CH]} {incr i; set bb [expr $bb + $bstep] } {
|
||||
lappend hmm_xml(OAT_TABLE,${coord}_boundaries) $bb
|
||||
lappend hmm_xml(OAT,${coord}_BOUNDARIES) $bb
|
||||
}
|
||||
} else {
|
||||
set bmax [set hmm_xml(OAT_TABLE,${coord}_max)]
|
||||
set bmax [set hmm_xml(OAT,${coord}_MAX)]
|
||||
set brange [expr {$bmax - $b0}]
|
||||
set NO${coord}CH [expr {int(floor($brange/$bstep))}]
|
||||
for {set bb $b0} {1} {set bb [expr $bb + $bstep] } {
|
||||
lappend hmm_xml(OAT_TABLE,${coord}_boundaries) $bb
|
||||
lappend hmm_xml(OAT,${coord}_BOUNDARIES) $bb
|
||||
if [expr {abs($bmax - $bb) < abs($bstep)}] { break }
|
||||
}
|
||||
}
|
||||
@@ -842,41 +865,45 @@ proc OAT_TABLE {args} {
|
||||
}
|
||||
}
|
||||
}
|
||||
set arglist [list NO_OAT_X_CHANNELS $NOXCH NO_OAT_Y_CHANNELS $NOYCH NO_OAT_T_CHANNELS $NOTCH]
|
||||
XXX_TABLE $tag $attributes $elements $arglist
|
||||
FAT_TABLE SIZE_PERIOD [expr {$NOXCH*$NOYCH*$NOTCH}]
|
||||
set hmm_xml(OAT_TABLE) [subst $hmm_xml(OAT_TABLE)]
|
||||
return $hmm_xml(OAT_TABLE)
|
||||
return [XXX_TABLE $tag $attributes $elements]
|
||||
}
|
||||
}
|
||||
}
|
||||
OAT_TABLE -clear
|
||||
|
||||
set hmm_xml(SAT_TABLE) ""
|
||||
##
|
||||
# @brief Spatial Allocation Table configuration parameters as maintained by SICS
|
||||
#
|
||||
# @see XXX_TABLE for subcommands.
|
||||
proc SAT_TABLE {args} {
|
||||
set attributes {FRAME_FREQUENCY SIZE_PERIOD COUNT_METHOD COUNT_SIZE READ_DATA_TYPE}
|
||||
set elements ""
|
||||
set tag SAT
|
||||
global hmm_xml
|
||||
set table_name [lindex [info level 0] 0]
|
||||
switch -- $args {
|
||||
"" {return $hmm_xml($table_name)}
|
||||
-clear {set hmm_xml($table_name) ""}
|
||||
default {}
|
||||
}
|
||||
}
|
||||
set hmm_xml(SRV_TABLE) ""
|
||||
proc SRV_TABLE {args} {
|
||||
global hmm_xml
|
||||
set table_name [lindex [info level 0] 0]
|
||||
switch -- $args {
|
||||
"" {return $hmm_xml($table_name)}
|
||||
-clear {set hmm_xml($table_name) ""}
|
||||
default {}
|
||||
|
||||
switch -glob -- [lindex $args 0] {
|
||||
"" {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
"-*" {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
default {
|
||||
XXX_TABLE $tag $attributes $elements $args
|
||||
}
|
||||
}
|
||||
}
|
||||
SAT_TABLE -clear
|
||||
|
||||
proc ::histogram_memory::clear_tables {} {
|
||||
BAT_TABLE -clear
|
||||
CAT_TABLE -clear
|
||||
FAT_TABLE -clear
|
||||
NAT_TABLE -clear
|
||||
OAT_TABLE -clear
|
||||
SAT_TABLE -clear
|
||||
SRV_TABLE -clear
|
||||
}
|
||||
|
||||
proc inst_defaults {} {
|
||||
@@ -891,16 +918,23 @@ proc ::histogram_memory::configure_server {instdef} {
|
||||
variable hmm_def_filename
|
||||
variable hmm_dae_type
|
||||
set hmm_def_filename $instdef
|
||||
# rank is always 3, but some or all of the dimensions can be 1
|
||||
hmm configure rank 3
|
||||
foreach hm_obj [sicslist type histmem] {
|
||||
$hm_obj configure hmaddress http://das1-[instname].nbi.ansto.gov.au:8080
|
||||
$hm_obj configure username spy
|
||||
$hm_obj configure password 007
|
||||
}
|
||||
::histogram_memory::setup
|
||||
if {[instname] == "wombat"} {
|
||||
hmm_dim0 [hmmdictitemval hmm stitch_nyc]
|
||||
hmm_dim1 [hmmdictitemval hmm stitch_nxc]
|
||||
hmm_dim0 [hmmdictitemval hmm stitch_nxc]
|
||||
hmm_dim1 [hmmdictitemval hmm stitch_nyc]
|
||||
} else {
|
||||
hmm_dim0 [hmmdictitemval hmm oat_nyc_eff]
|
||||
hmm_dim1 [hmmdictitemval hmm oat_nxc_eff]
|
||||
hmm_dim0 [hmmdictitemval hmm oat_nxc_eff]
|
||||
hmm_dim1 [hmmdictitemval hmm oat_nyc_eff]
|
||||
}
|
||||
hmm_length [expr {[SplitReply [hmm_dim0]] * [SplitReply [hmm_dim1]]} ]
|
||||
hmm_dim2 [hmmdictitemval hmm oat_ntc_eff]
|
||||
hmm_length [expr {[SplitReply [hmm_dim0]] * [SplitReply [hmm_dim1]] * [SplitReply [hmm_dim2]]} ]
|
||||
hmm configure dim0 [SplitReply [hmm_dim0]]
|
||||
hmm configure dim1 [SplitReply [hmm_dim1]]
|
||||
hmm configure dim2 [SplitReply [hmm_dim2]]
|
||||
@@ -913,7 +947,7 @@ proc ::histogram_memory::_initialize {} {
|
||||
time_channel -boundaries
|
||||
::histogram_memory::clear_tables
|
||||
::histogram_memory::configure_server Filler_defaults
|
||||
OAT_TABLE -init T_min 0 T_max 200000
|
||||
OAT_TABLE -init T_MIN 0 T_MAX 200000
|
||||
FAT_TABLE -init SIZE_PERIOD_MAX 125000000
|
||||
}
|
||||
|
||||
@@ -931,10 +965,8 @@ Publish ::histogram_memory::save user
|
||||
Publish BAT_TABLE user
|
||||
Publish CAT_TABLE user
|
||||
Publish FAT_TABLE user
|
||||
Publish NAT_TABLE user
|
||||
Publish OAT_TABLE user
|
||||
Publish SAT_TABLE user
|
||||
Publish SRV_TABLE user
|
||||
|
||||
namespace eval ::histogram_memory {
|
||||
command count {text:monitor,timer mode float: preset} {
|
||||
|
||||
Reference in New Issue
Block a user