|
24 | 24 | - ``Byte`` |
25 | 25 | - ``Vector`` |
26 | 26 | - ``Coordinate`` |
| 27 | +
|
| 28 | +- ``ADJUST`` |
| 29 | +- ``ATR`` |
| 30 | +- ``ATRLOCK`` |
| 31 | +- ``AUTOPOWER`` |
| 32 | +- ``CAPABILITIES`` |
| 33 | +- ``CONTROLLER`` |
| 34 | +- ``DEVICECLASS`` |
| 35 | +- ``EDMMODE`` |
| 36 | +- ``FACE`` |
| 37 | +- ``FORMAT`` |
| 38 | +- ``INCLINATION`` |
| 39 | +- ``MEASUREMENT`` |
| 40 | +- ``MEASUREPROGRAM`` |
| 41 | +- ``POSITION`` |
| 42 | +- ``SHUTDOWN`` |
| 43 | +- ``STARTUP`` |
| 44 | +- ``STOP`` |
| 45 | +- ``TRACKLIGHT`` |
| 46 | +- ``TURN`` |
27 | 47 | """ |
28 | 48 | from __future__ import annotations |
29 | 49 |
|
30 | 50 | import re |
31 | 51 | import math |
32 | | -from enum import Enum |
| 52 | +from enum import Enum, Flag |
33 | 53 | from typing import ( |
34 | 54 | TypeAlias, |
35 | 55 | Literal, |
|
39 | 59 | ) |
40 | 60 |
|
41 | 61 |
|
42 | | -__all__ = ( |
43 | | - "parsestr", |
44 | | - "toenum", |
45 | | - "enumparser", |
46 | | - "gsiword", |
47 | | - |
48 | | - "AngleUnit", |
49 | | - "Angle", |
50 | | - "Byte", |
51 | | - "Vector", |
52 | | - "Coordinate" |
53 | | -) |
54 | | - |
55 | | - |
56 | 62 | RO = 180 * 60 * 60 / math.pi |
57 | 63 | """RAD-SEC conversion coefficient""" |
58 | 64 |
|
@@ -926,3 +932,150 @@ class Coordinate(Vector): |
926 | 932 | 3.0 |
927 | 933 |
|
928 | 934 | """ |
| 935 | + |
| 936 | + |
| 937 | +class POSITION(Enum): |
| 938 | + """Positioning mode.""" |
| 939 | + NORMAL = 0 #: Fast |
| 940 | + PRECISE = 1 #: Precise |
| 941 | + |
| 942 | + |
| 943 | +class ADJUST(Enum): |
| 944 | + """ATR adjustment tolerance mode.""" |
| 945 | + NORMAL = 0 #: Angle tolerance. |
| 946 | + POINT = 1 #: Point tolerance. |
| 947 | + |
| 948 | + |
| 949 | +class ATR(Enum): |
| 950 | + """ATR mode.""" |
| 951 | + POSITION = 0 #: Position to angles. |
| 952 | + TARGET = 1 #: Position to target near angles. |
| 953 | + |
| 954 | + |
| 955 | +class TURN(Enum): |
| 956 | + """Turning direction.""" |
| 957 | + CLOCKWISE = 1 |
| 958 | + COUNTERCLOCKWISE = -1 |
| 959 | + |
| 960 | + |
| 961 | +class MEASUREPROGRAM(Enum): |
| 962 | + NOMEASURE = 0 #: No measurement, take last value. |
| 963 | + NODISTANCE = 1 #: No distance measurement, angles only. |
| 964 | + DISTANCE = 2 #: Default distance measurement. |
| 965 | + TRACK = 3 #: Tracking distance measurement. |
| 966 | + RAPIDTRACK = 4 #: Rapid tracking distance measurement. |
| 967 | + CLEAR = 5 #: Clear distances. |
| 968 | + STOPTRACK = 6 #: Stop tracking. |
| 969 | + |
| 970 | + |
| 971 | +class SHUTDOWN(Enum): |
| 972 | + """Instrument software stop mode.""" |
| 973 | + SHUTDOWN = 0 |
| 974 | + SLEEP = 1 |
| 975 | + |
| 976 | + |
| 977 | +class STARTUP(Enum): |
| 978 | + """Instrument startup mode.""" |
| 979 | + LOCAL = 0 #: Manual mode. |
| 980 | + REMOTE = 1 #: GeoCom mode. |
| 981 | + |
| 982 | + |
| 983 | +class DEVICECLASS(Enum): |
| 984 | + """Instrument accuracy class.""" |
| 985 | + CLASS_1100 = 0 #: TPS1000 3" |
| 986 | + CLASS_1700 = 1 #: TPS1000 1.5" |
| 987 | + CLASS_1800 = 2 #: TPS1000 1" |
| 988 | + CLASS_5000 = 3 #: TPS2000 |
| 989 | + CLASS_6000 = 4 #: TPS2000 |
| 990 | + CLASS_1500 = 5 #: TPS1000 |
| 991 | + |
| 992 | + |
| 993 | +class CAPABILITIES(Flag): |
| 994 | + """Instrument capabilities.""" |
| 995 | + THEODOLITE = 0x00000 #: Theodolite |
| 996 | + TC1 = 0x00001 # TPS1000 |
| 997 | + TC2 = 0x00002 # TPS1000 |
| 998 | + MOTORIZED = 0x00004 #: Motorized |
| 999 | + ATR = 0x00008 #: ATR |
| 1000 | + EGL = 0x00010 #: Guide Light |
| 1001 | + DATABASE = 0x00020 #: Database |
| 1002 | + DIODELASER = 0x00040 #: Diode laser |
| 1003 | + LASERPLUMB = 0x00080 #: Laser plumb |
| 1004 | + # SIM = 0x04000 # TPSSim |
| 1005 | + |
| 1006 | + |
| 1007 | +class TRACKLIGHT(Enum): |
| 1008 | + """Tracking light brightness""" |
| 1009 | + LOW = 0 |
| 1010 | + MID = 1 |
| 1011 | + HIGH = 2 |
| 1012 | + |
| 1013 | + |
| 1014 | +class ATRLOCK(Enum): |
| 1015 | + """ATR lock status.""" |
| 1016 | + NONE = 0 #: Disabled |
| 1017 | + LOCK = 1 #: Enabled |
| 1018 | + PREDICT = 2 |
| 1019 | + |
| 1020 | + |
| 1021 | +class STOP(Enum): |
| 1022 | + """Servo motor stopping mode.""" |
| 1023 | + NORMAL = 0 #: Slow down with current acceleration. |
| 1024 | + CUTOFF = 1 #: Slow down by motor power termination. |
| 1025 | + |
| 1026 | + |
| 1027 | +class CONTROLLER(Enum): |
| 1028 | + """Motor controller operation mode.""" |
| 1029 | + POSITIONING = 0 #: Relative positioning. |
| 1030 | + MOVE = 1 #: Constant speed. |
| 1031 | + MANUAL = 2 #: Manual positioning. |
| 1032 | + LOCK = 3 #: Lock-in controller. |
| 1033 | + BREAK = 4 #: Break controller. |
| 1034 | + # 5, 6 do not use (why?) |
| 1035 | + TERMINATE = 7 #: Terminate current task. |
| 1036 | + |
| 1037 | + |
| 1038 | +class AUTOPOWER(Enum): |
| 1039 | + """Automatic power off mode.""" |
| 1040 | + DISABLED = 0 #: Automatic poweroff disabled. |
| 1041 | + SLEEP = 1 #: Put instument into sleep mode. |
| 1042 | + SHUTDOWN = 2 #: Poweroff instrument. |
| 1043 | + |
| 1044 | + |
| 1045 | +class INCLINATION(Enum): |
| 1046 | + """Inclination calculation mode.""" |
| 1047 | + MEASURE = 0 #: Measure inclination. |
| 1048 | + AUTO = 1 #: Automatic inclination handling. |
| 1049 | + PLANE = 2 #: Model inclination from previous measurements. |
| 1050 | + |
| 1051 | + |
| 1052 | +class MEASUREMENT(Enum): |
| 1053 | + STOP = 0 #: Stop measurement program. |
| 1054 | + DISTANCE = 1 #: Default distance measurement. |
| 1055 | + TRACK = 2 #: Track distance. |
| 1056 | + CLEAR = 3 #: Clear current measurement data. |
| 1057 | + SIGNAL = 4 #: Signal intensity measurement. |
| 1058 | + RAPIDTRACK = 8 #: Rapid track distance. |
| 1059 | + |
| 1060 | + |
| 1061 | +class EDMMODE(Enum): |
| 1062 | + """Distance measurement mode.""" |
| 1063 | + SINGLE_STANDARD = 0, #: Standard single measurement. |
| 1064 | + SINGLE_EXACT = 1, #: Exact single measurement. |
| 1065 | + SINGLE_FAST = 2, #: Fast single measurement. |
| 1066 | + CONT_STANDARD = 3, #: Repeated measurement. |
| 1067 | + CONT_EXACT = 4, #: Repeated average measurement. |
| 1068 | + CONT_FAST = 5, #: Fast repeated measurement. |
| 1069 | + UNDEFINED = 6 #: Not defined. |
| 1070 | + |
| 1071 | + |
| 1072 | +class FACE(Enum): |
| 1073 | + """Instrument view face.""" |
| 1074 | + F1 = 0 #: Face left. |
| 1075 | + F2 = 1 #: Face right. |
| 1076 | + |
| 1077 | + |
| 1078 | +class FORMAT(Enum): |
| 1079 | + """Recording format.""" |
| 1080 | + GSI8 = 0 |
| 1081 | + GSI16 = 1 |
0 commit comments