underscores

This commit is contained in:
2022-07-08 20:09:33 +02:00
parent b7c4160b32
commit 8a745a3536
4 changed files with 40 additions and 40 deletions
+16 -16
View File
@@ -7,49 +7,49 @@ class SlitBlades(SlitBase):
def __init__(self, ID):
self.ID = ID
self._x1 = Motor(ID + ":MOTOR_X1")
self._x2 = Motor(ID + ":MOTOR_X2")
self._y1 = Motor(ID + ":MOTOR_Y1")
self._y2 = Motor(ID + ":MOTOR_Y2")
self.x1 = Motor(ID + ":MOTOR_X1")
self.x2 = Motor(ID + ":MOTOR_X2")
self.y1 = Motor(ID + ":MOTOR_Y1")
self.y2 = Motor(ID + ":MOTOR_Y2")
def get_hg(self):
return self._x2.get_current_value() - self._x1.get_current_value()
return self.x2.get_current_value() - self.x1.get_current_value()
def get_vg(self):
return self._y2.get_current_value() - self._y1.get_current_value()
return self.y2.get_current_value() - self.y1.get_current_value()
def get_ho(self):
return (self._x1.get_current_value() + self._x2.get_current_value()) / 2
return (self.x1.get_current_value() + self.x2.get_current_value()) / 2
def get_vo(self):
return (self._y1.get_current_value() + self._y2.get_current_value()) / 2
return (self.y1.get_current_value() + self.y2.get_current_value()) / 2
def set_hg(self, value, ho=None):
if ho is None:
ho = self.get_ho()
c1 = self._x1.set_target_value(ho - value / 2)
c2 = self._x2.set_target_value(ho + value / 2)
c1 = self.x1.set_target_value(ho - value / 2)
c2 = self.x2.set_target_value(ho + value / 2)
return c1, c2
def set_vg(self, value, vo=None):
if vo is None:
vo = self.get_vo()
c1 = self._y1.set_target_value(vo - value / 2)
c2 = self._y2.set_target_value(vo + value / 2)
c1 = self.y1.set_target_value(vo - value / 2)
c2 = self.y2.set_target_value(vo + value / 2)
return c1, c2
def set_ho(self, value, hg=None):
if hg is None:
hg = self.get_hg()
c1 = self._x1.set_target_value(value - hg / 2)
c2 = self._x2.set_target_value(value + hg / 2)
c1 = self.x1.set_target_value(value - hg / 2)
c2 = self.x2.set_target_value(value + hg / 2)
return c1, c2
def set_vo(self, value, vg=None):
if vg is None:
vg = self.get_vg()
c1 = self._y1.set_target_value(value - vg / 2)
c2 = self._y2.set_target_value(value + vg / 2)
c1 = self.y1.set_target_value(value - vg / 2)
c2 = self.y2.set_target_value(value + vg / 2)
return c1, c2
@@ -7,10 +7,10 @@ class SlitBladesJJ(SlitBlades):
def __init__(self, ID):
self.ID = ID
self._x1 = Motor(ID + ":MOT3")
self._x2 = Motor(ID + ":MOT2")
self._y1 = Motor(ID + ":MOT5")
self._y2 = Motor(ID + ":MOT4")
self.x1 = Motor(ID + ":MOT3")
self.x2 = Motor(ID + ":MOT2")
self.y1 = Motor(ID + ":MOT5")
self.y2 = Motor(ID + ":MOT4")
@@ -8,20 +8,20 @@ class SlitTwoBladesA(SlitBlades):
def __init__(self, ID):
self.ID = ID
self._x1 = Motor(ID + ":MOTOR_AX1")
self._x2 = Motor(ID + ":MOTOR_AX2")
self._y1 = Motor(ID + ":MOTOR_AY1")
self._y2 = Motor(ID + ":MOTOR_AY2")
self.x1 = Motor(ID + ":MOTOR_AX1")
self.x2 = Motor(ID + ":MOTOR_AX2")
self.y1 = Motor(ID + ":MOTOR_AY1")
self.y2 = Motor(ID + ":MOTOR_AY2")
class SlitTwoBladesB(SlitBlades):
def __init__(self, ID):
self.ID = ID
self._x1 = Motor(ID + ":MOTOR_BX1")
self._x2 = Motor(ID + ":MOTOR_BX2")
self._y1 = Motor(ID + ":MOTOR_BY1")
self._y2 = Motor(ID + ":MOTOR_BY2")
self.x1 = Motor(ID + ":MOTOR_BX1")
self.x2 = Motor(ID + ":MOTOR_BX2")
self.y1 = Motor(ID + ":MOTOR_BY1")
self.y2 = Motor(ID + ":MOTOR_BY2")
class SlitFourBlades(SlitBase):
+12 -12
View File
@@ -7,34 +7,34 @@ class SlitPosWidth(SlitBase):
def __init__(self, ID):
self.ID = ID
self._xoffs = Motor(ID + ":MOTOR_X")
self._yoffs = Motor(ID + ":MOTOR_Y")
self._xgap = Motor(ID + ":MOTOR_W")
self._ygap = Motor(ID + ":MOTOR_H")
self.xoffs = Motor(ID + ":MOTOR_X")
self.yoffs = Motor(ID + ":MOTOR_Y")
self.xgap = Motor(ID + ":MOTOR_W")
self.ygap = Motor(ID + ":MOTOR_H")
def get_hg(self):
return self._xgap.get_current_value()
return self.xgap.get_current_value()
def get_vg(self):
return self._ygap.get_current_value()
return self.ygap.get_current_value()
def get_ho(self):
return self._xoffs.get_current_value()
return self.xoffs.get_current_value()
def get_vo(self):
return self._yoffs.get_current_value()
return self.yoffs.get_current_value()
def set_hg(self, value):
return self._xgap.set_target_value(value)
return self.xgap.set_target_value(value)
def set_vg(self, value):
return self._ygap.set_target_value(value)
return self.ygap.set_target_value(value)
def set_ho(self, value):
return self._xoffs.set_target_value(value)
return self.xoffs.set_target_value(value)
def set_vo(self, value):
return self._yoffs.set_target_value(value)
return self.yoffs.set_target_value(value)