Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/procedure.py: 0%
23 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 -*-
4from marshmallow import fields
5from daiquiri.core.hardware.abstract import HardwareObject
6from daiquiri.core.schema.hardware import HardwareSchema
7from daiquiri.core.schema.validators import OneOf
8from daiquiri.core.schema.validators import RequireEmpty
10import logging
12logger = logging.getLogger(__name__)
14ProcedureStates = [
15 "STANDBY",
16 "DISABLED",
17 "RUNNING",
18 "ABORTING",
19 "AWAITING_USER_INPUT",
20 "UNKNOWN",
21]
24class ProcedurePropertiesSchema(HardwareSchema):
25 state = OneOf(ProcedureStates, metadata={"readOnly": True})
26 previous_run_state = fields.String()
27 previous_run_exception = fields.String()
28 parameters = fields.Dict()
31class ProcedureCallablesSchema(HardwareSchema):
32 start = RequireEmpty()
33 abort = RequireEmpty()
34 clear = RequireEmpty()
35 validate = fields.Dict(allow_none=True)
38class Procedure(HardwareObject):
39 _type = "procedure"
40 _state_ok = ["STANDBY", "RUNNING"]
42 _properties = ProcedurePropertiesSchema()
43 _callables = ProcedureCallablesSchema()