MultiPyVu 3.2.0__tar.gz → 3.3.0__tar.gz
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.
- {multipyvu-3.2.0/src/MultiPyVu.egg-info → multipyvu-3.3.0}/PKG-INFO +9 -1
- {multipyvu-3.2.0 → multipyvu-3.3.0}/README.md +8 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/CommandChamber.py +3 -7
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/CommandField.py +4 -8
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/CommandMultiVu.py +2 -3
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/CommandSdo.py +12 -18
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/CommandTemperature.py +3 -7
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/CommandWaitFor.py +5 -11
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/Command_factory.py +3 -3
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/ICommand.py +8 -8
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/IServer.py +1 -1
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/MultiVuClient.py +5 -12
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/MultiVuClient_base.py +6 -15
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/MultiVuDataFile/MultiVuDataFile.py +6 -5
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/MultiVuServer.py +9 -16
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/ParseInputs.py +1 -3
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/SocketMessage.py +21 -7
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/SocketMessageClient.py +3 -6
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/__init__.py +12 -7
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/__version.py +1 -1
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/instrument.py +3 -3
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/logging_config.py +3 -2
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/logging_config.yaml +2 -1
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/project_vars.py +0 -1
- {multipyvu-3.2.0 → multipyvu-3.3.0/src/MultiPyVu.egg-info}/PKG-INFO +9 -1
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu.egg-info/SOURCES.txt +0 -1
- multipyvu-3.2.0/src/MultiPyVu/GetRunningProcesses.py +0 -28
- {multipyvu-3.2.0 → multipyvu-3.3.0}/LICENSE +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/pyproject.toml +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/setup.cfg +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/setup.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/BRT.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/IEventManager.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/MultiVuDataFile/__init__.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/MultiVuDataFile/__version.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/MultiVuDataFile/is_pathname_valid.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/SocketMessageServer.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/__main__.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/check_windows_esc.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/exceptions.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/font/Play-Bold.ttf +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/font/Play-Regular.ttf +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/font/__init__.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/generate_sdo_objects.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/gui/Controller.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/gui/IController.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/gui/IView.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/gui/ViewFactory.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/gui/ViewTk.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/gui/__init__.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/images/Q.png +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/images/QD_logo.jpg +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/images/__init__.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/scripts/__init__.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/scripts/helper_scripts.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/scripts/whats_my_ip_address.cmd +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu/sdo_object.py +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu.egg-info/dependency_links.txt +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu.egg-info/requires.txt +0 -0
- {multipyvu-3.2.0 → multipyvu-3.3.0}/src/MultiPyVu.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: MultiPyVu
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
4
4
|
Summary: Control MultiVu using Python
|
|
5
5
|
Author-email: Damon D Jackson <djackson@qdusa.com>
|
|
6
6
|
Maintainer-email: "Quantum Design, Inc." <apps@qdusa.com>
|
|
@@ -435,6 +435,14 @@ client = mpv.Client(port=6000)
|
|
|
435
435
|
- A log file named QdMultiVu.log shows the traffic between the server and client which can also be useful during troubleshooting.
|
|
436
436
|
|
|
437
437
|
## Changelog<a class="anchor" id="changelog"></a>
|
|
438
|
+
**3.3.0**
|
|
439
|
+
- April 2025
|
|
440
|
+
- Bugfix which didn't allow this to be run on Mac or Linux platforms.
|
|
441
|
+
- Refactored mpv.DataFile() so that if a script is saving data to a file,
|
|
442
|
+
it can later load the file into a Pandas Dataframe without specifying the
|
|
443
|
+
filename. This means the file path is now optional in
|
|
444
|
+
.parse_MVu_data_file().
|
|
445
|
+
|
|
438
446
|
**3.2.0**
|
|
439
447
|
- November 2024
|
|
440
448
|
- Improvements in determining the running version of MultiVu.
|
|
@@ -390,6 +390,14 @@ client = mpv.Client(port=6000)
|
|
|
390
390
|
- A log file named QdMultiVu.log shows the traffic between the server and client which can also be useful during troubleshooting.
|
|
391
391
|
|
|
392
392
|
## Changelog<a class="anchor" id="changelog"></a>
|
|
393
|
+
**3.3.0**
|
|
394
|
+
- April 2025
|
|
395
|
+
- Bugfix which didn't allow this to be run on Mac or Linux platforms.
|
|
396
|
+
- Refactored mpv.DataFile() so that if a script is saving data to a file,
|
|
397
|
+
it can later load the file into a Pandas Dataframe without specifying the
|
|
398
|
+
filename. This means the file path is now optional in
|
|
399
|
+
.parse_MVu_data_file().
|
|
400
|
+
|
|
393
401
|
**3.2.0**
|
|
394
402
|
- November 2024
|
|
395
403
|
- Improvements in determining the running version of MultiVu.
|
|
@@ -9,15 +9,11 @@ Created on Tue May 18 13:14:28 2021
|
|
|
9
9
|
|
|
10
10
|
from abc import abstractmethod
|
|
11
11
|
from enum import IntEnum
|
|
12
|
-
from typing import
|
|
12
|
+
from typing import Dict, List, Tuple, Union
|
|
13
13
|
|
|
14
14
|
from .exceptions import MultiPyVuError
|
|
15
|
-
from .ICommand import (ICommand,
|
|
16
|
-
|
|
17
|
-
ISimulateChange,
|
|
18
|
-
ICommandObserverSim,
|
|
19
|
-
catch_thread_error,
|
|
20
|
-
)
|
|
15
|
+
from .ICommand import (ICommand, ICommandImp, ICommandObserverSim,
|
|
16
|
+
ISimulateChange, catch_thread_error)
|
|
21
17
|
from .IEventManager import IObserver
|
|
22
18
|
|
|
23
19
|
|
|
@@ -7,19 +7,15 @@ Created on Tue May 18 13:14:28 2021
|
|
|
7
7
|
@author: djackson
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
from abc import abstractmethod
|
|
11
10
|
import time
|
|
11
|
+
from abc import abstractmethod
|
|
12
12
|
from enum import IntEnum
|
|
13
|
-
from typing import
|
|
13
|
+
from typing import Dict, List, Tuple, Union
|
|
14
14
|
|
|
15
15
|
from .check_windows_esc import _check_windows_esc
|
|
16
16
|
from .exceptions import MultiPyVuError
|
|
17
|
-
from .ICommand import (ICommand,
|
|
18
|
-
|
|
19
|
-
ISimulateChange,
|
|
20
|
-
ICommandObserverSim,
|
|
21
|
-
catch_thread_error,
|
|
22
|
-
)
|
|
17
|
+
from .ICommand import (ICommand, ICommandImp, ICommandObserverSim,
|
|
18
|
+
ISimulateChange, catch_thread_error)
|
|
23
19
|
from .IEventManager import IObserver
|
|
24
20
|
from .project_vars import CLOCK_TIME
|
|
25
21
|
|
|
@@ -13,17 +13,16 @@ Created on Sat June 12 17:35:28 2021
|
|
|
13
13
|
import logging
|
|
14
14
|
from abc import abstractmethod
|
|
15
15
|
from sys import platform
|
|
16
|
-
from typing import
|
|
16
|
+
from typing import Dict, Tuple
|
|
17
17
|
|
|
18
18
|
from .exceptions import MultiPyVuError, PythoncomImportError
|
|
19
19
|
from .ICommand import ICommand
|
|
20
20
|
from .project_vars import SERVER_NAME
|
|
21
21
|
|
|
22
|
-
|
|
23
22
|
if platform == 'win32':
|
|
24
23
|
try:
|
|
25
|
-
import win32com.client as win32
|
|
26
24
|
import pythoncom
|
|
25
|
+
import win32com.client as win32
|
|
27
26
|
except ImportError:
|
|
28
27
|
raise PythoncomImportError
|
|
29
28
|
|
|
@@ -4,29 +4,23 @@ CommandSdo.py is used to read and write SDOs
|
|
|
4
4
|
@author: djackson
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
import struct
|
|
8
|
-
import re
|
|
9
7
|
import logging
|
|
8
|
+
import re
|
|
9
|
+
import struct
|
|
10
10
|
from abc import abstractmethod
|
|
11
11
|
from sys import platform
|
|
12
|
-
from typing import
|
|
13
|
-
|
|
14
|
-
from .exceptions import (MultiPyVuError,
|
|
15
|
-
|
|
16
|
-
CanError,
|
|
17
|
-
can_err_enum,
|
|
18
|
-
abort_err_enum,
|
|
19
|
-
PythoncomImportError
|
|
20
|
-
)
|
|
12
|
+
from typing import Dict, Tuple, Union
|
|
13
|
+
|
|
14
|
+
from .exceptions import (CanError, MultiPyVuError, PwinComError,
|
|
15
|
+
PythoncomImportError, abort_err_enum, can_err_enum)
|
|
21
16
|
from .ICommand import ICommand
|
|
22
|
-
from .project_vars import
|
|
17
|
+
from .project_vars import CLIENT_NAME, SERVER_NAME
|
|
23
18
|
from .sdo_object import SdoObject, val_type
|
|
24
19
|
|
|
25
|
-
|
|
26
20
|
if platform == 'win32':
|
|
27
21
|
try:
|
|
28
|
-
import win32com.client as win32
|
|
29
22
|
import pythoncom
|
|
23
|
+
import win32com.client as win32
|
|
30
24
|
from pywintypes import com_error as pywin_com_error
|
|
31
25
|
except ImportError:
|
|
32
26
|
raise PythoncomImportError
|
|
@@ -85,9 +79,9 @@ class CommandSdoBase(ICommand):
|
|
|
85
79
|
can_err_as_str, abort_err_as_str = search_rslt
|
|
86
80
|
can_err_as_int = int(can_err_as_str)
|
|
87
81
|
abort_err_as_int = int(abort_err_as_str)
|
|
88
|
-
except BaseException:
|
|
82
|
+
except BaseException as e:
|
|
89
83
|
msg = 'String can not be converted into two numbers'
|
|
90
|
-
raise ValueError(f'{msg}: {err_str}')
|
|
84
|
+
raise ValueError(f'{msg}: {err_str}') from e
|
|
91
85
|
return can_err_as_int, abort_err_as_int
|
|
92
86
|
|
|
93
87
|
def convert_result(self, response: Dict) -> Tuple:
|
|
@@ -189,8 +183,8 @@ class CommandSdoImp(CommandSdoBase):
|
|
|
189
183
|
|
|
190
184
|
def _binary_to_value(self,
|
|
191
185
|
sdo: SdoObject,
|
|
192
|
-
length
|
|
193
|
-
val
|
|
186
|
+
length,
|
|
187
|
+
val) -> Union[str, int, float]:
|
|
194
188
|
"""
|
|
195
189
|
Convert a binary value from reading an SDO into its correct
|
|
196
190
|
type.
|
|
@@ -10,16 +10,12 @@ Created on Tue May 18 13:14:28 2021
|
|
|
10
10
|
import time
|
|
11
11
|
from abc import abstractmethod
|
|
12
12
|
from enum import IntEnum
|
|
13
|
-
from typing import
|
|
13
|
+
from typing import Dict, List, Tuple, Union
|
|
14
14
|
|
|
15
15
|
from .check_windows_esc import _check_windows_esc
|
|
16
16
|
from .exceptions import MultiPyVuError
|
|
17
|
-
from .ICommand import (ICommand,
|
|
18
|
-
|
|
19
|
-
ISimulateChange,
|
|
20
|
-
ICommandObserverSim,
|
|
21
|
-
catch_thread_error,
|
|
22
|
-
)
|
|
17
|
+
from .ICommand import (ICommand, ICommandImp, ICommandObserverSim,
|
|
18
|
+
ISimulateChange, catch_thread_error)
|
|
23
19
|
from .IEventManager import IObserver
|
|
24
20
|
from .project_vars import CLOCK_TIME
|
|
25
21
|
|
|
@@ -10,28 +10,22 @@ import time
|
|
|
10
10
|
from abc import abstractmethod
|
|
11
11
|
from enum import IntEnum
|
|
12
12
|
from sys import platform
|
|
13
|
-
from typing import
|
|
13
|
+
from typing import Dict, List, Tuple, Union
|
|
14
14
|
|
|
15
15
|
from .check_windows_esc import _check_windows_esc
|
|
16
16
|
from .CommandChamber import SimulateChamberChange
|
|
17
17
|
from .CommandField import SimulateFieldChange
|
|
18
18
|
from .CommandTemperature import SimulateTemperatureChange
|
|
19
|
-
from .exceptions import (MultiPyVuError,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
can_err_enum,
|
|
23
|
-
)
|
|
19
|
+
from .exceptions import (CanError, MultiPyVuError, PythoncomImportError,
|
|
20
|
+
can_err_enum)
|
|
21
|
+
from .ICommand import ICommand, ICommandImp, ISimulateChange
|
|
24
22
|
from .IEventManager import IObserver
|
|
25
|
-
from .ICommand import (ICommand,
|
|
26
|
-
ICommandImp,
|
|
27
|
-
ISimulateChange
|
|
28
|
-
)
|
|
29
23
|
from .project_vars import CLOCK_TIME
|
|
30
24
|
|
|
31
25
|
if platform == 'win32':
|
|
32
26
|
try:
|
|
33
|
-
import win32com.client as win32
|
|
34
27
|
import pythoncom
|
|
28
|
+
import win32com.client as win32
|
|
35
29
|
except ImportError:
|
|
36
30
|
raise PythoncomImportError
|
|
37
31
|
|
|
@@ -5,12 +5,12 @@ simulated ICommand classes.
|
|
|
5
5
|
|
|
6
6
|
from typing import Union
|
|
7
7
|
|
|
8
|
-
from .CommandMultiVu import CommandMultiVuImp, CommandMultiVuSim
|
|
9
|
-
from . import CommandTemperature as temperature
|
|
10
|
-
from . import CommandField as field
|
|
11
8
|
from . import CommandChamber as chamber
|
|
9
|
+
from . import CommandField as field
|
|
12
10
|
from . import CommandSdo as sdo
|
|
11
|
+
from . import CommandTemperature as temperature
|
|
13
12
|
from . import CommandWaitFor as wait_for
|
|
13
|
+
from .CommandMultiVu import CommandMultiVuImp, CommandMultiVuSim
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
def create_command_mv(mvu_flavor,
|
|
@@ -15,18 +15,18 @@ Created on Tue May 18 12:59:24 2021
|
|
|
15
15
|
|
|
16
16
|
from abc import ABC, abstractmethod
|
|
17
17
|
from sys import platform
|
|
18
|
-
from threading import
|
|
19
|
-
from time import
|
|
20
|
-
from typing import
|
|
18
|
+
from threading import Lock, Thread, enumerate
|
|
19
|
+
from time import sleep, time
|
|
20
|
+
from typing import Dict, Tuple, Type, Union
|
|
21
21
|
|
|
22
22
|
from .exceptions import PythoncomImportError
|
|
23
|
-
from .IEventManager import
|
|
23
|
+
from .IEventManager import IObserver, Publisher
|
|
24
24
|
from .project_vars import CLOCK_TIME
|
|
25
25
|
|
|
26
26
|
if platform == 'win32':
|
|
27
27
|
try:
|
|
28
|
-
import win32com.client as win32
|
|
29
28
|
import pythoncom
|
|
29
|
+
import win32com.client as win32
|
|
30
30
|
from pywintypes import com_error as pywin_com_error
|
|
31
31
|
except ImportError:
|
|
32
32
|
raise PythoncomImportError
|
|
@@ -61,7 +61,7 @@ class ICommand(ABC):
|
|
|
61
61
|
self.units = ''
|
|
62
62
|
|
|
63
63
|
@abstractmethod
|
|
64
|
-
def convert_result(self,
|
|
64
|
+
def convert_result(self, response: Dict) -> Tuple:
|
|
65
65
|
raise NotImplementedError
|
|
66
66
|
|
|
67
67
|
@abstractmethod
|
|
@@ -74,8 +74,8 @@ class ICommand(ABC):
|
|
|
74
74
|
|
|
75
75
|
@abstractmethod
|
|
76
76
|
def get_state_server(self,
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
value_variant,
|
|
78
|
+
state_variant,
|
|
79
79
|
params: str = '') -> Tuple[float, int]:
|
|
80
80
|
raise NotImplementedError
|
|
81
81
|
|
|
@@ -16,10 +16,10 @@ with MultiVu.
|
|
|
16
16
|
import traceback
|
|
17
17
|
from enum import IntEnum
|
|
18
18
|
from sys import exc_info
|
|
19
|
-
from typing import
|
|
19
|
+
from typing import Tuple, Union
|
|
20
20
|
|
|
21
|
-
from .BRT import Brt as _brt
|
|
22
21
|
from . import Command_factory as _Command_factory
|
|
22
|
+
from .BRT import Brt as _brt
|
|
23
23
|
from .CommandChamber import modeEnum as _chamber_mode
|
|
24
24
|
from .CommandChamber import units as _chamber_units
|
|
25
25
|
from .CommandField import ApproachEnum as _field_approach_mode
|
|
@@ -29,18 +29,11 @@ from .CommandTemperature import STATE_DICT as _temperature_state_dict
|
|
|
29
29
|
from .CommandTemperature import ApproachEnum as _temperature_approach_mode
|
|
30
30
|
from .CommandTemperature import units as _temperature_units
|
|
31
31
|
from .CommandWaitFor import MaskEnum as _wait_for_enum
|
|
32
|
-
from .exceptions import (MultiPyVuError,
|
|
33
|
-
|
|
34
|
-
CanError,
|
|
35
|
-
can_err_enum,
|
|
36
|
-
abort_err_enum,
|
|
37
|
-
)
|
|
32
|
+
from .exceptions import (CanError, MultiPyVuError, ServerCloseError,
|
|
33
|
+
abort_err_enum, can_err_enum)
|
|
38
34
|
from .instrument import InstrumentList
|
|
39
35
|
from .MultiVuClient_base import ClientBase as _ClientBase
|
|
40
|
-
from .project_vars import
|
|
41
|
-
PORT,
|
|
42
|
-
TIMEOUT_LENGTH
|
|
43
|
-
)
|
|
36
|
+
from .project_vars import HOST_CLIENT, PORT, TIMEOUT_LENGTH
|
|
44
37
|
from .sdo_object import SdoObject
|
|
45
38
|
from .sdo_object import val_type as _sdo_val_type
|
|
46
39
|
|
|
@@ -19,23 +19,14 @@ from socket import timeout as sock_timeout
|
|
|
19
19
|
from time import sleep
|
|
20
20
|
from typing import Dict, Union
|
|
21
21
|
|
|
22
|
-
|
|
23
22
|
from .__version import __version__ as mpv_version
|
|
24
|
-
from .exceptions import (MultiPyVuError,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
from .logging_config import setup_logging, remove_logs
|
|
30
|
-
from .project_vars import (TIMEOUT_LENGTH,
|
|
31
|
-
CLIENT_NAME,
|
|
32
|
-
HOST_CLIENT,
|
|
33
|
-
PORT,
|
|
34
|
-
CLOCK_TIME,
|
|
35
|
-
)
|
|
23
|
+
from .exceptions import (ClientCloseError, MultiPyVuError, ServerCloseError,
|
|
24
|
+
SocketError)
|
|
25
|
+
from .logging_config import remove_logs, setup_logging
|
|
26
|
+
from .project_vars import (CLIENT_NAME, CLOCK_TIME, HOST_CLIENT, PORT,
|
|
27
|
+
TIMEOUT_LENGTH)
|
|
36
28
|
from .SocketMessageClient import ClientMessage as _ClientMessage
|
|
37
29
|
|
|
38
|
-
|
|
39
30
|
MAX_TRIES = 3
|
|
40
31
|
|
|
41
32
|
|
|
@@ -100,6 +91,7 @@ class ClientBase():
|
|
|
100
91
|
raise self.__exit__(*sys.exc_info())
|
|
101
92
|
except BaseException:
|
|
102
93
|
raise self.__exit__(*sys.exc_info())
|
|
94
|
+
self._logger.debug(f'MultiPyVu Version: {mpv_version}')
|
|
103
95
|
self._logger.info(f'Starting connection to {self.address}')
|
|
104
96
|
# send a request to the sever to confirm a connection
|
|
105
97
|
action = 'START'
|
|
@@ -112,7 +104,6 @@ class ClientBase():
|
|
|
112
104
|
self._instr = self._message.instr
|
|
113
105
|
self.instrument_name = self._message.instr.name
|
|
114
106
|
# self._log_event.show_logger_name(self._instr.run_with_threading)
|
|
115
|
-
self._logger.debug(f'MultiPyVu Version: {mpv_version}')
|
|
116
107
|
ver = self.get_version()
|
|
117
108
|
if ver != mpv_version:
|
|
118
109
|
self._query_server('CLOSE')
|
|
@@ -9,13 +9,14 @@ files. This code was ported from MultiVuDataFile.vb.
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
import os
|
|
12
|
-
import time
|
|
13
12
|
import re
|
|
14
|
-
import
|
|
15
|
-
from threading import Lock
|
|
16
|
-
from enum import Enum, auto, IntEnum
|
|
13
|
+
import time
|
|
17
14
|
from datetime import datetime
|
|
18
|
-
from
|
|
15
|
+
from enum import Enum, IntEnum, auto
|
|
16
|
+
from threading import Lock
|
|
17
|
+
from typing import Dict, Union
|
|
18
|
+
|
|
19
|
+
import pandas as pd
|
|
19
20
|
|
|
20
21
|
from .is_pathname_valid import is_pathname_valid
|
|
21
22
|
|
|
@@ -10,32 +10,25 @@ be used with MultiVuClient.py to control a Quantum Design cryostat.
|
|
|
10
10
|
|
|
11
11
|
import logging
|
|
12
12
|
import re
|
|
13
|
-
import sys
|
|
14
13
|
import selectors
|
|
14
|
+
import sys
|
|
15
15
|
import traceback
|
|
16
16
|
from time import sleep
|
|
17
17
|
from typing import List, Tuple
|
|
18
18
|
|
|
19
|
-
|
|
20
19
|
from .CommandChamber import SimulateChamberChange as _SimulateChamberChange
|
|
21
20
|
from .CommandField import SimulateFieldChange as _SimulateFieldChange
|
|
22
|
-
from .CommandTemperature import
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
SocketError,
|
|
27
|
-
)
|
|
21
|
+
from .CommandTemperature import \
|
|
22
|
+
SimulateTemperatureChange as _SimulateTemperatureChange
|
|
23
|
+
from .exceptions import (ClientCloseError, MultiPyVuError, ServerCloseError,
|
|
24
|
+
SocketError)
|
|
28
25
|
from .IEventManager import IObserver as _IObserver
|
|
29
|
-
from .IServer import IServer as _IServer
|
|
30
26
|
from .instrument import Instrument as _Instrument
|
|
31
|
-
from .
|
|
27
|
+
from .IServer import IServer as _IServer
|
|
28
|
+
from .logging_config import remove_logs, setup_logging
|
|
32
29
|
from .ParseInputs import inputs_from_command_line
|
|
33
|
-
from .project_vars import (SERVER_NAME,
|
|
34
|
-
|
|
35
|
-
PORT,
|
|
36
|
-
TIMEOUT_LENGTH,
|
|
37
|
-
CLOCK_TIME,
|
|
38
|
-
)
|
|
30
|
+
from .project_vars import (CLOCK_TIME, HOST_SERVER, PORT, SERVER_NAME,
|
|
31
|
+
TIMEOUT_LENGTH)
|
|
39
32
|
from .scripts.helper_scripts import force_quit
|
|
40
33
|
from .SocketMessageServer import ServerMessage as _ServerMessage
|
|
41
34
|
from .SocketMessageServer import ServerStatus as _ServerStatus
|
|
@@ -15,13 +15,12 @@ import re
|
|
|
15
15
|
import socket
|
|
16
16
|
import struct
|
|
17
17
|
import sys
|
|
18
|
+
import traceback
|
|
18
19
|
from abc import ABC
|
|
19
|
-
from typing import
|
|
20
|
+
from typing import Dict, Tuple, Union
|
|
20
21
|
|
|
21
22
|
from .__version import __version__ as mpv_version
|
|
22
|
-
from .exceptions import
|
|
23
|
-
SocketError,
|
|
24
|
-
)
|
|
23
|
+
from .exceptions import ClientCloseError, SocketError
|
|
25
24
|
from .project_vars import PORT
|
|
26
25
|
|
|
27
26
|
|
|
@@ -304,7 +303,8 @@ class Message(ABC):
|
|
|
304
303
|
"""
|
|
305
304
|
return json.dumps(dict_obj, ensure_ascii=False).encode(encoding)
|
|
306
305
|
|
|
307
|
-
def _json_decode(self,
|
|
306
|
+
def _json_decode(self,
|
|
307
|
+
json_bytes: bytes,
|
|
308
308
|
encoding: str = 'utf-8') -> Dict[str, str]:
|
|
309
309
|
"""
|
|
310
310
|
Takes a JSON formatted byte string and converts it to a dictionary
|
|
@@ -395,8 +395,22 @@ class Message(ABC):
|
|
|
395
395
|
# be longer if there is data.
|
|
396
396
|
if len(self._recv_buffer) >= header_len:
|
|
397
397
|
# parse the buffer to save the header
|
|
398
|
-
|
|
399
|
-
self.
|
|
398
|
+
try:
|
|
399
|
+
self.json_header = self._json_decode(
|
|
400
|
+
self._recv_buffer[:header_len])
|
|
401
|
+
except UnicodeDecodeError as e:
|
|
402
|
+
msg = f'\nFull received buffer = {self._recv_buffer}'
|
|
403
|
+
msg += '\nBuffer sent to ._json_decode = '
|
|
404
|
+
msg += f'{self._recv_buffer[:header_len]}'
|
|
405
|
+
self.log_message(msg)
|
|
406
|
+
|
|
407
|
+
original_traceback = traceback.format_exc()
|
|
408
|
+
traceback_with_msg = original_traceback + msg
|
|
409
|
+
raise UnicodeDecodeError(e.encoding,
|
|
410
|
+
e.object,
|
|
411
|
+
e.start,
|
|
412
|
+
e.end,
|
|
413
|
+
traceback_with_msg)
|
|
400
414
|
|
|
401
415
|
# This ensures that the header has all of the required fields
|
|
402
416
|
for required_header in (
|
|
@@ -12,14 +12,11 @@ import logging
|
|
|
12
12
|
import re
|
|
13
13
|
import socket
|
|
14
14
|
from time import sleep
|
|
15
|
-
from typing import
|
|
15
|
+
from typing import Dict, Tuple, Union
|
|
16
16
|
|
|
17
17
|
from .check_windows_esc import _check_windows_esc
|
|
18
|
-
from .exceptions import (MultiPyVuError,
|
|
19
|
-
|
|
20
|
-
ServerCloseError,
|
|
21
|
-
SocketError
|
|
22
|
-
)
|
|
18
|
+
from .exceptions import (ClientCloseError, MultiPyVuError, ServerCloseError,
|
|
19
|
+
SocketError)
|
|
23
20
|
from .instrument import Instrument
|
|
24
21
|
from .project_vars import CLIENT_NAME, CLOCK_TIME
|
|
25
22
|
from .SocketMessage import Message
|
|
@@ -26,23 +26,25 @@ import traceback
|
|
|
26
26
|
from enum import IntEnum as _IntEnum
|
|
27
27
|
from enum import auto as _auto
|
|
28
28
|
from os import path
|
|
29
|
-
from pandas import DataFrame
|
|
30
29
|
from sys import exc_info
|
|
31
|
-
from typing import Union
|
|
30
|
+
from typing import Optional, Union
|
|
31
|
+
|
|
32
|
+
from pandas import DataFrame
|
|
32
33
|
|
|
33
34
|
from .__version import __version__
|
|
34
35
|
from .exceptions import MultiPyVuError, SocketError
|
|
35
36
|
from .MultiVuClient import Client
|
|
36
37
|
from .MultiVuDataFile.MultiVuDataFile import LabelResult
|
|
37
|
-
from .MultiVuDataFile.MultiVuDataFile import
|
|
38
|
+
from .MultiVuDataFile.MultiVuDataFile import \
|
|
39
|
+
MultiVuDataFile as _MultiVuDataFile
|
|
38
40
|
from .MultiVuDataFile.MultiVuDataFile import MultiVuFileException
|
|
39
41
|
from .MultiVuDataFile.MultiVuDataFile import TScaleType as _TScaleType
|
|
40
|
-
from .MultiVuDataFile.MultiVuDataFile import
|
|
41
|
-
|
|
42
|
+
from .MultiVuDataFile.MultiVuDataFile import \
|
|
43
|
+
TStartupAxisType as _TStartupAxisType
|
|
42
44
|
from .MultiVuDataFile.MultiVuDataFile import TTimeMode as _TTimeMode
|
|
45
|
+
from .MultiVuDataFile.MultiVuDataFile import TTimeUnits as _TTimeUnits
|
|
43
46
|
from .MultiVuServer import Server
|
|
44
47
|
|
|
45
|
-
|
|
46
48
|
__version__ = __version__
|
|
47
49
|
__author__ = 'Damon D Jackson'
|
|
48
50
|
__credits__ = 'Quantum Design, Inc.'
|
|
@@ -421,7 +423,8 @@ class DataFile():
|
|
|
421
423
|
"""
|
|
422
424
|
return self.data_file.write_data_using_list(data_list, get_time_now)
|
|
423
425
|
|
|
424
|
-
def parse_MVu_data_file(self,
|
|
426
|
+
def parse_MVu_data_file(self,
|
|
427
|
+
file_path: Optional[str] = None) -> DataFrame:
|
|
425
428
|
"""
|
|
426
429
|
Returns a pandas DataFrame of all data points in the given file
|
|
427
430
|
|
|
@@ -440,6 +443,8 @@ class DataFile():
|
|
|
440
443
|
>>> parse_MVu_data_file('myMvFile.dat')
|
|
441
444
|
|
|
442
445
|
"""
|
|
446
|
+
if file_path is None:
|
|
447
|
+
file_path = self.data_file.full_path
|
|
443
448
|
try:
|
|
444
449
|
_df = self.data_file.parse_MVu_data_file(file_path)
|
|
445
450
|
except FileNotFoundError as e:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
__version__ = "3.
|
|
2
|
+
__version__ = "3.3.0"
|
|
@@ -15,15 +15,15 @@ from os import path
|
|
|
15
15
|
from sys import platform
|
|
16
16
|
from typing import Tuple
|
|
17
17
|
|
|
18
|
-
from .exceptions import MultiPyVuError, PythoncomImportError
|
|
19
18
|
from .__version import __version__ as mpv_version
|
|
20
|
-
from .
|
|
19
|
+
from .exceptions import MultiPyVuError, PythoncomImportError
|
|
20
|
+
from .project_vars import MIN_PYWIN32_VERSION, PYWIN32_VERSION, SERVER_NAME
|
|
21
21
|
|
|
22
22
|
if platform == 'win32':
|
|
23
23
|
try:
|
|
24
24
|
import pythoncom
|
|
25
|
-
import win32com.client as win32
|
|
26
25
|
import win32api
|
|
26
|
+
import win32com.client as win32
|
|
27
27
|
import win32process
|
|
28
28
|
except ImportError:
|
|
29
29
|
raise PythoncomImportError
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'''
|
|
2
|
-
|
|
2
|
+
logging_config.py is used to hold methods to help with the logging module
|
|
3
3
|
'''
|
|
4
4
|
|
|
5
5
|
import logging.config
|
|
6
|
-
import yaml
|
|
7
6
|
from logging import Logger
|
|
8
7
|
from os import path
|
|
9
8
|
|
|
9
|
+
import yaml
|
|
10
|
+
|
|
10
11
|
from .project_vars import LOG_NAME
|
|
11
12
|
|
|
12
13
|
NUMBER_OF_CALLS = 0
|
|
@@ -6,7 +6,8 @@ formatters:
|
|
|
6
6
|
no_name:
|
|
7
7
|
format: '%(message)s'
|
|
8
8
|
debug:
|
|
9
|
-
format: '%(asctime)
|
|
9
|
+
format: '%(asctime)s.%(msecs)03d %(name)-20s %(levelname)-8s %(message)s'
|
|
10
|
+
datefmt: '%Y-%m-%d %H:%M:%S'
|
|
10
11
|
gui:
|
|
11
12
|
format: '%(asctime)s - %(message)s'
|
|
12
13
|
datefmt: '%m-%d %H:%M'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: MultiPyVu
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
4
4
|
Summary: Control MultiVu using Python
|
|
5
5
|
Author-email: Damon D Jackson <djackson@qdusa.com>
|
|
6
6
|
Maintainer-email: "Quantum Design, Inc." <apps@qdusa.com>
|
|
@@ -435,6 +435,14 @@ client = mpv.Client(port=6000)
|
|
|
435
435
|
- A log file named QdMultiVu.log shows the traffic between the server and client which can also be useful during troubleshooting.
|
|
436
436
|
|
|
437
437
|
## Changelog<a class="anchor" id="changelog"></a>
|
|
438
|
+
**3.3.0**
|
|
439
|
+
- April 2025
|
|
440
|
+
- Bugfix which didn't allow this to be run on Mac or Linux platforms.
|
|
441
|
+
- Refactored mpv.DataFile() so that if a script is saving data to a file,
|
|
442
|
+
it can later load the file into a Pandas Dataframe without specifying the
|
|
443
|
+
filename. This means the file path is now optional in
|
|
444
|
+
.parse_MVu_data_file().
|
|
445
|
+
|
|
438
446
|
**3.2.0**
|
|
439
447
|
- November 2024
|
|
440
448
|
- Improvements in determining the running version of MultiVu.
|
|
@@ -10,7 +10,6 @@ src/MultiPyVu/CommandSdo.py
|
|
|
10
10
|
src/MultiPyVu/CommandTemperature.py
|
|
11
11
|
src/MultiPyVu/CommandWaitFor.py
|
|
12
12
|
src/MultiPyVu/Command_factory.py
|
|
13
|
-
src/MultiPyVu/GetRunningProcesses.py
|
|
14
13
|
src/MultiPyVu/ICommand.py
|
|
15
14
|
src/MultiPyVu/IEventManager.py
|
|
16
15
|
src/MultiPyVu/IServer.py
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'''
|
|
2
|
-
This script gets a list of running processes
|
|
3
|
-
'''
|
|
4
|
-
|
|
5
|
-
import win32process
|
|
6
|
-
import win32api
|
|
7
|
-
from os import path
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
search_keyword = "MultiVu"
|
|
11
|
-
|
|
12
|
-
# Get a list of all running processes
|
|
13
|
-
pids = win32process.EnumProcesses()
|
|
14
|
-
|
|
15
|
-
for pid in pids:
|
|
16
|
-
try:
|
|
17
|
-
# Open processes to query its executable path
|
|
18
|
-
h_process = win32api.OpenProcess(0x0410, False, pid)
|
|
19
|
-
exe_path = win32process.GetModuleFileNameEx(h_process, 0)
|
|
20
|
-
win32api.CloseHandle(h_process)
|
|
21
|
-
|
|
22
|
-
# Check if the path contains the keyword
|
|
23
|
-
if search_keyword.lower() in exe_path.lower():
|
|
24
|
-
exe_name = path.basename(exe_path)
|
|
25
|
-
print(f"PID: {pid}, Executable Path: {exe_path}, exe name: {exe_name}")
|
|
26
|
-
except Exception:
|
|
27
|
-
# Ignore processes that we don't have access to
|
|
28
|
-
pass
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|