quarchpy 2.2.7.dev1__py2.py3-none-any.whl → 2.2.8.dev1__py2.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.
- quarchpy/.idea/.name +1 -0
- quarchpy/.idea/inspectionProfiles/Project_Default.xml +39 -1
- quarchpy/.idea/misc.xml +2 -2
- quarchpy/.idea/quarchpy.iml +1 -1
- quarchpy/.idea/vcs.xml +6 -0
- quarchpy/.idea/workspace.xml +119 -21
- quarchpy/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/__pycache__/_version.cpython-311.pyc +0 -0
- quarchpy/__pycache__/_version.cpython-312.pyc +0 -0
- quarchpy/__pycache__/connection.cpython-311.pyc +0 -0
- quarchpy/__pycache__/connection.cpython-312.pyc +0 -0
- quarchpy/__pycache__/run.cpython-311.pyc +0 -0
- quarchpy/__pycache__/run.cpython-312.pyc +0 -0
- quarchpy/_version.py +1 -1
- quarchpy/config_files/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/config_files/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/config_files/__pycache__/quarch_config_parser.cpython-311.pyc +0 -0
- quarchpy/config_files/__pycache__/quarch_config_parser.cpython-312.pyc +0 -0
- quarchpy/connection_specific/QPS/win-amd64/InstallType.dat +1 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/myFile.csv +50 -0
- quarchpy/connection_specific/__pycache__/StreamChannels.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/StreamChannels.cpython-312.pyc +0 -0
- quarchpy/connection_specific/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_QIS.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_QIS.cpython-312.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_QPS.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_QPS.cpython-312.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_ReST.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_ReST.cpython-312.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_Serial.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_Serial.cpython-312.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_TCP.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_TCP.cpython-312.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_USB.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_USB.cpython-312.pyc +0 -0
- quarchpy/connection_specific/__pycache__/mDNS.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/mDNS.cpython-312.pyc +0 -0
- quarchpy/connection_specific/connection_QIS.py +1 -0
- quarchpy/connection_specific/jdk_j21_jres/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/connection_specific/jdk_j21_jres/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/connection_specific/jdk_j21_jres/__pycache__/fix_permissions.cpython-311.pyc +0 -0
- quarchpy/connection_specific/jdk_j21_jres/__pycache__/fix_permissions.cpython-312.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/serialutil.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/serialutil.cpython-312.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/serialwin32.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/serialwin32.cpython-312.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/win32.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/win32.cpython-312.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports.cpython-312.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports_common.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports_common.cpython-312.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports_windows.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports_windows.cpython-312.pyc +0 -0
- quarchpy/connection_specific/usb_libs/__pycache__/libusb1.cpython-312.pyc +0 -0
- quarchpy/connection_specific/usb_libs/__pycache__/usb1.cpython-312.pyc +0 -0
- quarchpy/debug/SystemTest.py +29 -14
- quarchpy/debug/__pycache__/SystemTest.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/SystemTest.cpython-312.pyc +0 -0
- quarchpy/debug/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/debug/__pycache__/module_debug.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/module_debug.cpython-312.pyc +0 -0
- quarchpy/debug/__pycache__/simple_terminal.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/simple_terminal.cpython-312.pyc +0 -0
- quarchpy/debug/__pycache__/upgrade_quarchpy.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/upgrade_quarchpy.cpython-312.pyc +0 -0
- quarchpy/debug/__pycache__/versionCompare.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/versionCompare.cpython-312.pyc +0 -0
- quarchpy/device/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/device/__pycache__/device.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/device.cpython-312.pyc +0 -0
- quarchpy/device/__pycache__/quarchArray.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/quarchArray.cpython-312.pyc +0 -0
- quarchpy/device/__pycache__/quarchPPM.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/quarchPPM.cpython-312.pyc +0 -0
- quarchpy/device/__pycache__/quarchQPS.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/quarchQPS.cpython-312.pyc +0 -0
- quarchpy/device/__pycache__/scanDevices.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/scanDevices.cpython-312.pyc +0 -0
- quarchpy/device/quarchQPS.py +1 -2
- quarchpy/disk_test/__pycache__/AbsDiskFinder.cpython-311.pyc +0 -0
- quarchpy/disk_test/__pycache__/AbsDiskFinder.cpython-312.pyc +0 -0
- quarchpy/disk_test/__pycache__/DiskTargetSelection.cpython-311.pyc +0 -0
- quarchpy/disk_test/__pycache__/DiskTargetSelection.cpython-312.pyc +0 -0
- quarchpy/disk_test/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/disk_test/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/disk_test/__pycache__/iometerDiskFinder.cpython-311.pyc +0 -0
- quarchpy/disk_test/__pycache__/iometerDiskFinder.cpython-312.pyc +0 -0
- quarchpy/docs/CHANGES.rst +4 -0
- quarchpy/docs/_build/doctrees/CHANGES.doctree +0 -0
- quarchpy/docs/_build/doctrees/environment.pickle +0 -0
- quarchpy/docs/_build/doctrees/source/changelog.doctree +0 -0
- quarchpy/docs/_build/doctrees/source/quarchpy.fio.doctree +0 -0
- quarchpy/docs/_build/html/CHANGES.html +145 -139
- quarchpy/docs/_build/html/_sources/CHANGES.rst.txt +7 -0
- quarchpy/docs/_build/html/genindex.html +8 -2
- quarchpy/docs/_build/html/index.html +71 -70
- quarchpy/docs/_build/html/objects.inv +0 -0
- quarchpy/docs/_build/html/searchindex.js +1 -1
- quarchpy/docs/_build/html/source/changelog.html +216 -209
- quarchpy/docs/_build/html/source/quarchpy.fio.html +64 -0
- quarchpy/docs/_build/html/source/quarchpy.html +3 -0
- quarchpy/fio/__pycache__/FIO_interface.cpython-311.pyc +0 -0
- quarchpy/fio/__pycache__/FIO_interface.cpython-312.pyc +0 -0
- quarchpy/fio/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/fio/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/iometer/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/iometer/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/iometer/__pycache__/gen_iometer_template.cpython-311.pyc +0 -0
- quarchpy/iometer/__pycache__/{gen_iometer_template.cpython-313.pyc → gen_iometer_template.cpython-312.pyc} +0 -0
- quarchpy/iometer/__pycache__/iometerFuncs.cpython-311.pyc +0 -0
- quarchpy/iometer/__pycache__/iometerFuncs.cpython-312.pyc +0 -0
- quarchpy/qis/__pycache__/StreamHeaderInfo.cpython-311.pyc +0 -0
- quarchpy/qis/__pycache__/StreamHeaderInfo.cpython-312.pyc +0 -0
- quarchpy/qis/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/qis/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/qis/__pycache__/qisFuncs.cpython-311.pyc +0 -0
- quarchpy/qis/__pycache__/qisFuncs.cpython-312.pyc +0 -0
- quarchpy/qis/qisFuncs.py +36 -39
- quarchpy/qps/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/qps/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/qps/__pycache__/qpsFuncs.cpython-311.pyc +0 -0
- quarchpy/qps/__pycache__/qpsFuncs.cpython-312.pyc +0 -0
- quarchpy/qps/qpsFuncs.py +7 -10
- quarchpy/user_interface/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/user_interface/__pycache__/__init__.cpython-312.pyc +0 -0
- quarchpy/user_interface/__pycache__/user_interface.cpython-311.pyc +0 -0
- quarchpy/user_interface/__pycache__/user_interface.cpython-312.pyc +0 -0
- quarchpy/utilities/__pycache__/TestCenter.cpython-311.pyc +0 -0
- quarchpy/utilities/__pycache__/TestCenter.cpython-312.pyc +0 -0
- quarchpy/utilities/__pycache__/TimeValue.cpython-311.pyc +0 -0
- quarchpy/utilities/__pycache__/TimeValue.cpython-312.pyc +0 -0
- quarchpy/utilities/__pycache__/Version.cpython-311.pyc +0 -0
- quarchpy/utilities/__pycache__/Version.cpython-312.pyc +0 -0
- quarchpy/utilities/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/utilities/__pycache__/__init__.cpython-312.pyc +0 -0
- {quarchpy-2.2.7.dev1.dist-info → quarchpy-2.2.8.dev1.dist-info}/METADATA +7 -12
- {quarchpy-2.2.7.dev1.dist-info → quarchpy-2.2.8.dev1.dist-info}/RECORD +148 -126
- {quarchpy-2.2.7.dev1.dist-info → quarchpy-2.2.8.dev1.dist-info}/WHEEL +1 -1
- quarchpy/.idea/.gitignore +0 -3
- quarchpy/_version.py.bak +0 -1
- quarchpy/config_files/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/config_files/__pycache__/quarch_config_parser.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/StreamChannels.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_QIS.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_QPS.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_ReST.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_Serial.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_TCP.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_Telnet.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_USB.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/mDNS.cpython-313.pyc +0 -0
- quarchpy/connection_specific/connection_QPS.py.bak +0 -242
- quarchpy/connection_specific/jdk_j21_jres/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/connection_specific/jdk_j21_jres/__pycache__/fix_permissions.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/serialutil.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/serialwin32.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/win32.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports_common.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports_windows.cpython-313.pyc +0 -0
- quarchpy/debug/__pycache__/SystemTest.cpython-313.pyc +0 -0
- quarchpy/debug/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/debug/__pycache__/module_debug.cpython-313.pyc +0 -0
- quarchpy/debug/__pycache__/simple_terminal.cpython-313.pyc +0 -0
- quarchpy/debug/__pycache__/upgrade_quarchpy.cpython-313.pyc +0 -0
- quarchpy/debug/__pycache__/versionCompare.cpython-313.pyc +0 -0
- quarchpy/device/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/device/__pycache__/device.cpython-313.pyc +0 -0
- quarchpy/device/__pycache__/quarchArray.cpython-313.pyc +0 -0
- quarchpy/device/__pycache__/quarchPPM.cpython-313.pyc +0 -0
- quarchpy/device/__pycache__/quarchQPS.cpython-313.pyc +0 -0
- quarchpy/device/__pycache__/scanDevices.cpython-313.pyc +0 -0
- quarchpy/device/quarchQPS.py.bak +0 -398
- quarchpy/disk_test/__pycache__/AbsDiskFinder.cpython-313.pyc +0 -0
- quarchpy/disk_test/__pycache__/DiskTargetSelection.cpython-313.pyc +0 -0
- quarchpy/disk_test/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/disk_test/__pycache__/iometerDiskFinder.cpython-313.pyc +0 -0
- quarchpy/docs/CHANGES.rst.bak +0 -430
- quarchpy/docs/_build/html/.buildinfo.bak +0 -4
- quarchpy/docs/_build/html/_static/github-banner.svg +0 -5
- quarchpy/fio/FIO_interface.py.bak +0 -317
- quarchpy/fio/__pycache__/FIO_interface.cpython-313.pyc +0 -0
- quarchpy/fio/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/fio/__pycache__/fioDiskFinder.cpython-311.pyc +0 -0
- quarchpy/fio/__pycache__/fioDiskFinder.cpython-313.pyc +0 -0
- quarchpy/iometer/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/iometer/__pycache__/iometerFuncs.cpython-313.pyc +0 -0
- quarchpy/qis/__pycache__/StreamHeaderInfo.cpython-313.pyc +0 -0
- quarchpy/qis/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/qis/__pycache__/qisFuncs.cpython-313.pyc +0 -0
- quarchpy/qps/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/qps/__pycache__/qpsFuncs.cpython-313.pyc +0 -0
- quarchpy/user_interface/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/user_interface/__pycache__/user_interface.cpython-313.pyc +0 -0
- quarchpy/utilities/__pycache__/TestCenter.cpython-313.pyc +0 -0
- quarchpy/utilities/__pycache__/TimeValue.cpython-313.pyc +0 -0
- quarchpy/utilities/__pycache__/Version.cpython-313.pyc +0 -0
- quarchpy/utilities/__pycache__/__init__.cpython-313.pyc +0 -0
- {quarchpy-2.2.7.dev1.dist-info → quarchpy-2.2.8.dev1.dist-info}/top_level.txt +0 -0
@@ -1,242 +0,0 @@
|
|
1
|
-
import sys
|
2
|
-
import socket
|
3
|
-
import time
|
4
|
-
import datetime
|
5
|
-
import subprocess
|
6
|
-
import os
|
7
|
-
import random
|
8
|
-
import logging
|
9
|
-
import time
|
10
|
-
import re
|
11
|
-
from quarchpy.user_interface import user_interface
|
12
|
-
|
13
|
-
class QpsInterface:
|
14
|
-
def __init__(self, host='127.0.0.1', port=9822):
|
15
|
-
self.host = host
|
16
|
-
self.port = port
|
17
|
-
|
18
|
-
self.client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
19
|
-
self.client.settimeout(5)
|
20
|
-
self.client.connect((host, port))
|
21
|
-
|
22
|
-
self.client.settimeout(None)
|
23
|
-
time.sleep(1)
|
24
|
-
self.recv()
|
25
|
-
time.sleep(1)
|
26
|
-
|
27
|
-
# Not blocking qps socket so scripts can continue if no read - 22/06
|
28
|
-
self.client.setblocking(False)
|
29
|
-
|
30
|
-
|
31
|
-
def recv(self):
|
32
|
-
try:
|
33
|
-
if sys.hexversion >= 0x03000000:
|
34
|
-
response = self.client.recv(4096)
|
35
|
-
i = 0
|
36
|
-
for b in response: # end buffer on first \0 character/value
|
37
|
-
if b > 0:
|
38
|
-
i += 1
|
39
|
-
else:
|
40
|
-
break;
|
41
|
-
|
42
|
-
return response[:i].decode('utf-8', "ignore")
|
43
|
-
else:
|
44
|
-
return self.client.recv(4096)
|
45
|
-
except Exception as e:
|
46
|
-
# Catching socket timeout caused from non blocking socket
|
47
|
-
return ""
|
48
|
-
|
49
|
-
|
50
|
-
def send(self, data):
|
51
|
-
if sys.hexversion >= 0x03000000:
|
52
|
-
self.client.send( data.encode() )
|
53
|
-
else:
|
54
|
-
self.client.send( data )
|
55
|
-
|
56
|
-
def sendCommand(self, cmd, timeout=20, expectedResponse=True ):
|
57
|
-
cmd = cmd + "\r\n"
|
58
|
-
logging.debug("Sending cmd to QPS: " + str(cmd))
|
59
|
-
self.send(cmd)
|
60
|
-
|
61
|
-
start = time.time()
|
62
|
-
response = self.recv().strip()
|
63
|
-
while response.rfind('\r\n>') == -1: # If true then the resposnse is large and multi packeted
|
64
|
-
time.sleep(0.1)
|
65
|
-
t_response = self.recv().strip()
|
66
|
-
# Add current response to new response
|
67
|
-
response += t_response
|
68
|
-
# Keep reading from the socket if there's stuff that was retreived
|
69
|
-
if len(str(t_response)) == 0:
|
70
|
-
if time.time() - start > timeout:
|
71
|
-
logging.warning("Command : " + str(cmd) + " Hit timeout during QPS read. timeout = " + str(timeout))
|
72
|
-
break
|
73
|
-
|
74
|
-
pos = response.rfind('\r\n>')
|
75
|
-
if pos == -1:
|
76
|
-
logging.warning("Did not retrieve trailing '\\r\\n>' from QPS read, returned full response so far")
|
77
|
-
logging.warning("command : " + cmd.replace('\r\n', '\\r\\n'))
|
78
|
-
logging.warning("returned : " + response.replace('\r\n', '\\r\\n'))
|
79
|
-
pos = len(str(response))
|
80
|
-
return response[:pos]
|
81
|
-
|
82
|
-
def sendCmdVerbose(self, cmd, timeout=20):
|
83
|
-
cmd = cmd + "\r\n"
|
84
|
-
logging.debug("Sending cmd to QPS: "+str(cmd))
|
85
|
-
self.send(cmd)
|
86
|
-
|
87
|
-
start = time.time()
|
88
|
-
response = self.recv().strip()
|
89
|
-
while response.rfind('\r\n>') == -1: #If true then the resposnse is large and multi packeted
|
90
|
-
time.sleep(0.1)
|
91
|
-
t_response = self.recv().strip()
|
92
|
-
# Add current response to new response
|
93
|
-
response += t_response
|
94
|
-
# Keep reading from the socket if there's stuff that was retreived
|
95
|
-
if len(str(t_response)) == 0:
|
96
|
-
if time.time() - start > timeout:
|
97
|
-
logging.warning("Command : "+str(cmd)+ " Hit timeout during QPS read. timeout = " +str(timeout))
|
98
|
-
break
|
99
|
-
|
100
|
-
pos = response.rfind('\r\n>')
|
101
|
-
if pos == -1:
|
102
|
-
logging.warning("Did not retrieve trailing '\\r\\n>' from QPS read, returned full response so far")
|
103
|
-
logging.warning("command : " + cmd.replace('\r\n','\\r\\n'))
|
104
|
-
logging.warning("returned : " + response.replace('\r\n','\\r\\n'))
|
105
|
-
pos = len(str(response))
|
106
|
-
return response[:pos]
|
107
|
-
|
108
|
-
|
109
|
-
def connect(self, targetDevice):
|
110
|
-
cmd="$connect " + targetDevice
|
111
|
-
retVal = self.sendCmdVerbose(cmd)
|
112
|
-
time.sleep(0.3)
|
113
|
-
return retVal
|
114
|
-
|
115
|
-
|
116
|
-
def disconnect(self, targetDevice):
|
117
|
-
self.sendCmdVerbose("$disconnect")
|
118
|
-
|
119
|
-
def closeConnection(self, conString=None):
|
120
|
-
if conString is None:
|
121
|
-
return self.sendCmdVerbose("close")
|
122
|
-
else:
|
123
|
-
return self.sendCmdVerbose(conString+" close")
|
124
|
-
def scanIP(self, ipAddress, sleep=10):
|
125
|
-
"""
|
126
|
-
Triggers QPS to look at a specific IP address for a quarch module
|
127
|
-
|
128
|
-
Parameters
|
129
|
-
----------
|
130
|
-
QpsConnection : QpsInterface
|
131
|
-
The interface to the instance of QPS you would like to use for the scan.
|
132
|
-
ipAddress : str
|
133
|
-
The IP address of the module you are looking for eg '192.168.123.123'
|
134
|
-
sleep : int, optional
|
135
|
-
This optional variable sleeps to allow the network to scan for the module before allowing new commands to be sent to QPS.
|
136
|
-
"""
|
137
|
-
ipAddress = "TCP::" + ipAddress
|
138
|
-
|
139
|
-
self.send("$scan " + ipAddress)
|
140
|
-
# logging.debug("Starting QPS IP Address Lookup")
|
141
|
-
time.sleep(
|
142
|
-
sleep) # Time must be allowed for QPS to Scan. If another scan request is sent it will time out and throw an error.
|
143
|
-
|
144
|
-
def get_list_details(self, sock=None):
|
145
|
-
if sock == None:
|
146
|
-
sock = self.sock
|
147
|
-
devString = self.sendCmdVerbose("$module list details")
|
148
|
-
#devString = self.sendAndReceiveText(sock, '$list details')
|
149
|
-
devString = devString.replace('>', '')
|
150
|
-
devString = devString.replace(r'\d+\) ', '')
|
151
|
-
devString = devString.split('\r\n')
|
152
|
-
devString = [x for x in devString if x] # remove empty elements
|
153
|
-
return devString
|
154
|
-
|
155
|
-
def getDeviceList(self, scan = True, ipAddress = None):
|
156
|
-
deviceList = []
|
157
|
-
scanWait = 2
|
158
|
-
foundDevices = "1"
|
159
|
-
foundDevices2 = "2"
|
160
|
-
if scan:
|
161
|
-
if ipAddress == None:
|
162
|
-
devString = self.sendCmdVerbose('$scan')
|
163
|
-
else:
|
164
|
-
devString = self.sendCmdVerbose('$module scan tcp::' + ipAddress)
|
165
|
-
time.sleep(scanWait)
|
166
|
-
while foundDevices not in foundDevices2:
|
167
|
-
foundDevices = self.sendCmdVerbose('$list')
|
168
|
-
time.sleep(scanWait)
|
169
|
-
foundDevices2 = self.sendCmdVerbose('$list')
|
170
|
-
else:
|
171
|
-
foundDevices = self.sendCmdVerbose('$list')
|
172
|
-
|
173
|
-
response = self.sendCmdVerbose( "$list" )
|
174
|
-
|
175
|
-
time.sleep(2)
|
176
|
-
|
177
|
-
response2 = self.sendCmdVerbose( "$list" )
|
178
|
-
|
179
|
-
while (response != response2):
|
180
|
-
response = response2
|
181
|
-
response2 = self.sendCmdVerbose( "$list" )
|
182
|
-
time.sleep(1)
|
183
|
-
if "no device" in response.lower() or "no module" in response.lower():
|
184
|
-
return [response.strip()]
|
185
|
-
#check if a response was received and the first char was a digit
|
186
|
-
if( len(response) > 0 and response[0].isdigit ):
|
187
|
-
sa = response.split()
|
188
|
-
for s in sa:
|
189
|
-
#checks for invalid chars
|
190
|
-
if( ")" not in s and ">" not in s ):
|
191
|
-
#append to list if conditions met
|
192
|
-
deviceList.append( s )
|
193
|
-
|
194
|
-
#return list of devices
|
195
|
-
return deviceList
|
196
|
-
|
197
|
-
|
198
|
-
def open_recording(self, file_path, cmdTimeout=5, pollInterval=3, startOpenTimout=5):
|
199
|
-
"""
|
200
|
-
|
201
|
-
"""
|
202
|
-
#print("Open recording at file : \""+str(file_path)+"\"")
|
203
|
-
notLoadingMessageStartTime=None
|
204
|
-
loadingStarted=False
|
205
|
-
message=""
|
206
|
-
|
207
|
-
openResponse = self.sendCmdVerbose("$open recording qpsFile=\""+str(file_path)+"\"",timeout=cmdTimeout)
|
208
|
-
print(openResponse)
|
209
|
-
while(1):
|
210
|
-
update=self.sendCmdVerbose("$progress check task=\"open recording\"",timeout=cmdTimeout)
|
211
|
-
#print(update)
|
212
|
-
m = re.search(r'\d+(\.\d+)?%', update)
|
213
|
-
if m: # A percentage was found
|
214
|
-
loadingStarted=True
|
215
|
-
found = float(m.group(0)[:-1])
|
216
|
-
user_interface.progressBar(found,100)
|
217
|
-
if found > 99.9: # This will catch the case we have 99.9999% or 100% loaded. recording with less that 1mill records auto return 100%
|
218
|
-
message = "Passed, Recording opened, loading detected and complete."
|
219
|
-
break
|
220
|
-
elif "Initialising main chart" in update:
|
221
|
-
loadingStarted = True
|
222
|
-
user_interface.progressBar(found, 100)
|
223
|
-
elif "Chart window is open but no loading is in progress." in update:
|
224
|
-
if loadingStarted == True:
|
225
|
-
# Loading started and has now ended, so we can exit the loop.
|
226
|
-
message="Passed, Recording opened, loading detected and complete."
|
227
|
-
break
|
228
|
-
else: # QPS has not started loading a recording.
|
229
|
-
if notLoadingMessageStartTime == None:
|
230
|
-
# Start a timer from now so that if loading doesn't take place between now and a timeout value,
|
231
|
-
# we exit, stating that no loading started within the desired time.
|
232
|
-
notLoadingMessageStartTime = time.time()
|
233
|
-
elif time.time() - notLoadingMessageStartTime> startOpenTimout:
|
234
|
-
message = "No detection that QPS started loading the recording within " + str(startOpenTimout) + "s."
|
235
|
-
break
|
236
|
-
|
237
|
-
time.sleep(pollInterval) #Sleep pollInterval time, so we are not hammering QPS for updates while its busy loading.
|
238
|
-
time.sleep(1) #sleep outside the loop as there is a
|
239
|
-
return message
|
240
|
-
|
241
|
-
|
242
|
-
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|