PSI sics-cvs-psi_pre-ansto

This commit is contained in:
2003-06-13 00:00:00 +00:00
committed by Douglas Clowes
parent 2e3ddfb6c6
commit 3ffd0d8af4
1099 changed files with 318432 additions and 0 deletions

37
cotop.tcl Normal file
View File

@@ -0,0 +1,37 @@
#--------------------------------------------------------------------------
# A MAD lookalike co command for TOPSI
# All arguments are optional. The current values will be used if not
# specified
# Dr. Mark Koennecke, November 1999
#--------------------------------------------------------------------------
proc SplitReply { text } {
set l [split $text =]
return [lindex $l 1]
}
#--------------------------------------------------------------------------
proc co { {mode NULL } { preset NULL } } {
starttime [sicstime]
#----- deal with mode
set mode2 [string toupper $mode]
set mode3 [string trim $mode2]
set mc [string index $mode2 0]
if { [string compare $mc T] == 0 } {
counter setMode Timer
} elseif { [string compare $mc M] == 0 } {
counter setMode Monitor
}
#------ deal with preset
if { [string compare $preset NULL] != 0 } {
set pre $preset
} else {
set pre [SplitReply [counter getpreset]]
}
#------ count
set ret [catch {counter count $pre} msg]
if { $ret != 0 } {
error [format "Counting ended with error: %s" $msg]
} else {
set cts [SplitReply [counter getcounts]]
}
return $cts
}