From acf91f494dfdf9af0bc818df7b3d3d22a95ad8b0 Mon Sep 17 00:00:00 2001 From: Jing Chen Date: Thu, 30 Aug 2012 09:21:58 +1000 Subject: [PATCH] r3728 | jgn | 2012-08-30 09:21:58 +1000 (Thu, 30 Aug 2012) | 1 line --- .../instrument/pelican/config/hmm/sct_hv.tcl | 75 +++++++++++-------- 1 file changed, 45 insertions(+), 30 deletions(-) diff --git a/site_ansto/instrument/pelican/config/hmm/sct_hv.tcl b/site_ansto/instrument/pelican/config/hmm/sct_hv.tcl index 9ee7c596..675edf58 100644 --- a/site_ansto/instrument/pelican/config/hmm/sct_hv.tcl +++ b/site_ansto/instrument/pelican/config/hmm/sct_hv.tcl @@ -299,57 +299,72 @@ proc ::scobj::hv::mkHV {argList} { } } -proc hvGetStatus {} { +proc hv_status {} { set cmd "get status\r\n" sct_hv send $cmd } -proc hvGetConfig {} { +proc hv_config {} { set cmd "get config\r\n" sct_hv send $cmd } -proc hvClearError {} { +proc hv_clear_error {} { set cmd "clear error\r\n" sct_hv send $cmd } -proc hvSetHV {vol} { - set cmd "set hv=$vol\r\n" - sct_hv send $cmd +proc hv_vol {{vol ""} args} { + if {$vol == ""} { + hget /sics/hv/config/hv + } else { + set cmd "set hv=$vol\r\n" + sct_hv send $cmd + } } -proc hvSetPressure {pressure} { - set cmd "set pressure=$pressure\r\n" - sct_hv send $cmd +proc hv_pressure {{pressure ""} args} { + if {$pressure == ""} { + hget /sics/hv/config/pressure_threshold + } else { + set cmd "set pressure=$pressure\r\n" + sct_hv send $cmd + } } -proc hvSetMode {mode} { - set cmd "set mode=$mode\r\n" - sct_hv send $cmd +proc hv_mode {{mode ""} args} { + if {$mode == ""} { + hget /sics/hv/config/mode + } else { + set cmd "set mode=$mode\r\n" + sct_hv send $cmd + } } -proc hvSetDate {date} { - set cmd "set date=$date\r\n" - sct_hv send $cmd +proc hv_date {{date ""} args} { + if {$date == ""} { + } else { + set cmd "set date=$date\r\n" + sct_hv send $cmd + } } -proc hvPowerUp {} { +proc hv_powerup {} { set cmd "power up\r\n" sct_hv send $cmd } -proc hvPowerDown {} { +proc hv_powerdown {} { set cmd "power down\r\n" sct_hv send $cmd } -proc hvHelp {} { +proc hv_help {} { set cmd "help\r\n" sct_hv send $cmd } -proc setDataRecord {args} { +proc set_data_record {args} { switch $args { "ON" {hset /sics/hv/dataRecording "ON"} "on" {hset /sics/hv/dataRecording "ON"} @@ -359,17 +374,17 @@ proc setDataRecord {args} { } } -publish hvGetStatus user -publish hvGetConfig user -publish hvClearError user -publish hvSetHV user -publish hvSetPressure user -publish hvSetMode user -publish hvSetDate user -publish hvPowerUp user -publish hvPowerDown user -publish hvHelp user -publish setDataRecord user +publish hv_status user +publish hv_config user +publish hv_clear_error user +publish hv_vol user +publish hv_pressure user +publish hv_mode user +publish hv_date user +publish hv_powerup user +publish hv_powerdown user +publish hv_help user +publish set_data_record user # Main process call ::scobj::hv::mkHV {