Пример #1
0
        self.positioner.set(pos, wait)

    def move_by(self, val, wait=False, force=False):
        self.positioner.set(self.positioner.get() + val, wait)

    def stop(self):
        pass

    def get_position(self):
        return self.positioner.get()

    def wait(self, **kwargs):
        pass


Registry.add_adapter([IPositioner], IMotor, '', PositionerMotor)


class Attenuator(BasePositioner):
    """
    A positioner for EPICS XIA attenuator boxes

    :param bitname: root name of attenuator PV
    :param energy: energy process variable name

    """
    def __init__(self, bitname, energy):
        super().__init__()
        fname = bitname[:-1]
        self._filters = [
            PV('%s4:bit' % fname),
Пример #2
0
class IMXDCService(Interface):
    def shutdown():
        """Shutdown MxDC"""


class IPerspectiveMXDC(Interface):
    def remote_shutdown(*args, **kwargs):
        """Shutdown MxDC"""


@implementer(IPerspectiveMXDC)
class PerspectiveMXDCFromService(pb.Root):
    def __init__(self, service):
        self.service = service

    def remote_shutdown(self, *args, **kwargs):
        """Shutdown MxDC"""
        return self.service.shutdown(*args, **kwargs)


Registry.add_adapter([IMXDCService], IPerspectiveMXDC, '',
                     PerspectiveMXDCFromService)


@implementer(IMXDCService)
class MXDCService(service.Service):
    def shutdown(self):
        logger.warning('Remote Shutdown ...')
        reactor.stop()