Coverage for python/lsst/summit/utils/enums.py: 100%

29 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2023-11-11 12:10 +0000

1# This file is part of summit_utils. 

2# 

3# Developed for the LSST Data Management System. 

4# This product includes software developed by the LSST Project 

5# (https://www.lsst.org). 

6# See the COPYRIGHT file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

9# This program is free software: you can redistribute it and/or modify 

10# it under the terms of the GNU General Public License as published by 

11# the Free Software Foundation, either version 3 of the License, or 

12# (at your option) any later version. 

13# 

14# This program is distributed in the hope that it will be useful, 

15# but WITHOUT ANY WARRANTY; without even the implied warranty of 

16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

17# GNU General Public License for more details. 

18# 

19# You should have received a copy of the GNU General Public License 

20# along with this program. If not, see <https://www.gnu.org/licenses/>. 

21 

22import enum 

23 

24__all__ = [ 

25 'ScriptState', 

26 'AxisMotionState', 

27 'PowerState', 

28] 

29 

30# TODO: Remove this file once RFC-942 passes and we can import from the source. 

31 

32 

33class ScriptState(enum.IntEnum): 

34 """ScriptState constants. 

35 

36 Note: this is copied over from 

37 https://github.com/lsst-ts/ts_idl/blob/develop/python/lsst/ts/idl/enums/Script.py # noqa: W505 

38 to save having to depend on T&S code directly. These enums are extremely 

39 static, so this is a reasonable thing to do, and much easier than setting 

40 up a dependency on ts_idl. 

41 """ 

42 

43 UNKNOWN = 0 

44 UNCONFIGURED = 1 

45 CONFIGURED = 2 

46 RUNNING = 3 

47 PAUSED = 4 

48 ENDING = 5 

49 STOPPING = 6 

50 FAILING = 7 

51 DONE = 8 

52 STOPPED = 9 

53 FAILED = 10 

54 CONFIGURE_FAILED = 11 

55 

56 

57class AxisMotionState(enum.IntEnum): 

58 """Motion state of azimuth elevation and camera cable wrap. 

59 

60 Note: this is copied over from 

61 https://github.com/lsst-ts/ts_idl/blob/develop/python/lsst/ts/idl/enums/MTMount.py # noqa: W505 

62 to save having to depend on T&S code directly. These enums are extremely 

63 static, so this is a reasonable thing to do, and much easier than setting 

64 up a dependency on ts_idl. 

65 """ 

66 

67 STOPPING = 0 

68 STOPPED = 1 

69 MOVING_POINT_TO_POINT = 2 

70 JOGGING = 3 

71 TRACKING = 4 

72 TRACKING_PAUSED = 5 

73 

74 

75class PowerState(enum.IntEnum): 

76 """Power state of a system or motion controller. 

77 

78 Also used for motion controller state. 

79 

80 Note that only a few systems (and no motion controllers) 

81 use TURNING_ON and TURNING_OFF. The oil supply system is one. 

82 

83 Note: this is copied over from 

84 https://github.com/lsst-ts/ts_idl/blob/develop/python/lsst/ts/idl/enums/MTMount.py # noqa: W505 

85 to save having to depend on T&S code directly. These enums are extremely 

86 static, so this is a reasonable thing to do, and much easier than setting 

87 up a dependency on ts_idl. 

88 """ 

89 

90 OFF = 0 

91 ON = 1 

92 FAULT = 2 

93 TURNING_ON = 3 

94 TURNING_OFF = 4 

95 UNKNOWN = 15