r3728 | jgn | 2012-08-30 09:21:58 +1000 (Thu, 30 Aug 2012) | 1 line
This commit is contained in:
committed by
Douglas Clowes
parent
2ea516d84b
commit
acf91f494d
@@ -299,57 +299,72 @@ proc ::scobj::hv::mkHV {argList} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc hvGetStatus {} {
|
proc hv_status {} {
|
||||||
set cmd "get status\r\n"
|
set cmd "get status\r\n"
|
||||||
sct_hv send $cmd
|
sct_hv send $cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
proc hvGetConfig {} {
|
proc hv_config {} {
|
||||||
set cmd "get config\r\n"
|
set cmd "get config\r\n"
|
||||||
sct_hv send $cmd
|
sct_hv send $cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
proc hvClearError {} {
|
proc hv_clear_error {} {
|
||||||
set cmd "clear error\r\n"
|
set cmd "clear error\r\n"
|
||||||
sct_hv send $cmd
|
sct_hv send $cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
proc hvSetHV {vol} {
|
proc hv_vol {{vol ""} args} {
|
||||||
set cmd "set hv=$vol\r\n"
|
if {$vol == ""} {
|
||||||
sct_hv send $cmd
|
hget /sics/hv/config/hv
|
||||||
|
} else {
|
||||||
|
set cmd "set hv=$vol\r\n"
|
||||||
|
sct_hv send $cmd
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc hvSetPressure {pressure} {
|
proc hv_pressure {{pressure ""} args} {
|
||||||
set cmd "set pressure=$pressure\r\n"
|
if {$pressure == ""} {
|
||||||
sct_hv send $cmd
|
hget /sics/hv/config/pressure_threshold
|
||||||
|
} else {
|
||||||
|
set cmd "set pressure=$pressure\r\n"
|
||||||
|
sct_hv send $cmd
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc hvSetMode {mode} {
|
proc hv_mode {{mode ""} args} {
|
||||||
set cmd "set mode=$mode\r\n"
|
if {$mode == ""} {
|
||||||
sct_hv send $cmd
|
hget /sics/hv/config/mode
|
||||||
|
} else {
|
||||||
|
set cmd "set mode=$mode\r\n"
|
||||||
|
sct_hv send $cmd
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc hvSetDate {date} {
|
proc hv_date {{date ""} args} {
|
||||||
set cmd "set date=$date\r\n"
|
if {$date == ""} {
|
||||||
sct_hv send $cmd
|
} else {
|
||||||
|
set cmd "set date=$date\r\n"
|
||||||
|
sct_hv send $cmd
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc hvPowerUp {} {
|
proc hv_powerup {} {
|
||||||
set cmd "power up\r\n"
|
set cmd "power up\r\n"
|
||||||
sct_hv send $cmd
|
sct_hv send $cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
proc hvPowerDown {} {
|
proc hv_powerdown {} {
|
||||||
set cmd "power down\r\n"
|
set cmd "power down\r\n"
|
||||||
sct_hv send $cmd
|
sct_hv send $cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
proc hvHelp {} {
|
proc hv_help {} {
|
||||||
set cmd "help\r\n"
|
set cmd "help\r\n"
|
||||||
sct_hv send $cmd
|
sct_hv send $cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
proc setDataRecord {args} {
|
proc set_data_record {args} {
|
||||||
switch $args {
|
switch $args {
|
||||||
"ON" {hset /sics/hv/dataRecording "ON"}
|
"ON" {hset /sics/hv/dataRecording "ON"}
|
||||||
"on" {hset /sics/hv/dataRecording "ON"}
|
"on" {hset /sics/hv/dataRecording "ON"}
|
||||||
@@ -359,17 +374,17 @@ proc setDataRecord {args} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
publish hvGetStatus user
|
publish hv_status user
|
||||||
publish hvGetConfig user
|
publish hv_config user
|
||||||
publish hvClearError user
|
publish hv_clear_error user
|
||||||
publish hvSetHV user
|
publish hv_vol user
|
||||||
publish hvSetPressure user
|
publish hv_pressure user
|
||||||
publish hvSetMode user
|
publish hv_mode user
|
||||||
publish hvSetDate user
|
publish hv_date user
|
||||||
publish hvPowerUp user
|
publish hv_powerup user
|
||||||
publish hvPowerDown user
|
publish hv_powerdown user
|
||||||
publish hvHelp user
|
publish hv_help user
|
||||||
publish setDataRecord user
|
publish set_data_record user
|
||||||
|
|
||||||
# Main process call
|
# Main process call
|
||||||
::scobj::hv::mkHV {
|
::scobj::hv::mkHV {
|
||||||
|
|||||||
Reference in New Issue
Block a user