Addded some missing files
r2848 | ffr | 2009-12-11 13:14:03 +1100 (Fri, 11 Dec 2009) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
7c75771acf
commit
f24284f96d
@@ -0,0 +1,53 @@
|
||||
# $Revision: 1.1.2.1 $
|
||||
# $Date: 2009-12-11 02:14:03 $
|
||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||
# Last revision by: $Author: ffr $
|
||||
|
||||
namespace eval ::environment::temperature { }
|
||||
|
||||
# @brief Make a simulated temperature controller object.
|
||||
#
|
||||
# @param temp_sobj, name for temperature controller object.
|
||||
proc ::environment::temperature::mkwest400sim {temp_sobj} {
|
||||
EvFactory new $temp_sobj sim
|
||||
sicslist setatt $temp_sobj numsensors 1
|
||||
sicslist setatt $temp_sobj controlsensor sensora
|
||||
sicslist setatt $temp_sobj sensorlist sensora
|
||||
sicslist setatt $temp_sobj units kelvin
|
||||
sicslist setatt $temp_sobj klass @none
|
||||
}
|
||||
|
||||
#WEST4100 tempcontroller creation
|
||||
proc ::environment::temperature::mkwest400 {temp_sobj IP } {
|
||||
MakeRS232Controller sertemp $IP 502
|
||||
sertemp timeout 300
|
||||
sertemp sendterminator 0x0
|
||||
sertemp replyterminator 0x0
|
||||
EvFactory new tc1 west4100 sertemp 1 2
|
||||
|
||||
sicslist setatt tc1 units kelvin
|
||||
sicslist setatt tc1 klass @none
|
||||
}
|
||||
|
||||
# @brief Adds a west400 temperature controller object.
|
||||
#
|
||||
# This must be called when the instrument configuration is loaded and before\n
|
||||
# the buildHDB function is called. Currently there is no way to add and remove\n
|
||||
# environment controllers and their hdb paths at runtime.
|
||||
proc ::environment::temperature::add_west400 {IP} {
|
||||
set sim_mode [SplitReply [environment_simulation]]
|
||||
if {$sim_mode == "true"} {
|
||||
::environment::temperature::mkwest400sim tc1
|
||||
} else {
|
||||
::environment::temperature::mkwest400 tc1 $IP
|
||||
tc1 Upperlimit 1500
|
||||
tc1 Lowerlimit 0
|
||||
tc1 tolerance 10
|
||||
}
|
||||
|
||||
sicslist setatt tc1 environment_name tempone
|
||||
sicslist setatt tc1 long_name control_sensor_reading
|
||||
::environment::mkenvinfo tc1 {ramprate {priv user} powerlimit {priv manager} }
|
||||
#::environment::mkenvinfo tc1 {heateron {priv user} range {priv manager} }
|
||||
|
||||
}
|
||||
569
site_ansto/instrument/config/hmm/hmm_object.tcl
Normal file
569
site_ansto/instrument/config/hmm/hmm_object.tcl
Normal file
@@ -0,0 +1,569 @@
|
||||
namespace eval histogram_memory {
|
||||
variable HMOBJ
|
||||
|
||||
set HMOBJ hmm
|
||||
|
||||
}
|
||||
proc ::histogram_memory::initialise_dictionary {} {
|
||||
variable HMOBJ
|
||||
if [catch {
|
||||
$HMOBJ configure init 0
|
||||
$HMOBJ configure statuscheck true
|
||||
$HMOBJ init
|
||||
$HMOBJ stop
|
||||
$HMOBJ configure statuscheck false
|
||||
$HMOBJ init
|
||||
# ::histogram_memory::hmm_set_read_type HISTOPERIOD_XY
|
||||
} msg ] {
|
||||
return -code error "([info level 0]) $msg"
|
||||
}
|
||||
}
|
||||
publish ::histogram_memory::initialise_dictionary user
|
||||
|
||||
proc ::histogram_memory::select_read_type {type} {
|
||||
variable HMOBJ
|
||||
# Instrument specific X and Y dimension names
|
||||
variable INST_NXC
|
||||
variable INST_NYC
|
||||
|
||||
if [catch {
|
||||
$HMOBJ configure read_data_period_number 0
|
||||
|
||||
switch [string toupper $type] {
|
||||
"HISTOGRAM_XYT" - "HISTOPERIOD_XYT" {
|
||||
$HMOBJ configure rank 3
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
$HMOBJ configure dim2 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_XYT"
|
||||
set hmm_ext ""
|
||||
}
|
||||
"HISTOGRAM_XY" - "HISTOPERIOD_XY" {
|
||||
$HMOBJ configure rank 2
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_XY"
|
||||
set hmm_ext "_xy"
|
||||
}
|
||||
"HISTOGRAM_XT" - "HISTOPERIOD_XT" {
|
||||
$HMOBJ configure rank 2
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_XT"
|
||||
set hmm_ext "_xt"
|
||||
}
|
||||
"HISTOGRAM_YT" - "HISTOPERIOD_YT" {
|
||||
$HMOBJ configure rank 2
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_YT"
|
||||
set hmm_ext "_ty"
|
||||
}
|
||||
"HISTOGRAM_X" - "HISTOPERIOD_X" {
|
||||
$HMOBJ configure rank 1
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_X"
|
||||
set hmm_ext "_x"
|
||||
}
|
||||
"HISTOGRAM_Y" - "HISTOPERIOD_Y" {
|
||||
$HMOBJ configure rank 1
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_Y"
|
||||
set hmm_ext "_y"
|
||||
}
|
||||
"HISTOGRAM_T" - "HISTOPERIOD_T" {
|
||||
$HMOBJ configure rank 1
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
$HMOBJ configure READ_DATA_TYPE "HISTOPERIOD_T"
|
||||
set hmm_ext "_t"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_XY" {
|
||||
$HMOBJ configure rank 2
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
$HMOBJ configure READ_DATA_TYPE $type
|
||||
set hmm_ext "_total_xy"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_XT" {
|
||||
$HMOBJ configure rank 2
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
$HMOBJ configure READ_DATA_TYPE $type
|
||||
set hmm_ext "_total_xt"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_YT" {
|
||||
$HMOBJ configure rank 2
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
$HMOBJ configure READ_DATA_TYPE $type
|
||||
set hmm_ext "_total_ty"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_XP" {
|
||||
$HMOBJ configure rank 2
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
$HMOBJ configure dim1 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]]
|
||||
$HMOBJ configure READ_DATA_TYPE $type
|
||||
set hmm_ext "_total_xp"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_YP" {
|
||||
$HMOBJ configure rank 2
|
||||
$HMOBJ configure dim0 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]]
|
||||
$HMOBJ configure dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
$HMOBJ configure READ_DATA_TYPE $type
|
||||
set hmm_ext "_total_py"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_X" {
|
||||
$HMOBJ configure rank 1
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
$HMOBJ configure READ_DATA_TYPE $type
|
||||
set hmm_ext "_total_x"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_Y" {
|
||||
$HMOBJ configure rank 1
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
$HMOBJ configure READ_DATA_TYPE $type
|
||||
set hmm_ext "_total_y"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_T" {
|
||||
$HMOBJ configure rank 1
|
||||
$HMOBJ configure dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
$HMOBJ configure READ_DATA_TYPE $type
|
||||
set hmm_ext "_total_t"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_P" {
|
||||
$HMOBJ configure rank 1
|
||||
$HMOBJ configure dim0 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]]
|
||||
$HMOBJ configure READ_DATA_TYPE $type
|
||||
set hmm_ext "_total_p"
|
||||
}
|
||||
default {
|
||||
error "ERROR: [info level 0], unknown data type $type"
|
||||
}
|
||||
}
|
||||
} msg ] {
|
||||
return -code error "([info level 0]) $msg"
|
||||
}
|
||||
return $hmm_ext
|
||||
}
|
||||
publish ::histogram_memory::select_read_type user
|
||||
|
||||
##
|
||||
# @brief Instrument specific configurations can redefine this
|
||||
# to select extra read data types or override one of the
|
||||
# common data types for the histogram memory.
|
||||
proc ::histogram_memory::is_select_read_type {type} {
|
||||
variable HMOBJ
|
||||
# Instrument specific X and Y dimension names
|
||||
variable INST_NXC
|
||||
variable INST_NYC
|
||||
|
||||
return "notfound"
|
||||
}
|
||||
publish ::histogram_memory::is_select_read_type user
|
||||
|
||||
##
|
||||
# @brief Set the read data type, if there is no instrument
|
||||
# specific type then set a common type.
|
||||
proc ::histogram_memory::hmm_set_read_type {type} {
|
||||
variable HMOBJ
|
||||
|
||||
if [ catch {
|
||||
set hmm_ext [is_select_read_type $type]
|
||||
if {$hmm_ext == "notfound"} {
|
||||
set hmm_ext [select_read_type $type]
|
||||
}
|
||||
$HMOBJ configure hmm_ext $hmm_ext
|
||||
$HMOBJ init
|
||||
} msg ] {
|
||||
return -code error "([info level 0]) $msg"
|
||||
}
|
||||
}
|
||||
|
||||
##
|
||||
# @brief Generate the "axes" string for NeXus plotable data and
|
||||
# link the axes to the data group
|
||||
proc ::histogram_memory::gen_axes {alist} {
|
||||
variable histmem_axes
|
||||
if [ catch {
|
||||
foreach axis_ID $alist {
|
||||
hsetprop $histmem_axes($axis_ID) link data_set
|
||||
set axis_name [lindex [split $histmem_axes($axis_ID) "/" ] end]
|
||||
lappend axes_list $axis_name
|
||||
}
|
||||
set axes [join $axes_list ":"]
|
||||
} msg ] {
|
||||
return -code error "([info level 0]) $msg"
|
||||
}
|
||||
return $axes
|
||||
}
|
||||
##
|
||||
# @brief Defines axes for each histmem data type
|
||||
# @return {rank $rank dimstr $dimstr axis_list $axis_list hmmdatname $hmmdatname}
|
||||
proc ::histogram_memory::set_axes {typelist} {
|
||||
variable histmem_axes
|
||||
variable HMOBJ
|
||||
variable HP_HMM
|
||||
# Instrument specific X and Y dimension names
|
||||
variable INST_NXC
|
||||
variable INST_NYC
|
||||
|
||||
if [catch {
|
||||
set signal 1
|
||||
foreach type $typelist {
|
||||
switch [string toupper $type] {
|
||||
"HISTOGRAM_XYT" - "HISTOPERIOD_XYT" {
|
||||
lappend rank 3
|
||||
set dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
set dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
set dim2 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
lappend dimstr "$dim0,$dim1,$dim2"
|
||||
lappend hmmslabstart [list 0 0 0]
|
||||
lappend hmmslabend [list $dim0 $dim1 $dim2]
|
||||
lappend hmmperiodsize [expr $dim0 * $dim1 * $dim2]
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR HOR VER TOF}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname $HMOBJ
|
||||
}
|
||||
"HISTOGRAM_XY" - "HISTOPERIOD_XY" {
|
||||
lappend rank 2
|
||||
set dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
set dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
lappend dimstr "$dim0,$dim1"
|
||||
lappend hmmslabstart [list 0 0]
|
||||
lappend hmmslabend [list $dim0 $dim1]
|
||||
lappend hmmperiodsize [expr $dim0 * $dim1]
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR HOR VER}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_xy"
|
||||
}
|
||||
"HISTOGRAM_XT" - "HISTOPERIOD_XT" {
|
||||
lappend rank 2
|
||||
set dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
set dim1 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
lappend dimstr "$dim0,$dim1"
|
||||
lappend hmmslabstart [list 0 0]
|
||||
lappend hmmslabend [list $dim0 $dim1]
|
||||
lappend hmmperiodsize [expr $dim0 * $dim1]
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR HOR TOF}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_xt"
|
||||
}
|
||||
"HISTOGRAM_YT" - "HISTOPERIOD_YT" {
|
||||
lappend rank 2
|
||||
set dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
set dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
lappend dimstr "$dim0,$dim1"
|
||||
lappend hmmslabstart [list 0 0]
|
||||
lappend hmmslabend [list $dim0 $dim1]
|
||||
lappend hmmperiodsize [expr $dim0 * $dim1]
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR TOF VER}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_ty"
|
||||
}
|
||||
"HISTOGRAM_X" - "HISTOPERIOD_X" {
|
||||
lappend rank 1
|
||||
set dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
lappend dimstr "$dim0"
|
||||
lappend hmmslabstart [list 0]
|
||||
lappend hmmslabend [list $dim0]
|
||||
lappend hmmperiodsize $dim0
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR HOR}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_x"
|
||||
}
|
||||
"HISTOGRAM_Y" - "HISTOPERIOD_Y" {
|
||||
lappend rank 1
|
||||
set dim0 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
lappend dimstr "$dim0"
|
||||
lappend hmmslabstart [list 0]
|
||||
lappend hmmslabend [list $dim0]
|
||||
lappend hmmperiodsize $dim0
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR VER}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_y"
|
||||
}
|
||||
"HISTOGRAM_T" - "HISTOPERIOD_T" {
|
||||
lappend rank 1
|
||||
set dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
lappend dimstr "$dim0"
|
||||
lappend hmmslabstart [list 0]
|
||||
lappend hmmslabend [list $dim0]
|
||||
lappend hmmperiodsize $dim0
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR TOF}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_t"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_XY" {
|
||||
lappend rank 2
|
||||
set dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
set dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
lappend dimstr "$dim0,$dim1"
|
||||
lappend hmmslabstart [list 0 0]
|
||||
lappend hmmslabend [list $dim0 $dim1]
|
||||
lappend hmmperiodsize [expr $dim0 * $dim1]
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR HOR VER}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_total_xy"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_XY_CORRECTED" {
|
||||
lappend rank 2
|
||||
set dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
set dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
lappend dimstr "$dim0,$dim1"
|
||||
lappend hmmslabstart [list 0 0]
|
||||
lappend hmmslabend [list $dim0 $dim1]
|
||||
lappend hmmperiodsize [expr $dim0 * $dim1]
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR HOR VER}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_total_xy_corrected"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_XT" {
|
||||
lappend rank 2
|
||||
set dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
set dim1 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
lappend dimstr "$dim0,$dim1"
|
||||
lappend hmmslabstart [list 0 0]
|
||||
lappend hmmslabend [list $dim0 $dim1]
|
||||
lappend hmmperiodsize [expr $dim0 * $dim1]
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR HOR TOF}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_total_xt"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_YT" {
|
||||
lappend rank 2
|
||||
set dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
set dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
lappend dimstr "$dim0,$dim1"
|
||||
lappend hmmslabstart [list 0 0]
|
||||
lappend hmmslabend [list $dim0 $dim1]
|
||||
lappend hmmperiodsize [expr $dim0 * $dim1]
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR TOF VER}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_total_ty"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_XP" {
|
||||
lappend rank 2
|
||||
set dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
set dim1 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]]
|
||||
lappend dimstr "$dim0,$dim1"
|
||||
lappend hmmslabstart [list 0 0]
|
||||
lappend hmmslabend [list $dim0 $dim1]
|
||||
lappend hmmperiodsize [expr $dim0 * $dim1]
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR HOR PER}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_total_xp"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_YP" {
|
||||
lappend rank 2
|
||||
set dim0 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]]
|
||||
set dim1 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
lappend dimstr "$dim0,$dim1"
|
||||
lappend hmmslabstart [list 0 0]
|
||||
lappend hmmslabend [list $dim0 $dim1]
|
||||
lappend hmmperiodsize [expr $dim0 * $dim1]
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR PER VER}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_total_py"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_X" {
|
||||
lappend rank 1
|
||||
set dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
lappend dimstr "$dim0"
|
||||
lappend hmmslabstart [list 0]
|
||||
lappend hmmslabend [list $dim0]
|
||||
lappend hmmperiodsize $dim0
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR HOR}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_total_x"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_X_CORRECTED" {
|
||||
lappend rank 1
|
||||
set dim0 [SplitReply [$HMOBJ configure $INST_NXC]]
|
||||
lappend dimstr "$dim0"
|
||||
lappend hmmslabstart [list 0]
|
||||
lappend hmmslabend [list $dim0]
|
||||
lappend hmmperiodsize $dim0
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR HOR}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_total_x_corrected"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_Y" {
|
||||
lappend rank 1
|
||||
set dim0 [SplitReply [$HMOBJ configure $INST_NYC]]
|
||||
lappend dimstr "$dim0"
|
||||
lappend hmmslabstart [list 0]
|
||||
lappend hmmslabend [list $dim0]
|
||||
lappend hmmperiodsize $dim0
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR VER}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_total_y"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_T" {
|
||||
lappend rank 1
|
||||
set dim0 [SplitReply [$HMOBJ configure oat_ntc_eff]]
|
||||
lappend dimstr "$dim0"
|
||||
lappend hmmslabstart [list 0]
|
||||
lappend hmmslabend [list $dim0]
|
||||
lappend hmmperiodsize $dim0
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR TOF}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_total_t"
|
||||
}
|
||||
"TOTAL_HISTOGRAM_P" {
|
||||
lappend rank 1
|
||||
set dim0 [expr 1 + [SplitReply [$HMOBJ configure maximum_period]]]
|
||||
lappend dimstr "$dim0"
|
||||
lappend hmmslabstart [list 0]
|
||||
lappend hmmslabend [list $dim0]
|
||||
lappend hmmperiodsize $dim0
|
||||
lappend axeslist [::histogram_memory::gen_axes {SVAR PER}]
|
||||
lappend siglist $signal
|
||||
lappend hmmdatname "${HMOBJ}_total_p"
|
||||
}
|
||||
default {
|
||||
error "ERROR: [info level 0], unknown data type $type"
|
||||
}
|
||||
}
|
||||
incr signal
|
||||
}
|
||||
hsetprop $HP_HMM hmmrank $rank
|
||||
hsetprop $HP_HMM hmmdimstr $dimstr
|
||||
hsetprop $HP_HMM hmmslabstart $hmmslabstart
|
||||
hsetprop $HP_HMM hmmslabend $hmmslabend
|
||||
hsetprop $HP_HMM hmmperiodsize $hmmperiodsize
|
||||
hsetprop $HP_HMM hmmdatname $hmmdatname
|
||||
hsetprop $HP_HMM @axes $axeslist
|
||||
hsetprop $HP_HMM @signal $siglist
|
||||
} msg ] {
|
||||
return -code error "([info level 0]) $msg"
|
||||
}
|
||||
return ok
|
||||
}
|
||||
|
||||
publish ::histogram_memory::hmm_set_read_type user
|
||||
|
||||
proc ::histogram_memory::gethmm {type} {
|
||||
variable HMOBJ
|
||||
if [catch {
|
||||
# set currType [SplitReply [$HMOBJ configure READ_DATA_TYPE]]
|
||||
::histogram_memory::hmm_set_read_type $type
|
||||
set hmdata [hmm get 1]
|
||||
# ::histogram_memory::hmm_set_read_type $currType
|
||||
} msg ] {
|
||||
return -code error "([info level 0]) $msg"
|
||||
}
|
||||
return $hmdata
|
||||
}
|
||||
publish ::histogram_memory::gethmm user
|
||||
|
||||
|
||||
proc ::histogram_memory::hmm_xy {cmd hmdirect} {
|
||||
if [catch {
|
||||
if {$cmd == "get" && $hmdirect == 1} {
|
||||
return [gethmm HISTOPERIOD_XY]
|
||||
}
|
||||
} msg ] {
|
||||
return -code error "([info level 0]) $msg"
|
||||
}
|
||||
}
|
||||
publish ::histogram_memory::hmm_xy user
|
||||
|
||||
proc ::histogram_memory::hdb_hmget {hpath} {
|
||||
if [ catch {
|
||||
# set hpath [SplitReply [sicslist ::histogram_memory::hdb_hmget hdb_path]]
|
||||
::histogram_memory::hmm_set_read_type [hgetpropval $hpath read_data_type]
|
||||
} msg ] {
|
||||
return -code error "([info level 0]) $msg"
|
||||
}
|
||||
hmm get 1
|
||||
}
|
||||
|
||||
namespace eval ::nexus::histmem {
|
||||
variable HMOBJ
|
||||
set HMOBJ hmm
|
||||
|
||||
proc hmm_set_sdsinfo {} {
|
||||
variable HMOBJ
|
||||
|
||||
if [catch {
|
||||
set dim0 [SplitReply [$HMOBJ configure dim0]]
|
||||
set dim1 [SplitReply [$HMOBJ configure dim1]]
|
||||
set dim2 [SplitReply [$HMOBJ configure dim2]]
|
||||
set rank [expr 1 + [SplitReply [$HMOBJ configure rank]]]
|
||||
switch $rank {
|
||||
2 {
|
||||
set dimstr "-1,$dim0"
|
||||
set hmslabstart [list 0]
|
||||
set hmslabend [list $dim0]
|
||||
set hmperiodsize $dim0
|
||||
|
||||
}
|
||||
3 {
|
||||
set dimstr "-1,$dim0,$dim1"
|
||||
set hmslabstart [list 0 0]
|
||||
set hmslabend [list $dim0 $dim1]
|
||||
set hmperiodsize [expr $dim0 * $dim1]
|
||||
}
|
||||
4 {
|
||||
set dimstr "-1,$dim0,$dim1,$dim2"
|
||||
set hmslabstart [list 0 0 0]
|
||||
set hmslabend [list $dim0 $dim1 $dim2]
|
||||
set hmperiodsize [expr $dim0 * $dim1 * $dim2]
|
||||
}
|
||||
default {
|
||||
error "ERROR: [info level 0] invalid rank $rank. Must be 2, 3, or 4"
|
||||
}
|
||||
}
|
||||
$HMOBJ configure hmslabstart $hmslabstart
|
||||
$HMOBJ configure hmslabend $hmslabend
|
||||
$HMOBJ configure hmperiodsize $hmperiodsize
|
||||
|
||||
set hmm_ext [SplitReply [$HMOBJ configure hmm_ext]]
|
||||
broadcast nxscript updatedictvar padimstr $dimstr
|
||||
nxscript updatedictvar padimstr $dimstr
|
||||
broadcast nxscript updatedictvar parank $rank
|
||||
nxscript updatedictvar parank $rank
|
||||
broadcast nxscript updatedictvar pahmm_ext $hmm_ext
|
||||
nxscript updatedictvar pahmm_ext $hmm_ext
|
||||
} msg ] {
|
||||
return -code error "([info level 0]) $msg"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
publish ::nexus::histmem::nxopen user
|
||||
publish ::nexus::histmem::hmm_set_sdsinfo user
|
||||
publish ::nexus::histmem::savehmm user
|
||||
publish ::histogram_memory::hdb_hmget user
|
||||
|
||||
namespace eval histogram_memory {
|
||||
set HMSCOBJ hmscobj
|
||||
set HP_HMM /sics/$HMSCOBJ/hmm
|
||||
MakeSICSObj hmscobj SCT_OBJECT
|
||||
hfactory $HP_HMM script "::histogram_memory::hdb_hmget $HP_HMM" hdbReadOnly intvarar 10
|
||||
hsetprop $HP_HMM read_data_type HISTOPERIOD_XY
|
||||
hsetprop $HP_HMM savecmd ::nexus::histmem::save
|
||||
hsetprop $HP_HMM sdsinfo ::nexus::histmem::sdsinfo
|
||||
hsetprop $HP_HMM datatype_savelist HISTOPERIOD_XY
|
||||
hsetprop $HP_HMM save_periods single_period
|
||||
hsetprop $HP_HMM privilege user
|
||||
hsetprop $HP_HMM nxsave false
|
||||
hsetprop $HP_HMM mutable true
|
||||
hsetprop $HP_HMM control false
|
||||
hsetprop $HP_HMM data true
|
||||
hsetprop $HP_HMM klass parameter
|
||||
hsetprop $HP_HMM nxalias hmscobj_hmm
|
||||
hsetprop $HP_HMM sicsdev none
|
||||
#hsetprop /sics/hmscobj/data
|
||||
#sicspoll add /sics/hmscobj/data hdb
|
||||
|
||||
sicslist setatt $HMSCOBJ kind scobj
|
||||
sicslist setatt $HMSCOBJ klass NXdetector
|
||||
sicslist setatt $HMSCOBJ long_name detector
|
||||
sicslist setatt $HMSCOBJ privilege user
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# $Revision: 1.2 $
|
||||
# $Date: 2009-12-11 02:09:56 $
|
||||
# $Revision: 1.2.2.1 $
|
||||
# $Date: 2009-12-11 02:14:03 $
|
||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||
# Last revision by: $Author: ffr $
|
||||
|
||||
|
||||
Reference in New Issue
Block a user