symetrie-hexapod 0.16.10__py3-none-any.whl → 0.16.12__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/hexapod/symetrie/__init__.py +2 -0
- egse/hexapod/symetrie/pmac.py +18 -6
- egse/hexapod/symetrie/pmac_regex.py +5 -1
- egse/hexapod/symetrie/puna_ui.py +27 -25
- symetrie_hexapod/settings.yaml +1 -0
- {symetrie_hexapod-0.16.10.dist-info → symetrie_hexapod-0.16.12.dist-info}/METADATA +1 -1
- {symetrie_hexapod-0.16.10.dist-info → symetrie_hexapod-0.16.12.dist-info}/RECORD +9 -9
- {symetrie_hexapod-0.16.10.dist-info → symetrie_hexapod-0.16.12.dist-info}/entry_points.txt +1 -1
- {symetrie_hexapod-0.16.10.dist-info → symetrie_hexapod-0.16.12.dist-info}/WHEEL +0 -0
|
@@ -102,6 +102,8 @@ class ProxyFactory(DeviceFactoryInterface):
|
|
|
102
102
|
"""
|
|
103
103
|
|
|
104
104
|
def create(self, device_type: str, *, device_id: str = None, **_ignored):
|
|
105
|
+
logger.debug(f"{device_type=}, {device_id=}")
|
|
106
|
+
|
|
105
107
|
with RegistryClient() as reg:
|
|
106
108
|
service = reg.discover_service(device_id)
|
|
107
109
|
|
egse/hexapod/symetrie/pmac.py
CHANGED
|
@@ -15,11 +15,14 @@ from datetime import datetime
|
|
|
15
15
|
from datetime import timedelta
|
|
16
16
|
from typing import List
|
|
17
17
|
|
|
18
|
+
from egse.env import bool_env
|
|
18
19
|
from egse.hexapod.symetrie import logger
|
|
19
20
|
from egse.hexapod.symetrie.pmac_regex import match_float_response
|
|
20
21
|
from egse.hexapod.symetrie.pmac_regex import match_int_response
|
|
21
22
|
from egse.hexapod.symetrie.pmac_regex import match_string_response
|
|
22
23
|
|
|
24
|
+
VERBOSE_DEBUG = bool_env("VERBOSE_DEBUG")
|
|
25
|
+
|
|
23
26
|
# Command set Request
|
|
24
27
|
|
|
25
28
|
VR_PMAC_SENDLINE = 0xB0
|
|
@@ -517,7 +520,8 @@ class EthernetCommand:
|
|
|
517
520
|
headerStr = struct.pack(">BBHHH", self.requestType, self.request, self.value, self.index, len(command))
|
|
518
521
|
wrappedCommand = headerStr + command.encode()
|
|
519
522
|
|
|
520
|
-
|
|
523
|
+
if VERBOSE_DEBUG:
|
|
524
|
+
logger.debug(f"Command Packet generated: {wrappedCommand}")
|
|
521
525
|
|
|
522
526
|
return wrappedCommand
|
|
523
527
|
|
|
@@ -729,13 +733,17 @@ class PmacEthernetInterface(object):
|
|
|
729
733
|
|
|
730
734
|
# Attempt to send the complete command to PMAC
|
|
731
735
|
|
|
732
|
-
|
|
736
|
+
if VERBOSE_DEBUG:
|
|
737
|
+
logger.debug(f"Sending out to PMAC: {command}")
|
|
738
|
+
|
|
733
739
|
self.sock.sendall(self.getResponseCommand.getCommandPacket(command))
|
|
734
740
|
|
|
735
741
|
# wait for, read and return the response from PMAC (will be at most 1400 chars)
|
|
736
742
|
|
|
737
743
|
returnStr = self.sock.recv(2048)
|
|
738
|
-
|
|
744
|
+
|
|
745
|
+
if VERBOSE_DEBUG:
|
|
746
|
+
logger.debug(f"Received from PMAC: {returnStr}")
|
|
739
747
|
|
|
740
748
|
return returnStr
|
|
741
749
|
|
|
@@ -798,7 +806,9 @@ class PmacEthernetInterface(object):
|
|
|
798
806
|
for qVar in qVars:
|
|
799
807
|
cmd += f"Q{qVar:02} "
|
|
800
808
|
retStr = self.getResponse(cmd)
|
|
801
|
-
|
|
809
|
+
|
|
810
|
+
if VERBOSE_DEBUG:
|
|
811
|
+
logger.debug(f"retStr={retStr} of type {type(retStr)}")
|
|
802
812
|
|
|
803
813
|
if retStr == b"\x00":
|
|
804
814
|
raise PMACError(f"No response received for {cmd}, return value is {retStr}")
|
|
@@ -949,11 +959,13 @@ class PmacEthernetInterface(object):
|
|
|
949
959
|
else:
|
|
950
960
|
fullCommand = cmd["cmd"]
|
|
951
961
|
|
|
952
|
-
|
|
962
|
+
if VERBOSE_DEBUG:
|
|
963
|
+
logger.debug(f"Sending the {cmd['name']} command.")
|
|
953
964
|
|
|
954
965
|
retStr = self.getResponse(fullCommand)
|
|
955
966
|
|
|
956
|
-
|
|
967
|
+
if VERBOSE_DEBUG:
|
|
968
|
+
logger.debug(f"Command '{cmd['name']}' returned \"{retStr}\"")
|
|
957
969
|
|
|
958
970
|
# Check the return code (usually Q20)
|
|
959
971
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import re
|
|
2
2
|
|
|
3
|
+
from egse.env import bool_env
|
|
3
4
|
from egse.hexapod.symetrie import logger
|
|
4
5
|
|
|
6
|
+
VERBOSE_DEBUG = bool_env("VERBOSE_DEBUG")
|
|
7
|
+
|
|
5
8
|
regex_response = {
|
|
6
9
|
# Error message as ERRXXX
|
|
7
10
|
"ERROR": re.compile(r"\a(ERR\d{3})\r"),
|
|
@@ -24,7 +27,8 @@ def match_regex_response(regex_prog, res):
|
|
|
24
27
|
|
|
25
28
|
Return None if no match and the match object otherwise.
|
|
26
29
|
"""
|
|
27
|
-
|
|
30
|
+
if VERBOSE_DEBUG:
|
|
31
|
+
logger.debug(f"res = {res} with type {type(res)}")
|
|
28
32
|
if isinstance(res, bytes):
|
|
29
33
|
res = res.decode()
|
|
30
34
|
match_obj = regex_prog.match(res)
|
egse/hexapod/symetrie/puna_ui.py
CHANGED
|
@@ -15,45 +15,45 @@ platform that supports Python and Qt5.
|
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
import argparse
|
|
18
|
-
import logging
|
|
19
18
|
import multiprocessing
|
|
20
19
|
import sys
|
|
21
20
|
import threading
|
|
22
21
|
from enum import IntEnum
|
|
23
22
|
from pathlib import Path
|
|
24
23
|
|
|
24
|
+
import typer
|
|
25
25
|
from PyQt5.QtCore import QLockFile
|
|
26
|
-
|
|
27
|
-
from egse.hexapod.symetrie import ControllerFactory
|
|
28
|
-
from egse.hexapod.symetrie import ProxyFactory
|
|
29
|
-
from egse.hexapod.symetrie import get_hexapod_controller_pars
|
|
30
|
-
from egse.hexapod.symetrie.punaplus import PunaPlusController
|
|
31
|
-
from egse.hexapod.symetrie.punaplus import PunaPlusProxy
|
|
32
|
-
|
|
33
|
-
multiprocessing.current_process().name = "puna_ui"
|
|
34
|
-
|
|
35
26
|
from PyQt5.QtGui import QIcon
|
|
36
|
-
from PyQt5.QtWidgets import QApplication
|
|
27
|
+
from PyQt5.QtWidgets import QApplication
|
|
37
28
|
from PyQt5.QtWidgets import QFrame
|
|
38
29
|
from PyQt5.QtWidgets import QHBoxLayout
|
|
30
|
+
from PyQt5.QtWidgets import QMessageBox
|
|
39
31
|
from PyQt5.QtWidgets import QVBoxLayout
|
|
40
|
-
from prometheus_client import start_http_server
|
|
41
32
|
|
|
42
33
|
from egse.gui import show_warning_message
|
|
43
34
|
from egse.gui.led import Indic
|
|
44
35
|
from egse.gui.states import States
|
|
36
|
+
from egse.hexapod.symetrie import ControllerFactory
|
|
37
|
+
from egse.hexapod.symetrie import ProxyFactory
|
|
38
|
+
from egse.hexapod.symetrie import get_hexapod_controller_pars
|
|
45
39
|
from egse.hexapod.symetrie.hexapod_ui import ActuatorStates
|
|
46
40
|
from egse.hexapod.symetrie.hexapod_ui import HexapodUIController
|
|
47
41
|
from egse.hexapod.symetrie.hexapod_ui import HexapodUIModel
|
|
48
42
|
from egse.hexapod.symetrie.hexapod_ui import HexapodUIView
|
|
49
43
|
from egse.hexapod.symetrie.puna import PunaSimulator
|
|
44
|
+
from egse.hexapod.symetrie.punaplus import PunaPlusController
|
|
45
|
+
from egse.hexapod.symetrie.punaplus import PunaPlusProxy
|
|
46
|
+
from egse.log import logging
|
|
50
47
|
from egse.process import ProcessStatus
|
|
51
48
|
from egse.resource import get_resource
|
|
52
49
|
from egse.settings import Settings
|
|
53
50
|
from egse.system import do_every
|
|
51
|
+
from dotenv import load_dotenv
|
|
54
52
|
|
|
55
53
|
MODULE_LOGGER = logging.getLogger(__name__)
|
|
56
54
|
|
|
55
|
+
load_dotenv(override=True)
|
|
56
|
+
|
|
57
57
|
|
|
58
58
|
class DeviceControllerType(IntEnum):
|
|
59
59
|
ALPHA = 0
|
|
@@ -283,8 +283,8 @@ class PunaUIView(HexapodUIView):
|
|
|
283
283
|
|
|
284
284
|
|
|
285
285
|
class PunaUIModel(HexapodUIModel):
|
|
286
|
-
def __init__(self, connection_type):
|
|
287
|
-
hostname, port, dev_id, dev_name, _ = get_hexapod_controller_pars()
|
|
286
|
+
def __init__(self, connection_type, device_id):
|
|
287
|
+
hostname, port, dev_id, dev_name, *_ = get_hexapod_controller_pars(device_id)
|
|
288
288
|
if connection_type == "proxy":
|
|
289
289
|
device = ProxyFactory().create(dev_name, device_id=dev_id)
|
|
290
290
|
elif connection_type == "direct":
|
|
@@ -346,15 +346,19 @@ def parse_arguments():
|
|
|
346
346
|
return parser.parse_args()
|
|
347
347
|
|
|
348
348
|
|
|
349
|
-
|
|
349
|
+
app = typer.Typer()
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
@app.command()
|
|
353
|
+
def main(device_id: str, device_type: str = "proxy", profile: bool = False):
|
|
354
|
+
multiprocessing.current_process().name = "puna_ui"
|
|
355
|
+
|
|
350
356
|
lock_file = QLockFile(str(Path("~/puna_ui.app.lock").expanduser()))
|
|
351
357
|
|
|
352
358
|
styles_location = get_resource(":/styles/default.qss")
|
|
353
359
|
app_logo = get_resource(":/icons/logo-puna.svg")
|
|
354
360
|
|
|
355
|
-
|
|
356
|
-
args[1:1] = ["-stylesheet", str(styles_location)]
|
|
357
|
-
app = QApplication(args)
|
|
361
|
+
app = QApplication(["-stylesheet", str(styles_location)])
|
|
358
362
|
app.setWindowIcon(QIcon(str(app_logo)))
|
|
359
363
|
|
|
360
364
|
if lock_file.tryLock(100):
|
|
@@ -364,13 +368,11 @@ def main():
|
|
|
364
368
|
timer_thread.daemon = True
|
|
365
369
|
timer_thread.start()
|
|
366
370
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
if args.profile:
|
|
371
|
+
if profile:
|
|
370
372
|
Settings.set_profiling(True)
|
|
371
373
|
|
|
372
|
-
if
|
|
373
|
-
|
|
374
|
+
if device_type == "proxy":
|
|
375
|
+
_, _, device_id, device_name, *_ = get_hexapod_controller_pars(device_id)
|
|
374
376
|
factory = ProxyFactory()
|
|
375
377
|
proxy = factory.create(device_name, device_id=device_id)
|
|
376
378
|
if not proxy.ping():
|
|
@@ -385,7 +387,7 @@ def main():
|
|
|
385
387
|
|
|
386
388
|
show_warning_message(description, info_text)
|
|
387
389
|
|
|
388
|
-
model = PunaUIModel(
|
|
390
|
+
model = PunaUIModel(device_type, device_id)
|
|
389
391
|
view = PunaUIView(model.get_device_controller_type(), model.device_id)
|
|
390
392
|
PunaUIController(model, view)
|
|
391
393
|
|
|
@@ -405,4 +407,4 @@ def main():
|
|
|
405
407
|
if __name__ == "__main__":
|
|
406
408
|
logging.basicConfig(level=logging.DEBUG, format=Settings.LOG_FORMAT_FULL)
|
|
407
409
|
|
|
408
|
-
sys.exit(
|
|
410
|
+
sys.exit(app())
|
symetrie_hexapod/settings.yaml
CHANGED
|
@@ -6,6 +6,7 @@ PUNA Alpha+ Controller:
|
|
|
6
6
|
password: provide password in local settings
|
|
7
7
|
|
|
8
8
|
Hexapod Control Server:
|
|
9
|
+
SERVICE_TYPE: puna
|
|
9
10
|
PROTOCOL: tcp
|
|
10
11
|
HOSTNAME: localhost # The hostname that client shall connect to, e.g. on the same machine
|
|
11
12
|
COMMANDING_PORT: 0 # The port on which the controller listens to commands - REQ-REP
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
egse/hexapod/__init__.py,sha256=a-pdJ5j5XcLPaiz-zLIjfyJjFFUnbl_sOdasMp0UwEI,918
|
|
2
|
-
egse/hexapod/symetrie/__init__.py,sha256=
|
|
2
|
+
egse/hexapod/symetrie/__init__.py,sha256=TzNC_EIL5wQTyVYFXh8N5sVSjQHdA8fY1NdDtT2ZtUE,6621
|
|
3
3
|
egse/hexapod/symetrie/alpha.py,sha256=cEuNtOd5BPW4zSo4HpKyCsvcDj_YBjZHhPcBa4UXnxw,33277
|
|
4
4
|
egse/hexapod/symetrie/dynalpha.py,sha256=HuDopBZygBaAPb5CGl9jmeTa-pN23EBiIIlx_IjPrMA,55145
|
|
5
5
|
egse/hexapod/symetrie/hexapod.py,sha256=YZggPY2xJrD-jOzNWz8EutUs6hS0qFLW02h42Ol5q3w,19023
|
|
@@ -9,14 +9,14 @@ egse/hexapod/symetrie/joran.yaml,sha256=p97aPO3JnNJqCyz6Md8Odkj3lX0m5ODhtdqwbAsU
|
|
|
9
9
|
egse/hexapod/symetrie/joran_cs.py,sha256=MB_sNpD0WpXLs219OfsSD7RaMPt8QaVIqX2zeWqNaVU,5365
|
|
10
10
|
egse/hexapod/symetrie/joran_protocol.py,sha256=E4GX0uE7evXANChN0R3akTKP_ipjAw-Ecc2NlUDrfF0,4444
|
|
11
11
|
egse/hexapod/symetrie/joran_ui.py,sha256=b8IjBPSpkHOr8kpoKYIhfiYYnKVjlVx-IRwjFpno7L8,14162
|
|
12
|
-
egse/hexapod/symetrie/pmac.py,sha256=
|
|
13
|
-
egse/hexapod/symetrie/pmac_regex.py,sha256
|
|
12
|
+
egse/hexapod/symetrie/pmac.py,sha256=8I6UzDUZjT2MtlI4ImZB68Mz6nFEHVJAu1YpvGd2iVw,30266
|
|
13
|
+
egse/hexapod/symetrie/pmac_regex.py,sha256=hS5wzrdT5FzQEYYDS5suur3yoIZKxBX7cRri2sGPOoE,2593
|
|
14
14
|
egse/hexapod/symetrie/puna.py,sha256=99hhOgrDjVFW-Kr8nw2UVL6WXPQ_0MPNlfc8Ge5Letc,22727
|
|
15
15
|
egse/hexapod/symetrie/puna.yaml,sha256=u_oEgIfuxt6ebWoZaADtO4cFpSVuUgMjG0G7y1_Nc0w,8534
|
|
16
16
|
egse/hexapod/symetrie/puna_cs.py,sha256=4Se4RAYYrw_2QKW2q03h3rMyTcBQPr7hN5Lyt3tmJNw,8048
|
|
17
17
|
egse/hexapod/symetrie/puna_protocol.py,sha256=6EgKpmQQZXLyqelWVxQGZUrAjABwSkhEYsgGizxCsSs,5010
|
|
18
18
|
egse/hexapod/symetrie/puna_sim.py,sha256=mzrAvXFV3e1rNeSy-MinioeHyX6RBtgy55mtdJWOQnY,7779
|
|
19
|
-
egse/hexapod/symetrie/puna_ui.py,sha256=
|
|
19
|
+
egse/hexapod/symetrie/puna_ui.py,sha256=GaeBRhBobHVgB9vDoygqsp7LbDXbNFh9RgEXCfqgHwg,13524
|
|
20
20
|
egse/hexapod/symetrie/punaplus.py,sha256=4O2uRi6rah_qRnHfuzoCsyc2fzkvSUxiDkRos47y2Mk,3428
|
|
21
21
|
egse/hexapod/symetrie/zonda.py,sha256=jgPQh6ajt_LUI8Co0vyxwrgnZ5oG3szNPu3eqanohWM,29509
|
|
22
22
|
egse/hexapod/symetrie/zonda.yaml,sha256=MC4kQ9k1USAUZOgDS1-Yi331LYq53JSRIDQh4VZXUNw,18737
|
|
@@ -27,8 +27,8 @@ egse/hexapod/symetrie/zonda_ui.py,sha256=IYqymUL_sSmIgeJf8jY_pocsyfi36XzJeZCaMCh
|
|
|
27
27
|
symetrie_hexapod/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
symetrie_hexapod/cgse_explore.py,sha256=0Pnz4fwbTQBRHoliF_dIJclK-7AaHmDRsAvsOuzDoGg,423
|
|
29
29
|
symetrie_hexapod/cgse_services.py,sha256=krF8Lk1uTNiRdZIxuaWtEDt8Q1cxpXOd0qgT9yefbOE,5350
|
|
30
|
-
symetrie_hexapod/settings.yaml,sha256=
|
|
31
|
-
symetrie_hexapod-0.16.
|
|
32
|
-
symetrie_hexapod-0.16.
|
|
33
|
-
symetrie_hexapod-0.16.
|
|
34
|
-
symetrie_hexapod-0.16.
|
|
30
|
+
symetrie_hexapod/settings.yaml,sha256=7tz8INhWSXV7bPTLYkS_06fYuMeeRiKRLuIW1_LnpX8,946
|
|
31
|
+
symetrie_hexapod-0.16.12.dist-info/METADATA,sha256=HrqsWdUrO4vpQrc8492aG8i_TGOqiXGLd13MomN86ic,651
|
|
32
|
+
symetrie_hexapod-0.16.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
33
|
+
symetrie_hexapod-0.16.12.dist-info/entry_points.txt,sha256=e_AmaY0OtfoHHnxDS2M0dbkZmPY38juEp42ZTwQtQkY,664
|
|
34
|
+
symetrie_hexapod-0.16.12.dist-info/RECORD,,
|
|
@@ -5,7 +5,7 @@ zonda_cs = egse.hexapod.symetrie.zonda_cs:app
|
|
|
5
5
|
|
|
6
6
|
[gui_scripts]
|
|
7
7
|
joran_ui = egse.hexapod.symetrie.joran_ui:main
|
|
8
|
-
puna_ui = egse.hexapod.symetrie.puna_ui:
|
|
8
|
+
puna_ui = egse.hexapod.symetrie.puna_ui:app
|
|
9
9
|
zonda_ui = egse.hexapod.symetrie.zonda_ui:main
|
|
10
10
|
|
|
11
11
|
[cgse.explore]
|
|
File without changes
|