Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/beamviewer.py: 0%
24 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-14 02:13 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-14 02:13 +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 RequireEmpty, OneOf
9import logging
11logger = logging.getLogger(__name__)
13BeamviewerStates = ["ON", "OFF", "UNKNOWN", "FAULT"]
16class BeamviewerPropertiesSchema(HardwareSchema):
17 state = OneOf(BeamviewerStates, metadata={"readOnly": True})
18 foil = OneOf(["IN", "OUT", "UNKNOWN", "NONE"], metadata={"readOnly": True})
19 led = OneOf(["ON", "OFF"], metadata={"readOnly": True})
20 screen = OneOf(["IN", "OUT", "UNKNOWN"], metadata={"readOnly": True})
21 diode_ranges = fields.List(fields.Str(), metadata={"readOnly": True})
22 diode_range = fields.Str()
25class BeamviewerCallablesSchema(HardwareSchema):
26 led = fields.Bool()
27 screen = fields.Bool()
28 foil = fields.Bool()
29 current = RequireEmpty()
32class Beamviewer(HardwareObject):
33 _type = "beamviewer"
34 _state_ok = [BeamviewerStates[0], BeamviewerStates[1]]
36 _properties = BeamviewerPropertiesSchema()
37 _callables = BeamviewerCallablesSchema()