- Added a a general data handling object

- Extended the callback interface to register scipts on callbacks
- Fixed a stop bug in the anticollision object
- Modified the HM code to do zero through a client connection
This commit is contained in:
cvs
2003-06-13 11:35:35 +00:00
parent f3853c20f0
commit 6819991e85
26 changed files with 1649 additions and 98 deletions

View File

@@ -266,3 +266,93 @@ source amorpar.tcl
Publish amorpar Spy
ClientPut "Done Initializing"
scriptcallback connect xxxscan SCANSTART scanmode
scriptcallback connect hm COUNTSTART tofmode
sicsdatafactory new wwwdata
Publish getmode Spy
Publish wwwgetdata Spy
Publish wwwsics Spy
Publish wwwgetaxis Spy
#-----------------------------------------------------------------
set mode 0
proc tofmode {} {
global mode
set mode 1
}
#---------------------------------------------------------------------
proc scanmode {} {
global mode
set mode 0
}
#------------------------------------------------------------------
proc getmode {} {
global mode
return $mode
}
#--------------------------------------------------------------------
proc wwwgetdata {} {
global mode
if {$mode == 1} {
wwwtofdata
} else {
wwwscandata
}
wwwdata writeuu wwwdata
}
#---------------------------------------------------------------------
proc wwwscandata {} {
wwwdata clear
set np [string trim [SplitReply [xxxscan np]]]
wwwdata putint 0 $np
if {$np > 0} {
wwwdata copyscanvar 1 xxxscan 0
wwwdata copyscancounts [expr $np + 1] xxxscan
wwwdata copyscanmon [expr $np*2 + 1] xxxscan 2
}
}
#----------------------------------------------------------------------
proc wwwtofdata {} {
wwwdata clear
set ntime [string trim [SplitReply [hm notimebin]]]
set dim0 [string trim [SplitReply [hm configure dim0]]]
set dim1 [string trim [SplitReply [hm configure dim1]]]
wwwdata putint 0 $ntime
wwwdata copytimebin 1 hm
set start [expr $dim0*$dim1*$ntime]
set end [expr $start + 2*$ntime]
wwwdata copyhm [expr $ntime + 1] hm $start $end
}
#---------------------------------------------------------------------------
proc wwwsics {} {
global mode
append result "<table BORDER=2>\n"
append result "<tr><th>User</th> <td>" [SplitReply [user]] "</td></tr>\n"
append result "<tr><th>Title</th> <td>"
append result [SplitReply [title]] "</td></tr>\n"
append result "<tr><th>Status</th> <td>"
append result [SplitReply [status]] "</td></tr>\n"
append result "<tr><th>Mode</th><td>"
if {$mode == 1} {
append result "time-of-flight"
} else {
append result "scan mode"
}
append result "</td></tr>\n"
append result "</table>\n"
}
#-------------------------------------------------------------------------
proc wwwgetaxis {} {
global mode
if {$mode == 1} {
return time-of-flight
} else {
set res [scan info]
set l [split $res ,]
return [lindex $l 2]
}
}