BUGFIX Forgot to actually send coil value when set.
Also cleared stale error messages.
This commit is contained in:
@@ -6,6 +6,9 @@ namespace eval ::scobj::chopper {
|
||||
# sicslist setatt disk_chopper long_name disk_chopper
|
||||
|
||||
proc sndMBquery {rdScript cmd nextReq} {
|
||||
if [hpropexists [sct] geterror] {
|
||||
hdelprop [sct] geterror
|
||||
}
|
||||
set chN [ lindex [sct P_chAddress] [sct P_chIndex] ]
|
||||
sct nextSndReq $nextReq
|
||||
sct send "$chN:$cmd"
|
||||
@@ -13,6 +16,12 @@ namespace eval ::scobj::chopper {
|
||||
}
|
||||
|
||||
proc sndMBset {root cmd} {
|
||||
if [hpropexists [sct] geterror] {
|
||||
hdelprop [sct] geterror
|
||||
}
|
||||
if {[hval $root/control/device_error] != ""} {
|
||||
hset $root/control/device_error ""
|
||||
}
|
||||
set val [sct target]
|
||||
#TODO convert val to appropriate units, if [convfact] then val = val * [sct convfact]
|
||||
sct send "$cmd:$val"
|
||||
@@ -27,6 +36,10 @@ namespace eval ::scobj::chopper {
|
||||
if {[string match "ASCERR:*" $val]} {
|
||||
sct geterror $val
|
||||
return idle
|
||||
} else {
|
||||
if [hpropexists [sct] geterror] {
|
||||
hdelprop [sct] geterror
|
||||
}
|
||||
}
|
||||
if {$val != $oldval} {
|
||||
sct update 1
|
||||
@@ -48,12 +61,21 @@ namespace eval ::scobj::chopper {
|
||||
set chIndex [sct P_chIndex]
|
||||
set currCh [ lindex [sct P_name] $chIndex ]
|
||||
set val [sct result]
|
||||
if {[string match "ASCERR:*" $val]} {
|
||||
sct geterror $val
|
||||
return idle
|
||||
} else {
|
||||
if [hpropexists [sct] geterror] {
|
||||
hdelprop [sct] geterror
|
||||
}
|
||||
}
|
||||
set cAddr [expr $coil - 1]
|
||||
set coilPath $root/$currCh/$node
|
||||
|
||||
set oldval [hgetpropval $coilPath P_oldval]
|
||||
if {$val != $oldval} {
|
||||
hsetprop $coilPath P_oldval $val
|
||||
hset $coilPath $val
|
||||
}
|
||||
return [sct nextSndReq]
|
||||
}
|
||||
@@ -68,10 +90,15 @@ namespace eval ::scobj::chopper {
|
||||
sct geterror $values
|
||||
hset $chPath/device_error $values
|
||||
return idle
|
||||
} else {
|
||||
if [hpropexists [sct] geterror] {
|
||||
hdelprop [sct] geterror
|
||||
}
|
||||
if {[hval $chPath/device_error] != ""} {
|
||||
hset $chPath/device_error ""
|
||||
}
|
||||
}
|
||||
if {[hval $chPath/device_error] != ""} {
|
||||
hset $chPath/device_error ""
|
||||
}
|
||||
|
||||
foreach n $nodes v $values {
|
||||
set oldval [hval $chPath/$n]
|
||||
if {$v != $oldval} {
|
||||
@@ -98,9 +125,6 @@ namespace eval ::scobj::chopper {
|
||||
hset $chPath/device_error $reply
|
||||
return idle
|
||||
}
|
||||
if {[hval $chPath/device_error] != ""} {
|
||||
hset $chPath/device_error ""
|
||||
}
|
||||
sct_fermi queue $root progress read
|
||||
return idle
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user