from abc import abstractmethod, ABCMeta
[docs]
class AlignmentInterface(metaclass=ABCMeta):
[docs]
@abstractmethod
def get_x(self):
pass
[docs]
@abstractmethod
def get_y(self):
pass
[docs]
@abstractmethod
def get_roll(self):
pass
[docs]
@abstractmethod
def set_x(self, val):
pass
[docs]
@abstractmethod
def set_y(self, val):
pass
[docs]
@abstractmethod
def set_roll(self, val):
pass
[docs]
class ElementInterface(metaclass=ABCMeta):
"""
Todo:
* review if an method should be added that user is supposed
to override and an other one that is the external
interface?
* should be the on_update_finished an event that has to
be added here?
Reason: after the element has been updated the proxy should
trigger the on_update_finished.
"""
[docs]
@abstractmethod
def get_name(self):
pass
[docs]
@abstractmethod
async def update(self, property_id: str, value: object):
pass
[docs]
@abstractmethod
def peek(self, property_id: str):
raise NotImplementedError("use derived class instead")
[docs]
class MagneticElementInterface(ElementInterface):
"""
Todo:
alignment is not part of elementinterface by design
it should be part of magnet
"""
[docs]
@abstractmethod
def get_alignment(self) -> AlignmentInterface:
pass
[docs]
@abstractmethod
def get_main_field_value(self):
pass
[docs]
@abstractmethod
def set_main_field_value(self):
pass