quarchpy 2.2.7.dev2__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/workspace.xml +23 -11
- quarchpy/_version.py +1 -1
- quarchpy/connection_specific/QPS/win-amd64/resources/profiles/3_PHASE_PAM_AC_DEFAULT.rcf +2 -2
- quarchpy/connection_specific/QPS/win-amd64/resources/profiles/3_PHASE_PAM_AC_FULL.rcf +5 -56
- quarchpy/connection_specific/QPS/win-amd64/resources/profiles/PAM_EXAMPLE_CONFIG.rcf +1 -1
- quarchpy/connection_specific/connection_QIS.py +3 -6
- quarchpy/connection_specific/mDNS.py +1 -3
- quarchpy/debug/SystemTest.py +29 -14
- quarchpy/debug/module_debug.py +0 -1
- quarchpy/device/quarchPPM.py +1 -2
- quarchpy/device/quarchQPS.py +1 -2
- quarchpy/device/scanDevices.py +3 -3
- quarchpy/docs/CHANGES.rst +3 -2
- 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/FIO_interface.py +0 -1
- quarchpy/qis/qisFuncs.py +40 -47
- quarchpy/qps/qpsFuncs.py +10 -17
- quarchpy/run.py +3 -3
- quarchpy/utilities/TestCenter.py +2 -2
- {quarchpy-2.2.7.dev2.dist-info → quarchpy-2.2.8.dev1.dist-info}/METADATA +4 -3
- {quarchpy-2.2.7.dev2.dist-info → quarchpy-2.2.8.dev1.dist-info}/RECORD +35 -38
- quarchpy/connection_specific/QPS/win-amd64/qis/Stream1.csv +0 -234
- quarchpy/connection_specific/QPS/win-amd64/qis/Stream1_resampled.csv +0 -31
- quarchpy/device/quarchPPM.py.bak +0 -67
- {quarchpy-2.2.7.dev2.dist-info → quarchpy-2.2.8.dev1.dist-info}/WHEEL +0 -0
- {quarchpy-2.2.7.dev2.dist-info → quarchpy-2.2.8.dev1.dist-info}/top_level.txt +0 -0
@@ -40,11 +40,75 @@
|
|
40
40
|
</section>
|
41
41
|
<section id="module-quarchpy.fio.FIO_interface">
|
42
42
|
<span id="quarchpy-fio-fio-interface-module"></span><h2>quarchpy.fio.FIO_interface module<a class="headerlink" href="#module-quarchpy.fio.FIO_interface" title="Link to this heading">¶</a></h2>
|
43
|
+
<dl class="py function">
|
44
|
+
<dt class="sig sig-object py" id="quarchpy.fio.FIO_interface.convert_qis_stream_to_unix_time">
|
45
|
+
<span class="sig-prename descclassname"><span class="pre">quarchpy.fio.FIO_interface.</span></span><span class="sig-name descname"><span class="pre">convert_qis_stream_to_unix_time</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">qis_stream_file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">unix_stream_start_time</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#quarchpy.fio.FIO_interface.convert_qis_stream_to_unix_time" title="Link to this definition">¶</a></dt>
|
46
|
+
<dd><p>Converts a QIS stream CSV file to Unix time by adding the unixStreamStartTime to the first column
|
47
|
+
in each row, taking into account the time units provided in both the CSV header and the start time.</p>
|
48
|
+
<dl class="field-list simple">
|
49
|
+
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
50
|
+
<dd class="field-odd"><ul class="simple">
|
51
|
+
<li><p><strong>qis_stream_file</strong> (<em>str</em>) – The path to the QIS stream CSV file.</p></li>
|
52
|
+
<li><p><strong>unix_stream_start_time</strong> (<em>str</em>) – The starting Unix time with units (e.g., “1737374310S”, “1737374310000mS”).</p></li>
|
53
|
+
</ul>
|
54
|
+
</dd>
|
55
|
+
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
56
|
+
<dd class="field-even"><p>Path to the converted CSV file.</p>
|
57
|
+
</dd>
|
58
|
+
<dt class="field-odd">Return type<span class="colon">:</span></dt>
|
59
|
+
<dd class="field-odd"><p>str</p>
|
60
|
+
</dd>
|
61
|
+
</dl>
|
62
|
+
</dd></dl>
|
63
|
+
|
64
|
+
<dl class="py function">
|
65
|
+
<dt class="sig sig-object py" id="quarchpy.fio.FIO_interface.fio_json_to_csv">
|
66
|
+
<span class="sig-prename descclassname"><span class="pre">quarchpy.fio.FIO_interface.</span></span><span class="sig-name descname"><span class="pre">fio_json_to_csv</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output_file</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#quarchpy.fio.FIO_interface.fio_json_to_csv" title="Link to this definition">¶</a></dt>
|
67
|
+
<dd></dd></dl>
|
68
|
+
|
43
69
|
<dl class="py function">
|
44
70
|
<dt class="sig sig-object py" id="quarchpy.fio.FIO_interface.follow">
|
45
71
|
<span class="sig-prename descclassname"><span class="pre">quarchpy.fio.FIO_interface.</span></span><span class="sig-name descname"><span class="pre">follow</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">thefile</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#quarchpy.fio.FIO_interface.follow" title="Link to this definition">¶</a></dt>
|
46
72
|
<dd></dd></dl>
|
47
73
|
|
74
|
+
<dl class="py function">
|
75
|
+
<dt class="sig sig-object py" id="quarchpy.fio.FIO_interface.merge_fio_qis_stream">
|
76
|
+
<span class="sig-prename descclassname"><span class="pre">quarchpy.fio.FIO_interface.</span></span><span class="sig-name descname"><span class="pre">merge_fio_qis_stream</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">qis_stream_file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fio_output_file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">unix_stream_start_time</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_file</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rounding_option</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'round'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#quarchpy.fio.FIO_interface.merge_fio_qis_stream" title="Link to this definition">¶</a></dt>
|
77
|
+
<dd><p>Merge FIO and QIS data into a single CSV file.</p>
|
78
|
+
<dl class="simple">
|
79
|
+
<dt>For each FIO entry:</dt><dd><ul class="simple">
|
80
|
+
<li><p>If timestamps match, append FIO data to the corresponding QIS row.</p></li>
|
81
|
+
<li><dl class="simple">
|
82
|
+
<dt>If no match, handle based on <cite>rounding_option</cite>:</dt><dd><ul>
|
83
|
+
<li><p>“round”: Find the nearest QIS time and add FIO data to that row.</p></li>
|
84
|
+
<li><p>“insert”: Add a new row with blank QIS data and only FIO data.</p></li>
|
85
|
+
</ul>
|
86
|
+
</dd>
|
87
|
+
</dl>
|
88
|
+
</li>
|
89
|
+
</ul>
|
90
|
+
</dd>
|
91
|
+
</dl>
|
92
|
+
<dl class="field-list simple">
|
93
|
+
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
94
|
+
<dd class="field-odd"><ul class="simple">
|
95
|
+
<li><p><strong>qis_stream_file</strong> (<em>str</em>) – Path to the QIS CSV file (converted to Unix time).</p></li>
|
96
|
+
<li><p><strong>fio_output_file</strong> (<em>str</em>) – Path to the FIO output file (in JSON format).</p></li>
|
97
|
+
<li><p><strong>unix_stream_start_time</strong> (<em>str</em>) – Starting Unix timestamp for the QIS stream.</p></li>
|
98
|
+
<li><p><strong>output_file</strong> (<em>str</em><em>, </em><em>optional</em>) – Output file path for the merged CSV. If not provided, the file is saved
|
99
|
+
with “_merged” appended to the QIS file name.</p></li>
|
100
|
+
<li><p><strong>rounding_option</strong> (<em>str</em>) – Determines how to handle mismatched times (“round” or “insert”).</p></li>
|
101
|
+
</ul>
|
102
|
+
</dd>
|
103
|
+
<dt class="field-even">Returns<span class="colon">:</span></dt>
|
104
|
+
<dd class="field-even"><p>Path to the merged CSV file.</p>
|
105
|
+
</dd>
|
106
|
+
<dt class="field-odd">Return type<span class="colon">:</span></dt>
|
107
|
+
<dd class="field-odd"><p>str</p>
|
108
|
+
</dd>
|
109
|
+
</dl>
|
110
|
+
</dd></dl>
|
111
|
+
|
48
112
|
<dl class="py function">
|
49
113
|
<dt class="sig sig-object py" id="quarchpy.fio.FIO_interface.return_data">
|
50
114
|
<span class="sig-prename descclassname"><span class="pre">quarchpy.fio.FIO_interface.</span></span><span class="sig-name descname"><span class="pre">return_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output_file</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fioCallbacks</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">myStream</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">user_data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">arguments</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#quarchpy.fio.FIO_interface.return_data" title="Link to this definition">¶</a></dt>
|
@@ -505,7 +505,10 @@
|
|
505
505
|
<li class="toctree-l1"><a class="reference internal" href="quarchpy.fio.html">quarchpy.fio package</a><ul>
|
506
506
|
<li class="toctree-l2"><a class="reference internal" href="quarchpy.fio.html#submodules">Submodules</a></li>
|
507
507
|
<li class="toctree-l2"><a class="reference internal" href="quarchpy.fio.html#module-quarchpy.fio.FIO_interface">quarchpy.fio.FIO_interface module</a><ul>
|
508
|
+
<li class="toctree-l3"><a class="reference internal" href="quarchpy.fio.html#quarchpy.fio.FIO_interface.convert_qis_stream_to_unix_time"><code class="docutils literal notranslate"><span class="pre">convert_qis_stream_to_unix_time()</span></code></a></li>
|
509
|
+
<li class="toctree-l3"><a class="reference internal" href="quarchpy.fio.html#quarchpy.fio.FIO_interface.fio_json_to_csv"><code class="docutils literal notranslate"><span class="pre">fio_json_to_csv()</span></code></a></li>
|
508
510
|
<li class="toctree-l3"><a class="reference internal" href="quarchpy.fio.html#quarchpy.fio.FIO_interface.follow"><code class="docutils literal notranslate"><span class="pre">follow()</span></code></a></li>
|
511
|
+
<li class="toctree-l3"><a class="reference internal" href="quarchpy.fio.html#quarchpy.fio.FIO_interface.merge_fio_qis_stream"><code class="docutils literal notranslate"><span class="pre">merge_fio_qis_stream()</span></code></a></li>
|
509
512
|
<li class="toctree-l3"><a class="reference internal" href="quarchpy.fio.html#quarchpy.fio.FIO_interface.return_data"><code class="docutils literal notranslate"><span class="pre">return_data()</span></code></a></li>
|
510
513
|
<li class="toctree-l3"><a class="reference internal" href="quarchpy.fio.html#quarchpy.fio.FIO_interface.runFIO"><code class="docutils literal notranslate"><span class="pre">runFIO()</span></code></a></li>
|
511
514
|
<li class="toctree-l3"><a class="reference internal" href="quarchpy.fio.html#quarchpy.fio.FIO_interface.start_fio"><code class="docutils literal notranslate"><span class="pre">start_fio()</span></code></a></li>
|
quarchpy/fio/FIO_interface.py
CHANGED
quarchpy/qis/qisFuncs.py
CHANGED
@@ -1,21 +1,18 @@
|
|
1
|
-
# -*- coding: future_fstrings -*-
|
2
1
|
"""
|
3
2
|
Contains general functions for starting and stopping QIS processes
|
4
3
|
"""
|
5
|
-
|
4
|
+
|
5
|
+
import os, sys
|
6
6
|
import time, platform
|
7
7
|
from threading import Thread, Lock, Event, active_count
|
8
|
-
|
9
|
-
from queue import Queue, Empty # Python 3
|
10
|
-
except ImportError:
|
11
|
-
from Queue import Queue, Empty # Python 2
|
12
|
-
|
8
|
+
from queue import Queue, Empty
|
13
9
|
from quarchpy.connection_specific.connection_QIS import QisInterface
|
14
10
|
from quarchpy.connection_specific.jdk_j21_jres.fix_permissions import main as fix_permissions, find_java_permissions
|
15
11
|
from quarchpy.user_interface.user_interface import printText, logDebug
|
16
12
|
import subprocess
|
17
13
|
import logging
|
18
14
|
|
15
|
+
|
19
16
|
def isQisRunning():
|
20
17
|
"""
|
21
18
|
Checks if a local instance of QIS is running and responding
|
@@ -38,7 +35,7 @@ def isQisRunning():
|
|
38
35
|
pass
|
39
36
|
if (qisRunning is False):
|
40
37
|
logging.debug("QIS is not running")
|
41
|
-
return False
|
38
|
+
return False
|
42
39
|
else:
|
43
40
|
logging.debug("QIS is running")
|
44
41
|
return True
|
@@ -49,7 +46,7 @@ def isQisRunningAndResponding(timeout=2):
|
|
49
46
|
checks if qis is running and responding to a $version
|
50
47
|
"""
|
51
48
|
qisRunning = isQisRunning()
|
52
|
-
if qisRunning ==False:
|
49
|
+
if qisRunning == False:
|
53
50
|
logging.debug("QIS is not running")
|
54
51
|
return False
|
55
52
|
|
@@ -67,7 +64,6 @@ def isQisRunningAndResponding(timeout=2):
|
|
67
64
|
time.sleep(timeout / maxCounter) # We attempt to get QIS
|
68
65
|
counter += 1
|
69
66
|
|
70
|
-
|
71
67
|
if (qisRunning is False):
|
72
68
|
logging.debug("QIS is not running")
|
73
69
|
return False
|
@@ -95,10 +91,11 @@ def startLocalQis(terminal=False, headless=False, args=None, timeout=20):
|
|
95
91
|
java_path = os.path.dirname(os.path.abspath(__file__))
|
96
92
|
java_path, junk = os.path.split(java_path)
|
97
93
|
java_path = os.path.join(java_path, "connection_specific", "jdk_j21_jres")
|
94
|
+
java_path = "\"" + java_path
|
98
95
|
|
99
96
|
# change directory to /QPS/QIS
|
100
97
|
qis_path = os.path.dirname(os.path.abspath(__file__))
|
101
|
-
qis_path,junk = os.path.split
|
98
|
+
qis_path, junk = os.path.split(qis_path)
|
102
99
|
|
103
100
|
# OS
|
104
101
|
current_os = platform.system()
|
@@ -112,13 +109,13 @@ def startLocalQis(terminal=False, headless=False, args=None, timeout=20):
|
|
112
109
|
return
|
113
110
|
|
114
111
|
# ensure the jres folder has the required permissions
|
115
|
-
permissions,message= find_java_permissions()
|
112
|
+
permissions, message = find_java_permissions()
|
116
113
|
if permissions is False:
|
117
114
|
logging.warning(message)
|
118
115
|
logging.warning("Not having correct permissions will prevent Quarch Java Programs to launch")
|
119
116
|
logging.warning("Run \"python -m quarchpy.run permission_fix\" to fix this.")
|
120
117
|
user_input = input("Would you like to fix permissions now? (Y/N)")
|
121
|
-
if user_input.lower()=="y":
|
118
|
+
if user_input.lower() == "y":
|
122
119
|
fix_permissions()
|
123
120
|
permissions, message = find_java_permissions()
|
124
121
|
time.sleep(0.5)
|
@@ -127,8 +124,6 @@ def startLocalQis(terminal=False, headless=False, args=None, timeout=20):
|
|
127
124
|
else:
|
128
125
|
logging.warning("Attempt to fix permissions was successful. Now continuing.")
|
129
126
|
|
130
|
-
|
131
|
-
|
132
127
|
# if current_os != "Windows":
|
133
128
|
# subprocess.call(['chmod', '-R', '+rwx', java_path])
|
134
129
|
|
@@ -154,16 +149,14 @@ def startLocalQis(terminal=False, headless=False, args=None, timeout=20):
|
|
154
149
|
|
155
150
|
# Building the command
|
156
151
|
|
157
|
-
|
158
152
|
# prefer IPV4 to IPV6
|
159
153
|
ipv4v6_vm_args = "-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false"
|
160
154
|
|
161
155
|
# Process command prefix. Needed for headless mode, to support OSs with no system tray.
|
162
|
-
cmd_prefix =ipv4v6_vm_args
|
156
|
+
cmd_prefix = ipv4v6_vm_args
|
163
157
|
if headless is True or (args is not None and "-headless" in args):
|
164
158
|
cmd_prefix += " -Djava.awt.headless=true"
|
165
159
|
|
166
|
-
|
167
160
|
# Process command suffix (additional standard options for QIS).
|
168
161
|
if terminal is True:
|
169
162
|
cmd_suffix = " -terminal"
|
@@ -181,9 +174,8 @@ def startLocalQis(terminal=False, headless=False, args=None, timeout=20):
|
|
181
174
|
# record current working directory
|
182
175
|
current_dir = os.getcwd()
|
183
176
|
|
177
|
+
command = "java\" " + cmd_prefix + " -jar qis.jar" + cmd_suffix
|
184
178
|
|
185
|
-
command = "java " + cmd_prefix + " -jar qis.jar" + cmd_suffix
|
186
|
-
|
187
179
|
# different start for different OS
|
188
180
|
if current_os == "Windows":
|
189
181
|
command = java_path + "\\win_amd64_jdk_21_jre\\bin\\" + command
|
@@ -199,12 +191,13 @@ def startLocalQis(terminal=False, headless=False, args=None, timeout=20):
|
|
199
191
|
command = java_path + "\\win_amd64_jdk_21_jre\\bin\\" + command
|
200
192
|
|
201
193
|
# Use the command and check QIS has launched
|
202
|
-
|
203
|
-
|
204
|
-
|
194
|
+
# If logging to a terminal window is on then os.system should be used to view logging.
|
195
|
+
if "-logging=ON" in str(args):
|
196
|
+
process = subprocess.Popen(command, shell=True)
|
197
|
+
startTime = time.time() # Checks for Popen launch only
|
205
198
|
while not isQisRunning():
|
206
199
|
if time.time() - startTime > timeout:
|
207
|
-
raise
|
200
|
+
raise TimeoutError("QIS failed to launch within timelimit of " + str(timeout) + " sec.")
|
208
201
|
pass
|
209
202
|
else:
|
210
203
|
if sys.version_info[0] < 3:
|
@@ -212,16 +205,15 @@ def startLocalQis(terminal=False, headless=False, args=None, timeout=20):
|
|
212
205
|
else:
|
213
206
|
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
214
207
|
|
215
|
-
startTime = time.time()
|
208
|
+
startTime = time.time() #Checks for Popen launch only
|
216
209
|
while not isQisRunning():
|
217
210
|
_get_std_msg_and_err_from_QIS_process(process)
|
218
211
|
if time.time() - startTime > timeout:
|
219
|
-
raise
|
212
|
+
raise TimeoutError("QIS failed to launch within timelimit of " + str(timeout) + " sec.")
|
220
213
|
pass
|
221
214
|
|
222
|
-
|
223
215
|
if isQisRunningAndResponding(timeout=timeout):
|
224
|
-
logDebug("
|
216
|
+
logDebug("QIS running and responding")
|
225
217
|
else:
|
226
218
|
logDebug("QIS running but not responding")
|
227
219
|
|
@@ -229,7 +221,7 @@ def startLocalQis(terminal=False, headless=False, args=None, timeout=20):
|
|
229
221
|
os.chdir(current_dir)
|
230
222
|
|
231
223
|
|
232
|
-
def reader(stream, q, source, lock,stop_flag):
|
224
|
+
def reader(stream, q, source, lock, stop_flag):
|
233
225
|
'''
|
234
226
|
Used to read output and place it in a queue for multithreaded reading
|
235
227
|
:param stream:
|
@@ -265,7 +257,7 @@ def _get_std_msg_and_err_from_QIS_process(process):
|
|
265
257
|
t2.start()
|
266
258
|
counter = 0
|
267
259
|
# check for stderr or stdmsg from the queue
|
268
|
-
while counter <= 3:
|
260
|
+
while counter <= 3: # If 3 empty reads from the queue then move on to see if QPS is running.
|
269
261
|
try:
|
270
262
|
source, line = q.get(timeout=1) # Wait for 1 second for new lines
|
271
263
|
counter = 0
|
@@ -275,7 +267,7 @@ def _get_std_msg_and_err_from_QIS_process(process):
|
|
275
267
|
printText(f"{source}: {line}")
|
276
268
|
except Empty:
|
277
269
|
counter += 1
|
278
|
-
stop_flag.set()
|
270
|
+
stop_flag.set() #Close the threads and return to the main loop where QPS is check to see if its started yet
|
279
271
|
|
280
272
|
|
281
273
|
def check_remote_qis(host='127.0.0.1', port=9722, timeout=0):
|
@@ -315,6 +307,7 @@ def check_remote_qis(host='127.0.0.1', port=9722, timeout=0):
|
|
315
307
|
logging.debug("QIS is running")
|
316
308
|
return True
|
317
309
|
|
310
|
+
|
318
311
|
def checkAndCloseQis(host='127.0.0.1', port=9722):
|
319
312
|
if isQisRunning() is True:
|
320
313
|
closeQis()
|
@@ -333,53 +326,53 @@ def closeQis(host='127.0.0.1', port=9722):
|
|
333
326
|
QIS connection port if set to a value other than the default
|
334
327
|
|
335
328
|
"""
|
336
|
-
|
329
|
+
|
337
330
|
myQis = QisInterface(host, port)
|
338
|
-
retVal=myQis.sendAndReceiveCmd(cmd
|
331
|
+
retVal = myQis.sendAndReceiveCmd(cmd="$shutdown")
|
339
332
|
myQis.disconnect()
|
340
333
|
time.sleep(1)
|
341
334
|
return retVal
|
342
335
|
|
336
|
+
|
343
337
|
#DEPRICATED
|
344
|
-
def GetQisModuleSelection
|
338
|
+
def GetQisModuleSelection(QisConnection):
|
345
339
|
"""
|
346
340
|
Prints a list of modules for user selection
|
347
341
|
|
348
342
|
.. deprecated:: 2.0.12
|
349
343
|
Use the module selection functions of the QisInterface class instead
|
350
344
|
"""
|
351
|
-
|
345
|
+
|
352
346
|
# Request a list of all USB and LAN accessible power modules
|
353
347
|
devList = QisConnection.getDeviceList()
|
354
348
|
# Removes rest devices
|
355
|
-
devList = [
|
349
|
+
devList = [x for x in devList if "rest" not in x]
|
356
350
|
|
357
351
|
# Print the devices, so the user can choose one to connect to
|
358
|
-
printText
|
359
|
-
printText
|
360
|
-
printText
|
361
|
-
printText
|
362
|
-
|
352
|
+
printText("\n ########## STEP 1 - Select a Quarch Module. ########## \n")
|
353
|
+
printText(' --------------------------------------------')
|
354
|
+
printText(' | {:^5} | {:^30}|'.format("INDEX", "MODULE"))
|
355
|
+
printText(' --------------------------------------------')
|
356
|
+
|
363
357
|
try:
|
364
358
|
for idx in xrange(len(devList)):
|
365
|
-
printText
|
359
|
+
printText(' | {:^5} | {:^30}|'.format(str(idx + 1), devList[idx]))
|
366
360
|
printText(' --------------------------------------------')
|
367
361
|
except:
|
368
362
|
for idx in range(len(devList)):
|
369
|
-
printText
|
363
|
+
printText(' | {:^5} | {:^30}|'.format(str(idx + 1), devList[idx]))
|
370
364
|
printText(' --------------------------------------------')
|
371
365
|
|
372
366
|
# Get the user to select the device to control
|
373
367
|
try:
|
374
|
-
moduleId = int(raw_input
|
368
|
+
moduleId = int(raw_input("\n>>> Enter the index of the Quarch module: "))
|
375
369
|
except NameError:
|
376
|
-
moduleId = int(input
|
370
|
+
moduleId = int(input("\n>>> Enter the index of the Quarch module: "))
|
377
371
|
|
378
372
|
# Verify the selection
|
379
373
|
if (moduleId > 0 and moduleId <= len(devList)):
|
380
|
-
myDeviceID = devList[moduleId-1]
|
374
|
+
myDeviceID = devList[moduleId - 1]
|
381
375
|
else:
|
382
376
|
myDeviceID = None
|
383
377
|
|
384
378
|
return myDeviceID
|
385
|
-
|
quarchpy/qps/qpsFuncs.py
CHANGED
@@ -1,15 +1,7 @@
|
|
1
|
-
# -*- coding: future_fstrings -*-
|
2
1
|
from threading import Thread, Lock, Event, active_count
|
3
|
-
|
4
|
-
from queue import Queue, Empty # Python 3
|
5
|
-
except ImportError:
|
6
|
-
from Queue import Queue, Empty # Python 2
|
7
|
-
import time
|
8
|
-
import os, sys
|
9
|
-
import datetime
|
2
|
+
from queue import Queue, Empty
|
10
3
|
import platform
|
11
4
|
from quarchpy.qis import isQisRunning, startLocalQis
|
12
|
-
from quarchpy.connection_specific.connection_QIS import QisInterface
|
13
5
|
from quarchpy.connection_specific.connection_QPS import QpsInterface
|
14
6
|
from quarchpy.connection_specific.jdk_j21_jres.fix_permissions import main as fix_permissions, find_java_permissions
|
15
7
|
from quarchpy.user_interface import *
|
@@ -91,6 +83,7 @@ def startLocalQps(keepQisRunning=False, args=[], timeout=30, startQPSMinimised=T
|
|
91
83
|
java_path = os.path.dirname(os.path.abspath(__file__))
|
92
84
|
java_path, junk = os.path.split(java_path)
|
93
85
|
java_path = os.path.join(java_path, "connection_specific", "jdk_j21_jres")
|
86
|
+
java_path = "\"" + java_path
|
94
87
|
# Start to build the path towards qps.jar
|
95
88
|
qps_path = os.path.dirname(os.path.abspath(__file__))
|
96
89
|
qps_path, junk = os.path.split(qps_path)
|
@@ -146,17 +139,17 @@ def startLocalQps(keepQisRunning=False, args=[], timeout=30, startQPSMinimised=T
|
|
146
139
|
|
147
140
|
# OS dependency
|
148
141
|
if current_os in "Windows":
|
149
|
-
command = java_path + "\\win_amd64_jdk_21_jre\\bin\\java -jar qps.jar " + str(args)
|
142
|
+
command = java_path + "\\win_amd64_jdk_21_jre\\bin\\java\" -jar qps.jar " + str(args)
|
150
143
|
elif current_os in "Linux" and current_arch == "x86_64":
|
151
|
-
command = java_path + "/lin_amd64_jdk_21_jre/bin/java -jar qps.jar " + str(args)
|
144
|
+
command = java_path + "/lin_amd64_jdk_21_jre/bin/java\" -jar qps.jar " + str(args)
|
152
145
|
elif current_os in "Linux" and current_arch == "aarch64":
|
153
|
-
command = java_path + "/lin_arm64_jdk_21_jre/bin/java -jar qps.jar " + str(args)
|
146
|
+
command = java_path + "/lin_arm64_jdk_21_jre/bin/java\" -jar qps.jar " + str(args)
|
154
147
|
elif current_os in "Darwin" and current_arch == "x86_64":
|
155
|
-
command = java_path + "/mac_amd64_jdk_21_jre/bin/java -jar qps.jar " + str(args)
|
148
|
+
command = java_path + "/mac_amd64_jdk_21_jre/bin/java\" -jar qps.jar " + str(args)
|
156
149
|
elif current_os in "Darwin" and current_arch == "arm64":
|
157
|
-
command = java_path + "/mac_arm64_jdk_21_jre/bin/java -jar qps.jar " + str(args)
|
150
|
+
command = java_path + "/mac_arm64_jdk_21_jre/bin/java\" -jar qps.jar " + str(args)
|
158
151
|
else: # default to windows
|
159
|
-
command = java_path + "\\win_amd64_jdk_21_jre\\bin\\java -jar qps.jar " + str(args)
|
152
|
+
command = java_path + "\\win_amd64_jdk_21_jre\\bin\\java\" -jar qps.jar " + str(args)
|
160
153
|
|
161
154
|
if "-logging=ON" in str(args): #If logging to a terminal window is on then os.system should be used to keep a window open to view logging.
|
162
155
|
if current_os in "Windows":
|
@@ -177,12 +170,12 @@ def startLocalQps(keepQisRunning=False, args=[], timeout=30, startQPSMinimised=T
|
|
177
170
|
_get_std_msg_and_err_from_QPS_process(process)
|
178
171
|
if time.time() - startTime > timeout:
|
179
172
|
os.chdir(current_dir)
|
180
|
-
raise
|
173
|
+
raise TimeoutError("QPS failed to launch within timelimit of " + str(timeout) + " sec.")
|
181
174
|
logging.debug("QPS detected after " + str(time.time() - startTime) + "s")
|
182
175
|
|
183
176
|
while not isQisRunning():
|
184
177
|
if time.time() - startTime > timeout:
|
185
|
-
raise
|
178
|
+
raise TimeoutError(
|
186
179
|
"QPS did launch but QIS did not respond during the timeout time of " + str(timeout) + " sec.")
|
187
180
|
time.sleep(0.2)
|
188
181
|
logging.debug("QIS detected after " + str(time.time() - startTime) + "s")
|
quarchpy/run.py
CHANGED
@@ -14,7 +14,7 @@ sys.path.insert(0, parent_dir) #It must be added at the start of the list so it
|
|
14
14
|
|
15
15
|
# Import the various functions which need to be called from the command line options
|
16
16
|
from quarchpy.debug.SystemTest import main as systemTestMain
|
17
|
-
|
17
|
+
from quarchpy.debug.module_debug import parse_arguments as moduleDebugMain
|
18
18
|
from quarchpy.qis.qisFuncs import startLocalQis, isQisRunning, closeQis as closeQIS
|
19
19
|
from quarchpy.qps.qpsFuncs import startLocalQps, isQpsRunning, closeQps as closeQPS
|
20
20
|
from quarchpy.debug.upgrade_quarchpy import main as uprade_quarchpy_main
|
@@ -127,8 +127,8 @@ def _run_module_debug_function(args=None):
|
|
127
127
|
List of sub arguments to process
|
128
128
|
|
129
129
|
"""
|
130
|
-
|
131
|
-
|
130
|
+
|
131
|
+
moduleDebugMain(args)
|
132
132
|
|
133
133
|
def _run_show_drives_function(args=None):
|
134
134
|
"""
|
quarchpy/utilities/TestCenter.py
CHANGED
@@ -9,7 +9,7 @@ as such, communication is based on simple strings
|
|
9
9
|
from inspect import getframeinfo, stack
|
10
10
|
import sys
|
11
11
|
|
12
|
-
def setup (interface_name, stack_level=1
|
12
|
+
def setup (interface_name, *command_params, stack_level=1):
|
13
13
|
"""
|
14
14
|
Sets up a test interface, passing the interface parameters onto TestCenter to process
|
15
15
|
|
@@ -45,7 +45,7 @@ def setup (interface_name, stack_level=1, *command_params):
|
|
45
45
|
return sys.stdin.readline().strip();
|
46
46
|
|
47
47
|
# Runs an interface setup function
|
48
|
-
def testPoint (command_name, stack_level=1
|
48
|
+
def testPoint (command_name, *command_params, stack_level=1):
|
49
49
|
"""
|
50
50
|
Runs a test point from the testcenter library functions
|
51
51
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: quarchpy
|
3
|
-
Version: 2.2.
|
3
|
+
Version: 2.2.8.dev1
|
4
4
|
Summary: This packpage offers Python support for Quarch Technology modules.
|
5
5
|
Author: Quarch Technology ltd
|
6
6
|
Author-email: support@quarch.com
|
@@ -36,9 +36,10 @@ Quarchpy
|
|
36
36
|
Change Log
|
37
37
|
----------
|
38
38
|
|
39
|
-
|
39
|
+
|
40
|
+
2.2.7
|
40
41
|
-----
|
41
|
-
-
|
42
|
+
- Bug fix for QIS 1.47 missing lib for linux only
|
42
43
|
|
43
44
|
2.2.6
|
44
45
|
-----
|