add items to log file
r3593 | jgn | 2012-06-05 12:03:28 +1000 (Tue, 05 Jun 2012) | 1 line
This commit is contained in:
committed by
Douglas Clowes
parent
a24df1fc78
commit
dc230ad1ab
@@ -56,13 +56,34 @@ proc ::scobj::hv:setting {field} {
|
||||
set newPara [sct target]
|
||||
|
||||
switch $field {
|
||||
"voltage" {set comm "set hv=$newPara\r\n"}
|
||||
"pressure" {set comm "set pressure=$newPara\r\n"}
|
||||
"mode" {set comm "set mode=$newPara\r\n"}
|
||||
"date" {set comm "set date=$newPara\r\n"}
|
||||
default {error "ERROR: illegal input command, type help for more info"
|
||||
return idle
|
||||
}
|
||||
"voltage" {set comm "set hv=$newPara\r\n"}
|
||||
"pressure" {set comm "set pressure=$newPara\r\n"}
|
||||
"mode" {set comm "set mode=$newPara\r\n"}
|
||||
"date" {set comm "set date=$newPara\r\n"}
|
||||
"clear" {if {[string equal [string toupper $newPara] "OK"]!=1} {
|
||||
error "ERROR: please enter 'ok' to clear the error"
|
||||
return idle
|
||||
} else {
|
||||
set comm "clear error\r\n"
|
||||
}
|
||||
}
|
||||
"PowerUp" {if {[string equal [string toupper $newPara] "OK"]!=1} {
|
||||
error "ERROR: please enter 'ok' to set the Power Up"
|
||||
return idle
|
||||
} else {
|
||||
set comm "power up\r\n"
|
||||
}
|
||||
}
|
||||
"PowerDown" {if {[string equal [string toupper $newPara] "OK"]!=1} {
|
||||
error "ERROR: please enter 'ok' to set the Power Down"
|
||||
return idle
|
||||
} else {
|
||||
set comm "power down\r\n"
|
||||
}
|
||||
}
|
||||
default {error "ERROR: illegal input command, type help for more info"
|
||||
return idle
|
||||
}
|
||||
}
|
||||
|
||||
sct send $comm
|
||||
@@ -123,7 +144,10 @@ proc ::scobj::hv::rdHVStatusFunc {basePath mode} {
|
||||
hset $basePath/status/Soft-S "[lindex $replyText 36]"
|
||||
hset $basePath/status/Hard-S "[lindex $replyText 38]"
|
||||
|
||||
set logdata "[lindex $replyText 10] [lindex $replyText 13] [lindex $replyText 16] [lindex $replyText 19] [lindex $replyText 22] [lindex $replyText 25]"
|
||||
set logdata "[lindex $replyText 10] [lindex $replyText 13] [lindex $replyText 16] [lindex $replyText 19] [lindex $replyText 22] [lindex $replyText 25] \
|
||||
[lindex $replyText 5] [lindex $replyText 7] \
|
||||
[lindex $replyText 28] [lindex $replyText 30] [lindex $replyText 32] [lindex $replyText 34] [lindex $replyText 36] [lindex $replyText 38] \
|
||||
[lindex $replyText 4] [lindex $replyText 3]"
|
||||
debug_log $logdata
|
||||
|
||||
} elseif {$mode == "config"} {
|
||||
@@ -213,10 +237,13 @@ proc ::scobj::hv::mkHV {argList} {
|
||||
hsetprop /sics/$pa(NAME) tuning $pa(TUNING)
|
||||
|
||||
if {$pa(TUNING)} {
|
||||
hfactory /sics/$pa(NAME)/set_hv plain user int
|
||||
hfactory /sics/$pa(NAME)/set_pressure plain user int
|
||||
hfactory /sics/$pa(NAME)/set_mode plain user text
|
||||
hfactory /sics/$pa(NAME)/set_date plain user text
|
||||
hfactory /sics/$pa(NAME)/set_hv plain user int
|
||||
hfactory /sics/$pa(NAME)/set_pressure plain user int
|
||||
hfactory /sics/$pa(NAME)/set_mode plain user text
|
||||
hfactory /sics/$pa(NAME)/set_date plain user text
|
||||
hfactory /sics/$pa(NAME)/clear_error plain user text
|
||||
hfactory /sics/$pa(NAME)/set_PowerUp plain user text
|
||||
hfactory /sics/$pa(NAME)/set_PowerDown plain user text
|
||||
|
||||
::scobj::hinitprops $pa(NAME) set_hv set_pressure set_mode set_date
|
||||
|
||||
@@ -232,11 +259,23 @@ proc ::scobj::hv::mkHV {argList} {
|
||||
hsetprop /sics/$pa(NAME)/set_date write ::scobj::hv:setting "date"
|
||||
hsetprop /sics/$pa(NAME)/set_date checkReply ::scobj::hv::checkReplyFunc /sics/$pa(NAME)
|
||||
|
||||
hsetprop /sics/$pa(NAME)/clear_error write ::scobj::hv:setting "clear"
|
||||
hsetprop /sics/$pa(NAME)/clear_error checkReply ::scobj::hv::checkReplyFunc /sics/$pa(NAME)
|
||||
|
||||
hsetprop /sics/$pa(NAME)/set_PowerUp write ::scobj::hv:setting "PowerUp"
|
||||
hsetprop /sics/$pa(NAME)/set_PowerUp checkReply ::scobj::hv::checkReplyFunc /sics/$pa(NAME)
|
||||
|
||||
hsetprop /sics/$pa(NAME)/set_PowerDown write ::scobj::hv:setting "PowerDown"
|
||||
hsetprop /sics/$pa(NAME)/set_PowerDown checkReply ::scobj::hv::checkReplyFunc /sics/$pa(NAME)
|
||||
|
||||
if {[SplitReply [environment_simulation]]=="false"} {
|
||||
sct_hv write /sics/$pa(NAME)/set_hv $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/set_pressure $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/set_mode $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/set_date $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/set_hv $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/set_pressure $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/set_mode $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/set_date $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/clear_error $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/set_PowerUp $pa(INTERVAL)
|
||||
sct_hv write /sics/$pa(NAME)/set_PowerDown $pa(INTERVAL)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user