Completed
Push — pulsed_with_queued_connections ( 0b7aaa...175b78 )
by
unknown
04:14 queued 01:18
created

SimpleLaserInterface   A

Complexity

Total Complexity 19

Size/Duplication

Total Lines 124
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 124
rs 10
wmc 19

19 Methods

Rating   Name   Duplication   Size   Complexity  
A set_power() 0 7 1
A set_current() 0 6 1
A get_current() 0 5 1
A get_power() 0 5 1
A get_power_setpoint() 0 5 1
A get_current_setpoint() 0 5 1
A off() 0 5 1
A get_extra_info() 0 5 1
A get_temperatures() 0 5 1
A set_control_mode() 0 6 1
A get_shutter_state() 0 5 1
A get_control_mode() 0 5 1
A allowed_control_modes() 0 5 1
A set_temperatures() 0 6 1
A set_laser_state() 0 6 1
A get_laser_state() 0 5 1
A set_shutter_state() 0 6 1
A on() 0 5 1
A get_temperature_setpoints() 0 5 1
1
# -*- coding: utf-8 -*-
2
"""
3
Interface file for lasers where current and power can be set.
4
5
Qudi is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9
10
Qudi is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License
16
along with Qudi. If not, see <http://www.gnu.org/licenses/>.
17
18
Copyright (c) the Qudi Developers. See the COPYRIGHT.txt file at the
19
top-level directory of this distribution and at <https://github.com/Ulm-IQO/qudi/>
20
"""
21
22
from core.util.customexceptions import function_signature
23
from core.util.customexceptions import InterfaceImplementationError
24
from enum import Enum
25
26
27
class ControlMode(Enum):
28
    MIXED = 0
29
    POWER = 1
30
    CURRENT = 2
31
32
class ShutterState(Enum):
33
    CLOSED = 0
34
    OPEN = 1
35
    UNKNOWN = 2
36
    NOSHUTTER = 3
37
38
class LaserState(Enum):
39
    OFF = 0
40
    ON = 1
41
    BLOCKED = 2
42
    UNKNOWN = 3
43
44
class SimpleLaserInterface:
45
    _modtype = 'SimpleLaserInterface'
46
    _modclass = 'interface'
47
48
    def get_power(self):
49
        """ Return laser power
50
        @return float: Actual laser power in watts
51
        """
52
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
53
54
    def set_power(self, power):
55
        """ Set laer power ins watts
56
          @param float power: laser power setpoint in watts
57
58
          @return float: laser power setpoint in watts
59
        """
60
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
61
62
    def get_power_setpoint(self):
63
        """ Return laser power setpoint
64
        @return float: Laser power setpoint in watts
65
        """
66
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
67
68
    def get_current(self):
69
        """ Return laser current
70
        @return float: Actual laser current in amperes
71
        """
72
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
73
74
    def get_current_setpoint(self):
75
        """ Return laser current
76
        @return float: Laser current setpoint in amperes
77
        """
78
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
79
80
    def set_current(self, current):
81
        """ Set laser current
82
        @param float current: Laser current setpoint in amperes
83
        @return float: Laser current setpoint in amperes
84
        """
85
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
86
87
    def allowed_control_modes(self):
88
        """ Get available control mode of laser
89
          @return list: list with enum control modes
90
        """
91
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
92
93
    def get_control_mode(self):
94
        """ Get control mode of laser
95
          @return enum ControlMode: control mode
96
        """
97
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
98
99
    def set_control_mode(self, control_mode):
100
        """ Set laser control mode.
101
          @param enum control_mode: desired control mode
102
          @return enum ControlMode: actual control mode
103
        """
104
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
105
106
    def on(self):
107
        """ Turn on laser. Does not open shutter if one is present.
108
          @return enum LaserState: actual laser state
109
        """
110
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
111
112
    def off(self):
113
        """ Turn ooff laser. Does not close shutter if one is present.
114
          @return enum LaserState: actual laser state
115
        """
116
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
117
118
    def get_laser_state(self):
119
        """ Get laser state.
120
          @return enum LaserState: laser state
121
        """
122
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
123
124
    def set_laser_state(self, state):
125
        """ Set laser state.
126
          @param enum state: desired laser state
127
          @return enum LaserState: actual laser state
128
        """
129
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
130
131
    def get_shutter_state(self):
132
        """ Get shutter state. Has a state for no shutter present.
133
          @return enum ShutterState: actual shutter state
134
        """
135
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
136
137
    def set_shutter_state(self, state):
138
        """ Set shutter state.
139
          @param enum state: desired shutter state
140
          @return enum ShutterState: actual shutter state
141
        """
142
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
143
144
    def get_temperatures(self):
145
        """ Get all available temperatures from laser.
146
          @return dict: dict of name, value for temperatures
147
        """
148
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
149
150
    def get_temperature_setpoints(self):
151
        """ Get all available temperature setpoints from laser.
152
          @return dict: dict of name, value for temperature setpoints
153
        """
154
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
155
156
    def set_temperatures(self, temps):
157
        """ Set laser temperatures.
158
          @param temps: dict of name, value to be set
159
          @return dict: dict of name, value of temperatures that were set
160
        """
161
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
162
163
    def get_extra_info(self):
164
        """ Show dianostic information about lasers.
165
          @return str: diagnostic info as a string
166
        """
167
        raise InterfaceImplementationError('{0}->{1}'.format(type(self).__name__, function_signature()))
168