From 7cb2b922631a320cf94c941b631609a92e9b7dbc Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Mon, 12 Feb 2007 12:00:47 +1100 Subject: [PATCH] Added during MKs visit r1460 | ffr | 2007-02-12 12:00:47 +1100 (Mon, 12 Feb 2007) | 2 lines --- site_ansto/instrument/hrpd/Makefile | 2 + .../hrpd/hipadaba_configuration.tcl | 63 +++++++++++++++++++ .../script_validator/hmm_configuration.tcl | 20 ++++++ .../hrpd/script_validator/sics_ports.tcl | 4 ++ site_ansto/instrument/hrpd/sics_ports.tcl | 4 ++ site_ansto/instrument/mksim_config.tcl | 28 +++++++++ 6 files changed, 121 insertions(+) create mode 100644 site_ansto/instrument/hrpd/Makefile create mode 100644 site_ansto/instrument/hrpd/hipadaba_configuration.tcl create mode 100644 site_ansto/instrument/hrpd/script_validator/hmm_configuration.tcl create mode 100644 site_ansto/instrument/hrpd/script_validator/sics_ports.tcl create mode 100644 site_ansto/instrument/hrpd/sics_ports.tcl create mode 100755 site_ansto/instrument/mksim_config.tcl diff --git a/site_ansto/instrument/hrpd/Makefile b/site_ansto/instrument/hrpd/Makefile new file mode 100644 index 00000000..4ac41717 --- /dev/null +++ b/site_ansto/instrument/hrpd/Makefile @@ -0,0 +1,2 @@ +all: motor_configuration.tcl + ../mksim_config.tcl -f motor_configuration.tcl > script_validator/motor_configuration.tcl diff --git a/site_ansto/instrument/hrpd/hipadaba_configuration.tcl b/site_ansto/instrument/hrpd/hipadaba_configuration.tcl new file mode 100644 index 00000000..35725398 --- /dev/null +++ b/site_ansto/instrument/hrpd/hipadaba_configuration.tcl @@ -0,0 +1,63 @@ +# Defines hashes which map SICS device object names to hipadaba paths +InstallHdb +hmake /graphics spy none +hsetprop /graphics type graphset +hmake /commands spy none +hsetprop /commands type commandset + +#TODO change this to hparts.tcl +source hpaths.tcl +set instrument echidna +hmake /$instrument spy none +hsetprop /$instrument type instrument +#--- admin +hattach /$instrument title title +hattach /$instrument sample sample +hmake /$instrument/user spy none +hsetprop /$instrument/user type part +hattach /$instrument/user user name +hattach /$instrument/user email email +hattach /$instrument/user phone phone + +# Generate hipadaba nodes for the paths in the hpaths file +foreach hp $hpaths { + hmake /$instrument/$hp spy none; + hsetprop /$instrument/$hp type part; +} + + +#--- Motors +foreach {obj name part} $motor_hpath { + hattach /$instrument/$part $obj $name + #TODO Only ignore node deletion errors for simulated motors + if [ catch {hdel /$instrument/$part/$name/axis} ] {} + if [ catch {hdel /$instrument/$part/$name/units} ] {} +} + +#--- Configurable Virtual Motors +foreach {obj name part master_obj} $cvirtmotor_hpath { + set path /$instrument/$part +# hattach /$instrument/$part $obj $name + hattach $path $obj $name + hchain $path/$name $path/$master_obj +} + +#------------- scan command +hsetprop /commands type part +hcommand /commands/scan hdb_hmscan +hsetprop /commands/scan type command +hsetprop /commands/scan priv user +hmake /commands/scan/scan_variable user text +hsetprop /commands/scan/scan_variable argtype drivable +hmake /commands/scan/scan_start user float +hsetprop /commands/scan/scan_start argtype float +hmake /commands/scan/scan_increment user float +hsetprop /commands/scan/scan_increment argtype float +hmake /commands/scan/NP user int +hsetprop /commands/scan/NP argtype int +hmake /commands/scan/mode user text +hsetprop /commands/scan/mode argtype text +hsetprop /commands/scan/mode values monitor,timer +hmake /commands/scan/preset user float +hsetprop /commands/scan/preset argtype float + diff --git a/site_ansto/instrument/hrpd/script_validator/hmm_configuration.tcl b/site_ansto/instrument/hrpd/script_validator/hmm_configuration.tcl new file mode 100644 index 00000000..717141c7 --- /dev/null +++ b/site_ansto/instrument/hrpd/script_validator/hmm_configuration.tcl @@ -0,0 +1,20 @@ +MakeCounter bm SIM -.5 +bm SetExponent 0 +MakeHM hmm SIM +hmm configure HistMode Normal +hmm configure OverFlowMode Ceil +hmm configure dim0 512 +hmm configure dim1 128 +hmm configure rank 2 +hmm configure BinWidth 4 +#hmm configure BinWidth 1 +hmm preset 100. +hmm CountMode Timer +hmm configure Counter counter +hmm configure init 0 +hmm init + +MakeScanCommand hmscan bm echidna.hdd recover.bin + +proc hs_prepare {scanobjectname userobjectname} {} +proc hs_finish {scanobjectname userobjectname} {} diff --git a/site_ansto/instrument/hrpd/script_validator/sics_ports.tcl b/site_ansto/instrument/hrpd/script_validator/sics_ports.tcl new file mode 100644 index 00000000..6ff92173 --- /dev/null +++ b/site_ansto/instrument/hrpd/script_validator/sics_ports.tcl @@ -0,0 +1,4 @@ +set quieckport quieck-val-echidna +set serverport server-val-echidna +set interruptport interrupt-val-echidna +set telnetport telnet-val-echidna diff --git a/site_ansto/instrument/hrpd/sics_ports.tcl b/site_ansto/instrument/hrpd/sics_ports.tcl new file mode 100644 index 00000000..413c3097 --- /dev/null +++ b/site_ansto/instrument/hrpd/sics_ports.tcl @@ -0,0 +1,4 @@ +set quieckport quieck-echidna +set serverport server-echidna +set interruptport interrupt-echidna +set telnetport telnet-echidna diff --git a/site_ansto/instrument/mksim_config.tcl b/site_ansto/instrument/mksim_config.tcl new file mode 100755 index 00000000..649d3369 --- /dev/null +++ b/site_ansto/instrument/mksim_config.tcl @@ -0,0 +1,28 @@ +#!/usr/bin/tclsh +array set args $argv + +puts "# !!- AUTOGENERATED FROM $args(-f) -!!" +puts "# !!- DO NOT MODIFY -!!" +puts "# [clock format [clock seconds] -format %c]\n" + +proc unknown {args} { + set param [lindex $args 1]; + set nonsim_motpars [list speed home hardlowerlim hardupperlim accel decel maxSpeed minSpeed maxAccel minDecel ] + if { [ lsearch -exact $nonsim_motpars $param ] == -1 } { + puts $args; + } +} +source ../utility.tcl +proc my_proc {args} {puts "proc $args"} + +proc Motor {name type par} { + global motors + upvar #0 $par arr + upvar #0 $name param_arr + array set param_arr [array get arr] + lappend motors $name + puts "Motor $name SIM $param_arr(hardlowerlim) $param_arr(hardupperlim) -1.0" +} +rename proc _proc_ +rename my_proc proc +source $args(-f)