forked from mxcube/HardwareObjects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMicrodiffHolderlength.py
27 lines (20 loc) · 943 Bytes
/
MicrodiffHolderlength.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from MD2Motor import MD2Motor
class MicrodiffHolderlength(MD2Motor):
def __init__(self, *args):
MD2Motor.__init__(self, *args)
def init(self):
MD2Motor.init(self)
offset_chan = self.addChannel({"type":"exporter", "name":"offset" }, "SampleHolderLength")
#self.offset_chan.connectSignal("update", self.offsetChanged)
self.offset = offset_chan.getValue()
def offsetChanged(self, new_offset):
self.offset = new_offset
def motorPositionChanged(self, absolutePosition, private={}):
MD2Motor.motorPositionChanged(self, self.offset-absolutePosition)
def getPosition(self):
return self.offset-self.position_attr.getValue()
def getLimits(self):
low_lim, hi_lim = MD2Motor.getLimits(self)
return ((low_lim + self.offset), (hi_lim+self.offset))
def move(self, absolutePosition):
MD2Motor.move(self, self.offset-absolutePosition)