Skip to content

Commit bb1696d

Browse files
committed
Added TPS1100 EDM
1 parent 6045fd1 commit bb1696d

File tree

5 files changed

+215
-0
lines changed

5 files changed

+215
-0
lines changed

docs/api/tps1100/edm.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Distance Measurement
2+
====================
3+
4+
.. automodule:: geocompy.tps1100.edm
5+
:inherited-members:
6+
:exclude-members: on,get_bumerang,set_bumerang,get_trk_light_brightness,set_trk_light_brightness,get_trk_light_switch,set_trk_light_switch
7+
8+
Definitions
9+
-----------

docs/api/tps1100/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ TPS1100
2121
com
2222
csv
2323
ctl
24+
edm

src/geocompy/data.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,14 @@ class TRACKLIGHT(Enum):
10221022
HIGH = 2
10231023

10241024

1025+
class GUIDELIGHT(Enum):
1026+
"""Guide light intensity."""
1027+
OFF = 0
1028+
LOW = 1
1029+
MID = 2
1030+
HIGH = 3
1031+
1032+
10251033
class ATRLOCK(Enum):
10261034
"""ATR lock status."""
10271035
NONE = 0 #: Disabled

src/geocompy/tps1100/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- ``geocompy.tps1100.com``
2424
- ``geocompy.tps1100.csv``
2525
- ``geocompy.tps1100.ctl``
26+
- ``geocompy.tps1100.edm``
2627
"""
2728
from __future__ import annotations
2829

@@ -50,6 +51,7 @@
5051
from .com import TPS1100COM
5152
from .csv import TPS1100CSV
5253
from .ctl import TPS1100CTL
54+
from .edm import TPS1100EDM
5355
from .rc import TPS1100RC, rpcnames
5456

5557

@@ -144,6 +146,8 @@ def __init__(
144146
"""Central services subsystem."""
145147
self.ctl: TPS1100CTL = TPS1100CTL(self)
146148
"""Control task subsystem."""
149+
self.edm: TPS1100EDM = TPS1100EDM(self)
150+
"""Electronic distance measurement subsystem."""
147151

148152
for i in range(retry):
149153
try:

src/geocompy/tps1100/edm.py

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
"""
2+
Description
3+
===========
4+
5+
Module: ``geocompy.tps1100.edm``
6+
7+
Definitions for the TPS1100 EDM subsystem.
8+
9+
Types
10+
-----
11+
12+
- ``TPS1100EDM``
13+
14+
"""
15+
from __future__ import annotations
16+
17+
from typing_extensions import deprecated
18+
19+
from ..data import (
20+
toenum,
21+
enumparser,
22+
TRACKLIGHT,
23+
GUIDELIGHT
24+
)
25+
from ..protocols import GeoComResponse
26+
from ..tps1000.edm import TPS1000EDM
27+
28+
29+
class TPS1100EDM(TPS1000EDM):
30+
"""
31+
Electronic distance measurement subsystem of the TPS1100 GeoCom
32+
protocol.
33+
34+
This subsystem provides access to control some of the EDM module
35+
functions.
36+
37+
"""
38+
39+
def get_egl_intensity(self) -> GeoComResponse[GUIDELIGHT]:
40+
"""
41+
RPC 1058, ``EDM_GetEglIntensity``
42+
43+
Gets the current intensity setting of the electronic guide light.
44+
45+
Returns
46+
-------
47+
GeoComResponse
48+
Params:
49+
- `GUIDELIGHT`: Current intensity mode.
50+
Error codes:
51+
- ``EDM_DEV_NOT_INSTALLED``: Instrument has no
52+
EGL.
53+
54+
"""
55+
return self._request(
56+
1058,
57+
parsers=enumparser(GUIDELIGHT)
58+
)
59+
60+
def set_egl_intensity(
61+
self,
62+
intensity: GUIDELIGHT | str
63+
) -> GeoComResponse[None]:
64+
"""
65+
RPC 1059, ``EDM_SetEglIntensity``
66+
67+
Sets the intensity setting of the electronic guide light.
68+
69+
Parameters
70+
----------
71+
intensity : GUIDELIGHT | str
72+
Intensity setting to activate.
73+
74+
Returns
75+
-------
76+
GeoComResponse
77+
Error codes:
78+
- ``EDM_DEV_NOT_INSTALLED``: Instrument has no
79+
EGL.
80+
81+
"""
82+
_intesity = toenum(GUIDELIGHT, intensity)
83+
return self._request(
84+
1059,
85+
[_intesity.value]
86+
)
87+
88+
@deprecated("This command was removed for TPS1100 instruments")
89+
def on(
90+
self,
91+
*args
92+
) -> GeoComResponse[None]:
93+
"""
94+
RPC 1010, ``EDM_On``
95+
96+
.. versionremoved:: GeoCom-TPS1100-1.00
97+
98+
Raises
99+
------
100+
AttributeError
101+
"""
102+
raise AttributeError()
103+
104+
@deprecated("This command was removed for TPS1100 instruments")
105+
def get_bumerang(self) -> GeoComResponse[bool]:
106+
"""
107+
RPC 1044, ``EDM_GetBumerang``
108+
109+
.. versionremoved:: GeoCom-TPS1100-1.00
110+
111+
Raises
112+
------
113+
AttributeError
114+
"""
115+
raise AttributeError()
116+
117+
@deprecated("This command was removed for TPS1100 instruments")
118+
def set_bumerang(
119+
self,
120+
*args
121+
) -> GeoComResponse[None]:
122+
"""
123+
RPC 1007, ``EDM_SetBumerang``
124+
125+
.. versionremoved:: GeoCom-TPS1100-1.00
126+
127+
Raises
128+
------
129+
AttributeError
130+
"""
131+
raise AttributeError()
132+
133+
@deprecated("This command was removed for TPS1100 instruments")
134+
def get_trk_light_brightness(self) -> GeoComResponse[TRACKLIGHT]:
135+
"""
136+
RPC 1041, ``EDM_GetTrkLightBrightness``
137+
138+
.. versionremoved:: GeoCom-TPS1100-1.00
139+
Use `get_egl_intensity` instead.
140+
141+
Raises
142+
------
143+
AttributeError
144+
"""
145+
raise AttributeError()
146+
147+
@deprecated("This command was removed for TPS1100 instruments")
148+
def set_trk_light_brightness(
149+
self,
150+
*args
151+
) -> GeoComResponse[None]:
152+
"""
153+
RPC 1032, ``EDM_SetTrkLightBrightness``
154+
155+
.. versionremoved:: GeoCom-TPS1100-1.00
156+
Use `set_egl_intensity` instead.
157+
158+
Raises
159+
------
160+
AttributeError
161+
"""
162+
raise AttributeError()
163+
164+
@deprecated("This command was removed for TPS1100 instruments")
165+
def get_trk_light_switch(self) -> GeoComResponse[bool]:
166+
"""
167+
RPC 1040, ``EDM_GetTrkLightSwitch``
168+
169+
.. versionremoved:: GeoCom-TPS1100-1.00
170+
Use `get_egl_intensity` instead.
171+
172+
Raises
173+
------
174+
AttributeError
175+
"""
176+
raise AttributeError()
177+
178+
@deprecated("This command was removed for TPS1100 instruments")
179+
def set_trk_light_switch(
180+
self,
181+
*args
182+
) -> GeoComResponse[None]:
183+
"""
184+
RPC 1031, ``EDM_SetTrkLightSwitch``
185+
186+
.. versionremoved:: GeoCom-TPS1100-1.00
187+
Use `set_egl_intensity` instead.
188+
189+
Raises
190+
------
191+
AttributeError
192+
"""
193+
raise AttributeError()

0 commit comments

Comments
 (0)