Completed
Pull Request — master (#380)
by
unknown
04:42
created

SetpointInterface   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 34
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A get_setpoint_unit() 0 4 1
A get_setpoint_limits() 0 5 1
A get_setpoint() 0 7 1
A set_setpoint() 0 8 1
1
# -*- coding: utf-8 -*-
2
3
"""
4
Interface file to define a setpoint for a process variable.
5
6
Qudi is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
Qudi is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with Qudi. If not, see <http://www.gnu.org/licenses/>.
18
19
Copyright (c) the Qudi Developers. See the COPYRIGHT.txt file at the
20
top-level directory of this distribution and at <https://github.com/Ulm-IQO/qudi/>
21
"""
22
23
import abc
24
from core.util.interfaces import InterfaceMetaclass
25
26
27
class SetpointInterface(metaclass=InterfaceMetaclass):
28
    """ This interface is used to manage a setpoint value.
29
    """
30
31
    _modtype = 'ProcessControlInterface'
32
    _modclass = 'interface'
33
34
    @abc.abstractmethod
35
    def get_setpoint(self):
36
        """ Getter for the setpoint value
37
38
        Return a value in unit
39
        """
40
        pass
41
42
    @abc.abstractmethod
43
    def set_setpoint(self, setpoint):
44
        """ Set the current setpoint
45
46
        Parameter : new value desired in unit
47
        Return the real new value
48
        """
49
        pass
50
51
    @abc.abstractmethod
52
    def get_setpoint_unit(self):
53
        """ Return the unit that the setpoint value is set in as a tuple of ('abbreviation', 'full unit name') """
54
        pass
55
56
    @abc.abstractmethod
57
    def get_setpoint_limits(self):
58
        """ Return limits within which the setpoint value can be set as a tuple of (low limit, high limit)
59
        """
60
        pass
61