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

16 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 tango import DevState 

4 

5from daiquiri.core.hardware.abstract import HardwareProperty 

6from daiquiri.core.hardware.abstract.pump import Pump as AbstractPump 

7from daiquiri.core.hardware.tango.object import TangoObject 

8 

9import logging 

10 

11logger = logging.getLogger(__name__) 

12 

13 

14class PumpStateProperty(HardwareProperty): 

15 def translate_from(self, value): 

16 val_map = {DevState.ON: "ON", DevState.OFF: "OFF", DevState.UNKNOWN: "UNKNOWN"} 

17 for k, v in val_map.items(): 

18 if k == value: 

19 return v 

20 

21 return "UNKNOWN" 

22 

23 

24class Pump(TangoObject, AbstractPump): 

25 

26 PROPERTY_MAP = { 

27 "state": PumpStateProperty("state"), 

28 "status": HardwareProperty("status"), 

29 "pressure": HardwareProperty("pressure"), 

30 "voltage": HardwareProperty("voltage"), 

31 "current": HardwareProperty("current"), 

32 } 

33 

34 CALLABLE_MAP = {"on": "on", "off": "off"}