commands_common.tcl
Added ::motor::go_home command to run motors to their home positions.

hrpd,hipd,rsd,sans,reflectometer/commands.tcl
Initilise ::motor::is_homing_list for the ::motor::go_hom command

util/command.tcl
Allow an empty parameter list

server_config.tcl
Call the "commands" initilisation function on server init

motor_asim.c
Added the "home" parameter so we can test the go_home command

r2677 | ffr | 2008-08-14 15:00:18 +1000 (Thu, 14 Aug 2008) | 17 lines
This commit is contained in:
Ferdi Franceschini
2008-08-14 15:00:18 +10:00
committed by Douglas Clowes
parent f7c357a56d
commit 348bd3aed1
9 changed files with 73 additions and 3 deletions

View File

@@ -2,6 +2,8 @@
# @file Definition of common command node procs.
################################################################################
namespace eval commands { }
# SCAN COMMANDS
namespace eval scan {
command hdb_bmonscan {
@@ -80,3 +82,30 @@ namespace eval monitor {
::monitor::count -set feedback status IDLE
}
################################################################################
proc ::commands::ic_initialize {} {
# Generate the following commands,
# ::motor::go_home
namespace eval ::motor {
set NS [uplevel namespace current]
if {[info exists is_homing_list] == 0} {
return -code error "ERROR: Instrument specific command config must set ${NS}::is_homing_list\n"
}
command go_home "text=$is_homing_list motors" {
# Instrument specific command configurations must define
# ::motor::is_homing_list, this is a possibly empty comma separated list
# of motors which are safe to send to home
variable is_homing_list
if {$motors == ""} {return}
set motlist [split $motors ,]
if {[setdiff $motlist [split $is_homing_list , ]] != ""} {
return -code error "ERROR: You can only \"home\" a subset of $is_homing_list"
}
foreach motor $motlist {
lappend runargs $motor [SplitReply [$motor home]]
}
eval "run $runargs"
}
}
}