|
1
|
|
|
# -*- coding: utf-8 -*- |
|
2
|
|
|
|
|
3
|
|
|
""" |
|
4
|
|
|
This interface is used to manage a control value. |
|
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
|
|
View Code Duplication |
class ProcessControlInterface(metaclass=InterfaceMetaclass): |
|
|
|
|
|
|
28
|
|
|
""" A very simple interface to control a single value. |
|
29
|
|
|
Used for PID control. |
|
30
|
|
|
|
|
31
|
|
|
This interface can be used to command the power, flow or any value of a device that can be turned on or off. |
|
32
|
|
|
|
|
33
|
|
|
""" |
|
34
|
|
|
|
|
35
|
|
|
_modtype = 'ProcessControlInterface' |
|
36
|
|
|
_modclass = 'interface' |
|
37
|
|
|
|
|
38
|
|
|
@abc.abstractmethod |
|
39
|
|
|
def set_control_value(self, value): |
|
40
|
|
|
""" Set the value of the controlled process variable """ |
|
41
|
|
|
pass |
|
42
|
|
|
|
|
43
|
|
|
@abc.abstractmethod |
|
44
|
|
|
def get_control_value(self): |
|
45
|
|
|
""" Get the value of the controlled process variable """ |
|
46
|
|
|
pass |
|
47
|
|
|
|
|
48
|
|
|
@abc.abstractmethod |
|
49
|
|
|
def get_control_unit(self): |
|
50
|
|
|
""" Return the unit that the value is set in as a tuple of ('abreviation', 'full unit name') """ |
|
51
|
|
|
pass |
|
52
|
|
|
|
|
53
|
|
|
@abc.abstractmethod |
|
54
|
|
|
def get_control_limits(self): |
|
55
|
|
|
""" Return limits within which the controlled value can be set as a tuple of (low limit, high limit) |
|
56
|
|
|
""" |
|
57
|
|
|
pass |
|
58
|
|
|
|
|
59
|
|
|
@abc.abstractmethod |
|
60
|
|
|
def get_enabled(self): |
|
61
|
|
|
""" Return the enabled state of the control device |
|
62
|
|
|
""" |
|
63
|
|
|
pass |
|
64
|
|
|
|
|
65
|
|
|
@abc.abstractmethod |
|
66
|
|
|
def set_enabled(self, enabled): |
|
67
|
|
|
""" Set the enabled state of the control device |
|
68
|
|
|
""" |
|
69
|
|
|
pass |
|
70
|
|
|
|