keithley-tempcontrol 0.17.0__py3-none-any.whl → 0.17.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- egse/tempcontrol/keithley/daq6510_cs.py +3 -0
- egse/tempcontrol/keithley/daq6510_dev.py +10 -8
- egse/tempcontrol/keithley/daq6510_sim.py +17 -16
- {keithley_tempcontrol-0.17.0.dist-info → keithley_tempcontrol-0.17.1.dist-info}/METADATA +1 -1
- {keithley_tempcontrol-0.17.0.dist-info → keithley_tempcontrol-0.17.1.dist-info}/RECORD +7 -7
- {keithley_tempcontrol-0.17.0.dist-info → keithley_tempcontrol-0.17.1.dist-info}/WHEEL +0 -0
- {keithley_tempcontrol-0.17.0.dist-info → keithley_tempcontrol-0.17.1.dist-info}/entry_points.txt +0 -0
|
@@ -166,6 +166,7 @@ def start():
|
|
|
166
166
|
|
|
167
167
|
with remote_logging():
|
|
168
168
|
from egse.env import setup_env
|
|
169
|
+
|
|
169
170
|
setup_env()
|
|
170
171
|
|
|
171
172
|
try:
|
|
@@ -198,6 +199,7 @@ def stop():
|
|
|
198
199
|
multiprocessing.current_process().name = "daq6510_cs (stop)"
|
|
199
200
|
|
|
200
201
|
from egse.env import setup_env
|
|
202
|
+
|
|
201
203
|
setup_env()
|
|
202
204
|
|
|
203
205
|
try:
|
|
@@ -217,6 +219,7 @@ def status():
|
|
|
217
219
|
multiprocessing.current_process().name = "daq6510_cs (status)"
|
|
218
220
|
|
|
219
221
|
from egse.env import setup_env
|
|
222
|
+
|
|
220
223
|
setup_env()
|
|
221
224
|
|
|
222
225
|
endpoint = get_endpoint(SERVICE_TYPE, PROTOCOL, HOSTNAME, COMMANDING_PORT)
|
|
@@ -23,6 +23,9 @@ DEV_HOST = dev_settings.get("HOSTNAME")
|
|
|
23
23
|
DEV_PORT = dev_settings.get("PORT")
|
|
24
24
|
READ_TIMEOUT = dev_settings.get("TIMEOUT") # [s], can be smaller than timeout (for DAQ6510Proxy) (e.g. 1s)
|
|
25
25
|
|
|
26
|
+
SEPARATOR = b"\n"
|
|
27
|
+
SEPARATOR_STR = SEPARATOR.decode()
|
|
28
|
+
|
|
26
29
|
|
|
27
30
|
class DAQ6510Command(ClientServerCommand):
|
|
28
31
|
def get_cmd_string(self, *args, **kwargs) -> str:
|
|
@@ -36,7 +39,7 @@ class DAQ6510Command(ClientServerCommand):
|
|
|
36
39
|
"""
|
|
37
40
|
|
|
38
41
|
out = super().get_cmd_string(*args, **kwargs)
|
|
39
|
-
return out +
|
|
42
|
+
return out + SEPARATOR_STR
|
|
40
43
|
|
|
41
44
|
|
|
42
45
|
class DAQ6510(DeviceInterface, DeviceTransport):
|
|
@@ -107,6 +110,8 @@ class DAQ6510(DeviceInterface, DeviceTransport):
|
|
|
107
110
|
logger.debug(f"Sending {cmd}...")
|
|
108
111
|
self.write(cmd)
|
|
109
112
|
|
|
113
|
+
return responses
|
|
114
|
+
|
|
110
115
|
def is_simulator(self) -> bool:
|
|
111
116
|
return False
|
|
112
117
|
|
|
@@ -243,7 +248,7 @@ class DAQ6510(DeviceInterface, DeviceTransport):
|
|
|
243
248
|
"""
|
|
244
249
|
|
|
245
250
|
try:
|
|
246
|
-
command +=
|
|
251
|
+
command += SEPARATOR_STR if not command.endswith(SEPARATOR_STR) else ""
|
|
247
252
|
|
|
248
253
|
self._sock.sendall(command.encode())
|
|
249
254
|
|
|
@@ -258,7 +263,7 @@ class DAQ6510(DeviceInterface, DeviceTransport):
|
|
|
258
263
|
raise DeviceConnectionError(DEVICE_NAME, msg)
|
|
259
264
|
raise
|
|
260
265
|
|
|
261
|
-
def trans(self, command: str) ->
|
|
266
|
+
def trans(self, command: str) -> bytes:
|
|
262
267
|
"""Sends a single command to the device controller and block until a response from the controller.
|
|
263
268
|
|
|
264
269
|
This is seen as a transaction.
|
|
@@ -277,7 +282,7 @@ class DAQ6510(DeviceInterface, DeviceTransport):
|
|
|
277
282
|
try:
|
|
278
283
|
# Attempt to send the complete command
|
|
279
284
|
|
|
280
|
-
command +=
|
|
285
|
+
command += SEPARATOR_STR if not command.endswith(SEPARATOR_STR) else ""
|
|
281
286
|
|
|
282
287
|
self._sock.sendall(command.encode())
|
|
283
288
|
|
|
@@ -323,10 +328,7 @@ class DAQ6510(DeviceInterface, DeviceTransport):
|
|
|
323
328
|
break
|
|
324
329
|
except socket.timeout:
|
|
325
330
|
logger.warning(f"Socket timeout error for {self.hostname}:{self.port}")
|
|
326
|
-
return
|
|
327
|
-
except TimeoutError as exc:
|
|
328
|
-
logger.warning(f"Socket timeout error: {exc}")
|
|
329
|
-
return b"\r\n"
|
|
331
|
+
return SEPARATOR
|
|
330
332
|
finally:
|
|
331
333
|
self._sock.settimeout(saved_timeout)
|
|
332
334
|
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
1
|
import contextlib
|
|
4
2
|
import datetime
|
|
5
|
-
import logging
|
|
6
3
|
import re
|
|
7
4
|
import socket
|
|
8
5
|
import time
|
|
6
|
+
from typing import Annotated
|
|
9
7
|
|
|
10
8
|
import typer
|
|
9
|
+
|
|
10
|
+
from egse.log import logging
|
|
11
11
|
from egse.settings import Settings
|
|
12
12
|
from egse.system import SignalCatcher
|
|
13
13
|
|
|
14
|
-
logger = logging.getLogger("daq6510-sim")
|
|
14
|
+
logger = logging.getLogger("egse.daq6510-sim")
|
|
15
15
|
|
|
16
16
|
HOST = "localhost"
|
|
17
17
|
DAQ_SETTINGS = Settings.load("Keithley DAQ6510")
|
|
18
18
|
|
|
19
|
+
SEPARATOR = b"\n"
|
|
20
|
+
SEPARATOR_STR = SEPARATOR.decode()
|
|
19
21
|
|
|
20
22
|
device_time = datetime.datetime.now(datetime.timezone.utc)
|
|
21
23
|
reference_time = device_time
|
|
@@ -79,7 +81,7 @@ COMMAND_PATTERNS_ACTIONS_RESPONSES = {
|
|
|
79
81
|
|
|
80
82
|
|
|
81
83
|
def write(conn, response: str):
|
|
82
|
-
response = f"{response}
|
|
84
|
+
response = f"{response}{SEPARATOR_STR}".encode()
|
|
83
85
|
logger.debug(f"write: {response = }")
|
|
84
86
|
conn.sendall(response)
|
|
85
87
|
|
|
@@ -196,7 +198,7 @@ def run_simulator():
|
|
|
196
198
|
logger.info(f"{exc.__class__.__name__} caught: {exc.args}")
|
|
197
199
|
|
|
198
200
|
|
|
199
|
-
def send_request(cmd: str,
|
|
201
|
+
def send_request(cmd: str, cmd_type: str = "query") -> str | None:
|
|
200
202
|
from egse.tempcontrol.keithley.daq6510_dev import DAQ6510
|
|
201
203
|
|
|
202
204
|
response = None
|
|
@@ -204,12 +206,12 @@ def send_request(cmd: str, type_: str = "query"):
|
|
|
204
206
|
daq_dev = DAQ6510(hostname="localhost", port=5025)
|
|
205
207
|
daq_dev.connect()
|
|
206
208
|
|
|
207
|
-
if
|
|
209
|
+
if cmd_type.lower().strip() == "query":
|
|
208
210
|
response = daq_dev.query(cmd)
|
|
209
|
-
elif
|
|
211
|
+
elif cmd_type.lower().strip() == "write":
|
|
210
212
|
daq_dev.write(cmd)
|
|
211
213
|
else:
|
|
212
|
-
logger.info(f"Unknown type {
|
|
214
|
+
logger.info(f"Unknown command type {cmd_type} for send_request.")
|
|
213
215
|
|
|
214
216
|
daq_dev.disconnect()
|
|
215
217
|
|
|
@@ -234,15 +236,14 @@ def stop():
|
|
|
234
236
|
|
|
235
237
|
|
|
236
238
|
@app.command()
|
|
237
|
-
def command(
|
|
238
|
-
|
|
239
|
+
def command(
|
|
240
|
+
cmd: str,
|
|
241
|
+
cmd_type: Annotated[str, typer.Argument(help="either 'write', 'query'")] = "query",
|
|
242
|
+
):
|
|
243
|
+
"""Send an SCPI command directly to the simulator. The response will be in the log info."""
|
|
244
|
+
response = send_request(cmd, cmd_type)
|
|
239
245
|
logger.info(f"{response}")
|
|
240
246
|
|
|
241
247
|
|
|
242
248
|
if __name__ == "__main__":
|
|
243
|
-
logging.basicConfig(
|
|
244
|
-
level=logging.DEBUG,
|
|
245
|
-
format="%(asctime)s %(threadName)-12s %(levelname)-8s %(name)-12s %(module)-20s %(message)s",
|
|
246
|
-
)
|
|
247
|
-
|
|
248
249
|
app()
|
|
@@ -3,16 +3,16 @@ egse/tempcontrol/keithley/daq6510.py,sha256=pe12HIC2Yav5ZCGYecoQzhypYcCwecEaJpWZ
|
|
|
3
3
|
egse/tempcontrol/keithley/daq6510.yaml,sha256=dHHVNyUpOQpdrZpnxPbT6slsl-8Gbnhifj4Q8QOfOYg,4400
|
|
4
4
|
egse/tempcontrol/keithley/daq6510_acs.py,sha256=6sGc2E8gg67ZwkNmHtNSsunC6cN0IYNwtJXC3yMYcpM,64
|
|
5
5
|
egse/tempcontrol/keithley/daq6510_adev.py,sha256=WjBuQvhpeXr2WHVB54mACM5WQwnecSY6I3iG2Cajs5c,2247
|
|
6
|
-
egse/tempcontrol/keithley/daq6510_cs.py,sha256=
|
|
7
|
-
egse/tempcontrol/keithley/daq6510_dev.py,sha256=
|
|
6
|
+
egse/tempcontrol/keithley/daq6510_cs.py,sha256=Ga7z8S6z0oTxL_qQP8FXPaNKlJ6o9RrsPFOXeIJ2TT4,7700
|
|
7
|
+
egse/tempcontrol/keithley/daq6510_dev.py,sha256=EKFFDhP8-FdIPBPosc1DfzE3h4DQmNU1d0Fi7Yhx4I4,12906
|
|
8
8
|
egse/tempcontrol/keithley/daq6510_mon.py,sha256=Xbn2U-l9uxPwNN1-aYW72oJodL2sx13suCiPPbDSti0,20932
|
|
9
9
|
egse/tempcontrol/keithley/daq6510_protocol.py,sha256=v8FUrxEm7bnRzM_iQzW0mMCHTgAMZw4f2Ronl8fdKIE,2676
|
|
10
|
-
egse/tempcontrol/keithley/daq6510_sim.py,sha256=
|
|
10
|
+
egse/tempcontrol/keithley/daq6510_sim.py,sha256=RGjdbNmK2khflc53f4egOJ0dGJBght6TN8kpQDi9hfs,7665
|
|
11
11
|
keithley_tempcontrol/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
keithley_tempcontrol/cgse_explore.py,sha256=y_FkFxJW0vdqGNp9yTU0ELBKxby74-ev3fTuf99Vl1s,400
|
|
13
13
|
keithley_tempcontrol/cgse_services.py,sha256=tndviv2rvygkNSsGy1oA43VfFpyVkdB9If-9sVlLbK4,2466
|
|
14
14
|
keithley_tempcontrol/settings.yaml,sha256=wbrgSZQAdqFl6AxiLJIN36UsdiVHQCzdsgi7Hs7dv7o,1467
|
|
15
|
-
keithley_tempcontrol-0.17.
|
|
16
|
-
keithley_tempcontrol-0.17.
|
|
17
|
-
keithley_tempcontrol-0.17.
|
|
18
|
-
keithley_tempcontrol-0.17.
|
|
15
|
+
keithley_tempcontrol-0.17.1.dist-info/METADATA,sha256=qVuytSXOrdXx9yy3TuFYkhMifush-gJQxFgKVG7Tbao,962
|
|
16
|
+
keithley_tempcontrol-0.17.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
17
|
+
keithley_tempcontrol-0.17.1.dist-info/entry_points.txt,sha256=_0j2BwcwPi4LlRrhvEWfp9GO9KT8WhCkJe2gFgMzOPs,491
|
|
18
|
+
keithley_tempcontrol-0.17.1.dist-info/RECORD,,
|
|
File without changes
|
{keithley_tempcontrol-0.17.0.dist-info → keithley_tempcontrol-0.17.1.dist-info}/entry_points.txt
RENAMED
|
File without changes
|