keithley-tempcontrol 0.17.3__py3-none-any.whl → 0.18.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/__init__.py +0 -2
- egse/tempcontrol/keithley/daq6510.py +101 -255
- egse/tempcontrol/keithley/daq6510_adev.py +27 -35
- egse/tempcontrol/keithley/daq6510_amon.py +569 -0
- egse/tempcontrol/keithley/daq6510_cs.py +115 -44
- egse/tempcontrol/keithley/daq6510_dev.py +77 -210
- egse/tempcontrol/keithley/daq6510_mon.py +242 -453
- egse/tempcontrol/keithley/daq6510_protocol.py +43 -38
- egse/tempcontrol/keithley/daq6510_sim.py +119 -62
- keithley_tempcontrol/cgse_services.py +58 -7
- {keithley_tempcontrol-0.17.3.dist-info → keithley_tempcontrol-0.18.1.dist-info}/METADATA +1 -1
- keithley_tempcontrol-0.18.1.dist-info/RECORD +18 -0
- {keithley_tempcontrol-0.17.3.dist-info → keithley_tempcontrol-0.18.1.dist-info}/entry_points.txt +1 -0
- keithley_tempcontrol-0.17.3.dist-info/RECORD +0 -17
- {keithley_tempcontrol-0.17.3.dist-info → keithley_tempcontrol-0.18.1.dist-info}/WHEEL +0 -0
|
@@ -1,62 +1,70 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
from pathlib import Path
|
|
2
3
|
|
|
3
4
|
from egse.control import ControlServer
|
|
4
5
|
from egse.device import DeviceTimeoutError
|
|
5
|
-
from egse.hk import read_conversion_dict
|
|
6
|
-
from egse.metrics import define_metrics
|
|
6
|
+
from egse.hk import convert_hk_names, read_conversion_dict
|
|
7
7
|
from egse.protocol import CommandProtocol
|
|
8
|
+
from egse.log import logger
|
|
8
9
|
from egse.settings import Settings
|
|
9
10
|
from egse.setup import load_setup
|
|
10
|
-
from egse.synoptics import SynopticsManagerProxy
|
|
11
11
|
from egse.system import format_datetime
|
|
12
|
-
from egse.tempcontrol.keithley.daq6510 import DAQ6510Controller
|
|
13
|
-
from egse.tempcontrol.keithley.daq6510 import DAQ6510Interface
|
|
14
|
-
from egse.tempcontrol.keithley.daq6510 import DAQ6510Simulator
|
|
12
|
+
from egse.tempcontrol.keithley.daq6510 import DAQ6510Controller, DAQ6510Interface
|
|
15
13
|
from egse.tempcontrol.keithley.daq6510_dev import DAQ6510Command
|
|
16
14
|
from egse.zmq_ser import bind_address
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
HERE = Path(__file__).parent
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
COMMAND_SETTINGS = Settings.load(location=HERE, filename="daq6510.yaml")
|
|
21
19
|
|
|
22
20
|
|
|
23
21
|
class DAQ6510Protocol(CommandProtocol):
|
|
24
22
|
def __init__(self, control_server: ControlServer):
|
|
25
|
-
"""
|
|
23
|
+
"""Initialization of a new Protocol for DAQ6510 Management.
|
|
26
24
|
|
|
27
25
|
Args:
|
|
28
26
|
control_server: Control Server for which to send out status and monitoring information
|
|
29
27
|
"""
|
|
30
28
|
|
|
31
|
-
super().__init__()
|
|
32
|
-
self.control_server = control_server
|
|
29
|
+
super().__init__(control_server)
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
self.daq = DAQ6510Simulator()
|
|
36
|
-
else:
|
|
37
|
-
self.daq = DAQ6510Controller()
|
|
31
|
+
self.daq = DAQ6510Controller()
|
|
38
32
|
|
|
39
33
|
try:
|
|
40
34
|
self.daq.connect()
|
|
41
35
|
except (ConnectionError, DeviceTimeoutError):
|
|
42
|
-
|
|
36
|
+
logger.warning("Couldn't establish a connection to the DAQ6510, check the log messages.")
|
|
37
|
+
|
|
38
|
+
try:
|
|
39
|
+
self.hk_conversion_table = read_conversion_dict(
|
|
40
|
+
self.get_control_server().get_storage_mnemonic(), use_site=False
|
|
41
|
+
)
|
|
42
|
+
except Exception as exc:
|
|
43
|
+
logger.warning(f"Failed to read housekeeping conversion dictionary: {exc}")
|
|
44
|
+
self.hk_conversion_table = None
|
|
43
45
|
|
|
44
46
|
self.load_commands(COMMAND_SETTINGS.Commands, DAQ6510Command, DAQ6510Interface)
|
|
45
47
|
self.build_device_method_lookup_table(self.daq)
|
|
46
48
|
|
|
47
49
|
setup = load_setup()
|
|
48
|
-
self.channels = setup.gse.DAQ6510.channels
|
|
50
|
+
self.channels = setup.gse.DAQ6510.channels # type: ignore[attr-defined]
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
def get_device(self) -> DAQ6510Controller:
|
|
53
|
+
"""
|
|
54
|
+
Returns the DAQ6510Controller device.
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
Returns:
|
|
57
|
+
The DAQ6510Controller device.
|
|
58
|
+
"""
|
|
54
59
|
|
|
55
|
-
|
|
56
|
-
"""Returns a string with the bind address, the endpoint, for accepting connections and bind a socket to.
|
|
60
|
+
return self.daq
|
|
57
61
|
|
|
62
|
+
def get_bind_address(self) -> str:
|
|
63
|
+
"""
|
|
64
|
+
Returns a string with the bind address, the endpoint, for accepting connections and bind a socket to.
|
|
58
65
|
|
|
59
|
-
Returns:
|
|
66
|
+
Returns:
|
|
67
|
+
String with the protocol and port to bind a socket to.
|
|
60
68
|
"""
|
|
61
69
|
|
|
62
70
|
return bind_address(
|
|
@@ -65,33 +73,30 @@ class DAQ6510Protocol(CommandProtocol):
|
|
|
65
73
|
)
|
|
66
74
|
|
|
67
75
|
def get_status(self) -> dict:
|
|
68
|
-
"""
|
|
76
|
+
"""
|
|
77
|
+
Returns a dictionary with status information for the Control Server and the DAQ6510.
|
|
69
78
|
|
|
70
|
-
Returns:
|
|
79
|
+
Returns:
|
|
80
|
+
Dictionary with status information for the Control Server and the DAQ6510.
|
|
71
81
|
"""
|
|
72
82
|
|
|
73
83
|
return super().get_status()
|
|
74
84
|
|
|
75
85
|
def get_housekeeping(self) -> dict:
|
|
76
|
-
"""
|
|
86
|
+
"""
|
|
87
|
+
Returns a dictionary with housekeeping information about the DAQ6510.
|
|
77
88
|
|
|
78
|
-
Returns:
|
|
89
|
+
Returns:
|
|
90
|
+
Dictionary with housekeeping information about the DAQ6510.
|
|
79
91
|
"""
|
|
80
92
|
|
|
81
93
|
hk_dict = dict()
|
|
82
94
|
hk_dict["timestamp"] = format_datetime()
|
|
83
95
|
|
|
84
|
-
#
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
# hk_dict.update(temperatures)
|
|
89
|
-
#
|
|
90
|
-
# self.synoptics.store_th_synoptics(hk_dict)
|
|
91
|
-
#
|
|
92
|
-
# for key, value in hk_dict.items():
|
|
93
|
-
# if key != "timestamp":
|
|
94
|
-
# self.metrics[key].set(value)
|
|
96
|
+
# logger.warning("DAQ6510Protocol.get_housekeeping() not implemented yet.")
|
|
97
|
+
|
|
98
|
+
if self.hk_conversion_table:
|
|
99
|
+
return convert_hk_names(hk_dict, self.hk_conversion_table)
|
|
95
100
|
|
|
96
101
|
return hk_dict
|
|
97
102
|
|
|
@@ -1,21 +1,32 @@
|
|
|
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 functools import partial
|
|
7
|
+
from typing import Annotated
|
|
9
8
|
|
|
10
9
|
import typer
|
|
10
|
+
|
|
11
|
+
from egse.env import bool_env
|
|
12
|
+
from egse.log import logging
|
|
11
13
|
from egse.settings import Settings
|
|
12
14
|
from egse.system import SignalCatcher
|
|
13
15
|
|
|
14
|
-
logger = logging.getLogger("daq6510-sim")
|
|
16
|
+
logger = logging.getLogger("egse.daq6510-sim")
|
|
15
17
|
|
|
18
|
+
VERSION = "0.1.0"
|
|
19
|
+
VERBOSE_DEBUG = bool_env("VERBOSE_DEBUG")
|
|
16
20
|
HOST = "localhost"
|
|
17
21
|
DAQ_SETTINGS = Settings.load("Keithley DAQ6510")
|
|
18
22
|
|
|
23
|
+
READ_TIMEOUT = 2.0
|
|
24
|
+
"""The timeout set on the connection socket, applicable when reading from the socket with `recv`."""
|
|
25
|
+
CONNECTION_TIMEOUT = 2.0
|
|
26
|
+
"""The timeout set on the socket before accepting a connection."""
|
|
27
|
+
|
|
28
|
+
SEPARATOR = b"\n"
|
|
29
|
+
SEPARATOR_STR = SEPARATOR.decode()
|
|
19
30
|
|
|
20
31
|
device_time = datetime.datetime.now(datetime.timezone.utc)
|
|
21
32
|
reference_time = device_time
|
|
@@ -23,8 +34,8 @@ reference_time = device_time
|
|
|
23
34
|
|
|
24
35
|
app = typer.Typer(help="DAQ6510 Simulator")
|
|
25
36
|
|
|
26
|
-
error_msg: str
|
|
27
|
-
"""Global error message, always contains the last error. Reset in the inner loop of run_simulator."""
|
|
37
|
+
error_msg: str = ""
|
|
38
|
+
"""Global error message, always contains the last error. Reset to an empty string in the inner loop of run_simulator."""
|
|
28
39
|
|
|
29
40
|
|
|
30
41
|
def create_datetime(year, month, day, hour, minute, second):
|
|
@@ -62,8 +73,14 @@ def reset():
|
|
|
62
73
|
logger.info("RESET")
|
|
63
74
|
|
|
64
75
|
|
|
76
|
+
def log(level: int, msg: str):
|
|
77
|
+
logger.log(level, msg)
|
|
78
|
+
|
|
79
|
+
|
|
65
80
|
COMMAND_ACTIONS_RESPONSES = {
|
|
66
|
-
"*IDN?": (None, "KEITHLEY INSTRUMENTS,
|
|
81
|
+
"*IDN?": (None, f"KEITHLEY INSTRUMENTS,DAQ6510,SIMULATOR,{VERSION}"),
|
|
82
|
+
"*ACTION-RESPONSE?": (partial(log, logging.INFO, "Requested action with response."), get_time),
|
|
83
|
+
"*ACTION-NO-RESPONSE": (partial(log, logging.INFO, "Requested action without response."), None),
|
|
67
84
|
}
|
|
68
85
|
|
|
69
86
|
# Check the regex at https://regex101.com
|
|
@@ -79,65 +96,105 @@ COMMAND_PATTERNS_ACTIONS_RESPONSES = {
|
|
|
79
96
|
|
|
80
97
|
|
|
81
98
|
def write(conn, response: str):
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
99
|
+
response_b = f"{response}{SEPARATOR_STR}".encode()
|
|
100
|
+
if VERBOSE_DEBUG:
|
|
101
|
+
logger.debug(f"write: {response_b = }")
|
|
102
|
+
conn.sendall(response_b)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# Keep a receive buffer per connection
|
|
106
|
+
_recv_buffers: dict[int, bytes] = {}
|
|
85
107
|
|
|
86
108
|
|
|
87
109
|
def read(conn) -> str:
|
|
88
110
|
"""
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
The command string with the linefeed stripped off.
|
|
111
|
+
Read bytes from `conn` until a `SEPARATOR` is found (or connection closed / timeout).
|
|
112
|
+
Returns the first chunk (separator stripped). Any bytes after the separator are kept
|
|
113
|
+
in a per-connection buffer for the next call.
|
|
93
114
|
"""
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
buf_size = 1024 * 4
|
|
97
|
-
command_string = bytes()
|
|
115
|
+
fileno = conn.fileno()
|
|
116
|
+
buf = _recv_buffers.get(fileno, b"")
|
|
98
117
|
|
|
99
118
|
try:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
119
|
+
while True:
|
|
120
|
+
# If we already have a full line in the buffer, split and return it.
|
|
121
|
+
if SEPARATOR in buf:
|
|
122
|
+
line, rest = buf.split(SEPARATOR, 1)
|
|
123
|
+
_recv_buffers[fileno] = rest
|
|
124
|
+
logger.info(f"read: {line=}")
|
|
125
|
+
return line.decode().rstrip()
|
|
126
|
+
|
|
127
|
+
# Read more data
|
|
128
|
+
data = conn.recv(1024 * 4)
|
|
129
|
+
if not data:
|
|
130
|
+
# Connection closed by peer; return whatever we have (may be empty)
|
|
131
|
+
_recv_buffers.pop(fileno, None)
|
|
132
|
+
logger.info(f"read (connection closed): {buf=}")
|
|
133
|
+
return buf.decode().rstrip()
|
|
134
|
+
buf += data
|
|
135
|
+
_recv_buffers[fileno] = buf
|
|
136
|
+
|
|
108
137
|
except socket.timeout:
|
|
109
|
-
#
|
|
138
|
+
# If we have accumulated data without a separator, return it (partial read),
|
|
139
|
+
# otherwise propagate the timeout so caller can handle/suppress it.
|
|
140
|
+
if buf:
|
|
141
|
+
_recv_buffers[fileno] = buf
|
|
142
|
+
logger.info(f"read (timeout, partial): {buf=}")
|
|
143
|
+
return buf.decode().rstrip()
|
|
110
144
|
raise
|
|
111
145
|
|
|
112
|
-
logger.info(f"read: {command_string=}")
|
|
113
|
-
|
|
114
|
-
return command_string.decode().rstrip()
|
|
115
|
-
|
|
116
146
|
|
|
117
|
-
def process_command(command_string: str) -> str:
|
|
147
|
+
def process_command(command_string: str) -> str | None:
|
|
148
|
+
"""Process the given command string and return a response."""
|
|
118
149
|
global COMMAND_ACTIONS_RESPONSES
|
|
119
150
|
global COMMAND_PATTERNS_ACTIONS_RESPONSES
|
|
120
151
|
global error_msg
|
|
121
152
|
|
|
122
|
-
|
|
153
|
+
if VERBOSE_DEBUG:
|
|
154
|
+
logger.debug(f"{command_string=}")
|
|
123
155
|
|
|
124
156
|
try:
|
|
125
157
|
action, response = COMMAND_ACTIONS_RESPONSES[command_string]
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
158
|
+
if VERBOSE_DEBUG:
|
|
159
|
+
logger.debug(f"{action=}, {response=}")
|
|
160
|
+
|
|
161
|
+
if action:
|
|
162
|
+
action()
|
|
163
|
+
|
|
164
|
+
if response:
|
|
165
|
+
if error_msg:
|
|
166
|
+
return error_msg
|
|
167
|
+
else:
|
|
168
|
+
return response() if callable(response) else response
|
|
129
169
|
else:
|
|
130
|
-
|
|
170
|
+
if error_msg:
|
|
171
|
+
logger.error(f"Error occurred during process command: {error_msg}")
|
|
172
|
+
return None
|
|
131
173
|
except KeyError:
|
|
132
174
|
# try to match with a value
|
|
133
175
|
for key, value in COMMAND_PATTERNS_ACTIONS_RESPONSES.items():
|
|
134
176
|
if match := re.match(key, command_string, flags=re.IGNORECASE):
|
|
135
|
-
|
|
177
|
+
if VERBOSE_DEBUG:
|
|
178
|
+
logger.debug(f"{match=}, {match.groups()}")
|
|
136
179
|
action, response = value
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
180
|
+
if VERBOSE_DEBUG:
|
|
181
|
+
logger.debug(f"{action=}, {response=}")
|
|
182
|
+
|
|
183
|
+
if action:
|
|
184
|
+
action(*match.groups())
|
|
185
|
+
|
|
186
|
+
if response:
|
|
187
|
+
if error_msg:
|
|
188
|
+
return error_msg
|
|
189
|
+
else:
|
|
190
|
+
return response() if callable(response) else response
|
|
191
|
+
else:
|
|
192
|
+
if error_msg:
|
|
193
|
+
logger.error(f"Error occurred during process command: {error_msg}")
|
|
194
|
+
return None
|
|
195
|
+
|
|
196
|
+
logger.error(f"ERROR: unknown command string: {command_string}")
|
|
197
|
+
return None
|
|
141
198
|
|
|
142
199
|
|
|
143
200
|
def run_simulator():
|
|
@@ -150,7 +207,7 @@ def run_simulator():
|
|
|
150
207
|
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
151
208
|
s.bind((HOST, DAQ_SETTINGS.PORT))
|
|
152
209
|
s.listen()
|
|
153
|
-
s.settimeout(
|
|
210
|
+
s.settimeout(CONNECTION_TIMEOUT)
|
|
154
211
|
while True:
|
|
155
212
|
while True:
|
|
156
213
|
with contextlib.suppress(socket.timeout):
|
|
@@ -160,14 +217,18 @@ def run_simulator():
|
|
|
160
217
|
return
|
|
161
218
|
with conn:
|
|
162
219
|
logger.info(f"Accepted connection from {addr}")
|
|
163
|
-
write(conn, "This is PLATO DAQ6510 X.X.sim")
|
|
164
|
-
conn.settimeout(
|
|
220
|
+
# write(conn, "This is PLATO DAQ6510 X.X.sim") # The DAQ6510 doesn't send a string after connection
|
|
221
|
+
conn.settimeout(READ_TIMEOUT)
|
|
165
222
|
try:
|
|
166
223
|
while True:
|
|
167
224
|
error_msg = ""
|
|
168
225
|
with contextlib.suppress(socket.timeout):
|
|
169
226
|
data = read(conn)
|
|
170
|
-
|
|
227
|
+
if VERBOSE_DEBUG:
|
|
228
|
+
logger.debug(f"{data = }")
|
|
229
|
+
if not data:
|
|
230
|
+
logger.info("Client closed connection, accepting new connection...")
|
|
231
|
+
break
|
|
171
232
|
if data.strip() == "STOP":
|
|
172
233
|
logger.info("Client requested to terminate...")
|
|
173
234
|
s.close()
|
|
@@ -176,9 +237,6 @@ def run_simulator():
|
|
|
176
237
|
response = process_command(cmd.strip())
|
|
177
238
|
if response is not None:
|
|
178
239
|
write(conn, response)
|
|
179
|
-
if not data:
|
|
180
|
-
logger.info("Client closed connection, accepting new connection...")
|
|
181
|
-
break
|
|
182
240
|
if killer.term_signal_received:
|
|
183
241
|
logger.info("Terminating...")
|
|
184
242
|
s.close()
|
|
@@ -196,20 +254,20 @@ def run_simulator():
|
|
|
196
254
|
logger.info(f"{exc.__class__.__name__} caught: {exc.args}")
|
|
197
255
|
|
|
198
256
|
|
|
199
|
-
def send_request(cmd: str,
|
|
200
|
-
from egse.tempcontrol.keithley.daq6510_dev import
|
|
257
|
+
def send_request(cmd: str, cmd_type: str = "query") -> str | None:
|
|
258
|
+
from egse.tempcontrol.keithley.daq6510_dev import DAQ6510
|
|
201
259
|
|
|
202
260
|
response = None
|
|
203
261
|
|
|
204
|
-
daq_dev =
|
|
262
|
+
daq_dev = DAQ6510(hostname="localhost", port=5025)
|
|
205
263
|
daq_dev.connect()
|
|
206
264
|
|
|
207
|
-
if
|
|
265
|
+
if cmd_type.lower().strip() == "query":
|
|
208
266
|
response = daq_dev.query(cmd)
|
|
209
|
-
elif
|
|
267
|
+
elif cmd_type.lower().strip() == "write":
|
|
210
268
|
daq_dev.write(cmd)
|
|
211
269
|
else:
|
|
212
|
-
logger.info(f"Unknown type {
|
|
270
|
+
logger.info(f"Unknown command type {cmd_type} for send_request.")
|
|
213
271
|
|
|
214
272
|
daq_dev.disconnect()
|
|
215
273
|
|
|
@@ -234,15 +292,14 @@ def stop():
|
|
|
234
292
|
|
|
235
293
|
|
|
236
294
|
@app.command()
|
|
237
|
-
def command(
|
|
238
|
-
|
|
295
|
+
def command(
|
|
296
|
+
cmd: str,
|
|
297
|
+
cmd_type: Annotated[str, typer.Argument(help="either 'write', 'query'")] = "query",
|
|
298
|
+
):
|
|
299
|
+
"""Send an SCPI command directly to the simulator. The response will be in the log info."""
|
|
300
|
+
response = send_request(cmd, cmd_type)
|
|
239
301
|
logger.info(f"{response}")
|
|
240
302
|
|
|
241
303
|
|
|
242
304
|
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
305
|
app()
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
#
|
|
3
3
|
import subprocess
|
|
4
4
|
import sys
|
|
5
|
-
from pathlib import Path
|
|
6
5
|
|
|
7
6
|
import rich
|
|
8
7
|
import typer
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
)
|
|
9
|
+
from egse.system import redirect_output_to_log
|
|
10
|
+
|
|
11
|
+
daq6510 = typer.Typer(name="daq6510", help="DAQ6510 Data Acquisition Unit, Keithley, temperature monitoring")
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
@daq6510.command(name="start")
|
|
@@ -17,19 +16,39 @@ def start_daq6510():
|
|
|
17
16
|
"""Start the daq6510 service."""
|
|
18
17
|
rich.print("Starting service daq6510")
|
|
19
18
|
|
|
19
|
+
out = redirect_output_to_log("daq6510_cs.start.log")
|
|
20
|
+
|
|
21
|
+
subprocess.Popen(
|
|
22
|
+
[sys.executable, "-m", "egse.tempcontrol.keithley.daq6510_cs", "start"],
|
|
23
|
+
stdout=out,
|
|
24
|
+
stderr=out,
|
|
25
|
+
stdin=subprocess.DEVNULL,
|
|
26
|
+
close_fds=True,
|
|
27
|
+
)
|
|
28
|
+
|
|
20
29
|
|
|
21
30
|
@daq6510.command(name="stop")
|
|
22
31
|
def stop_daq6510():
|
|
23
32
|
"""Stop the daq6510 service."""
|
|
24
33
|
rich.print("Terminating service daq6510")
|
|
25
34
|
|
|
35
|
+
out = redirect_output_to_log("daq6510_cs.stop.log")
|
|
36
|
+
|
|
37
|
+
subprocess.Popen(
|
|
38
|
+
[sys.executable, "-m", "egse.tempcontrol.keithley.daq6510_cs", "stop"],
|
|
39
|
+
stdout=out,
|
|
40
|
+
stderr=out,
|
|
41
|
+
stdin=subprocess.DEVNULL,
|
|
42
|
+
close_fds=True,
|
|
43
|
+
)
|
|
44
|
+
|
|
26
45
|
|
|
27
46
|
@daq6510.command(name="status")
|
|
28
47
|
def status_daq6510():
|
|
29
48
|
"""Print status information on the daq6510 service."""
|
|
30
49
|
|
|
31
50
|
proc = subprocess.Popen(
|
|
32
|
-
[sys.executable, "-m", "egse.tempcontrol.keithley.
|
|
51
|
+
[sys.executable, "-m", "egse.tempcontrol.keithley.daq6510_cs", "status"],
|
|
33
52
|
stdout=subprocess.PIPE,
|
|
34
53
|
stderr=subprocess.PIPE,
|
|
35
54
|
stdin=subprocess.DEVNULL,
|
|
@@ -47,7 +66,7 @@ def start_daq6510_sim():
|
|
|
47
66
|
"""Start the DAQ6510 Simulator."""
|
|
48
67
|
rich.print("Starting service DAQ6510 Simulator")
|
|
49
68
|
|
|
50
|
-
out =
|
|
69
|
+
out = redirect_output_to_log("daq6510_sim.start.log")
|
|
51
70
|
|
|
52
71
|
subprocess.Popen(
|
|
53
72
|
[sys.executable, "-m", "egse.tempcontrol.keithley.daq6510_sim", "start"],
|
|
@@ -63,7 +82,7 @@ def stop_daq6510_sim():
|
|
|
63
82
|
"""Stop the DAQ6510 Simulator."""
|
|
64
83
|
rich.print("Terminating the DAQ6510 simulator.")
|
|
65
84
|
|
|
66
|
-
out =
|
|
85
|
+
out = redirect_output_to_log("daq6510_sim.stop.log")
|
|
67
86
|
|
|
68
87
|
subprocess.Popen(
|
|
69
88
|
[sys.executable, "-m", "egse.tempcontrol.keithley.daq6510_sim", "stop"],
|
|
@@ -74,5 +93,37 @@ def stop_daq6510_sim():
|
|
|
74
93
|
)
|
|
75
94
|
|
|
76
95
|
|
|
96
|
+
@daq6510.command(name="start-mon")
|
|
97
|
+
def start_daq6510_mon():
|
|
98
|
+
"""Start the daq6510 monitoring service."""
|
|
99
|
+
rich.print("Starting monitoring service daq6510_mon")
|
|
100
|
+
|
|
101
|
+
out = redirect_output_to_log("daq6510_mon.start.log")
|
|
102
|
+
|
|
103
|
+
subprocess.Popen(
|
|
104
|
+
[sys.executable, "-m", "egse.tempcontrol.keithley.daq6510_mon", "start"],
|
|
105
|
+
stdout=out,
|
|
106
|
+
stderr=out,
|
|
107
|
+
stdin=subprocess.DEVNULL,
|
|
108
|
+
close_fds=True,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
@daq6510.command(name="stop-mon")
|
|
113
|
+
def stop_daq6510_mon():
|
|
114
|
+
"""Stop the daq6510 monitoring service."""
|
|
115
|
+
rich.print("Stopping monitoring service daq6510_mon")
|
|
116
|
+
|
|
117
|
+
out = redirect_output_to_log("daq6510_mon.stop.log")
|
|
118
|
+
|
|
119
|
+
subprocess.Popen(
|
|
120
|
+
[sys.executable, "-m", "egse.tempcontrol.keithley.daq6510_mon", "stop"],
|
|
121
|
+
stdout=out,
|
|
122
|
+
stderr=out,
|
|
123
|
+
stdin=subprocess.DEVNULL,
|
|
124
|
+
close_fds=True,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
|
|
77
128
|
if __name__ == "__main__":
|
|
78
129
|
daq6510()
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
egse/tempcontrol/keithley/__init__.py,sha256=IasaUltrExCB6CgWl_ZscX51ssVq3Fn_-9V_P-gtV9I,120
|
|
2
|
+
egse/tempcontrol/keithley/daq6510.py,sha256=2ImQrL185T_hsG4Yvw5bqd5_FJ-gJnfAfgZxH-OG0yc,20629
|
|
3
|
+
egse/tempcontrol/keithley/daq6510.yaml,sha256=dHHVNyUpOQpdrZpnxPbT6slsl-8Gbnhifj4Q8QOfOYg,4400
|
|
4
|
+
egse/tempcontrol/keithley/daq6510_adev.py,sha256=wIE-vyDZK9OrT9fio-FWSKEzmTGNQCFh2meiLBinsmY,2586
|
|
5
|
+
egse/tempcontrol/keithley/daq6510_amon.py,sha256=cUgA_ARcEMHzf-_41-c-13KVReAipFCBa6dwiZn-lYE,21330
|
|
6
|
+
egse/tempcontrol/keithley/daq6510_cs.py,sha256=gfq0pnTlmVSrMPRnbYJLslNquFPpCO80Ynb0ZBC5YuU,8441
|
|
7
|
+
egse/tempcontrol/keithley/daq6510_dev.py,sha256=3LMPxmlcuQ3nFy-XTOUnyDOGhWMHLEJGxj0wxK9OT-Q,5212
|
|
8
|
+
egse/tempcontrol/keithley/daq6510_mon.py,sha256=a5a5ke9j2kjsWWnHhelHkzXP0EaO4MeuRNR7LcsSx6k,11113
|
|
9
|
+
egse/tempcontrol/keithley/daq6510_protocol.py,sha256=xBAo7Rd_C4Ts-Tt21EtweEadXKnOtfs-GgnLtugSTsQ,3428
|
|
10
|
+
egse/tempcontrol/keithley/daq6510_sim.py,sha256=Jstq00LcNzji8fVWMxmLpRExDC-Y8zeCJL1Gl5OcD_I,9979
|
|
11
|
+
keithley_tempcontrol/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
keithley_tempcontrol/cgse_explore.py,sha256=y_FkFxJW0vdqGNp9yTU0ELBKxby74-ev3fTuf99Vl1s,400
|
|
13
|
+
keithley_tempcontrol/cgse_services.py,sha256=LUk_Gk8RCzyRVzvmEkO0Dtz1dwfWpBN0VVCpRY9OFXg,3333
|
|
14
|
+
keithley_tempcontrol/settings.yaml,sha256=wbrgSZQAdqFl6AxiLJIN36UsdiVHQCzdsgi7Hs7dv7o,1467
|
|
15
|
+
keithley_tempcontrol-0.18.1.dist-info/METADATA,sha256=otqtIXT5UpVDLpa-jZ66j-B0TTxXbi2l4_hgoQNeSAc,962
|
|
16
|
+
keithley_tempcontrol-0.18.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
17
|
+
keithley_tempcontrol-0.18.1.dist-info/entry_points.txt,sha256=eo5NMMjip3sejDbn3uZvm9kgZt_EYcepuhaCu_mixic,547
|
|
18
|
+
keithley_tempcontrol-0.18.1.dist-info/RECORD,,
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
egse/tempcontrol/keithley/__init__.py,sha256=QMm0vy6OMqzWmJZ1K6IwKSOpgYeCmUdbcRhv75LH9ZY,130
|
|
2
|
-
egse/tempcontrol/keithley/daq6510.py,sha256=QA3K0xJ_-bsY6D4jzOyeDHz1uYSrgf8Z8O-9RynCB5E,24711
|
|
3
|
-
egse/tempcontrol/keithley/daq6510.yaml,sha256=dHHVNyUpOQpdrZpnxPbT6slsl-8Gbnhifj4Q8QOfOYg,4400
|
|
4
|
-
egse/tempcontrol/keithley/daq6510_adev.py,sha256=kodJGonsy_whr15XbVC5CA94mMqm1036FGK0DXmZtxo,3482
|
|
5
|
-
egse/tempcontrol/keithley/daq6510_cs.py,sha256=YVmUtEkGZ0ZKQ7BtvloL_da_fSy_rVr0EB1V2SjLdq0,6089
|
|
6
|
-
egse/tempcontrol/keithley/daq6510_dev.py,sha256=ZjzDU3x7XYRLRoNK9lcqE-t32XDMt0IHW26GO87xt98,10780
|
|
7
|
-
egse/tempcontrol/keithley/daq6510_mon.py,sha256=uox4IaHKwC_hXDQpj4sGEnZyK-dKXjqQdZ2yiaCbt_c,19103
|
|
8
|
-
egse/tempcontrol/keithley/daq6510_protocol.py,sha256=fdcJxsOFYaEDVIY4XzLVC4PSIAL20gKj8os8f0nsSh4,3655
|
|
9
|
-
egse/tempcontrol/keithley/daq6510_sim.py,sha256=GHC7NY2NZ5fm20AjMx7glSGWY1OOynndHUnCPcs5MZM,7568
|
|
10
|
-
keithley_tempcontrol/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
keithley_tempcontrol/cgse_explore.py,sha256=y_FkFxJW0vdqGNp9yTU0ELBKxby74-ev3fTuf99Vl1s,400
|
|
12
|
-
keithley_tempcontrol/cgse_services.py,sha256=H62jEzwRQMvKjkefFw9mSQTYRnT8ga_-SdJ26gPaUE8,1960
|
|
13
|
-
keithley_tempcontrol/settings.yaml,sha256=wbrgSZQAdqFl6AxiLJIN36UsdiVHQCzdsgi7Hs7dv7o,1467
|
|
14
|
-
keithley_tempcontrol-0.17.3.dist-info/METADATA,sha256=JhlNFJaYoCoFBeh8A3boUq3XSNPLxJs72_0NrW7BgcY,962
|
|
15
|
-
keithley_tempcontrol-0.17.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
16
|
-
keithley_tempcontrol-0.17.3.dist-info/entry_points.txt,sha256=_0j2BwcwPi4LlRrhvEWfp9GO9KT8WhCkJe2gFgMzOPs,491
|
|
17
|
-
keithley_tempcontrol-0.17.3.dist-info/RECORD,,
|
|
File without changes
|