SICS-795 Bring GIT up to date with changes made on ics1-wombat.

This commit is contained in:
Ferdi Franceschini
2014-10-08 20:29:23 +11:00
parent 9720f1d0f0
commit d8f5030a8d
8 changed files with 122 additions and 48 deletions

View File

@@ -6,7 +6,7 @@ namespace eval motor {
}
namespace eval ajscmds {
namespace export SetRadColl SimpleRun SimpleScan RadCollRun RadCollTimed RadCollScan
namespace export SetRadColl SimpleRun SimpleScan RadCollRun RadCollTimed RadCollScan RadCollBiScan
# SetRadColl
command SetRadColl {
@@ -34,13 +34,13 @@ catch {
} msg
clientput $msg
}
# SimpleRun
command SimpleRun {
float=0:inf steptime
int=1:inf numsteps
} {
# RadCollOff
histmem mode time
histmem preset $steptime
newfile HISTOGRAM_XY
@@ -49,6 +49,7 @@ int=1:inf numsteps
save $i
}
}
# SimpleScan
command SimpleScan {
text=drivable motor
@@ -58,7 +59,6 @@ int=1:inf numsteps
float=0:inf steptime
} {
# RadCollOff
histmem mode time
histmem preset $steptime
newfile HISTOGRAM_XY
@@ -68,13 +68,13 @@ float=0:inf steptime
save $i
}
}
# RadCollRun
command RadCollRun {
int=1:inf oscno
int=1:inf reps
} {
# RadCollOn $oscno
histmem mode unlimited
newfile HISTOGRAM_XY
for {set i 0} {$i < $reps} {incr i} {
@@ -83,8 +83,8 @@ int=1:inf reps
hmm countblock
save $i
}
# RadCollOff
}
# RadCollTimed
command RadCollTimed {
int=1:inf oscno
@@ -99,14 +99,16 @@ float=0:inf time
set i 0
set timsecs [expr $time*60]
while {$bool == 0} {
oct oscillate_count $oscno
oct oscillate start
histmem start block
save $i
incr i
set tim2 [expr [clock seconds] - $tim1]
if {$tim2 > $timsecs} {set bool 1}
}
RadCollOff
}
# RadCollScan
command RadCollScan {
text=drivable motor
@@ -115,8 +117,6 @@ float step
int=1:inf numsteps
int=1:inf oscno
} {
# RadCollOn $oscno
histmem mode unlimited
newfile HISTOGRAM_XY
for {set i 0} {$i < $numsteps} {incr i} {
@@ -126,8 +126,12 @@ int=1:inf oscno
hmm countblock
save $i
}
# RadCollOff
}
}
namespace import ::ajscmds::*
publish SetRadColl user
@@ -140,3 +144,67 @@ publish RadCollScan user
proc ::commands::isc_initialize {} {
::commands::ic_initialize
}
# RadCollScanRange
proc RadCollScanRange {motor start step fin oscno} {
if {$step==0} {break}
if {($start > $fin) && ($step > 0)} {break}
if {($start < $fin) && ($step < 0)} {break}
set i_bool 0
histmem mode unlimited
set currentmot $start
set i 0
newfile HISTOGRAM_XY
while {$i_bool==0} {
drive $motor $currentmot
oct oscillate_count $oscno
oct oscillate start
hmm countblock
save $i
set currentmot [expr {$currentmot + $step}]
if {($step > 0) && ($currentmot > $fin)} {set i_bool 1}
if {($step < 0) && ($currentmot < $fin)} {set i_bool 1}
incr i
}
}
publish RadCollScanRange user
#RadCollScanBi
proc RadCollScanBi {motor start step fin oscno motdir} {
set i_bool 0
histmem mode unlimited
if {$motdir == 1} {
set currentmot $start
set i 0
} else {
set currentmot $fin
set i [expr {int(($fin-$start)/$step)}]
}
newfile HISTOGRAM_XY
while {$i_bool==0} {
# drive $motor $currentmot
oct oscillate_count $oscno
oct oscillate start
hmm countblock
if {($motdir > 0)} {
set currentmot [expr {$currentmot + $step}]
if {$currentmot > $fin} {set i_bool 1}
incr i
} else {
set currentmot [expr {$currentmot - $step}]
if {$currentmot < $start} {set i_bool 1}
incr i -1
}
run $motor $currentmot
save $i
}
}
publish RadCollScanBi user