Beispiel #1
0
    def init_device(self):
        PoolDevice.init_device(self)

        detect_evts = "state", "status"
        non_detect_evts = ("elementlist",)
        self.set_change_events(detect_evts, non_detect_evts)
        ctrl = self.ctrl
        if ctrl is None:
            role_ids = self.get_role_ids()
            full_name = self.get_full_name()
            name = self.alias or full_name
            args = dict(
                type=self.Type,
                name=name,
                full_name=full_name,
                library=self.Library,
                klass=self.Klass,
                id=self.Id,
                role_ids=role_ids,
                properties=self._get_ctrl_properties(),
            )
            ctrl = self.pool.create_controller(**args)
            ctrl.add_listener(self.on_controller_changed)
            self.ctrl = ctrl
            self.set_state(DevState.ON)
            # self.set_state(to_tango_state(ctrl.get_state()))
            # self.set_status(ctrl.get_status())
        else:
            ctrl.re_init()
Beispiel #2
0
    def init_device(self):
        PoolDevice.init_device(self)

        detect_evts = "state", "status"
        non_detect_evts = "elementlist",
        self.set_change_events(detect_evts, non_detect_evts)
        ctrl = self.ctrl
        if ctrl is None:
            role_ids = self.get_role_ids()
            full_name = self.get_full_name()
            name = self.alias or full_name
            args = dict(type=self.Type,
                        name=name,
                        full_name=full_name,
                        library=self.Library,
                        klass=self.Klass,
                        id=self.Id,
                        role_ids=role_ids,
                        properties=self._get_ctrl_properties())
            ctrl = self.pool.create_controller(**args)
            ctrl.add_listener(self.on_controller_changed)
            self.ctrl = ctrl
            self.set_state(DevState.ON)
            #self.set_state(to_tango_state(ctrl.get_state()))
            #self.set_status(ctrl.get_status())
        else:
            ctrl.re_init()
Beispiel #3
0
 def get_dynamic_attributes(self):
     if hasattr(self, "_dynamic_attributes_cache"):
         return self._standard_attributes_cache, self._dynamic_attributes_cache
     info = self.ctrl.ctrl_info
     if info is None:
         self.warning("Controller %s doesn't have any information", self.ctrl)
         return PoolDevice.get_dynamic_attributes(self)
     self._dynamic_attributes_cache = dyn_attrs = CaselessDict()
     self._standard_attributes_cache = std_attrs = CaselessDict()
     for attr_name, attr_data in info.ctrl_attributes.items():
         name, tg_info = to_tango_attr_info(attr_name, attr_data)
         dyn_attrs[attr_name] = attr_name, tg_info, attr_data
     return std_attrs, dyn_attrs
Beispiel #4
0
 def get_dynamic_attributes(self):
     if hasattr(self, "_dynamic_attributes_cache"):
         return self._standard_attributes_cache, self._dynamic_attributes_cache
     info = self.ctrl.ctrl_info
     if info is None:
         self.warning("Controller %s doesn't have any information",
                      self.ctrl)
         return PoolDevice.get_dynamic_attributes(self)
     self._dynamic_attributes_cache = dyn_attrs = CaselessDict()
     self._standard_attributes_cache = std_attrs = CaselessDict()
     for attr_name, attr_data in info.ctrl_attributes.items():
         name, tg_info = to_tango_attr_info(attr_name, attr_data)
         dyn_attrs[attr_name] = attr_name, tg_info, attr_data
     return std_attrs, dyn_attrs
Beispiel #5
0
 def delete_device(self):
     PoolDevice.delete_device(self)
Beispiel #6
0
 def init(self, name):
     PoolDevice.init(self, name)
Beispiel #7
0
 def __init__(self, dclass, name):
     PoolDevice.__init__(self, dclass, name)
Beispiel #8
0
 def dev_status(self):
     if self.ctrl is None or not self.ctrl.is_online():
         self._status = self.ctrl.get_ctrl_error_str()
     else:
         self._status = PoolDevice.dev_status(self)
     return self._status
Beispiel #9
0
 def delete_device(self):
     PoolDevice.delete_device(self)
Beispiel #10
0
 def init(self, name):
     PoolDevice.init(self, name)
Beispiel #11
0
 def __init__(self, dclass, name):
     PoolDevice.__init__(self, dclass, name)
Beispiel #12
0
 def dev_status(self):
     if self.ctrl is None or not self.ctrl.is_online():
         self._status = self.ctrl.get_ctrl_error_str()
     else:
         self._status = PoolDevice.dev_status(self)
     return self._status