Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/tomoholo.py: 0%
23 statements
« prev ^ index » next coverage.py v7.6.5, created at 2024-11-15 02:12 +0000
« 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
5from daiquiri.core.hardware.abstract import HardwareObject
6from daiquiri.core.schema.hardware import HardwareSchema
7from daiquiri.core.schema.validators import OneOf
9import logging
11logger = logging.getLogger(__name__)
13TomoHoloStatues = [
14 "READY",
15 "MOVING",
16 "STABILIZING",
17 "INVALID",
18 "INVALID_DETECTOR_BINNING_CHANGED",
19 "INVALID_DETECTOR_DISTANCE_CHANGED",
20 "INVALID_DETECTOR_CHANGED",
21 "UNKNOWN",
22]
25class _DistanceSchema(HardwareSchema):
26 position = fields.Number()
27 z1 = fields.Number()
28 pixel_size = fields.Number()
31class _PropertiesSchema(HardwareSchema):
32 state = OneOf(TomoHoloStatues, metadata={"readOnly": True})
33 pixel_size = fields.Number(allow_none=True)
34 nb_distances = fields.Integer()
35 settle_time = fields.Number()
36 distances = fields.List(fields.Nested(_DistanceSchema), metadata={"readOnly": True})
39class _CallablesSchema(HardwareSchema):
40 move = fields.Str()
43class TomoHolo(HardwareObject):
44 _type = "tomoholo"
45 _properties = _PropertiesSchema()
46 _callables = _CallablesSchema()