Example #1
0
 def CalcAllPhysical(self, pseudo_positions):
     """Returns the physical motor positions for the given pseudo motor
     position(s)"""
     result = self.pseudo_motor.calc_physical(pseudo_positions)
     if result.error:
         throw_sardana_exception(result)
     return result.value
Example #2
0
 def CalcAllPhysical(self, pseudo_positions):
     """Returns the physical motor positions for the given pseudo motor
     position(s)"""
     result = self.pseudo_motor.calc_physical(pseudo_positions)
     if result.error:
         throw_sardana_exception(result)
     return result.value
Example #3
0
 def read_RecordData(self, attr):
     try:
         macro_data = self.door.get_macro_data()
         codec = CodecFactory().getCodec('bz2_pickle')
         data = codec.encode(('', macro_data))
     except MacroServerException, mse:
         throw_sardana_exception(mse)
Example #4
0
 def read_RecordData(self, attr):
     try:
         macro_data = self.door.get_macro_data()
         codec = CodecFactory().getCodec('bz2_pickle')
         data = codec.encode(('', macro_data))
     except MacroServerException, mse:
         throw_sardana_exception(mse)
Example #5
0
 def CalcPseudo(self, physical_positions):
     """Returns the pseudo motor position for the given physical positions"""
     if not len(physical_positions):
         physical_positions = None
     result = self.pseudo_motor.calc_pseudo(physical_positions=physical_positions)
     if result.error:
         throw_sardana_exception(result)
     return result.value
Example #6
0
 def CalcPhysical(self, pseudo_position):
     """Returns the physical motor positions for the given pseudo motor
     position assuming the current pseudo motor write positions for all the
     other sibling pseudo motors"""
     result = self.pseudo_motor.calc_physical(pseudo_position)
     if result.error:
         throw_sardana_exception(result)
     return result.value
Example #7
0
 def CalcPhysical(self, pseudo_position):
     """Returns the physical motor positions for the given pseudo motor
     position assuming the current pseudo motor write positions for all the
     other sibling pseudo motors"""
     result = self.pseudo_motor.calc_physical(pseudo_position)
     if result.error:
         throw_sardana_exception(result)
     return result.value
Example #8
0
 def CalcAllPseudo(self, physical_values):
     """Returns the pseudo counter values for the given physical counters"""
     if not len(physical_values):
         physical_values = None
     result = self.pseudo_counter.calc(physical_values=physical_values)
     if result.error:
         throw_sardana_exception(result)
     return result.value
Example #9
0
 def CalcAllPseudo(self, physical_values):
     """Returns the pseudo counter values for the given physical counters"""
     if not len(physical_values):
         physical_values = None
     result = self.pseudo_counter.calc(physical_values=physical_values)
     if result.error:
         throw_sardana_exception(result)
     return result.value
Example #10
0
 def CalcPseudo(self, physical_positions):
     """Returns the pseudo motor position for the given physical positions"""
     if not len(physical_positions):
         physical_positions = None
     result = self.pseudo_motor.calc_pseudo(
         physical_positions=physical_positions)
     if result.error:
         throw_sardana_exception(result)
     return result.value
Example #11
0
 def write_Value(self, attr):
     self.in_write_value = True
     value = attr.get_write_value()
     try:
         self.ior.set_value(value)
         # manually store write value in the database
         self.set_write_value_to_db()
     except PoolException as pe:
         throw_sardana_exception(pe)
     finally:
         self.in_write_value = False
Example #12
0
 def read_Position(self, attr):
     pseudo_motor = self.pseudo_motor
     use_cache = pseudo_motor.is_in_operation() and not self.Force_HW_Read
     position = pseudo_motor.get_position(cache=use_cache, propagate=0)
     if position.error:
         throw_sardana_exception(position)
     state = pseudo_motor.get_state(cache=use_cache, propagate=0)
     quality = None
     if state == State.Moving:
         quality = AttrQuality.ATTR_CHANGING
     self.set_attribute(attr, value=position.value, w_value=position.w_value,
                        quality=quality, priority=0,
                        timestamp=position.timestamp)
