diff --git a/site_ansto/instrument/bilby/config/motors/shutters.sct b/site_ansto/instrument/bilby/config/motors/shutters.sct index 80137a57..6db24ffd 100644 --- a/site_ansto/instrument/bilby/config/motors/shutters.sct +++ b/site_ansto/instrument/bilby/config/motors/shutters.sct @@ -104,11 +104,27 @@ driver shutters = { code postamble = { @ variable rough_slits_enabled 0 @ variable rough_slits_cb_pending 0 -@ proc selrs {slit {cb_timeout 60}} { +@ proc selrs {args} { @ variable rough_slits_enabled @ variable rough_slits_cb_pending -@ set usage_msg "Valid arguments are 40 or 100 or use 'reset' to terminate a previous selrs call" +@ set usage_msg "Valid arguments are 40 or 100 or use 'reset' to terminate a previous selrs call. Without argurments selrs reports current positions." @ set catch_status [ catch { +@ switch [llength $args] { +@ 0 { +@ clientput [hlist -val /sics/shutters] +@ return +@ } +@ 1 { +@ set slit $args +@ set cb_timeout 60 +@ } +@ 2 { +@ foreach {slit cb_timeout} $args {} +@ } +@ default { +@ error "[info level 0]: $usage_msg" +@ } +@ } @ if {$slit == "help"} { @ clientput "Usage: $usage_msg" @ return diff --git a/site_ansto/instrument/bilby/config/motors/shutters_sct.tcl b/site_ansto/instrument/bilby/config/motors/shutters_sct.tcl index 6c3c7a51..b58c817d 100644 --- a/site_ansto/instrument/bilby/config/motors/shutters_sct.tcl +++ b/site_ansto/instrument/bilby/config/motors/shutters_sct.tcl @@ -363,11 +363,27 @@ namespace eval ::scobj::shutters { # postamble hook code starts variable rough_slits_enabled 0 variable rough_slits_cb_pending 0 - proc selrs {slit {cb_timeout 60}} { + proc selrs {args} { variable rough_slits_enabled variable rough_slits_cb_pending - set usage_msg "Valid arguments are 40 or 100 or use 'reset' to terminate a previous selrs call" + set usage_msg "Valid arguments are 40 or 100 or use 'reset' to terminate a previous selrs call. Without argurments selrs reports current positions." set catch_status [ catch { + switch [llength $args] { + 0 { + clientput [hlist -val /sics/shutters] + return + } + 1 { + set slit $args + set cb_timeout 60 + } + 2 { + foreach {slit cb_timeout} $args {} + } + default { + error "[info level 0]: $usage_msg" + } + } if {$slit == "help"} { clientput "Usage: $usage_msg" return