- Changes to test
This commit is contained in:
@ -10,7 +10,7 @@ testint=/entry1,NXentry/SDS testint -type NX_INT32
|
||||
testmot=/entry1,NXentry/SDS position
|
||||
testmot_null=/entry1,NXentry/SDS position_zeropoint
|
||||
testcter_preset=/entry1,NXentry/control,NXmonitor/SDS preset
|
||||
testcter_mode=/entry1,NXentry/control,NXmonitor/SDS mode -type NX_CHAR
|
||||
testcter_mode=/entry1,NXentry/control,NXmonitor/SDS mode -type NX_CHAR -dim {132}
|
||||
testcter_time=/entry1,NXentry/control,NXmonitor/SDS time
|
||||
testcter_00=/entry1,NXentry/control,NXmonitor/SDS counts0 -type NX_INT32
|
||||
testcter_01=/entry1,NXentry/control,NXmonitor/SDS counts1 -type NX_INT32
|
||||
|
132
test/testini.tcl
132
test/testini.tcl
@ -197,14 +197,7 @@ hattach /instrument lotte title
|
||||
|
||||
restore
|
||||
|
||||
|
||||
# Generic Controller
|
||||
#-------------------------------------------------------------------
|
||||
MakeAsyncProtocol norma
|
||||
MakeAsyncQueue farmQueue norma localhost 9090
|
||||
MakeGenController farm
|
||||
genconfigure asynconnect farm farmQueue
|
||||
#------------------------------------------------
|
||||
#-------------------------------------------------
|
||||
proc farmFormat {par num} {
|
||||
hsetprop /sics/farm/$par lastError none
|
||||
return [format "$par %d" [string trim $num]]
|
||||
@ -303,29 +296,6 @@ proc schrunget {} {
|
||||
#-----------------------------------------------
|
||||
set farm 0
|
||||
if {$farm == 1} {
|
||||
genconfigure makepar farm hase int
|
||||
hsetprop /sics/farm/hase priv user
|
||||
hsetprop /sics/farm/hase writeCommand "farmFormat hase"
|
||||
hsetprop /sics/farm/hase readCommand "farmRead hase"
|
||||
hsetprop /sics/farm/hase replyCommand "farmReply hase"
|
||||
|
||||
genconfigure makepar farm schnegge int
|
||||
hsetprop /sics/farm/schnegge priv user
|
||||
hsetprop /sics/farm/schnegge writeCommand "farmFormat schnegge"
|
||||
hsetprop /sics/farm/schnegge readCommand "farmRead schnegge"
|
||||
hsetprop /sics/farm/schnegge replyCommand "farmReply schnegge"
|
||||
|
||||
genconfigure makepar farm schneggerunning int
|
||||
hsetprop /sics/farm/schneggerunning priv internal
|
||||
hsetprop /sics/farm/schneggerunning readCommand "farmRead schneggerunning"
|
||||
hsetprop /sics/farm/schneggerunning replyCommand "farmReply schneggerunning"
|
||||
|
||||
genconfigure makepar farm schneggecon int
|
||||
hsetprop /sics/farm/schneggecon priv user
|
||||
hsetprop /sics/farm/schneggecon writeCommand schconset
|
||||
hsetprop /sics/farm/schneggecon readCommand schget
|
||||
hsetprop /sics/farm/schneggecon replyCommand schreply
|
||||
}
|
||||
# Generic Controller
|
||||
#-------------------------------------------------------------------
|
||||
MakeAsyncProtocol norma
|
||||
@ -333,104 +303,6 @@ MakeAsyncQueue farmQueue norma localhost 9090
|
||||
MakeGenController farm
|
||||
genconfigure asynconnect farm farmQueue
|
||||
#------------------------------------------------
|
||||
proc farmFormat {par num} {
|
||||
hsetprop /sics/farm/$par lastError none
|
||||
return [format "$par %d" [string trim $num]]
|
||||
}
|
||||
#-----------------------------------------------
|
||||
proc farmRead {par } {
|
||||
hsetprop /sics/farm/$par lastError none
|
||||
hsetprop /sics/farm/$par replyCommand "farmReply $par"
|
||||
return $par
|
||||
}
|
||||
#-----------------------------------------------
|
||||
proc farmReply {par reply} {
|
||||
set action [string trim [hgetpropval /sics/farm/$par status]]
|
||||
hsetprop /sics/farm/$par status idle
|
||||
if {[string first OK $reply] >= 0} {
|
||||
if {[string first get $action] >= 0} {
|
||||
set idx [string first : $reply]
|
||||
if {$idx > 0} {
|
||||
set val [string trim [string range $reply [expr $idx +1] end]]
|
||||
hupdate /sics/farm/$par $val
|
||||
}
|
||||
} else {
|
||||
hget /sics/farm/$par
|
||||
}
|
||||
} else {
|
||||
if {[string first ERROR $reply] < 0} {
|
||||
set reply "ERROR: $reply"
|
||||
}
|
||||
clientPut $reply
|
||||
error $reply
|
||||
}
|
||||
}
|
||||
#=============================================
|
||||
proc schconset {val} {
|
||||
set com [farmFormat schnegge $val]
|
||||
hsetprop /sics/farm/schneggecon replyCommand schreply
|
||||
return $com
|
||||
}
|
||||
#----------------------------------------------
|
||||
proc schreply {reply} {
|
||||
clientput "schreply $reply"
|
||||
if {[string first OK $reply] >= 0} {
|
||||
hsetprop /sics/farm/schneggerunning readCommand schrunget
|
||||
hget /sics/farm/schneggerunning
|
||||
hsetprop /sics/farm/schneggerunning readCommand \
|
||||
"farmReply schneggerunning"
|
||||
} else {
|
||||
hsetprop /sics/farm/schneggecon status idle
|
||||
hsetprop /sics/farm/schneggecon lastError $reply
|
||||
clientput "ERROR: $reply on schnegge"
|
||||
}
|
||||
}
|
||||
#-----------------------------------------------
|
||||
proc schrun {reply} {
|
||||
clientput "schrun $reply"
|
||||
hsetprop /sics/farm/schneggerunning status idle
|
||||
if {[string first OK $reply] >= 0} {
|
||||
set idx [string first : $reply]
|
||||
if {$idx > 0} {
|
||||
set val [string trim [string range $reply [expr $idx +1] end]]
|
||||
hupdate /sics/farm/schneggerunning $val
|
||||
if {$val == 1} {
|
||||
clientput "schnegge creeping"
|
||||
hsetprop /sics/farm/schneggerunning readCommand schrunget
|
||||
hget /sics/farm/schneggerunning
|
||||
hsetprop /sics/farm/schneggerunning readCommand \
|
||||
"farmReply schneggerunning"
|
||||
} else {
|
||||
clientput "schnegge finished"
|
||||
hsetprop /sics/farm/schneggerunning readCommand \
|
||||
"farmRead schneggerunning"
|
||||
hsetprop /sics/farm/schneggecon status idle
|
||||
}
|
||||
}
|
||||
} else {
|
||||
clientput "schnegge has error: $reply"
|
||||
hsetprop /sics/farm/schneggerunning readCommand \
|
||||
"farmRead schneggerunning"
|
||||
hsetprop /sics/farm/schneggecon status idle
|
||||
hsetprop /sics/farm/schneggecon lastError $reply
|
||||
hsetprop /sics/farm/schneggerunning lastError $reply
|
||||
}
|
||||
}
|
||||
#----------------------------------------------
|
||||
proc schget {} {
|
||||
hsetprop /sics/farm/schneggecon lastError none
|
||||
hsetprop /sics/farm/schneggecon replyCommand "farmReply schneggecon"
|
||||
return schnegge
|
||||
}
|
||||
#----------------------------------------------
|
||||
proc schrunget {} {
|
||||
hsetprop /sics/farm/schneggerunning lastError none
|
||||
hsetprop /sics/farm/schneggerunning replyCommand schrun
|
||||
return schneggerunning
|
||||
}
|
||||
#-----------------------------------------------
|
||||
set farm 0
|
||||
if {$farm == 1} {
|
||||
genconfigure makepar farm hase int
|
||||
hsetprop /sics/farm/hase priv user
|
||||
hsetprop /sics/farm/hase writeCommand "farmFormat hase"
|
||||
@ -455,7 +327,7 @@ hsetprop /sics/farm/schneggecon readCommand schget
|
||||
hsetprop /sics/farm/schneggecon replyCommand schreply
|
||||
}
|
||||
|
||||
source sansdruck.tcl
|
||||
#source sansdruck.tcl
|
||||
|
||||
|
||||
#MakeRS232Controller sadu pc4639 4168
|
||||
|
Reference in New Issue
Block a user