2023-10-13 22:33:07 +03:00
|
|
|
from turtle import Turtle
|
2023-11-16 23:56:44 +03:00
|
|
|
from typing import Any
|
|
|
|
from equipment.device import SynchronyDevice
|
2023-11-13 21:25:16 +03:00
|
|
|
import inspect
|
2023-10-13 22:33:07 +03:00
|
|
|
|
|
|
|
class TurtleDevice(SynchronyDevice):
|
2023-11-13 21:25:16 +03:00
|
|
|
|
2023-11-16 23:56:44 +03:00
|
|
|
def open(self):
|
2023-11-13 21:25:16 +03:00
|
|
|
super().open()
|
|
|
|
return Turtle()
|
|
|
|
|
|
|
|
|
|
|
|
def close (self):
|
|
|
|
super().close()
|
|
|
|
del(self)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def trait_descriptors(self):
|
|
|
|
print("This is all class attributes: ", l)
|
|
|
|
for i in dir(Turtle):
|
|
|
|
if not i.startswith("__") and inspect.ismethod(Turtle.i)==False:
|
|
|
|
print(i, '\n')
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
def action_descriptors(self):
|
|
|
|
print("This is all class methods: \n")
|
|
|
|
for i in dir(Turtle):
|
|
|
|
if not i.startswith("__") and inspect.ismethod(Turtle.i)==True:
|
|
|
|
sig = inspect.signature(Turtle.i)
|
|
|
|
print(i, str(sig), '\n')
|
|
|
|
|
|
|
|
def execute(self, action_name: str, *args, **kwargs):
|
|
|
|
"""Execute action `action_name`, using `args` and `kwargs` as action argument."""
|
|
|
|
pass
|
|
|
|
|
|
|
|
def read(self, trait_name: str):
|
|
|
|
"""Read physical state of trait `trait_name` from device."""
|
|
|
|
pass
|
|
|
|
|
|
|
|
def write(self, trait_name: str, value: Any) -> bool:
|
|
|
|
"""Pass `value` to trait `trait_name` of device."""
|
|
|
|
pass
|
|
|
|
|
|
|
|
def invalidate(self, trait_name: str):
|
|
|
|
"""Invalidate logical state of trait `trait_name`"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2023-11-16 23:56:44 +03:00
|
|
|
#print(TurtleDevice.action_descriptors())
|
2023-11-13 21:25:16 +03:00
|
|
|
|
2023-10-13 22:33:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|