Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/optic.py: 0%

19 statements  

« prev     ^ index     » next       coverage.py v7.6.5, created at 2024-11-15 02:12 +0000

1#!/usr/bin/env python 

2# -*- coding: utf-8 -*- 

3from marshmallow import fields 

4 

5from daiquiri.core.hardware.abstract import HardwareObject 

6from daiquiri.core.schema.hardware import HardwareSchema 

7 

8import logging 

9 

10logger = logging.getLogger(__name__) 

11 

12 

13class OpticPropertiesSchema(HardwareSchema): 

14 state = fields.String() 

15 magnification = fields.Float() 

16 available_magnifications = fields.List(fields.Float()) 

17 target_magnification = fields.Float() 

18 magnification_range = fields.List(fields.Float(), metadata={"length": 2}) 

19 

20 

21class OpticCallablesSchema(HardwareSchema): 

22 move = fields.Float() 

23 

24 

25class Optic(HardwareObject): 

26 _type = "optic" 

27 

28 _properties = OpticPropertiesSchema() 

29 _callables = OpticCallablesSchema() 

30 

31 def move(self, value): 

32 self.call("move", value)