# Path: concert/base.py
# class State(Parameter):
# 
#     """
#     Finite state machine.
# 
#     Use this on a class, to keep some sort of known state. In order to enforce
#     restrictions, you would decorate methods on the class with
#     :func:`.check`::
# 
#         class SomeObject(object):
# 
#             state = State(default='standby')
# 
#             @check(source='*', target='moving')
#             def move(self):
#                 pass
# 
#     In case your device doesn't provide information on its state you can use
#     the :func:`.transition` to store the state in an instance of your device::
# 
#         @transition(immediate='moving', target='standby')
#         def _set_some_param(self, param_value):
#             # when the method starts device state is set to *immediate*
#             # long operation goes here
#             pass
#             # the state is set to *target* in the end
# 
#     Accessing the state variable will return the current state value, i.e.::
# 
#         obj = SomeObject()
#         assert obj.state == 'standby'
# 
#     The state cannot be set explicitly by::
# 
#         obj.state = 'some_state'
# 
#     but the object needs to provide methods which transition out of
#     states, the same holds for transitioning out of error states.
#     If the :meth:`_get_state` method is implemented in the device
#     it is always used to get the state, otherwise the state is stored
#     in software.
#     """
# 
#     def __init__(self, default=None, fget=None, fset=None, data=None, check=None, help=None):
#         super(State, self).__init__(fget=fget, help=help)
#         self.default = default
# 
#     def __set__(self, instance, value):
#         raise AttributeError('State cannot be set')
# 
#     def _value(self, instance):
#         if not hasattr(instance, '_state_value'):
#             setattr(instance, '_state_value', self.default)
# 
#         return getattr(instance, '_state_value')
# 
# class AccessorNotImplementedError(NotImplementedError):
# 
#     """Raised when a setter or getter is not implemented."""
# 
# Path: concert/devices/base.py
# class Device(Parameterizable):
# 
#     """
#     A :class:`.Device` provides locked access to a real-world device.
# 
#     It implements the context protocol to provide locking::
# 
#         async with device:
#             # device is locked
#             await device.set_parameter(1 * q.m)
#             ...
# 
#         # device is unlocked again
#     """
# 
#     def __init__(self):
#         # We have to create the lock early on because it will be accessed in
#         # any add_parameter calls, especially those in the Parameterizable base
#         # class
#         self._lock = asyncio.Lock()
#         super(Device, self).__init__()
# 
#     async def __aenter__(self):
#         await self._lock.acquire()
# 
#         return self
# 
#     async def __aexit__(self, exc_type, exc, tb):
#         self._lock.release()
# 
#     @background
#     async def emergency_stop(self):
#         """Emergency stop."""
#         await self._emergency_stop()
# 
#     async def _emergency_stop(self):
#         """Emergency stop implementation."""
#         pass


from concert.base import State, AccessorNotImplementedError
from concert.devices.base import Device
'''
Attenuator module.
Getter and Setter for filter material and the
current state must be provided by the device implementation.
'''



class AttenuatorBox(Device):
    '''Attenuator box base class'''
    state = State(default='standby')

    def __init__(self):
        super(AttenuatorBox, self).__init__()

    async def _set_attenuator(self, att):
        raise AccessorNotImplementedError

    async def _get_attenuator(self):

# Path: concert/base.py
# class State(Parameter):
# 
#     """
#     Finite state machine.
# 
#     Use this on a class, to keep some sort of known state. In order to enforce
#     restrictions, you would decorate methods on the class with
#     :func:`.check`::
# 
#         class SomeObject(object):
# 
#             state = State(default='standby')
# 
#             @check(source='*', target='moving')
#             def move(self):
#                 pass
# 
#     In case your device doesn't provide information on its state you can use
#     the :func:`.transition` to store the state in an instance of your device::
# 
#         @transition(immediate='moving', target='standby')
#         def _set_some_param(self, param_value):
#             # when the method starts device state is set to *immediate*
#             # long operation goes here
#             pass
#             # the state is set to *target* in the end
# 
#     Accessing the state variable will return the current state value, i.e.::
# 
#         obj = SomeObject()
#         assert obj.state == 'standby'
# 
#     The state cannot be set explicitly by::
# 
#         obj.state = 'some_state'
# 
#     but the object needs to provide methods which transition out of
#     states, the same holds for transitioning out of error states.
#     If the :meth:`_get_state` method is implemented in the device
#     it is always used to get the state, otherwise the state is stored
#     in software.
#     """
# 
#     def __init__(self, default=None, fget=None, fset=None, data=None, check=None, help=None):
#         super(State, self).__init__(fget=fget, help=help)
#         self.default = default
# 
#     def __set__(self, instance, value):
#         raise AttributeError('State cannot be set')
# 
#     def _value(self, instance):
#         if not hasattr(instance, '_state_value'):
#             setattr(instance, '_state_value', self.default)
# 
#         return getattr(instance, '_state_value')
# 
# class AccessorNotImplementedError(NotImplementedError):
# 
#     """Raised when a setter or getter is not implemented."""
# 
# Path: concert/devices/base.py
# class Device(Parameterizable):
# 
#     """
#     A :class:`.Device` provides locked access to a real-world device.
# 
#     It implements the context protocol to provide locking::
# 
#         async with device:
#             # device is locked
#             await device.set_parameter(1 * q.m)
#             ...
# 
#         # device is unlocked again
#     """
# 
#     def __init__(self):
#         # We have to create the lock early on because it will be accessed in
#         # any add_parameter calls, especially those in the Parameterizable base
#         # class
#         self._lock = asyncio.Lock()
#         super(Device, self).__init__()
# 
#     async def __aenter__(self):
#         await self._lock.acquire()
# 
#         return self
# 
#     async def __aexit__(self, exc_type, exc, tb):
#         self._lock.release()
# 
#     @background
#     async def emergency_stop(self):
#         """Emergency stop."""
#         await self._emergency_stop()
# 
#     async def _emergency_stop(self):
#         """Emergency stop implementation."""
#         pass


# Path: concert/devices/attenuatorboxes/base.py
from concert.base import State, AccessorNotImplementedError
from concert.devices.base import Device

'''
Attenuator module.
Getter and Setter for filter material and the
current state must be provided by the device implementation.
'''



class AttenuatorBox(Device):
    '''Attenuator box base class'''
    state = State(default='standby')

    def __init__(self):
        super(AttenuatorBox, self).__init__()

    async def _set_attenuator(self, att):
        raise AccessorNotImplementedError

    async def _get_attenuator(self):

        raise AccessorNotImplementedError