This commit is contained in:
@@ -7,7 +7,10 @@ class LEEM2000(TcpDevice):
|
||||
self.NUMBER_MNEMONICS = 100
|
||||
self._mnemonics = None
|
||||
self._names = None
|
||||
self.high_voltage = Channel("X11MA-ES1-PEEM:UMON", alias = "PEEM high voltage", monitored=True)
|
||||
try:
|
||||
self.high_voltage = Channel("X11MA-ES1-PEEM:UMON", alias = "PEEM high voltage", monitored=True)
|
||||
except:
|
||||
self.high_voltage = None
|
||||
self.debug = False
|
||||
self.retries = 1
|
||||
self.timeout = 1000
|
||||
@@ -119,10 +122,10 @@ class LEEM2000(TcpDevice):
|
||||
def get_high_voltage(self):
|
||||
return self.high_voltage.get(False)
|
||||
|
||||
def get_child(self, var, name=None):
|
||||
def get_child(self, var, name=None, scale=None):
|
||||
if name is None:
|
||||
name=var
|
||||
ret = LEEM2000Child(name, var, self)
|
||||
ret = LEEM2000Child(name, var, self, scale)
|
||||
ret.initialize()
|
||||
return ret
|
||||
|
||||
@@ -203,15 +206,23 @@ class LEEM2000(TcpDevice):
|
||||
|
||||
|
||||
class LEEM2000Child(RegisterBase):
|
||||
def __init__(self,name, var, microscope):
|
||||
def __init__(self,name, var, microscope, scale=None):
|
||||
RegisterBase.__init__(self,name)
|
||||
self.var = var
|
||||
self.scale = scale
|
||||
self.microscope = microscope
|
||||
|
||||
def doRead(self):
|
||||
return self.microscope.get_value(self.var)
|
||||
ret = self.microscope.get_value(self.var)
|
||||
if ret is not None:
|
||||
if self.scale is not None:
|
||||
ret = float(ret)*self.scale
|
||||
return ret
|
||||
|
||||
def doWrite(self, val):
|
||||
if val is not None:
|
||||
if self.scale is not None:
|
||||
val = float(val)/self.scale
|
||||
self.microscope.set_value(self.var, val)
|
||||
|
||||
class LEEM2000Positioner (PositionerBase):
|
||||
@@ -283,7 +294,7 @@ add_device (microscope.get_tilt('D','U', "tilt_v"), True)
|
||||
add_device (microscope.get_child("MOBJ","objective"), True)
|
||||
add_device (microscope.get_child("OSTIGA","obj_stig_a"), True)
|
||||
add_device (microscope.get_child("OSTIGB","obj_stig_b"), True)
|
||||
add_device (microscope.get_child("MDRIVE","azimuth_rot"), True)
|
||||
add_device (microscope.get_child("MDRIVE","azimuth_rot", 0.01794), True)
|
||||
add_device (microscope.get_child("BOMBV","bv"), True)
|
||||
add_device (microscope.get_child("FIL","fil"), True)
|
||||
add_device (microscope.get_child("STV","start_voltage"), True)
|
||||
@@ -321,8 +332,11 @@ class Fov(ReadonlyRegisterBase):
|
||||
self.position = 0
|
||||
|
||||
def doRead(self):
|
||||
return self.mic.get_preset_label()
|
||||
|
||||
ret = self.mic.get_preset_label()
|
||||
if ret is not None:
|
||||
if ":" in ret:
|
||||
ret = ret[0:ret.rindex(":")]
|
||||
return ret
|
||||
|
||||
|
||||
def init_tilt():
|
||||
@@ -337,6 +351,8 @@ tilt_horizontal.polling=500
|
||||
manip_x.polling=500
|
||||
manip_y.polling=500
|
||||
fov.polling=5000
|
||||
azimuth_rot.precision=2
|
||||
azimuth_rot.polling=5000
|
||||
bv.polling=1000
|
||||
fil.polling=1000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user