61 lines
1.6 KiB
Tcl
61 lines
1.6 KiB
Tcl
#!/usr/bin/tclsh
|
|
# $Revision: 1.2 $
|
|
# $Date: 2006-11-22 06:32:35 $
|
|
# Author: Douglas Clowes (dcl@ansto.gov.au)
|
|
# Last revision by $Author: dcl $
|
|
|
|
set instName [lindex $argv 0];
|
|
set infile $instName/motor_configuration.tcl
|
|
set fh [open $instName/hipadaba_configuration.tcl w]
|
|
|
|
proc publish {args} {}
|
|
|
|
if 1 {
|
|
# Use this to create an array of named parameters to initialise motors.
|
|
proc params {args} {
|
|
upvar 1 "" x;
|
|
if [info exists x] {unset x}
|
|
foreach {k v} $args {set x([string tolower $k]) $v}
|
|
}
|
|
proc setHomeandRange {args} {}
|
|
proc SplitReply { text } {}
|
|
proc setpos {motor pos} {}
|
|
} else {
|
|
source utility.tcl
|
|
}
|
|
|
|
proc Motor {name type parms} {
|
|
puts $::fh [format "%s(%s) %s %s" {makeHdbMotor $motor_hpath} $name $name $name]
|
|
uplevel #0 "proc $name {args} {}"
|
|
}
|
|
proc MakeConfigurableMotor {name} {
|
|
puts $::fh [format "%s(%s) %s %s" {makeHdbVirtMotor $motor_hpath} $name $name $name]
|
|
uplevel #0 "proc $name {args} {}"
|
|
}
|
|
|
|
puts $fh "# autogenerated from $infile"
|
|
puts $fh "# Output Date: [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S"]"
|
|
puts $fh "# Source Date: [clock format [file mtime $infile] -format "%Y-%m-%d %H:%M:%S"]"
|
|
puts $fh ""
|
|
puts $fh "# Defines hashes which map motor names to arrays"
|
|
puts $fh "source hpaths.tcl"
|
|
puts $fh ""
|
|
puts $fh "# Enumerate the categories"
|
|
puts $fh {foreach hp $hpaths { hmake $hp spy none }}
|
|
puts $fh ""
|
|
puts $fh "# Enumerate the motors"
|
|
|
|
|
|
source $infile
|
|
|
|
if 0 {
|
|
foreach m $motors {
|
|
puts [format "%s(%s) %s %s" {makeHdbMotor $motor_hpath} $name $name $name]
|
|
}
|
|
foreach m $vmotors {
|
|
puts [format "%s(%s) %s %s" {makeHdbVirtMotor $motor_hpath} $name $name $name]
|
|
}
|
|
}
|
|
|
|
close $fh
|