Example #13
0
    def read_RecordData(self, attr):
        try:
            macro_data = self.door.get_macro_data()
            codec = CodecFactory().getCodec('bz2_pickle')
            data = codec.encode(('', macro_data))
        except MacroServerException as mse:
            throw_sardana_exception(mse)

        attr.set_value(*data)
        # workaround for a bug in PyTango (tango-controls/pytango#147),
        # i.e. temporary solution for issue #447
        # (storing reference to data so it can not be destroyed by GC)
        self.__buf_data = data
Example #14
0
 def write_Position(self, attr):
     self.in_write_position = True
     try:
         position = attr.get_write_value()
         self.debug("write_Position(%s)", position)
         try:
             self.wait_for_operation()
         except:
             raise Exception("Cannot move: already in motion")
         try:
             self.motor_group.position = position
         except PoolException, pe:
             throw_sardana_exception(pe)
     finally:
         self.in_write_position = False
Example #15
0
 def write_Position(self, attr):
     self.in_write_position = True
     try:
         position = attr.get_write_value()
         self.debug("write_Position(%s)", position)
         try:
             self.wait_for_operation()
         except:
             raise Exception("Cannot move: already in motion")
         try:
             self.motor_group.position = position
         except PoolException, pe:
             throw_sardana_exception(pe)
     finally:
         self.in_write_position = False
Example #16
0
    def write_Position(self, attr):
        self.in_write_position = True
        position = attr.get_write_value()
        try:
            self.info("write_Position(%s)", position)
            try:
                self.wait_for_operation()
            except:
                raise Exception("Cannot move: already in motion")
            try:
                self.motor.position = position
            except PoolException, pe:
                throw_sardana_exception(pe)

            # manually store write dial position in the database
            self.set_write_dial_position_to_db()
Example #17
0
 def write_Position(self, attr):
     self.in_write_position = True
     try:
         position = attr.get_write_value()
         self.debug("write_Position(%s)", position)
         try:
             self.wait_for_operation()
         except:
             raise Exception("Cannot move: already in motion")
         pseudo_motor = self.pseudo_motor
         try:
             pseudo_motor.position = position
         except SardanaException as se:
             throw_sardana_exception(se)
     finally:
         self.in_write_position = False
Example #18
0
    def write_Position(self, attr):
        self.in_write_position = True
        position = attr.get_write_value()
        try:
            self.info("write_Position(%s)", position)
            try:
                self.wait_for_operation()
            except:
                raise Exception("Cannot move: already in motion")
            try:
                self.motor.position = position
            except PoolException, pe:
                throw_sardana_exception(pe)

            # manually store write dial position in the database
            self.set_write_dial_position_to_db()
Example #19
0
 def write_Position(self, attr):
     self.in_write_position = True
     try:
         position = attr.get_write_value()
         self.debug("write_Position(%s)", position)
         try:
             self.wait_for_operation()
         except:
             raise Exception("Cannot move: already in motion")
         pseudo_motor = self.pseudo_motor
         try:
             pseudo_motor.position = position
         except SardanaException as se:
             throw_sardana_exception(se)
     finally:
         self.in_write_position = False
Example #20
0
 def read_Position(self, attr):
     pseudo_motor = self.pseudo_motor
     use_cache = pseudo_motor.is_in_operation() and not self.Force_HW_Read
     position = pseudo_motor.get_position(cache=use_cache, propagate=0)
     if position.error:
         throw_sardana_exception(position)
     state = pseudo_motor.get_state(cache=use_cache, propagate=0)
     quality = None
     if state == State.Moving:
         quality = AttrQuality.ATTR_CHANGING
     self.set_attribute(attr,
                        value=position.value,
                        w_value=position.w_value,
                        quality=quality,
                        priority=0,
                        timestamp=position.timestamp)
Example #21
0
 def CalcAllPseudo(self, physical_positions):
     """Returns the pseudo motor position(s) for the given physical positions"""
     result = self.pseudo_motor.calc_all_pseudo(physical_positions)
     if result.error:
         throw_sardana_exception(result)
     return result.value
Example #22
0
 def CalcAllPseudo(self, physical_positions):
     """Returns the pseudo motor position(s) for the given physical positions"""
     result = self.pseudo_motor.calc_all_pseudo(physical_positions)
     if result.error:
         throw_sardana_exception(result)
     return result.value