本文整理匯總了Python中sardana.tango.pool.PoolDevice.PoolElementDevice.init_device方法的典型用法代碼示例。如果您正苦於以下問題:Python PoolElementDevice.init_device方法的具體用法?Python PoolElementDevice.init_device怎麽用?Python PoolElementDevice.init_device使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sardana.tango.pool.PoolDevice.PoolElementDevice
的用法示例。
在下文中一共展示了PoolElementDevice.init_device方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: init_device
# 需要導入模塊: from sardana.tango.pool.PoolDevice import PoolElementDevice [as 別名]
# 或者: from sardana.tango.pool.PoolDevice.PoolElementDevice import init_device [as 別名]
def init_device(self):
PoolElementDevice.init_device(self)
motor = self.motor
if motor is None:
full_name = self.get_full_name()
name = self.alias or full_name
self.motor = motor = \
self.pool.create_element(type="Motor", name=name,
full_name=full_name, id=self.Id, axis=self.Axis,
ctrl_id=self.Ctrl_id)
if self.instrument is not None:
motor.set_instrument(self.instrument)
# if in constructor, for all memorized no init attributes (position)
# let poolmotor know their write values
if self.in_constructor:
try:
w_pos, w_ts = self.get_write_dial_position_from_db()
self.in_write_position = True
try:
motor.set_write_position(w_pos, timestamp=w_ts)
finally:
self.in_write_position = False
except KeyError:
pass
if self.Sleep_bef_last_read > 0:
motor.set_instability_time(self.Sleep_bef_last_read / 1000.0)
motor.add_listener(self.on_motor_changed)
self.set_state(DevState.ON)
示例2: init_device
# 需要導入模塊: from sardana.tango.pool.PoolDevice import PoolElementDevice [as 別名]
# 或者: from sardana.tango.pool.PoolDevice.PoolElementDevice import init_device [as 別名]
def init_device(self):
PoolElementDevice.init_device(self)
tg = self.tg
if tg is None:
full_name = self.get_full_name()
name = self.alias or full_name
self.tg = tg = \
self.pool.create_element(type="TriggerGate",
name=name, full_name=full_name, id=self.Id, axis=self.Axis,
ctrl_id=self.Ctrl_id)
tg.add_listener(self.on_tg_changed)
self.set_state(DevState.ON)
示例3: init_device
# 需要導入模塊: from sardana.tango.pool.PoolDevice import PoolElementDevice [as 別名]
# 或者: from sardana.tango.pool.PoolDevice.PoolElementDevice import init_device [as 別名]
def init_device(self):
PoolElementDevice.init_device(self)
zerod = self.zerod
if zerod is None:
full_name = self.get_full_name()
name = self.alias or full_name
self.zerod = zerod = \
self.pool.create_element(type="ZeroDExpChannel", name=name,
full_name=full_name, id=self.Id, axis=self.Axis,
ctrl_id=self.Ctrl_id)
zerod.add_listener(self.on_zerod_changed)
## force a state read to initialize the state attribute
#state = zerod.state
self.set_state(DevState.ON)
示例4: init_device
# 需要導入模塊: from sardana.tango.pool.PoolDevice import PoolElementDevice [as 別名]
# 或者: from sardana.tango.pool.PoolDevice.PoolElementDevice import init_device [as 別名]
def init_device(self):
PoolElementDevice.init_device(self)
twod = self.twod
if twod is None:
full_name = self.get_full_name()
name = self.alias or full_name
self.twod = twod = \
self.pool.create_element(type="TwoDExpChannel",
name=name, full_name=full_name, id=self.Id, axis=self.Axis,
ctrl_id=self.Ctrl_id)
if self.instrument is not None:
twod.set_instrument(self.instrument)
twod.add_listener(self.on_twod_changed)
## force a state read to initialize the state attribute
#state = ct.state
self.set_state(DevState.ON)
示例5: init_device
# 需要導入模塊: from sardana.tango.pool.PoolDevice import PoolElementDevice [as 別名]
# 或者: from sardana.tango.pool.PoolDevice.PoolElementDevice import init_device [as 別名]
def init_device(self):
PoolElementDevice.init_device(self)
self.Elements = map(int, self.Elements)
pseudo_counter = self.pseudo_counter
if pseudo_counter is None:
full_name = self.get_full_name()
name = self.alias or full_name
self.pseudo_counter = pseudo_counter = \
self.pool.create_element(type="PseudoCounter", name=name,
full_name=full_name, id=self.Id, axis=self.Axis,
ctrl_id=self.Ctrl_id, user_elements=self.Elements)
if self.instrument is not None:
pseudo_counter.set_instrument(self.instrument)
pseudo_counter.add_listener(self.on_pseudo_counter_changed)
self.set_state(DevState.ON)
示例6: init_device
# 需要導入模塊: from sardana.tango.pool.PoolDevice import PoolElementDevice [as 別名]
# 或者: from sardana.tango.pool.PoolDevice.PoolElementDevice import init_device [as 別名]
def init_device(self):
PoolElementDevice.init_device(self)
ior = self.ior
if ior is None:
full_name = self.get_full_name()
name = self.alias or full_name
self.ior = ior = \
self.pool.create_element(type="IORegister", name=name,
full_name=full_name, id=self.Id, axis=self.Axis,
ctrl_id=self.Ctrl_id)
if self.instrument is not None:
ior.set_instrument(self.instrument)
ior.add_listener(self.on_ior_changed)
## force a state read to initialize the state attribute
#state = ior.get_state(cache=False)
self.set_state(DevState.ON)