Use new dir structure.
r1515 | ffr | 2007-02-20 08:03:21 +1100 (Tue, 20 Feb 2007) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
a24d966eea
commit
14a244d014
130
site_ansto/instrument/hipd/config/scan/scan.tcl
Normal file
130
site_ansto/instrument/hipd/config/scan/scan.tcl
Normal file
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user