Updated from ics2-pelican.

This commit is contained in:
Ferdi Franceschini
2013-11-23 11:49:28 +11:00
committed by Ferdi Franceschini
parent 7b814089ff
commit 472ca4f9d9
3 changed files with 103 additions and 106 deletions

View File

@@ -179,7 +179,9 @@ proc ::scobj::hv::rdHVStatusFunc {basePath mode} {
} elseif {$mode == "config"} {
hset $basePath/config/mode "[lindex $replyText 3] [lindex $replyText 4]"
hset $basePath/config/hv [lindex $replyText 5]
if {[lindex $replyText 5] != ""} {
hset $basePath/config/hv [lindex $replyText 5]
}
hset $basePath/config/pressure_threshold [lindex $replyText 6]
hsetprop $basePath/config/pressure_threshold units [lindex $replyText 7]
@@ -329,17 +331,17 @@ proc ::scobj::hv::mkHV {argList} {
proc hv_status {} {
set cmd "get status\r\n"
sct_hv send $cmd
sct_hv transact $cmd
}
proc hv_config {} {
set cmd "get config\r\n"
sct_hv send $cmd
sct_hv transact $cmd
}
proc hv_clear_error {} {
set cmd "clear error\r\n"
sct_hv send $cmd
sct_hv transact $cmd
}
proc hv_vol {{vol ""} args} {
@@ -347,7 +349,7 @@ proc hv_vol {{vol ""} args} {
hget /instrument/hv/config/hv
} else {
set cmd "set hv=$vol\r\n"
sct_hv send $cmd
sct_hv transact $cmd
}
}
@@ -356,7 +358,7 @@ proc hv_pressure {{pressure ""} args} {
hget /instrument/hv/config/pressure_threshold
} else {
set cmd "set pressure=$pressure\r\n"
sct_hv send $cmd
sct_hv transact $cmd
}
}
@@ -365,7 +367,7 @@ proc hv_mode {{mode ""} args} {
hget /instrument/hv/config/mode
} else {
set cmd "set mode=$mode\r\n"
sct_hv send $cmd
sct_hv transact $cmd
}
}
@@ -373,23 +375,23 @@ proc hv_date {{date ""} args} {
if {$date == ""} {
} else {
set cmd "set date=$date\r\n"
sct_hv send $cmd
sct_hv transact $cmd
}
}
proc hv_powerup {} {
set cmd "power up\r\n"
sct_hv send $cmd
sct_hv transact $cmd
}
proc hv_powerdown {} {
set cmd "power down\r\n"
sct_hv send $cmd
sct_hv transact $cmd
}
proc hv_help {} {
set cmd "help\r\n"
sct_hv send $cmd
sct_hv transact $cmd
}
proc set_data_record {args} {
@@ -414,14 +416,17 @@ publish hv_powerdown user
publish hv_help user
publish set_data_record user
MakeAsyncProtocol std
MakeAsyncQueue hvport std 10.157.205.10 4001
# Main process call to create the driver
#::scobj::hv::mkHV {
# name "hv"
# IP 137.157.202.215
# PORT 55011
# tuning 1
# interval 5
#}
::scobj::hv::mkHV {
name "hv"
IP aqadapter
PORT hvport
tuning 1
interval 5
}