From 1cef94cbd267dbb0724108f54e00ccc588a7de6a Mon Sep 17 00:00:00 2001 From: l_samenv Date: Mon, 22 Aug 2022 15:26:45 +0200 Subject: [PATCH] stickrot script --- tcl/stickrot.tcl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tcl/stickrot.tcl diff --git a/tcl/stickrot.tcl b/tcl/stickrot.tcl new file mode 100644 index 0000000..48ff81e --- /dev/null +++ b/tcl/stickrot.tcl @@ -0,0 +1,20 @@ +# make the sample stick rotation using the phytron motor controller +# stickname may contain the name of the object (dom is default) +# stickconn may contain an example of a connection used in the error message when disconnected +if {![info exists stickname]} { + set stickname sr +} +if {![info exists stickconn]} { + set stickconn ma11-ts:3005 +} +source phytron.tcl +if {[sicsdescriptor stickrot] eq "notfound"} { + makesctcontroller stickrot phytron unconnected 0.5 + phytron::make $stickname X stickrot -360 360 0 +} +silent 0 stickrot reconnectinterval 0 +stickrot disconnect + +hsetprop /sics/stickrot/reconnect __save true +hsetprop /sics/$stickname offline_msg "disconnected - use e.g. '$stickname connect $stickconn'" +hsetprop /sics/$stickname refused_msg "controller is already connected by someone else\nERROR: use '$stickname disconnect' on the instrument where this device was last used"