diff --git a/site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl b/site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl index 8a5e1e88..b8eab4fa 100755 --- a/site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl +++ b/site_ansto/instrument/TEST_SICS/fakeDMC/mkSimAxes.tcl @@ -1,7 +1,7 @@ #!/usr/bin/tclsh -# $Revision: 1.3 $ -# $Date: 2006-11-12 23:19:36 $ +# $Revision: 1.4 $ +# $Date: 2007-02-19 20:58:19 $ # Author: Ferdi Franceschini (ffr@ansto.gov.au) # Last revision by: $Author: ffr $ @@ -88,6 +88,6 @@ proc main {args} { } if {$tcl_interactive==0} { - main motor_configuration.tcl; + main config/motors/motor_configuration.tcl; } diff --git a/site_ansto/instrument/hipd/MANIFEST.TXT b/site_ansto/instrument/hipd/MANIFEST.TXT index 533c86b9..ef83a0fb 100644 --- a/site_ansto/instrument/hipd/MANIFEST.TXT +++ b/site_ansto/instrument/hipd/MANIFEST.TXT @@ -1,9 +1,5 @@ +sics_ports.tcl wombat_configuration.tcl -motor_configuration.tcl -hipadaba_configuration.tcl -hpaths.tcl extraconfig.tcl -wombat.hdd -motor_test.tcl -troubleshoot_setup.tcl -InstXML.xml +config +util diff --git a/site_ansto/instrument/hipd/Makefile b/site_ansto/instrument/hipd/Makefile index 4ac41717..19a3916b 100644 --- a/site_ansto/instrument/hipd/Makefile +++ b/site_ansto/instrument/hipd/Makefile @@ -1,2 +1,4 @@ -all: motor_configuration.tcl - ../mksim_config.tcl -f motor_configuration.tcl > script_validator/motor_configuration.tcl +cfPath=config/motors + +all: $(cfPath)/motor_configuration.tcl + ../mksim_config.tcl -f $(cfPath)/motor_configuration.tcl > script_validator/$(cfPath)/motor_configuration.tcl diff --git a/site_ansto/instrument/hipd/config/hipadaba/common_hipadaba_configuration.tcl b/site_ansto/instrument/hipd/config/hipadaba/common_hipadaba_configuration.tcl new file mode 100644 index 00000000..b0160aa2 --- /dev/null +++ b/site_ansto/instrument/hipd/config/hipadaba/common_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 $cfPath(hipadaba)/hpaths.tcl +set instrument [string tolower [SplitReply [Instrument]] ] +hmake /$instrument spy none +hsetprop /$instrument type instrument + +# Generate hipadaba nodes for the paths in the hpaths file +foreach hp $hpaths { + hmake /$instrument/$hp spy none; + hsetprop /$instrument/$hp type part; +} + +#--- admin +hattach /$instrument title title +hattach /$instrument/experiment sample description +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 + +#--- 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/hipd/config/hipadaba/hipadaba_configuration.tcl b/site_ansto/instrument/hipd/config/hipadaba/hipadaba_configuration.tcl new file mode 100644 index 00000000..eae0fc03 --- /dev/null +++ b/site_ansto/instrument/hipd/config/hipadaba/hipadaba_configuration.tcl @@ -0,0 +1 @@ +source $cfPath(hipadaba)/common_hipadaba_configuration.tcl diff --git a/site_ansto/instrument/hipd/config/hipadaba/hpaths.tcl b/site_ansto/instrument/hipd/config/hipadaba/hpaths.tcl new file mode 100644 index 00000000..24089471 --- /dev/null +++ b/site_ansto/instrument/hipd/config/hipadaba/hpaths.tcl @@ -0,0 +1,44 @@ +set hpaths [list \ +experiment sample monochromator slits \ +slits/1 slits/1/horizontal slits/1/vertical slits/2 slits/2/horizontal slits/2/vertical detector detector/monitor detector/histmem ] + +# Maps devices (eg motors) to hipadaba paths. +# obj name path +set motor_hpath [list \ +ss1u top slits/1/vertical\ +ss1d bottom slits/1/vertical\ +ss1l left slits/1/horizontal\ +ss1r right slits/1/horizontal\ +ss2u top slits/2/vertical\ +ss2d bottom slits/2/vertical\ +ss2l left slits/2/horizontal\ +ss2r right slits/2/horizontal\ +som rotate sample \ +schi chi sample \ +sphi phi sample \ +sx translate_x sample \ +sy translate_y sample \ +stth detector_rotate sample \ +mchi chi monochromator \ +mom rotate monochromator \ +mphi phi monochromator \ +mtth takeoff_angle monochromator \ +mx translate_x monochromator \ +my translate_y monochromator ] + +# Configurable virtual motors +# obj name path master_obj +set cvirtmotor_hpath [list \ +ss1hg gap slits/1/horizontal left\ +ss1ho offset slits/1/horizontal left\ +ss1vg gap slits/1/vertical top\ +ss1vo offset slits/1/vertical top\ +ss2hg gap slits/2/horizontal left\ +ss2ho offset slits/2/horizontal left\ +ss2vg gap slits/2/vertical top\ +ss2vo offset slits/2/vertical top] + +array set counter_hpath [ list \ +hm /detector/histmem \ +counter /detector/monitor ] + diff --git a/site_ansto/instrument/hipd/motor_configuration.tcl b/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl similarity index 99% rename from site_ansto/instrument/hipd/motor_configuration.tcl rename to site_ansto/instrument/hipd/config/motors/motor_configuration.tcl index 616ccee7..3db026cc 100644 --- a/site_ansto/instrument/hipd/motor_configuration.tcl +++ b/site_ansto/instrument/hipd/config/motors/motor_configuration.tcl @@ -1,5 +1,5 @@ -# $Revision: 1.7 $ -# $Date: 2007-02-14 05:49:53 $ +# $Revision: 1.1 $ +# $Date: 2007-02-19 21:03:21 $ # Author: Ferdi Franceschini (ffr@ansto.gov.au) # Last revision by: $Author: ffr $ diff --git a/site_ansto/instrument/hipd/config/nexus/nxscripts.tcl b/site_ansto/instrument/hipd/config/nexus/nxscripts.tcl new file mode 100644 index 00000000..ef4038bf --- /dev/null +++ b/site_ansto/instrument/hipd/config/nexus/nxscripts.tcl @@ -0,0 +1,148 @@ +MakeNXScript +#nxscript createxml junk4.xml echidna.dic +proc getVal {msg} { + return [string trim [lindex [split $msg =] 1 ] ] +} + +proc newFileName {} { + sicsdatanumber incr; + set idNum [SplitReply [sicsdatanumber]]; + set dataPath [SplitReply [sicsdatapath]]; + set prefix [SplitReply [sicsdataprefix]]; + set postfix [SplitReply [sicsdatapostfix]]; + set isodate [lindex [split [sicstime] " "] 0]; + return [format "%s/%s_%s_%s%s" $dataPath $prefix $isodate $idNum $postfix]; +} + +proc nxcreatefile {{type nx.hdf}} { + global dataFileName nxFileOpen cfPath; + SicsDataPostFix .$type; + + array set nxmode [list nx.hdf create5 h5 create5 nx5 create5 xml createxml]; + set dataFileName [newFileName] + nxscript $nxmode($type) $dataFileName $cfPath(nexus)/echidna.dic; + set nxFileOpen true +} + + +proc nxreopenfile {} { + global dataFileName nxFileOpen cfPath; + nxscript reopen $dataFileName $cfPath(nexus)/echidna.dic; + set nxFileOpen true; +} + +proc nxclosefile {} { + global dataFileName nxFileOpen; + if {$nxFileOpen == true} { + nxscript close; + set nxFileOpen false; + set flist [split $dataFileName "/"]; + set fname [lindex $flist [expr [llength $flist] - 1] ]; + clientput "$fname updated" "event"; + } +} + +set dradius 1.25 +set ndect 128 +set tubedia 0.0254 +set pi 3.1415926 +#set angsep [expr $tubedia/$dradius *(180/$pi)] +set angsep 1.25 +# stthmin = (180 - (1.25*127))/2 +proc addnxentry {nxobj entryname scanVariable scanVarPos scanVarStep} { + global dradius ndect angsep; +putcommon $nxobj $entryname $scanVariable +putcrystal $nxobj +putmonitor $nxobj +putsample $nxobj + set scanVar_value [string trim [lindex [split [$scanVariable] =] 1]] + $nxobj putfloat $scanVariable $scanVar_value +# Add thetamin and stth to tharr(i) + set sampletwotheta [string trim [lindex [split [stth] =] 1]] + for {set i 0} {$i < $ndect} {incr i} { + set tharr($i) [expr ($i-63.5)*$angsep + $sampletwotheta] + } + $nxobj updatedictvar thetadim $ndect + $nxobj putarray dtheta tharr $ndect + $nxobj puttext dtype He-3 position sensitive detector, tube active length=335+/-5mm, tube diameter=25.4 +/- 0.8mm + $nxobj puttext ddesc 128 He-3 proportional counter detector tubes (GE Energy Reuter Stokes Inc. item=RS-P4-0814-217) + $nxobj putfloat dradius $dradius + $nxobj puttext dlayout area + $nxobj puthm dcounts hmm + $nxobj puthm deff hmm + $nxobj makelink scandata dcounts + $nxobj makelink scandata dtheta + $nxobj makelink scanvar $scanVariable + $nxobj putfloat scanstep $scanVarStep + +} + +proc bm_addnxentry {nxobj entryname scanVariable scanVarPos scanVarStep} { + global dradius ndect angsep; +putcommon $nxobj $entryname $scanVariable +putcrystal $nxobj +putmonitor $nxobj +putsample $nxobj + set scanVar_value [string trim [lindex [split [$scanVariable] =] 1]] + $nxobj putfloat $scanVariable $scanVar_value +# Add thetamin and stth to tharr(i) +# $nxobj puttext dtype He-3 position sensitive detector, tube active length=335+/-5mm, tube diameter=25.4 +/- 0.8mm +# $nxobj puttext ddesc 128 He-3 proportional counter detector tubes (GE Energy Reuter Stokes Inc. item=RS-P4-0814-217) +# $nxobj putfloat dradius $dradius + $nxobj puttext dlayout point + $nxobj makelink scandata mdata + $nxobj makelink scanvar $scanVariable + $nxobj putfloat scanstep $scanVarStep + +} + +proc putmonitor {nxobj} { + $nxobj puttext mmode [string trim [lindex [split [bm getmode] =] 1]] + $nxobj putfloat mpreset [string trim [lindex [split [bm getpreset] =] 1]] + $nxobj putint mdata [string trim [lindex [split [bm getcounts] =] 1]] + $nxobj putfloat mdistance [getVal [sics_bm_distance]] +} + +proc putsample {nxobj} { + $nxobj puttext saname [getVal [Sample]] +} +proc putcrystal {nxobj} { + $nxobj puttext ctype [sics_mono_crystal] +} +proc putcommon {nxobj entryName scanVariable} { + $nxobj updatedictvar entryName $entryName + $nxobj updatedictvar scan_variable $scanVariable + $nxobj puttext etitle [getVal [Title]] + $nxobj puttext iname [getVal [Instrument]] + +# NXsource + $nxobj puttext sname OPAL + $nxobj puttext stype Reactor Neutron Source + $nxobj puttext sprobe Neutron + putsamplemotors $nxobj + putslitmotors $nxobj + putmonomotors $nxobj +} + +proc putsamplemotors {nxobj} { + foreach motor { som schi sphi sx sy stth sth } { + $nxobj putfloat $motor [getVal [$motor] ]; + } +} + +proc putmonomotors {nxobj} { + foreach motor { mom mchi mphi mx my mtth mth } { + $nxobj putfloat $motor [getVal [$motor] ]; + } +} + +proc putslitmotors {nxobj} { + foreach motor {ss1u ss1d ss1l ss1r ss1vg ss1vo ss1hg ss1ho ss2u ss2d ss2l ss2r ss2vg ss2vo ss2hg ss2ho } { + $nxobj putfloat $motor [getVal [$motor] ]; + } +} + +publish nxcreatefile user +publish addnxentry user +publish bm_addnxentry user + diff --git a/site_ansto/instrument/hipd/config/nexus/wombat.dic b/site_ansto/instrument/hipd/config/nexus/wombat.dic new file mode 100644 index 00000000..cd9fb505 --- /dev/null +++ b/site_ansto/instrument/hipd/config/nexus/wombat.dic @@ -0,0 +1,99 @@ +##NXDICT-1.0 +#---------------------------------------------------------------------------- +# +# DO NOT EDIT WHEN YOU DO NOT KNOW WHAT YOU ARE DOING! +# This file determines the placement of data items in the Powder NeXus +# data file. Your data may not be readable if this file is messed up. +# +# Mark Koennecke, May 2004 +#---------------------------------------------------------------------------- +entryName=entry1 +dataName=histogram +inst=instrument +detector=detector +monochromator=monochromator +thetadim=128 +scan_variable=scanvar +samplemotor=samplemotor +#---------- NXentry level +etitle=/$(entryName),NXentry/SDS title -type NX_CHAR +estart=/$(entryName),NXentry/SDS start_time -type NX_CHAR +eend=/$(entryName),NXentry/SDS end_time -type NX_CHAR +#----------------- NXinstrument +iname=/$(entryName),NXentry/$(inst),NXinstrument/SDS name -type NX_CHAR \ + -rank 1 -dim {132} + + +#----------------- NXmonitor +mmode=/$(entryName),NXentry/monitor,NXmonitor/SDS mode -type NX_CHAR +mpreset=/$(entryName),NXentry/monitor,NXmonitor/SDS preset -type NX_FLOAT32 +mdata=/$(entryName),NXentry/monitor,NXmonitor/SDS data -type NX_INT32 +mdistance=/$(entryName),NXentry/monitor,NXmonitor/SDS distance -type NX_FLOAT32 -attr {units,metre} + +#----------------- NXsource +sname=/$(entryName),NXentry/$(inst),NXinstrument/source,NXsource/SDS name \ + -type NX_CHAR -rank 1 +stype=/$(entryName),NXentry/$(inst),NXinstrument/source,NXsource/SDS type -type NX_CHAR -rank 1 +sprobe=/$(entryName),NXentry/$(inst),NXinstrument/source,NXsource/SDS probe -type NX_CHAR -rank 1 +#----------------- NXcrystal +clambda=/$(entryName),NXentry/$(inst),NXinstrument/monochromator_crystal,NXcrystal/SDS wavelength -type NX_FLOAT32 -attr {units,Angstrom} +ctype=/$(entryName),NXentry/$(inst),NXinstrument/monochromator_crystal,NXcrystal/SDS type -type NX_CHAR +#------------- counter +#-------------- Detector +# histogram data +dradius=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS distance -type NX_FLOAT32 +dtheta=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS polar_angle -type NX_FLOAT32 -LZW -rank 1 -dim {$(thetadim)} -attr {units,degree} + +dcounts=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS \ + data -type NX_INT32 -LZW -rank 2 -dim {$(dim0),$(dim1)} \ + -attr {signal,1} + +deff=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/calibration,NXdata/SDS efficiency -type NX_INT32 -LZW -rank 2 -dim {$(dim0),$(dim1)} + +ddesc=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS description -type NX_CHAR + +dtype=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS type -type NX_CHAR + +dlayout=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS layout -type NX_CHAR +#--------------- NXmonochromator +mom=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/mom,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,mom} +mchi=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/mchi,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,mchi} +mphi=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/mphi,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,mphi} +mx=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/mx,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,mx} +my=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/my,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,my} +mtth=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/mtth,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,mtth} +mth=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/mth,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,mth} +#--------------- NXsample +saname=/$(entryName),NXentry/sample,NXsample/SDS name -type NX_CHAR +sarot=/$(entryName),NXentry/sample,NXsample/SDS rotation_angle -type NX_FLOAT32 -attr {units,degree} +som=/$(entryName),NXentry/sample,NXsample/som,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,som} +schi=/$(entryName),NXentry/sample,NXsample/schi,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,schi} +sphi=/$(entryName),NXentry/sample,NXsample/sphi,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,sphi} +sx=/$(entryName),NXentry/sample,NXsample/sx,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,sx} +sy=/$(entryName),NXentry/sample,NXsample/sy,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,sy} +stth=/$(entryName),NXentry/sample,NXsample/stth,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,stth} +sth=/$(entryName),NXentry/sample,NXsample/sth,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,sth} +# Slit motors +ss1u=/$(entryName),NXentry/sample,NXsample/ss1u,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1u} +ss1d=/$(entryName),NXentry/sample,NXsample/ss1d,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1d} +ss1l=/$(entryName),NXentry/sample,NXsample/ss1l,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1l} +ss1r=/$(entryName),NXentry/sample,NXsample/ss1r,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1r} +ss1vg=/$(entryName),NXentry/sample,NXsample/ss1vg,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1vg} +ss1vo=/$(entryName),NXentry/sample,NXsample/ss1vo,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1vo} +ss1hg=/$(entryName),NXentry/sample,NXsample/ss1hg,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1hg} +ss1ho=/$(entryName),NXentry/sample,NXsample/ss1ho,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1ho} +ss2u=/$(entryName),NXentry/sample,NXsample/ss2u,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2u} +ss2d=/$(entryName),NXentry/sample,NXsample/ss2d,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2d} +ss2l=/$(entryName),NXentry/sample,NXsample/ss2l,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2l} +ss2r=/$(entryName),NXentry/sample,NXsample/ss2r,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2r} +ss2vg=/$(entryName),NXentry/sample,NXsample/ss2vg,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2vg} +ss2vo=/$(entryName),NXentry/sample,NXsample/ss2vo,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2vo} +ss2hg=/$(entryName),NXentry/sample,NXsample/ss2hg,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2hg} +ss2ho=/$(entryName),NXentry/sample,NXsample/ss2ho,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2ho} +#----------------NXdata ------------------------------------------------ +scandata=/$(entryName),NXentry/scan_data,NXdata/NXVGROUP +scanvar=/$(entryName),NXentry/scan_variable,NXdata/NXVGROUP +scanstep=/$(entryName),NXentry/scan_step,NXdata/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,stepsize} +#histogram=/$(entryName),NXentry/histogram,NXdata/NXVGROUP +#scanvar=/$(entryName),NXentry/$(scan_variable),NXdata/NXVGROUP + diff --git a/site_ansto/instrument/hipd/config/scan/scan.tcl b/site_ansto/instrument/hipd/config/scan/scan.tcl new file mode 100644 index 00000000..8e49190c --- /dev/null +++ b/site_ansto/instrument/hipd/config/scan/scan.tcl @@ -0,0 +1,130 @@ +namespace eval scanCommand { +#MakeScanCommand escan counter echidna.hdd recover.bin +variable scanVariable scan_var scanVarStart 0 scanVarStep 1 + proc scan_prepare {sobj uobj} { + variable scanVarStart; + variable scanVarStep; + variable scanVariable; + + nxcreatefile; + nxscript updatedictvar entryName start; + nxscript puttext estart [sicstime]; + nxclosefile; +# stdscan prepare $sobj $uobj; + set vlist [split [$sobj getvarpar 0] = ]; + set scanVariable [string trim [lindex [split [lindex $vlist 0] . ] 1]]; + set scanVarStart [lindex $vlist 1]; + set scanVarStep [lindex $vlist 2]; + hs_prepare $sobj $uobj + } + + proc hm_scan_finish {sobj uobj} { + hs_finish $sobj $uobj; + nxreopenfile; + nxscript updatedictvar entryName stop; + nxscript puttext eend [sicstime]; + nxclosefile; + } + + proc bm_scan_finish {sobj uobj} { + stdscan finish $sobj $uobj; + nxreopenfile; + nxscript updatedictvar entryName stop; + nxscript puttext eend [sicstime]; + nxclosefile; + } +#proc hm_scan_finish {sobj uobj} { +# nxclosefile; +#} + +# Add an nxentry for the current scan point + proc nxaddpoint {sobj uobj pt} { + variable scanVarStart; + variable scanVarStep; + variable scanVariable; + set scanVarPos [expr $scanVarStart + $pt * $scanVarStep]; + nxreopenfile; + addnxentry nxscript scan_[format "%05d" $pt] $scanVariable $scanVarPos $scanVarStep; + nxclosefile + } + + proc donothing {args} {} + +proc bmcount {sobj uobj pt mode preset} { + bm setmode $mode + bm count $preset; +} + proc bm_scan_prepare {sobj uobj} { + variable scanVarStart; + variable scanVarStep; + variable scanVariable; + nxcreatefile; + nxscript updatedictvar entryName start; + nxscript puttext estart [sicstime]; + nxclosefile; + set vlist [split [$sobj getvarpar 0] = ]; + set scanVariable [string trim [lindex [split [lindex $vlist 0] . ] 1]]; + set scanVarStart [lindex $vlist 1]; + set scanVarStep [lindex $vlist 2]; + stdscan prepare $sobj $uobj; + } + proc bm_nxaddpoint {sobj uobj pt} { + variable scanVarStart; + variable scanVarStep; + variable scanVariable; + set scanVarPos [expr $scanVarStart + $pt * $scanVarStep]; + nxreopenfile; + bm_addnxentry nxscript scan_$pt $scanVariable $scanVarPos $scanVarStep; + nxclosefile + } +} + +publish ::scanCommand::scan_prepare user +publish ::scanCommand::hm_scan_finish user +publish ::scanCommand::nxaddpoint user +publish ::scanCommand::donothing user + +publish ::scanCommand::bm_scan_prepare user +publish ::scanCommand::bm_scan_finish user +publish ::scanCommand::bm_nxaddpoint user +publish ::scanCommand::donothing user +publish ::scanCommand::bmcount user + +#scan2 function writeheader ::scanCommand::donothing +#scan2 function writepoint ::scanCommand::nxaddpoint +#scan2 function prepare ::scanCommand::scan_prepare + +hmscan configure script +#hmscan function prepare hdbprepare +#hmscan function collect hdbcollect +hmscan function writeheader ::scanCommand::donothing +hmscan function writepoint ::scanCommand::nxaddpoint +hmscan function prepare ::scanCommand::scan_prepare +hmscan function finish ::scanCommand::hm_scan_finish + +# Wombat proc hdb_hmscan {scanvar scanstart scanincr scanend mode preset} { +proc hdb_hmscan {scanvar scanstart scanincr np mode preset} { + hmscan clear + hmscan configure script + + hmscan add $scanvar scanstart scanincr + set status [catch {hmscan run $np $mode $preset} msg] + hmscan configure soft + if {$status == 0} { + return $msg + } else { + error $msg + } +} + +publish hdb_hmscan user + +MakeScanCommand bmonscan bm $cfPath(scan)/echidna.hdd recover.bin +bmonscan configure script +bmonscan function writeheader ::scanCommand::donothing +bmonscan function writepoint ::scanCommand::bm_nxaddpoint +bmonscan function prepare ::scanCommand::bm_scan_prepare +bmonscan function count ::scanCommand::bmcount +bmonscan function finish ::scanCommand::bm_scan_finish + + diff --git a/site_ansto/instrument/hipd/wombat.hdd b/site_ansto/instrument/hipd/config/scan/wombat.hdd similarity index 79% rename from site_ansto/instrument/hipd/wombat.hdd rename to site_ansto/instrument/hipd/config/scan/wombat.hdd index 396d06a4..5deec86c 100644 --- a/site_ansto/instrument/hipd/wombat.hdd +++ b/site_ansto/instrument/hipd/config/scan/wombat.hdd @@ -1,5 +1,5 @@ ##SICS ASCII at HIPD -*************************** HRPD SCAN File ******************************** +*************************** HIPD SCAN File ******************************** Original Filename = !!FILE!! Title = !!VAR(Title)!! User = !!VAR(User)!! diff --git a/site_ansto/instrument/hipd/hipadaba_configuration.tcl b/site_ansto/instrument/hipd/hipadaba_configuration.tcl deleted file mode 100644 index e69de29b..00000000 diff --git a/site_ansto/instrument/hipd/hpaths.tcl b/site_ansto/instrument/hipd/hpaths.tcl deleted file mode 100644 index 2d6bc578..00000000 --- a/site_ansto/instrument/hipd/hpaths.tcl +++ /dev/null @@ -1,41 +0,0 @@ -set hpaths [list \ -/sample /monochromator /slits \ -/slits/1 /slits/2 /detector /detector/monitor /detector/histmem ] - -# Maps devices (eg motors) to hipadaba paths. -array set motor_hpath [list \ -ss1u /slits/1 \ -ss1d /slits/1 \ -ss1l /slits/1 \ -ss1r /slits/1 \ -ss1hg /slits/1 \ -ss1ho /slits/1 \ -ss1vg /slits/1 \ -ss1vo /slits/1 \ -ss2d /slits/2 \ -ss2hg /slits/2 \ -ss2ho /slits/2 \ -ss2l /slits/2 \ -ss2r /slits/2 \ -ss2u /slits/2 \ -ss2vg /slits/2 \ -ss2vo /slits/2 \ -som /sample \ -schi /sample \ -sphi /sample \ -sx /sample \ -sy /sample \ -stth /sample \ -sth /sample \ -mchi /monochromator \ -mom /monochromator \ -mphi /monochromator \ -mth /monochromator \ -mtth /monochromator \ -mx /monochromator \ -my /monochromator ] - -array set counter_hpath [ list \ -hm /detector/histmem \ -counter /detector/monitor ] - diff --git a/site_ansto/instrument/hipd/motor_test.tcl b/site_ansto/instrument/hipd/motor_test.tcl deleted file mode 100644 index e69de29b..00000000 diff --git a/site_ansto/instrument/hipd/troubleshoot_setup.tcl b/site_ansto/instrument/hipd/troubleshoot_setup.tcl deleted file mode 100644 index 7be9ab8d..00000000 --- a/site_ansto/instrument/hipd/troubleshoot_setup.tcl +++ /dev/null @@ -1,22 +0,0 @@ -# Wombat troubleshooter setup - -# $Revision: 1.2 $ -# $Date: 2006-12-01 04:09:25 $ -# Author: Ferdi Franceschini (ffr@ansto.gov.au) -# Last revision by $Author: dcl $ - -set configFileName "motor_configuration.tcl" - -# These subroutines should be installed on the controllers -set contSubs(dmc2280_controller1) "#AUTO #LIMSWI #SOLCTRL #TCPERR" -set contSubs(dmc2280_controller2) "#AUTO #LIMSWI #SOLCTRL #TCPERR" -set contSubs(dmc2280_controller3) "#AUTO #HOME #LOOPER #RES #TCPERR" -set contSubs(dmc2280_controller4) "#AUTO #HOME #LIMSWI #LOOPER #TCPERR" - - -# These threads should be running on the controllers. -set contThreads(dmc2280_controller1) "0" -set contThreads(dmc2280_controller2) "0" -set contThreads(dmc2280_controller3) "0" -set contThreads(dmc2280_controller4) "0" - diff --git a/site_ansto/instrument/hipd/wombat_configuration.tcl b/site_ansto/instrument/hipd/wombat_configuration.tcl index f4c303ca..caf4bea5 100644 --- a/site_ansto/instrument/hipd/wombat_configuration.tcl +++ b/site_ansto/instrument/hipd/wombat_configuration.tcl @@ -1,14 +1,11 @@ -# $Revision: 1.5 $ -# $Date: 2006-11-13 22:40:28 $ +# $Revision: 1.6 $ +# $Date: 2007-02-19 20:59:40 $ # Author: Ferdi Franceschini (ffr@ansto.gov.au) -# Last revision by: $Author: dcl $ +# Last revision by: $Author: ffr $ #START SERVER CONFIGURATION SECTION -source dmc2280_util.tcl -set quieckport quieck-wombat -set serverport server-wombat -set interruptport interrupt-wombat -set telnetport telnet-wombat +source util/dmc2280/dmc2280_util.tcl +source sics_ports.tcl source server_config.tcl #END SERVER CONFIGURATION SECTION @@ -18,27 +15,14 @@ VarMake Instrument Text Internal Instrument Wombat Instrument lock -#------------------------------------------------------------------------- -# System: Histogram Server -#------------------------------------------------------------------------ -# For the time being, use a simulated counter. -# When the beam monitor is interfaced, it can be used instead. -MakeCounter counter SIM -1.0 -MakeHM hm anstohttp -hm configure hmaddress http://localhost:8888 -hm configure username spy -hm configure password 007 -hm configure hmconfigscript puts anstohm.xml -# -hm CountMode timer -hm preset 2 -hm exponent 0 -# -hm configure init 1 -hm init -MakeScanCommand xxxscan counter wombat.hdd recover.bin +fileeval $cfPath(motors)/motor_configuration.tcl -fileeval motor_configuration.tcl -fileeval gen_hipadaba.tcl -fileeval extraconfig.tcl +######## +source $cfPath(hipadaba)/hipadaba_configuration.tcl +source gumxml.tcl + +#fileeval $cfPath(hmm)/hmm_configuration.tcl +#fileeval $cfPath(nexus)/nxscripts.tcl +#fileeval $cfPath(scan)/scan.tcl +#fileeval extraconfig.tcl