commands_common.tcl
Added histmem and runscan command hmm_configuration_common_1.tcl Set histmem_cmd status feedback to IDLE on COUNTEND event nxscripts_common_1.tcl When saving a set of files the time-stamp is offset from the time the first file is created. scan_common_1.tcl The hmscan hook functions now set feedback on the runscan_cmd sct_positmotor_common.tcl Added mk_sct_positmotor command to create a script context controller which runs a motor to an indexed position. Added positmotor_configuration.tcl to echidna, wombat, kowari, quokka, platypus. sans/config/motors/positmotor_configuration.tcl Has an example of a positmotor configuration for the sample changer sanx/quokka_configuration.tcl Setup feedback nodes for AttRotDeg and RotApDeg. motor_utility.tcl Added reldrive and relrun commands along with getmotpar convenience command. r2725 | ffr | 2008-10-27 15:55:48 +1100 (Mon, 27 Oct 2008) | 26 lines
This commit is contained in:
committed by
Douglas Clowes
parent
7ded983eba
commit
81f98bd337
@@ -4,8 +4,52 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
namespace eval commands { }
|
namespace eval commands { }
|
||||||
|
|
||||||
|
proc ::commands::ic_initialize {} {
|
||||||
|
namespace eval ::histogram {
|
||||||
|
set NS [namespace current]
|
||||||
|
|
||||||
|
command histmem_cmd [subst {
|
||||||
|
text=start,stop,pause cmd
|
||||||
|
text=[join $::histogram_memory::ic_count_methods , ] mode
|
||||||
|
int=0:inf preset
|
||||||
|
float freq
|
||||||
|
text=[join $::histogram_memory::ic_fsrce_values , ] frame_source
|
||||||
|
}] {
|
||||||
|
switch $cmd {
|
||||||
|
"stop" {
|
||||||
|
histmem stop
|
||||||
|
::histogram::histmem_cmd -set feedback status IDLE
|
||||||
|
}
|
||||||
|
"pause" {
|
||||||
|
histmem pause
|
||||||
|
::histogram::histmem_cmd -set feedback status PAUSED
|
||||||
|
}
|
||||||
|
"start" {
|
||||||
|
histmem mode $mode
|
||||||
|
histmem preset $preset
|
||||||
|
histmem freq $freq
|
||||||
|
histmem fsrce $frame_source
|
||||||
|
histmem start
|
||||||
|
::histogram::histmem_cmd -set feedback status BUSY
|
||||||
|
}
|
||||||
|
default {
|
||||||
|
# $cmd unknown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::histogram::histmem_cmd -set mode [histmem mode]
|
||||||
|
::histogram::histmem_cmd -set preset [histmem preset]
|
||||||
|
::histogram::histmem_cmd -set freq [histmem freq]
|
||||||
|
::histogram::histmem_cmd -set frame_source [histmem fsrce]
|
||||||
|
::histogram::histmem_cmd -addfb text status
|
||||||
|
::histogram::histmem_cmd -set feedback status IDLE
|
||||||
|
sicslist setatt ::histogram::histmem_cmd long_name histmem
|
||||||
|
}
|
||||||
# SCAN COMMANDS
|
# SCAN COMMANDS
|
||||||
namespace eval scan {
|
namespace eval ::scan {
|
||||||
|
set NS [uplevel namespace current]
|
||||||
|
|
||||||
|
|
||||||
command hdb_bmonscan {
|
command hdb_bmonscan {
|
||||||
text=drivable scan_variable
|
text=drivable scan_variable
|
||||||
float scan_start
|
float scan_start
|
||||||
@@ -34,40 +78,30 @@ command hdb_bmonscan {
|
|||||||
::scan::hdb_bmonscan -addfb text mode float preset float scan_variable_value int scanpoint int counts text status
|
::scan::hdb_bmonscan -addfb text mode float preset float scan_variable_value int scanpoint int counts text status
|
||||||
::scan::hdb_bmonscan -set feedback status IDLE
|
::scan::hdb_bmonscan -set feedback status IDLE
|
||||||
|
|
||||||
command hdb_hmscan {
|
|
||||||
|
command runscan_cmd [subst {
|
||||||
text=drivable scan_variable
|
text=drivable scan_variable
|
||||||
float scan_start
|
float scan_start
|
||||||
float scan_increment
|
float scan_stop
|
||||||
int NP
|
int=0:inf numpoints
|
||||||
text=monitor,timer mode
|
text=[join [concat [list time unlimited period count frame] $::counter::isc_beam_monitor_list ] , ] mode
|
||||||
float preset
|
float=0,inf preset
|
||||||
int=0,2 channel
|
text=[join [array names ::nexus::histmem_filetype_spec] , ] datatype
|
||||||
} {
|
text=save,nosave savetype
|
||||||
|
text=true,false force
|
||||||
hmscan clear
|
}] {
|
||||||
|
::scan::runscan $scan_variable $scan_start $scan_stop $numpoints $mode $preset savetype $savetype datatype $datatype force $force
|
||||||
hmscan add $scan_variable $scan_start $scan_increment
|
|
||||||
hmscan setchannel $channel;
|
|
||||||
set status [catch {hmscan run $NP $mode $preset} msg]
|
|
||||||
|
|
||||||
if {$status == 0} {
|
|
||||||
return $msg
|
|
||||||
} else {
|
|
||||||
return -code error "ERROR [info level 0]"
|
|
||||||
}
|
}
|
||||||
|
::scan::runscan_cmd -addfb float scan_variable_value float scan_step int scanpoint text status
|
||||||
|
::scan::runscan_cmd -set feedback status IDLE
|
||||||
}
|
sicslist setatt ::scan::runscan_cmd long_name runscan
|
||||||
::scan::hdb_hmscan -addfb text mode float preset float scan_variable_value int scanpoint int counts text status
|
|
||||||
::scan::hdb_hmscan -set feedback status IDLE
|
|
||||||
}
|
}
|
||||||
sicslist setatt ::scan::hdb_bmonscan long_name bmonscan
|
sicslist setatt ::scan::hdb_bmonscan long_name bmonscan
|
||||||
sicslist setatt ::scan::hdb_hmscan long_name hmscan
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# MONITOR COMMANDS
|
# MONITOR COMMANDS
|
||||||
namespace eval monitor {
|
namespace eval ::monitor {
|
||||||
command count {
|
command count {
|
||||||
text=timer,monitor mode
|
text=timer,monitor mode
|
||||||
float preset
|
float preset
|
||||||
@@ -83,7 +117,6 @@ namespace eval monitor {
|
|||||||
}
|
}
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
proc ::commands::ic_initialize {} {
|
|
||||||
# Generate the following commands,
|
# Generate the following commands,
|
||||||
# ::motor::go_home
|
# ::motor::go_home
|
||||||
namespace eval ::motor {
|
namespace eval ::motor {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# $Revision: 1.41 $
|
# $Revision: 1.42 $
|
||||||
# $Date: 2008-09-24 04:28:44 $
|
# $Date: 2008-10-27 04:55:41 $
|
||||||
# Author: Ferdi Franceschini
|
# Author: Ferdi Franceschini
|
||||||
# Based on the examples in the hs_test.tcl sample configuration by Mark Lesha.
|
# Based on the examples in the hs_test.tcl sample configuration by Mark Lesha.
|
||||||
# http://gumtree.ansto.gov.au:9080/nbicms/bragg-systems/histogram-server/hs_test.tcl/view
|
# http://gumtree.ansto.gov.au:9080/nbicms/bragg-systems/histogram-server/hs_test.tcl/view
|
||||||
@@ -1578,10 +1578,11 @@ sicslist setatt ::histogram_memory::time units seconds
|
|||||||
|
|
||||||
##
|
##
|
||||||
# @brief Update the beam monitors when the histmem has finished counting.
|
# @brief Update the beam monitors when the histmem has finished counting.
|
||||||
proc ::histogram_memory::update_bm {} {
|
proc ::histogram_memory::countend_event {} {
|
||||||
|
::histogram::histmem_cmd -set feedback status IDLE
|
||||||
bm status
|
bm status
|
||||||
}
|
}
|
||||||
publish ::histogram_memory::update_bm user
|
publish ::histogram_memory::countend_event user
|
||||||
|
|
||||||
##
|
##
|
||||||
# @brief Sets histogram server to default configuration, initialises SICS histogram memory
|
# @brief Sets histogram server to default configuration, initialises SICS histogram memory
|
||||||
@@ -1645,7 +1646,7 @@ proc ::histogram_memory::ic_initialize {} {
|
|||||||
hmm configure hmDataPath ../HMData
|
hmm configure hmDataPath ../HMData
|
||||||
hmm configure hmconfigscript $configuration
|
hmm configure hmconfigscript $configuration
|
||||||
::histogram_memory::configure_dims
|
::histogram_memory::configure_dims
|
||||||
scriptcallback connect hmm COUNTEND ::histogram_memory::update_bm
|
scriptcallback connect hmm COUNTEND ::histogram_memory::countend_event
|
||||||
} message ] {
|
} message ] {
|
||||||
if {$::errorCode=="NONE"} {return $message}
|
if {$::errorCode=="NONE"} {return $message}
|
||||||
return -code error $message
|
return -code error $message
|
||||||
|
|||||||
190
site_ansto/instrument/config/motors/sct_positmotor_common.tcl
Normal file
190
site_ansto/instrument/config/motors/sct_positmotor_common.tcl
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
namespace eval ::sobj::positmotor {
|
||||||
|
variable posit_table
|
||||||
|
variable posit_indices
|
||||||
|
# TODO Add a script to edit the posit_table and attach it to indexed nodes with read and write actions.
|
||||||
|
|
||||||
|
proc abort_on_invalid_posindex {pos} {
|
||||||
|
variable posit_indices
|
||||||
|
|
||||||
|
set pos0 [lindex $posit_indices 0]
|
||||||
|
set posend [lindex $posit_indices end]
|
||||||
|
if {$pos < $pos0 || $pos > $posend} {
|
||||||
|
return -code error "ERROR: Indexed position must be between $pos0 and $posend"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
##
|
||||||
|
# @brief Convert an indexed position to a physical motor position
|
||||||
|
proc pos2val {pos} {
|
||||||
|
variable posit_table
|
||||||
|
|
||||||
|
if [ catch {
|
||||||
|
abort_on_invalid_posindex $pos
|
||||||
|
set bot [expr int(floor($pos))]
|
||||||
|
set top [expr int(ceil($pos))]
|
||||||
|
set fract [expr fmod($pos,1)]
|
||||||
|
set val [expr $fract * ($posit_table($top) - $posit_table($bot)) + $posit_table($bot)]
|
||||||
|
} message ] {
|
||||||
|
return -code error $message
|
||||||
|
} else {
|
||||||
|
return $val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
##
|
||||||
|
# @brief Convert a physical motor position to and indexed position
|
||||||
|
proc val2pos {val precision} {
|
||||||
|
variable posit_table
|
||||||
|
variable posit_indices
|
||||||
|
|
||||||
|
set val [expr double($val)]
|
||||||
|
set pos0 [lindex $posit_indices 0]
|
||||||
|
set posend [lindex $posit_indices end]
|
||||||
|
if {$val < [expr $posit_table($pos0) - $precision]} {return -$pos0}
|
||||||
|
if {$val > [expr $posit_table($posend) + $precision]} {return -$posend}
|
||||||
|
if [catch {
|
||||||
|
set ibot $pos0
|
||||||
|
set itop [lindex $posit_indices 1]
|
||||||
|
while {$val > [expr $posit_table($itop) + $precision]} {
|
||||||
|
incr ibot
|
||||||
|
incr itop
|
||||||
|
}
|
||||||
|
set bot [expr $posit_table($ibot)]
|
||||||
|
set top [expr $posit_table($itop)]
|
||||||
|
if {[expr $bot - $precision] <= $val && $val <= [expr $bot + $precision]} {
|
||||||
|
set pos $ibot
|
||||||
|
} elseif {[expr $top - $precision] <= $val && $val <= [expr $top + $precision]} {
|
||||||
|
set pos $itop
|
||||||
|
} else {
|
||||||
|
# set pos [format "%.3f" [expr int(($val -$bot)/$precision)*$precision/($top - $bot) + $ibot]]
|
||||||
|
set pos [expr int(($val -$bot)/$precision)*$precision/($top - $bot) + $ibot]
|
||||||
|
}
|
||||||
|
} errmsg] {
|
||||||
|
return -code error $errmsg
|
||||||
|
} else {
|
||||||
|
return $pos
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
proc rd_index {par motor} {
|
||||||
|
sct result [SplitReply [$motor]]
|
||||||
|
return state_reading_index
|
||||||
|
}
|
||||||
|
|
||||||
|
proc state_reading_index {path par} {
|
||||||
|
variable posit_table
|
||||||
|
sct writestatus replyreceived
|
||||||
|
set rply [val2pos [sct result] [hval $path/motprecision]]
|
||||||
|
set data $rply
|
||||||
|
# broadcast state_reading_index update parameter $par $data
|
||||||
|
if {$data != [sct oldval] || [sct force_update] } {
|
||||||
|
# if {[status] == "status = Driving" && [hval $path/state] == "idle"} {
|
||||||
|
# hset $path/state busy
|
||||||
|
# }
|
||||||
|
sct oldval $data
|
||||||
|
sct update $data
|
||||||
|
sct force_update False
|
||||||
|
sct utime readtime
|
||||||
|
}
|
||||||
|
if {[hval $path/state] == "stopping"} {
|
||||||
|
hset $path/state idle
|
||||||
|
}
|
||||||
|
return idle
|
||||||
|
}
|
||||||
|
|
||||||
|
# Convert position index to a physical position before running the motor
|
||||||
|
proc w_index {sct_controller path par motor} {
|
||||||
|
variable posit_table
|
||||||
|
|
||||||
|
# broadcast w_index
|
||||||
|
if [ catch {
|
||||||
|
set val [pos2val [sct target] ]
|
||||||
|
hset $path/state busy
|
||||||
|
run $motor $val
|
||||||
|
$sct_controller poll $path 1
|
||||||
|
} errmsg ] {
|
||||||
|
error $errmsg
|
||||||
|
return idle
|
||||||
|
} else {
|
||||||
|
return idle
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# TODO Check thread 0 and motion control disabled?
|
||||||
|
proc check_motor {} {
|
||||||
|
# broadcast check_motor
|
||||||
|
set val [sct target]
|
||||||
|
return OK
|
||||||
|
}
|
||||||
|
|
||||||
|
proc setposindex {posindex val} {
|
||||||
|
variable posit_table
|
||||||
|
|
||||||
|
set posit_table($posindex) $val
|
||||||
|
}
|
||||||
|
|
||||||
|
proc mk_sct_positmotor {sct_controller motname param axis posit_list} {
|
||||||
|
variable posit_table
|
||||||
|
variable posit_indices
|
||||||
|
|
||||||
|
array set posit_table $posit_list
|
||||||
|
set posit_indices [lsort [array names posit_table]]
|
||||||
|
|
||||||
|
|
||||||
|
if [ catch {
|
||||||
|
set ns ::sobj::positmotor
|
||||||
|
set parnode ${motname}_motor
|
||||||
|
MakeSICSObj $parnode SCT_MOTOR
|
||||||
|
# Make setable position parameter and poll it.
|
||||||
|
set posindex_node /sics/${parnode}/${param}
|
||||||
|
hfactory $posindex_node plain spy float
|
||||||
|
hsetprop $posindex_node read ${ns}::rd_index $param $motname
|
||||||
|
hsetprop $posindex_node state_reading_index ${ns}::state_reading_index $posindex_node $param
|
||||||
|
hsetprop $posindex_node write ${ns}::w_index $sct_controller $posindex_node $param $motname
|
||||||
|
hsetprop $posindex_node check ${ns}::check_motor
|
||||||
|
|
||||||
|
hsetprop $posindex_node oldval UNKNOWN
|
||||||
|
hsetprop $posindex_node force_update True
|
||||||
|
# hsetprop $posindex_node motprecision [SplitReply [samx precision]]
|
||||||
|
hfactory $posindex_node/motprecision script "getmotpar samx precision" "samx precision " float 1
|
||||||
|
|
||||||
|
hfactory $posindex_node/lookup_table plain spy none
|
||||||
|
hsetprop $posindex_node/lookup_table numpos [llength $posit_indices]
|
||||||
|
foreach posindex $posit_indices {
|
||||||
|
hfactory $posindex_node/lookup_table/$posindex script "${ns}::pos2val $posindex" "${ns}::setposindex $posindex " float 1
|
||||||
|
}
|
||||||
|
|
||||||
|
hfactory $posindex_node/state plain spy text
|
||||||
|
hset $posindex_node/state idle
|
||||||
|
|
||||||
|
proc ${motname}_MOTEND {} [subst -nocommands {
|
||||||
|
if { [hval $posindex_node/state] == "busy"} {
|
||||||
|
$sct_controller poll $posindex_node 5
|
||||||
|
hset $posindex_node/state stopping
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
publish ${ns}::${motname}_MOTEND user
|
||||||
|
|
||||||
|
scriptcallback connect $motname MOTEND ${ns}::${motname}_MOTEND
|
||||||
|
|
||||||
|
$sct_controller poll $posindex_node
|
||||||
|
$sct_controller write $posindex_node
|
||||||
|
|
||||||
|
} message ] {
|
||||||
|
return -code error $message
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace export mk_sct_positmotor
|
||||||
|
}
|
||||||
|
namespace import ::sobj::positmotor::*
|
||||||
|
##
|
||||||
|
# Eg
|
||||||
|
# hfactory /controllers plain spy none
|
||||||
|
#
|
||||||
|
# makesctcontroller /controllers/sct_mc1 std localhost:62034
|
||||||
|
#
|
||||||
|
# mk_sct_positmotor sct_mc1 phi phi_posindex A
|
||||||
|
# mk_sct_positmotor sct_mc1 chi B { 1 0 2 15 3 20 }
|
||||||
|
|
||||||
@@ -402,6 +402,7 @@ proc ::nexus::save {{point 0}} {
|
|||||||
proc ::nexus::save_collection {args} {
|
proc ::nexus::save_collection {args} {
|
||||||
variable state
|
variable state
|
||||||
variable data_gp_path
|
variable data_gp_path
|
||||||
|
variable start_seconds
|
||||||
variable start_seconds_array
|
variable start_seconds_array
|
||||||
variable currFilename
|
variable currFilename
|
||||||
|
|
||||||
@@ -456,7 +457,7 @@ proc ::nexus::save {{point 0}} {
|
|||||||
eend [lindex [sicstime] 1]
|
eend [lindex [sicstime] 1]
|
||||||
array unset start_seconds_array
|
array unset start_seconds_array
|
||||||
set start_seconds [clock seconds]
|
set start_seconds [clock seconds]
|
||||||
set start_seconds_array($data_label) $start_seconds
|
# set start_seconds_array($data_label) $start_seconds
|
||||||
timestamp 0
|
timestamp 0
|
||||||
::nexus::nxreopenfile $currFilename($data_label)
|
::nexus::nxreopenfile $currFilename($data_label)
|
||||||
::nexus::save_data $point
|
::nexus::save_data $point
|
||||||
@@ -465,7 +466,8 @@ proc ::nexus::save {{point 0}} {
|
|||||||
::nexus::nxclosefile $currFilename($data_label)
|
::nexus::nxclosefile $currFilename($data_label)
|
||||||
} else {
|
} else {
|
||||||
eend [lindex [sicstime] 1]
|
eend [lindex [sicstime] 1]
|
||||||
timestamp [expr {[clock seconds] - $start_seconds_array($data_label)}]
|
# timestamp [expr {[clock seconds] - $start_seconds_array($data_label)}]
|
||||||
|
timestamp [expr {[clock seconds] - $start_seconds}]
|
||||||
dataFileName $currFilename($data_label)
|
dataFileName $currFilename($data_label)
|
||||||
::nexus::nxreopenfile $currFilename($data_label)
|
::nexus::nxreopenfile $currFilename($data_label)
|
||||||
::nexus::save_data $point
|
::nexus::save_data $point
|
||||||
@@ -1214,7 +1216,7 @@ foreach expt $::nexus::exports {
|
|||||||
|
|
||||||
set tmpstr [string map {"$" ""} {$Name: not supported by cvs2svn $}]
|
set tmpstr [string map {"$" ""} {$Name: not supported by cvs2svn $}]
|
||||||
set nx_content_release_tag [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
set nx_content_release_tag [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
||||||
set tmpstr [string map {"$" ""} {$Revision: 1.44 $}]
|
set tmpstr [string map {"$" ""} {$Revision: 1.45 $}]
|
||||||
set nx_content_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
set nx_content_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
||||||
|
|
||||||
#namespace eval data {
|
#namespace eval data {
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ proc ::scan::ic_initialize {} {
|
|||||||
numpoints int=0,inf
|
numpoints int=0,inf
|
||||||
mode text=[join [concat [list time unlimited period count frame] $::counter::isc_beam_monitor_list ] , ]
|
mode text=[join [concat [list time unlimited period count frame] $::counter::isc_beam_monitor_list ] , ]
|
||||||
preset float=0,inf
|
preset float=0,inf
|
||||||
filetype text=[join [array names ::nexus::histmem_filetype_spec] , ]
|
datatype text=[join [array names ::nexus::histmem_filetype_spec] , ]
|
||||||
savetype text=save,nosave
|
savetype text=save,nosave
|
||||||
force boolean
|
force boolean
|
||||||
}]
|
}]
|
||||||
@@ -207,17 +207,12 @@ proc ::scan::hmm_scan_prepare {sobj uobj} {
|
|||||||
set vlist [split [$sobj getvarpar 0] = ]
|
set vlist [split [$sobj getvarpar 0] = ]
|
||||||
set scanstart [lindex $vlist 1]
|
set scanstart [lindex $vlist 1]
|
||||||
set scanstep [lindex $vlist 2]
|
set scanstep [lindex $vlist 2]
|
||||||
::scan::hdb_hmscan -set NP $numpoints
|
|
||||||
::scan::hdb_hmscan -set scan_variable [string trim [lindex [split [lindex $vlist 0] . ] 1]]
|
|
||||||
::scan::hdb_hmscan -set scan_start $scanstart
|
|
||||||
::scan::hdb_hmscan -set scan_increment $scanstep
|
|
||||||
|
|
||||||
|
::scan::runscan_cmd -set feedback status BUSY
|
||||||
::scan::hdb_hmscan -set feedback status BUSY
|
|
||||||
run_mode "hmscan"
|
run_mode "hmscan"
|
||||||
|
|
||||||
::nexus::newfile $ic_hmm_datatype $save_filetype
|
::nexus::newfile $ic_hmm_datatype $save_filetype
|
||||||
data axis 1 [::scan::hdb_hmscan -set scan_variable]
|
data axis 1 [::scan::runscan_cmd -set scan_variable]
|
||||||
|
|
||||||
clientput "Scan start: $scanstart, Scan step: $scanstep, Number of points: $numpoints"
|
clientput "Scan start: $scanstart, Scan step: $scanstep, Number of points: $numpoints"
|
||||||
clientput "Datatype: $ic_hmm_datatype"
|
clientput "Datatype: $ic_hmm_datatype"
|
||||||
@@ -233,12 +228,8 @@ proc ::scan::hmm_scan_prepare {sobj uobj} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
proc ::scan::hmm_count {sobj uobj point mode preset} {
|
proc ::scan::hmm_count {sobj uobj point mode preset} {
|
||||||
::scan::hdb_hmscan -set mode $mode
|
::scan::runscan_cmd -set feedback scanpoint $point
|
||||||
::scan::hdb_hmscan -set preset $preset
|
::scan::runscan_cmd -set feedback scan_variable_value [SplitReply [[::scan::runscan_cmd -set scan_variable]]]
|
||||||
::scan::hdb_hmscan -set feedback scanpoint $point
|
|
||||||
::scan::hdb_hmscan -set feedback mode $mode
|
|
||||||
::scan::hdb_hmscan -set feedback preset $preset
|
|
||||||
::scan::hdb_hmscan -set feedback scan_variable_value [SplitReply [[::scan::hdb_hmscan -set scan_variable]]]
|
|
||||||
# Start histogram and block until count is complete
|
# Start histogram and block until count is complete
|
||||||
::histogram_memory::start block
|
::histogram_memory::start block
|
||||||
}
|
}
|
||||||
@@ -249,17 +240,17 @@ proc ::scan::hmm_scan_finish {sobj uobj} {
|
|||||||
variable reset_position
|
variable reset_position
|
||||||
set $save_filetype "data"
|
set $save_filetype "data"
|
||||||
::histogram_memory::stop
|
::histogram_memory::stop
|
||||||
::scan::hdb_hmscan -set feedback status IDLE
|
::scan::runscan_cmd -set feedback status IDLE
|
||||||
run_mode "normal"
|
run_mode "normal"
|
||||||
# Make sure that the next save command doesn't overwrite our scan data.
|
# Make sure that the next save command doesn't overwrite our scan data.
|
||||||
# and clear any data links
|
# and clear any data links
|
||||||
::nexus::newfile clear data
|
::nexus::newfile clear data
|
||||||
if {$reset_position == "true"} {
|
if {$reset_position == "true"} {
|
||||||
set reset_position "false"
|
set reset_position "false"
|
||||||
set svar [::scan::hdb_hmscan -get scan_variable]
|
set svar [::scan::runscan_cmd -get scan_variable]
|
||||||
set svtype [getatt $svar type]
|
set svtype [getatt $svar type]
|
||||||
if {$svtype == "motor" || $svtype == "configurablevirtualmotor"} {
|
if {$svtype == "motor" || $svtype == "configurablevirtualmotor"} {
|
||||||
drive $svar [::scan::hdb_hmscan -get scan_start]
|
drive $svar [::scan::runscan_cmd -get scan_start]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# ::histogram_memory::configure_server Filler_defaults
|
# ::histogram_memory::configure_server Filler_defaults
|
||||||
@@ -454,6 +445,13 @@ namespace eval scan {
|
|||||||
hmscan clear
|
hmscan clear
|
||||||
hmscan add $scanvar $start $step
|
hmscan add $scanvar $start $step
|
||||||
# hmscan ignores mode and preset, we use FAT_COUNT_METHOD and FAT_COUNT_STOP
|
# hmscan ignores mode and preset, we use FAT_COUNT_METHOD and FAT_COUNT_STOP
|
||||||
|
::scan::runscan_cmd -set numpoints $numpoints
|
||||||
|
::scan::runscan_cmd -set scan_variable $scanvar
|
||||||
|
::scan::runscan_cmd -set scan_start $start
|
||||||
|
::scan::runscan_cmd -set scan_stop $stop
|
||||||
|
::scan::runscan_cmd -set feedback scan_step $step
|
||||||
|
::scan::runscan_cmd -set mode $mode
|
||||||
|
::scan::runscan_cmd -set preset $preset
|
||||||
set status [catch {hmscan run $numpoints timer 0} msg]
|
set status [catch {hmscan run $numpoints timer 0} msg]
|
||||||
set force_scan false
|
set force_scan false
|
||||||
|
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ config/hmm/anstohm_linked.xml
|
|||||||
config/scan/scan_common_1.hdd
|
config/scan/scan_common_1.hdd
|
||||||
config/scan/scan_common_1.tcl
|
config/scan/scan_common_1.tcl
|
||||||
config/nexus/nxscripts_common_1.tcl
|
config/nexus/nxscripts_common_1.tcl
|
||||||
config/commands/commands_common.tcl
|
config/motors/sct_positmotor_common.tcl
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
source $cfPath(motors)/sct_positmotor_common.tcl
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# $Revision: 1.28 $
|
# $Revision: 1.29 $
|
||||||
# $Date: 2008-10-20 00:08:30 $
|
# $Date: 2008-10-27 04:55:43 $
|
||||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||||
# Last revision by: $Author: ffr $
|
# Last revision by: $Author: ffr $
|
||||||
|
|
||||||
@@ -23,6 +23,7 @@ source instrument_vars.tcl
|
|||||||
|
|
||||||
fileeval $cfPath(source)/source.tcl
|
fileeval $cfPath(source)/source.tcl
|
||||||
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
||||||
|
fileeval $cfPath(motors)/positmotor_configuration.tcl
|
||||||
fileeval $cfPath(plc)/plc.tcl
|
fileeval $cfPath(plc)/plc.tcl
|
||||||
fileeval $cfPath(counter)/counter.tcl
|
fileeval $cfPath(counter)/counter.tcl
|
||||||
#TODO Provide method for choosing environment controller
|
#TODO Provide method for choosing environment controller
|
||||||
|
|||||||
@@ -13,3 +13,4 @@ config/scan/scan_common_1.hdd
|
|||||||
config/scan/scan_common_1.tcl
|
config/scan/scan_common_1.tcl
|
||||||
config/nexus/nxscripts_common_1.tcl
|
config/nexus/nxscripts_common_1.tcl
|
||||||
config/commands/commands_common.tcl
|
config/commands/commands_common.tcl
|
||||||
|
config/motors/sct_positmotor_common.tcl
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
source $cfPath(motors)/sct_positmotor_common.tcl
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# $Revision: 1.34 $
|
# $Revision: 1.35 $
|
||||||
# $Date: 2008-10-20 00:08:30 $
|
# $Date: 2008-10-27 04:55:44 $
|
||||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||||
# Last revision by: $Author: ffr $
|
# Last revision by: $Author: ffr $
|
||||||
|
|
||||||
@@ -23,6 +23,7 @@ source instrument_vars.tcl
|
|||||||
|
|
||||||
fileeval $cfPath(source)/source.tcl
|
fileeval $cfPath(source)/source.tcl
|
||||||
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
||||||
|
fileeval $cfPath(motors)/positmotor_configuration.tcl
|
||||||
fileeval $cfPath(plc)/plc.tcl
|
fileeval $cfPath(plc)/plc.tcl
|
||||||
fileeval $cfPath(counter)/counter.tcl
|
fileeval $cfPath(counter)/counter.tcl
|
||||||
#TODO Provide method for choosing environment controller
|
#TODO Provide method for choosing environment controller
|
||||||
|
|||||||
@@ -11,3 +11,4 @@ config/scan/scan_common_1.hdd
|
|||||||
config/scan/scan_common_1.tcl
|
config/scan/scan_common_1.tcl
|
||||||
config/nexus/nxscripts_common_1.tcl
|
config/nexus/nxscripts_common_1.tcl
|
||||||
config/commands/commands_common.tcl
|
config/commands/commands_common.tcl
|
||||||
|
config/motors/sct_positmotor_common.tcl
|
||||||
|
|||||||
@@ -11,3 +11,4 @@ config/scan/scan_common_1.hdd
|
|||||||
config/scan/scan_common_1.tcl
|
config/scan/scan_common_1.tcl
|
||||||
config/nexus/nxscripts_common_1.tcl
|
config/nexus/nxscripts_common_1.tcl
|
||||||
config/commands/commands_common.tcl
|
config/commands/commands_common.tcl
|
||||||
|
config/motors/sct_positmotor_common.tcl
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
source $cfPath(motors)/sct_positmotor_common.tcl
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# $Revision: 1.21 $
|
# $Revision: 1.22 $
|
||||||
# $Date: 2008-10-20 00:08:30 $
|
# $Date: 2008-10-27 04:55:45 $
|
||||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||||
# Last revision by: $Author: ffr $
|
# Last revision by: $Author: ffr $
|
||||||
|
|
||||||
@@ -22,6 +22,7 @@ fileeval $cfPath(motors)/motor_configuration.tcl
|
|||||||
|
|
||||||
fileeval $cfPath(source)/source.tcl
|
fileeval $cfPath(source)/source.tcl
|
||||||
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
||||||
|
fileeval $cfPath(motors)/positmotor_configuration.tcl
|
||||||
fileeval $cfPath(parameters)/parameters.tcl
|
fileeval $cfPath(parameters)/parameters.tcl
|
||||||
fileeval $cfPath(plc)/plc.tcl
|
fileeval $cfPath(plc)/plc.tcl
|
||||||
fileeval $cfPath(counter)/counter.tcl
|
fileeval $cfPath(counter)/counter.tcl
|
||||||
|
|||||||
@@ -11,3 +11,4 @@ config/scan/scan_common_1.hdd
|
|||||||
config/scan/scan_common_1.tcl
|
config/scan/scan_common_1.tcl
|
||||||
config/nexus/nxscripts_common_1.tcl
|
config/nexus/nxscripts_common_1.tcl
|
||||||
config/commands/commands_common.tcl
|
config/commands/commands_common.tcl
|
||||||
|
config/motors/sct_positmotor_common.tcl
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
source $cfPath(motors)/sct_positmotor_common.tcl
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# $Revision: 1.15 $
|
# $Revision: 1.16 $
|
||||||
# $Date: 2008-10-20 00:08:30 $
|
# $Date: 2008-10-27 04:55:46 $
|
||||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||||
# Last revision by: $Author: ffr $
|
# Last revision by: $Author: ffr $
|
||||||
|
|
||||||
@@ -22,6 +22,7 @@ fileeval $cfPath(motors)/motor_configuration.tcl
|
|||||||
|
|
||||||
fileeval $cfPath(source)/source.tcl
|
fileeval $cfPath(source)/source.tcl
|
||||||
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
||||||
|
fileeval $cfPath(motors)/positmotor_configuration.tcl
|
||||||
fileeval $cfPath(plc)/plc.tcl
|
fileeval $cfPath(plc)/plc.tcl
|
||||||
fileeval $cfPath(counter)/counter.tcl
|
fileeval $cfPath(counter)/counter.tcl
|
||||||
fileeval $cfPath(hmm)/hmm_configuration.tcl
|
fileeval $cfPath(hmm)/hmm_configuration.tcl
|
||||||
|
|||||||
@@ -11,3 +11,4 @@ config/scan/scan_common_1.hdd
|
|||||||
config/scan/scan_common_1.tcl
|
config/scan/scan_common_1.tcl
|
||||||
config/nexus/nxscripts_common_1.tcl
|
config/nexus/nxscripts_common_1.tcl
|
||||||
config/commands/commands_common.tcl
|
config/commands/commands_common.tcl
|
||||||
|
config/motors/sct_positmotor_common.tcl
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
source $cfPath(motors)/sct_positmotor_common.tcl
|
||||||
|
|
||||||
|
set port [::utility::get_portnum pmc1-quokka]
|
||||||
|
makesctcontroller sct_mc1 std localhost:$port
|
||||||
|
|
||||||
|
mk_sct_positmotor sct_mc1 samx samplenum C {
|
||||||
|
1 0
|
||||||
|
2 15
|
||||||
|
3 20
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -48,13 +48,3 @@ proc pop { which } {
|
|||||||
}
|
}
|
||||||
publish pop user
|
publish pop user
|
||||||
|
|
||||||
# TODO SICS-198 add feedback support to getset macro generator
|
|
||||||
foreach pname {AttRotDeg RotApDeg} {
|
|
||||||
hmake /instrument/parameters/derived_parameters/$pname/feedback spy none
|
|
||||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback data false
|
|
||||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback control true
|
|
||||||
hattach /instrument/parameters/derived_parameters/$pname/feedback ${pname}_status status
|
|
||||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback/status control true
|
|
||||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback/status data false
|
|
||||||
hsetprop /instrument/parameters/derived_parameters/$pname/feedback/status nxsave false
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# $Revision: 1.14 $
|
# $Revision: 1.15 $
|
||||||
# $Date: 2008-10-20 00:08:31 $
|
# $Date: 2008-10-27 04:55:47 $
|
||||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||||
# Last revision by: $Author: ffr $
|
# Last revision by: $Author: ffr $
|
||||||
|
|
||||||
@@ -22,6 +22,7 @@ fileeval $cfPath(motors)/motor_configuration.tcl
|
|||||||
|
|
||||||
fileeval $cfPath(source)/source.tcl
|
fileeval $cfPath(source)/source.tcl
|
||||||
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
source $cfPath(hipadaba)/hipadaba_configuration.tcl
|
||||||
|
fileeval $cfPath(motors)/positmotor_configuration.tcl
|
||||||
fileeval $cfPath(parameters)/parameters.tcl
|
fileeval $cfPath(parameters)/parameters.tcl
|
||||||
fileeval $cfPath(velsel)/velsel.tcl
|
fileeval $cfPath(velsel)/velsel.tcl
|
||||||
fileeval $cfPath(plc)/plc.tcl
|
fileeval $cfPath(plc)/plc.tcl
|
||||||
@@ -43,3 +44,14 @@ server_init
|
|||||||
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
# WARNING: Do not add any code below server_init, if you do SICS may fail to initialise properly.
|
||||||
|
|
||||||
# You can add extra-configuration code in ../extraconfig.tcl
|
# You can add extra-configuration code in ../extraconfig.tcl
|
||||||
|
|
||||||
|
# TODO SICS-198 add feedback support to getset macro generator
|
||||||
|
foreach pname {AttRotDeg RotApDeg} {
|
||||||
|
hmake /instrument/parameters/derived_parameters/$pname/feedback spy none
|
||||||
|
hsetprop /instrument/parameters/derived_parameters/$pname/feedback data false
|
||||||
|
hsetprop /instrument/parameters/derived_parameters/$pname/feedback control true
|
||||||
|
hattach /instrument/parameters/derived_parameters/$pname/feedback ${pname}_status status
|
||||||
|
hsetprop /instrument/parameters/derived_parameters/$pname/feedback/status control true
|
||||||
|
hsetprop /instrument/parameters/derived_parameters/$pname/feedback/status data false
|
||||||
|
hsetprop /instrument/parameters/derived_parameters/$pname/feedback/status nxsave false
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# SICS common configuration
|
# SICS common configuration
|
||||||
|
|
||||||
# $Revision: 1.44 $
|
# $Revision: 1.45 $
|
||||||
# $Date: 2008-10-20 00:08:30 $
|
# $Date: 2008-10-27 04:55:40 $
|
||||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||||
# Last revision by $Author: ffr $
|
# Last revision by $Author: ffr $
|
||||||
# RELEASE_NUMBER: $Name: not supported by cvs2svn $
|
# RELEASE_NUMBER: $Name: not supported by cvs2svn $
|
||||||
@@ -139,7 +139,7 @@ sics_release [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
|||||||
sics_release lock
|
sics_release lock
|
||||||
|
|
||||||
::utility::mkVar sics_revision_num Text internal
|
::utility::mkVar sics_revision_num Text internal
|
||||||
set tmpstr [string map {"$" ""} {$Revision: 1.44 $}]
|
set tmpstr [string map {"$" ""} {$Revision: 1.45 $}]
|
||||||
sics_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
sics_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
||||||
sics_revision_num lock
|
sics_revision_num lock
|
||||||
|
|
||||||
@@ -227,18 +227,18 @@ proc server_set_sobj_attributes {} {
|
|||||||
|
|
||||||
proc server_init {} {
|
proc server_init {} {
|
||||||
if [ catch {
|
if [ catch {
|
||||||
########
|
|
||||||
# Parameters set above the restore command will be clobbered by
|
|
||||||
# the values in the status.tcl file
|
|
||||||
if [file exists $::sicsroot/log/status.tcl ] {
|
|
||||||
restore
|
|
||||||
}
|
|
||||||
::source::isc_initialize
|
::source::isc_initialize
|
||||||
::counter::isc_initialize
|
::counter::isc_initialize
|
||||||
::histogram_memory::isc_initialize
|
::histogram_memory::isc_initialize
|
||||||
::scan::isc_initialize
|
::scan::isc_initialize
|
||||||
::anticollider::init
|
::anticollider::init
|
||||||
::commands::isc_initialize
|
::commands::isc_initialize
|
||||||
|
########
|
||||||
|
# Parameters set above the restore command will be clobbered by
|
||||||
|
# the values in the status.tcl file
|
||||||
|
if [file exists $::sicsroot/log/status.tcl ] {
|
||||||
|
restore
|
||||||
|
}
|
||||||
MakeStateMon hmscan
|
MakeStateMon hmscan
|
||||||
sicslist setatt sics_suid privilege readonly
|
sicslist setatt sics_suid privilege readonly
|
||||||
sicslist setatt sics_suid klass data
|
sicslist setatt sics_suid klass data
|
||||||
|
|||||||
@@ -1,10 +1,66 @@
|
|||||||
# Some useful functions for SICS motor configuration.
|
# Some useful functions for SICS motor configuration.
|
||||||
|
|
||||||
# $Revision: 1.3 $
|
# $Revision: 1.4 $
|
||||||
# $Date: 2008-09-23 22:44:01 $
|
# $Date: 2008-10-27 04:55:48 $
|
||||||
# Author: Douglas Clowes (dcl@ansto.gov.au)
|
# Author: Douglas Clowes (dcl@ansto.gov.au)
|
||||||
# Last revision by $Author: ffr $
|
# Last revision by $Author: ffr $
|
||||||
|
|
||||||
|
proc relmove {runcmd args} {
|
||||||
|
if [ catch {
|
||||||
|
if {[llength $args] == 1} {
|
||||||
|
set arguments [lindex $args 0]
|
||||||
|
} else {
|
||||||
|
set arguments $args
|
||||||
|
}
|
||||||
|
|
||||||
|
array set motoffset $arguments
|
||||||
|
foreach motor [array names motoffset] {
|
||||||
|
set currpos [SplitReply [$motor]]
|
||||||
|
lappend motdest $motor [expr $currpos + $motoffset($motor)]
|
||||||
|
}
|
||||||
|
switch $runcmd {
|
||||||
|
"relrun" {
|
||||||
|
eval "run $motdest"
|
||||||
|
}
|
||||||
|
"reldrive" {
|
||||||
|
eval "drive $motdest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} message ] {
|
||||||
|
if {$::errorCode=="NONE"} {return }
|
||||||
|
return -code error $message
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
proc relrun {args} {
|
||||||
|
if [ catch {
|
||||||
|
relmove "relrun" $args
|
||||||
|
} message ] {
|
||||||
|
if {$::errorCode=="NONE"} {return }
|
||||||
|
return -code error $message
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publish relrun user
|
||||||
|
|
||||||
|
proc reldrive {args} {
|
||||||
|
if [ catch {
|
||||||
|
relmove "reldrive" $args
|
||||||
|
} message ] {
|
||||||
|
if {$::errorCode=="NONE"} {return }
|
||||||
|
return -code error $message
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publish reldrive user
|
||||||
|
|
||||||
|
##
|
||||||
|
# @brief A convenience command for fetching motor parameter values
|
||||||
|
#
|
||||||
|
# This convenience command is useful for avoiding command
|
||||||
|
# substitution problems when defining hdb node read scripts.
|
||||||
|
proc getmotpar {motor par} {
|
||||||
|
return [SplitReply [$motor $par]]
|
||||||
|
}
|
||||||
|
|
||||||
# Functions for the slit motors (echidna, wombat, platypus, ...)
|
# Functions for the slit motors (echidna, wombat, platypus, ...)
|
||||||
#
|
#
|
||||||
# functions used by the generated functions
|
# functions used by the generated functions
|
||||||
|
|||||||
Reference in New Issue
Block a user