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

23 statements  

« 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 daiquiri.core.hardware.abstract import HardwareProperty 

4from daiquiri.core.hardware.abstract.beamviewer import Beamviewer as AbstractBeamviewer 

5from daiquiri.core.hardware.bliss.object import BlissObject 

6 

7import logging 

8 

9logger = logging.getLogger(__name__) 

10 

11 

12class Beamviewer(BlissObject, AbstractBeamviewer): 

13 def _get_state(self): 

14 return self._object._bpm._cam_proxy.state() 

15 

16 PROPERTY_MAP = { 

17 "led": HardwareProperty("led_status"), 

18 "foil": HardwareProperty("foil_status"), 

19 "screen": HardwareProperty("screen_status"), 

20 "diode_range": HardwareProperty("diode_range"), 

21 "diode_ranges": HardwareProperty("diode_range_available"), 

22 "state": HardwareProperty("state", getter=_get_state), 

23 } 

24 

25 def _call_led(self, value, **kwargs): 

26 if value: 

27 self._object.led_on() 

28 else: 

29 self._object.led_off() 

30 

31 def _call_foil(self, value, **kwargs): 

32 if value: 

33 self._object.foil_in() 

34 else: 

35 self._object.foil_out() 

36 

37 def _call_screen(self, value, **kwargs): 

38 if value: 

39 self._object.screen_in() 

40 else: 

41 self._object.screen_out() 

42 

43 def _call_current(self, value, **kwargs): 

44 return self._object.current