quarchpy 2.1.20.dev1__py2.py3-none-any.whl → 2.1.20.dev3__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.
Files changed (152) hide show
  1. quarchpy/.idea/.name +1 -1
  2. quarchpy/.idea/inspectionProfiles/Project_Default.xml +26 -0
  3. quarchpy/.idea/modules.xml +0 -1
  4. quarchpy/.idea/quarchpy.iml +1 -4
  5. quarchpy/.idea/workspace.xml +25 -230
  6. quarchpy/__pycache__/__init__.cpython-311.pyc +0 -0
  7. quarchpy/__pycache__/_version.cpython-311.pyc +0 -0
  8. quarchpy/__pycache__/connection.cpython-311.pyc +0 -0
  9. quarchpy/__pycache__/run.cpython-311.pyc +0 -0
  10. quarchpy/_version.py +1 -1
  11. quarchpy/config_files/__pycache__/__init__.cpython-311.pyc +0 -0
  12. quarchpy/config_files/__pycache__/quarch_config_parser.cpython-311.pyc +0 -0
  13. quarchpy/connection_specific/QPS/qis/help.txt +12 -4
  14. quarchpy/connection_specific/QPS/qis/qis.jar +0 -0
  15. quarchpy/connection_specific/QPS/qis/qis_lib/CInterface-1.7.8.jar +0 -0
  16. quarchpy/connection_specific/QPS/qis/qis_lib/Collections-2.4.jar +0 -0
  17. quarchpy/connection_specific/QPS/qis/qis_lib/Desktop-1.1.jar +0 -0
  18. quarchpy/connection_specific/QPS/qis/qis_lib/Executor-3.13.jar +0 -0
  19. quarchpy/connection_specific/QPS/qis/qis_lib/JNA-1.2.jar +0 -0
  20. quarchpy/connection_specific/QPS/qis/qis_lib/OS-1.8.jar +0 -0
  21. quarchpy/connection_specific/QPS/qis/qis_lib/QuarchCommon-0.2.9.jar +0 -0
  22. quarchpy/connection_specific/QPS/qis/qis_lib/SystemTray-4.4.jar +0 -0
  23. quarchpy/connection_specific/QPS/qis/qis_lib/Updates-1.1.jar +0 -0
  24. quarchpy/connection_specific/QPS/qis/qis_lib/Utilities-1.46.jar +0 -0
  25. quarchpy/connection_specific/QPS/qis/qis_lib/commons-csv-1.8.jar +0 -0
  26. quarchpy/connection_specific/QPS/qis/qis_lib/javassist-3.29.2-GA.jar +0 -0
  27. quarchpy/connection_specific/QPS/qis/qis_lib/jna-jpms-5.12.1.jar +0 -0
  28. quarchpy/connection_specific/QPS/qis/qis_lib/jna-platform-jpms-5.12.1.jar +0 -0
  29. quarchpy/connection_specific/QPS/qis/qis_lib/kotlin-stdlib-1.9.21.jar +0 -0
  30. quarchpy/connection_specific/QPS/qis/qis_lib/slf4j-api-2.0.9.jar +0 -0
  31. quarchpy/connection_specific/QPS/qis/qis_lib/slf4j-simple-2.0.9.jar +0 -0
  32. quarchpy/connection_specific/QPS/qis/resources/filters/Example.txt +36 -0
  33. quarchpy/connection_specific/QPS/qis/resources/filters/filters.csv +1004 -0
  34. quarchpy/connection_specific/QPS/qis/resources/filters/iec_filters.xml +26 -0
  35. quarchpy/connection_specific/QPS/qis/resources/filters/iec_filters.xml.bak +26 -0
  36. quarchpy/connection_specific/QPS/qps.jar +0 -0
  37. quarchpy/connection_specific/QPS/qps_lib/QuarchCommon-0.2.9.jar +0 -0
  38. quarchpy/connection_specific/QPS/qps_lib/commons-lang3-3.12.0.jar +0 -0
  39. quarchpy/connection_specific/QPS/qps_lib/opencsv-5.9.jar +0 -0
  40. quarchpy/connection_specific/QPS/qps_lib/qis-1.40.jar +0 -0
  41. quarchpy/connection_specific/QPS/scriptCommands.txt +2 -2
  42. quarchpy/connection_specific/__pycache__/StreamChannels.cpython-311.pyc +0 -0
  43. quarchpy/connection_specific/__pycache__/__init__.cpython-311.pyc +0 -0
  44. quarchpy/connection_specific/__pycache__/connection_QIS.cpython-311.pyc +0 -0
  45. quarchpy/connection_specific/__pycache__/connection_QPS.cpython-311.pyc +0 -0
  46. quarchpy/connection_specific/__pycache__/connection_ReST.cpython-311.pyc +0 -0
  47. quarchpy/connection_specific/__pycache__/connection_Serial.cpython-311.pyc +0 -0
  48. quarchpy/connection_specific/__pycache__/connection_TCP.cpython-311.pyc +0 -0
  49. quarchpy/connection_specific/__pycache__/connection_Telnet.cpython-311.pyc +0 -0
  50. quarchpy/connection_specific/__pycache__/connection_USB.cpython-311.pyc +0 -0
  51. quarchpy/connection_specific/__pycache__/connection_mDNS.cpython-311.pyc +0 -0
  52. quarchpy/connection_specific/connection_QIS.py +5 -3
  53. quarchpy/connection_specific/connection_QIS.py.bak +1738 -0
  54. quarchpy/connection_specific/serial/__pycache__/__init__.cpython-311.pyc +0 -0
  55. quarchpy/connection_specific/serial/__pycache__/serialutil.cpython-311.pyc +0 -0
  56. quarchpy/connection_specific/serial/__pycache__/serialwin32.cpython-311.pyc +0 -0
  57. quarchpy/connection_specific/serial/__pycache__/win32.cpython-311.pyc +0 -0
  58. quarchpy/connection_specific/serial/tools/__pycache__/__init__.cpython-311.pyc +0 -0
  59. quarchpy/connection_specific/serial/tools/__pycache__/list_ports.cpython-311.pyc +0 -0
  60. quarchpy/connection_specific/serial/tools/__pycache__/list_ports_common.cpython-311.pyc +0 -0
  61. quarchpy/connection_specific/serial/tools/__pycache__/list_ports_windows.cpython-311.pyc +0 -0
  62. quarchpy/connection_specific/usb_libs/__pycache__/libusb1.cpython-311.pyc +0 -0
  63. quarchpy/connection_specific/usb_libs/__pycache__/usb1.cpython-311.pyc +0 -0
  64. quarchpy/debug/TextScanIP.py +11 -0
  65. quarchpy/debug/__pycache__/SystemTest.cpython-311.pyc +0 -0
  66. quarchpy/debug/__pycache__/__init__.cpython-311.pyc +0 -0
  67. quarchpy/debug/__pycache__/module_debug.cpython-311.pyc +0 -0
  68. quarchpy/debug/__pycache__/simple_terminal.cpython-311.pyc +0 -0
  69. quarchpy/debug/__pycache__/upgrade_quarchpy.cpython-311.pyc +0 -0
  70. quarchpy/debug/__pycache__/versionCompare.cpython-311.pyc +0 -0
  71. quarchpy/debug/simple_terminal.py +29 -25
  72. quarchpy/device/__pycache__/__init__.cpython-311.pyc +0 -0
  73. quarchpy/device/__pycache__/device.cpython-311.pyc +0 -0
  74. quarchpy/device/__pycache__/quarchArray.cpython-311.pyc +0 -0
  75. quarchpy/device/__pycache__/quarchPPM.cpython-311.pyc +0 -0
  76. quarchpy/device/__pycache__/quarchQPS.cpython-311.pyc +0 -0
  77. quarchpy/device/__pycache__/scanDevices.cpython-311.pyc +0 -0
  78. quarchpy/device/device.py.bak +504 -0
  79. quarchpy/device/quarchPPM.py.bak +67 -0
  80. quarchpy/device/quarchQPS.py.bak +396 -0
  81. quarchpy/device/scanDevices.py +78 -86
  82. quarchpy/device/scanDevices.py.bak +126 -106
  83. quarchpy/disk_test/__pycache__/AbsDiskFinder.cpython-311.pyc +0 -0
  84. quarchpy/disk_test/__pycache__/DiskTargetSelection.cpython-311.pyc +0 -0
  85. quarchpy/disk_test/__pycache__/__init__.cpython-311.pyc +0 -0
  86. quarchpy/disk_test/__pycache__/iometerDiskFinder.cpython-311.pyc +0 -0
  87. quarchpy/docs/CHANGES.rst +10 -0
  88. quarchpy/docs/CHANGES.rst.bak +364 -0
  89. quarchpy/docs/_build/doctrees/CHANGES.doctree +0 -0
  90. quarchpy/docs/_build/doctrees/environment.pickle +0 -0
  91. quarchpy/docs/_build/doctrees/source/changelog.doctree +0 -0
  92. quarchpy/docs/_build/doctrees/source/quarchpy.fio.doctree +0 -0
  93. quarchpy/docs/_build/html/CHANGES.html +121 -113
  94. quarchpy/docs/_build/html/_sources/CHANGES.rst.txt +6 -1
  95. quarchpy/docs/_build/html/_static/alabaster.css +14 -9
  96. quarchpy/docs/_build/html/_static/basic.css +1 -1
  97. quarchpy/docs/_build/html/_static/pygments.css +1 -1
  98. quarchpy/docs/_build/html/genindex.html +9 -27
  99. quarchpy/docs/_build/html/index.html +62 -60
  100. quarchpy/docs/_build/html/objects.inv +0 -0
  101. quarchpy/docs/_build/html/py-modindex.html +7 -11
  102. quarchpy/docs/_build/html/readme.html +7 -6
  103. quarchpy/docs/_build/html/search.html +7 -6
  104. quarchpy/docs/_build/html/searchindex.js +1 -1
  105. quarchpy/docs/_build/html/source/changelog.html +176 -167
  106. quarchpy/docs/_build/html/source/licenses.html +7 -6
  107. quarchpy/docs/_build/html/source/modules.html +8 -7
  108. quarchpy/docs/_build/html/source/quarchpy.calibration.html +7 -6
  109. quarchpy/docs/_build/html/source/quarchpy.config_files.html +7 -6
  110. quarchpy/docs/_build/html/source/quarchpy.connection_specific.html +7 -6
  111. quarchpy/docs/_build/html/source/quarchpy.debug.html +7 -6
  112. quarchpy/docs/_build/html/source/quarchpy.device.html +7 -6
  113. quarchpy/docs/_build/html/source/quarchpy.disk_test.html +7 -6
  114. quarchpy/docs/_build/html/source/quarchpy.fio.html +9 -34
  115. quarchpy/docs/_build/html/source/quarchpy.html +8 -16
  116. quarchpy/docs/_build/html/source/quarchpy.iometer.html +7 -6
  117. quarchpy/docs/_build/html/source/quarchpy.qis.html +7 -6
  118. quarchpy/docs/_build/html/source/quarchpy.qps.html +7 -6
  119. quarchpy/docs/_build/html/source/quarchpy.user_interface.html +7 -6
  120. quarchpy/docs/_build/html/source/quarchpy.utilities.html +7 -6
  121. quarchpy/docs/_build/html/source/readme.html +7 -6
  122. quarchpy/fio/__pycache__/FIO_interface.cpython-311.pyc +0 -0
  123. quarchpy/fio/__pycache__/__init__.cpython-311.pyc +0 -0
  124. quarchpy/fio/__pycache__/fioDiskFinder.cpython-311.pyc +0 -0
  125. quarchpy/iometer/__pycache__/__init__.cpython-311.pyc +0 -0
  126. quarchpy/iometer/__pycache__/gen_iometer_template.cpython-311.pyc +0 -0
  127. quarchpy/iometer/__pycache__/iometerFuncs.cpython-311.pyc +0 -0
  128. quarchpy/qis/__pycache__/StreamHeaderInfo.cpython-311.pyc +0 -0
  129. quarchpy/qis/__pycache__/__init__.cpython-311.pyc +0 -0
  130. quarchpy/qis/__pycache__/qisFuncs.cpython-311.pyc +0 -0
  131. quarchpy/qis/qisFuncs.py +48 -14
  132. quarchpy/qps/__pycache__/__init__.cpython-311.pyc +0 -0
  133. quarchpy/qps/__pycache__/qpsFuncs.cpython-311.pyc +0 -0
  134. quarchpy/qps/qpsFuncs.py.bak +28 -68
  135. quarchpy/user_interface/__pycache__/__init__.cpython-311.pyc +0 -0
  136. quarchpy/user_interface/__pycache__/user_interface.cpython-311.pyc +0 -0
  137. quarchpy/user_interface/user_interface.py.bak +749 -0
  138. quarchpy/utilities/TestCenter.py.bak +150 -0
  139. quarchpy/utilities/__pycache__/BitManipulation.cpython-311.pyc +0 -0
  140. quarchpy/utilities/__pycache__/TestCenter.cpython-311.pyc +0 -0
  141. quarchpy/utilities/__pycache__/TimeValue.cpython-311.pyc +0 -0
  142. quarchpy/utilities/__pycache__/Version.cpython-311.pyc +0 -0
  143. quarchpy/utilities/__pycache__/__init__.cpython-311.pyc +0 -0
  144. {quarchpy-2.1.20.dev1.dist-info → quarchpy-2.1.20.dev3.dist-info}/METADATA +11 -1
  145. {quarchpy-2.1.20.dev1.dist-info → quarchpy-2.1.20.dev3.dist-info}/RECORD +147 -115
  146. quarchpy/_version.py.bak +0 -1
  147. quarchpy/connection_specific/connection_mDNS.py.bak +0 -48
  148. quarchpy/debug/SystemTest.py.bak +0 -188
  149. quarchpy/fio/FIO_interface.py.bak +0 -322
  150. quarchpy/run.py.bak +0 -283
  151. {quarchpy-2.1.20.dev1.dist-info → quarchpy-2.1.20.dev3.dist-info}/WHEEL +0 -0
  152. {quarchpy-2.1.20.dev1.dist-info → quarchpy-2.1.20.dev3.dist-info}/top_level.txt +0 -0
@@ -6,8 +6,8 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
7
7
 
8
8
  <title>quarchpy.utilities package &#8212; quarchpy documentation</title>
9
- <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b3523f8e" />
10
- <link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=039e1c02" />
9
+ <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=61cd365c" />
10
+ <link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=12dfc556" />
11
11
  <script src="../_static/documentation_options.js?v=5929fcd5"></script>
12
12
  <script src="../_static/doctools.js?v=888ff710"></script>
13
13
  <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
@@ -18,8 +18,9 @@
18
18
 
19
19
  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
20
20
 
21
+
22
+
21
23
 
22
- <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
23
24
 
24
25
  </head><body>
25
26
 
@@ -193,11 +194,11 @@ on the reporting of the results.</p>
193
194
  <div class="clearer"></div>
194
195
  </div>
195
196
  <div class="footer">
196
- &copy;2020, Quarch Technology Ltd.
197
+ &#169;2020, Quarch Technology Ltd.
197
198
 
198
199
  |
199
- Powered by <a href="http://sphinx-doc.org/">Sphinx 7.2.6</a>
200
- &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
200
+ Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.2.6</a>
201
+ &amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
201
202
 
202
203
  |
203
204
  <a href="../_sources/source/quarchpy.utilities.rst.txt"
@@ -6,8 +6,8 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
7
7
 
8
8
  <title>Quarchpy - Readme &#8212; quarchpy documentation</title>
9
- <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b3523f8e" />
10
- <link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=039e1c02" />
9
+ <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=61cd365c" />
10
+ <link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=12dfc556" />
11
11
  <script src="../_static/documentation_options.js?v=5929fcd5"></script>
12
12
  <script src="../_static/doctools.js?v=888ff710"></script>
13
13
  <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
@@ -18,8 +18,9 @@
18
18
 
19
19
  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
20
20
 
21
+
22
+
21
23
 
22
- <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
23
24
 
24
25
  </head><body>
25
26
 
@@ -129,11 +130,11 @@
129
130
  <div class="clearer"></div>
130
131
  </div>
131
132
  <div class="footer">
132
- &copy;2020, Quarch Technology Ltd.
133
+ &#169;2020, Quarch Technology Ltd.
133
134
 
134
135
  |
135
- Powered by <a href="http://sphinx-doc.org/">Sphinx 7.2.6</a>
136
- &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
136
+ Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.2.6</a>
137
+ &amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
137
138
 
138
139
  |
139
140
  <a href="../_sources/source/readme.rst.txt"
quarchpy/qis/qisFuncs.py CHANGED
@@ -11,38 +11,71 @@ from quarchpy.user_interface.user_interface import printText
11
11
  import subprocess
12
12
  import logging
13
13
 
14
- def isQisRunning():
14
+ def isQisRunning():
15
15
  """
16
16
  Checks if a local instance of QIS is running and responding
17
-
18
17
  Returns
19
18
  -------
20
19
  is_running : bool
21
20
  True if QIS is running and responding
22
-
23
21
  """
24
-
22
+
25
23
  qisRunning = False
26
24
  myQis = None
27
-
28
25
  #attempt to connect to Qis
29
26
  try:
30
27
  myQis = QisInterface(connectionMessage=False)
31
28
  if (myQis is not None):
32
29
  #if we can connect to qis, it's running
33
- qisRunning = True
30
+ qisRunning = True
34
31
  except:
35
32
  #if there's no connection to qis, an exception will be caught
36
- pass
37
-
33
+ pass
38
34
  if (qisRunning is False):
39
35
  logging.debug("QIS is not running")
40
36
  return False
41
37
  else:
42
38
  logging.debug("QIS is running")
43
39
  return True
44
-
45
- def startLocalQis(terminal=False, headless=False, args=None):
40
+
41
+
42
+ def isQisRunningAndResponding(timeout=2):
43
+ """
44
+ checks if qis is running and responding to a $version
45
+ """
46
+ qisRunning = isQisRunning()
47
+ if qisRunning ==False:
48
+ logging.debug("QIS is not running")
49
+ return False
50
+
51
+ logging.debug("Qis is running")
52
+ myQis = QisInterface(connectionMessage=False)
53
+ counter = 0
54
+ maxCounter = 20
55
+ while counter <= maxCounter:
56
+ print(str(counter)) # TODO Remove sb db
57
+ versionResponse = myQis.sendAndReceiveCmd(cmd="$version")
58
+ if ": v" in versionResponse.lower():
59
+ qisResponding = True
60
+ break
61
+ else:
62
+ logging.debug("Qis returned from $version: " + str(versionResponse) + " Expected to contain ': v'")
63
+ print("Qis returned from $version: " + str(
64
+ versionResponse) + " Expected to contain ': v'") # TODO Remove sb db
65
+
66
+ time.sleep(timeout / maxCounter) # We attempt to get QIS
67
+ counter += 1
68
+
69
+
70
+ if (qisRunning is False):
71
+ logging.debug("QIS is not running")
72
+ return False
73
+ else:
74
+ logging.debug("QIS is running")
75
+ return True
76
+
77
+
78
+ def startLocalQis(terminal=False, headless=False, args=None, timeout=20):
46
79
  """
47
80
  Executes QIS on the local system, using the version contained within quarchpy
48
81
 
@@ -95,16 +128,17 @@ def startLocalQis(terminal=False, headless=False, args=None):
95
128
  process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
96
129
 
97
130
  startTime = time.time() #Checks for Popen launch only
98
- timeout = 10
99
- last_error = ""
100
- last_out = ""
101
131
  while not isQisRunning():
102
132
  _get_std_msg_and_err_from_QIS_process(process)
103
-
104
133
  if time.time() - startTime > timeout:
105
134
  raise TimeoutError("QIS failed to launch within timelimit of " + str(timeout) + " sec.")
106
135
  pass
107
136
 
137
+ if isQisRunningAndResponding(timeout=timeout):
138
+ logging.debug("QPS running and responding")
139
+ else:
140
+ logging.debug("QIS running but not responding")
141
+
108
142
  #change directory back to start directory
109
143
  os.chdir(current_direc)
110
144
 
@@ -1,9 +1,6 @@
1
- from threading import Thread, Lock, Event, active_count
2
- from queue import Queue, Empty
3
- import time
4
1
  import os, sys
5
2
  import datetime
6
- import platform
3
+ import time, platform
7
4
  from quarchpy.qis import isQisRunning, startLocalQis
8
5
  from quarchpy.connection_specific.connection_QIS import QisInterface
9
6
  from quarchpy.connection_specific.connection_QPS import QpsInterface
@@ -69,7 +66,7 @@ def isQpsRunning(host='127.0.0.1', port=9822, timeout=0):
69
66
  return False
70
67
 
71
68
 
72
- def startLocalQps(keepQisRunning=False, args=[], timeout=30):
69
+ def startLocalQps(keepQisRunning=False, args=[]):
73
70
  if keepQisRunning:
74
71
  if not isQisRunning():
75
72
  startLocalQis()
@@ -79,76 +76,39 @@ def startLocalQps(keepQisRunning=False, args=[], timeout=30):
79
76
  QpsPath = os.path.dirname(os.path.abspath(__file__))
80
77
  QpsPath, junk = os.path.split(QpsPath)
81
78
  QpsPath = os.path.join(QpsPath, "connection_specific", "QPS", "qps.jar")
82
- current_dir = os.getcwd()
79
+
80
+ current_direc = os.getcwd()
81
+
83
82
  os.chdir(os.path.dirname(QpsPath))
84
83
 
85
- command = "java -jar \"" + QpsPath + "\"" + " " + str(args)
86
- 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.
84
+ command = "-jar \"" + QpsPath + "\""
85
+
86
+ currentOs = platform.system()
87
+
88
+ if currentOs in "Windows":
89
+ if "-logging=ON" not in str(args):
90
+ command = "start /high /b javaw -Djava.awt.headless=true " + command + " " + str(args)
91
+ else:
92
+ command = "java " + command + " " + str(args)
93
+ # command = "start /high /b javaw -Djava.awt.headless=true " + command + " " + str(args) # Running application with this method seems to prevent QPS from logging to terminal
94
+ # command = command + " -ccs=HIDE" # note: multiple -ccs options ignored
87
95
  os.system(command)
88
- else:
96
+ elif currentOs in "Linux":
97
+ command = command + "-ccs=HIDE"
89
98
  if sys.version_info[0] < 3:
90
- process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
99
+ os.popen2("java " + command + " 2>&1")
91
100
  else:
92
- process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
101
+ os.popen("java " + command + " 2>&1")
102
+ else: # default to Windows
103
+ command = "start /high /b javaw -Djava.awt.headless=true " + command + " " + str(args)
104
+ command = command + " -ccs=HIDE"
105
+ os.system(command)
93
106
 
94
- startTime = time.time()
95
107
  while not isQpsRunning():
96
- time.sleep(0.2)
97
- _get_std_msg_and_err_from_QPS_process(process)
98
-
99
- if time.time() - startTime > timeout:
100
- os.chdir(current_dir)
101
- raise TimeoutError("QPS failed to launch within timelimit of " + str(timeout) + " sec.")
102
- # return current working directory
103
- os.chdir(current_dir)
108
+ time.sleep(0.3)
109
+ pass
104
110
 
105
- def reader(stream, q, source, lock,stop_flag):
106
- '''
107
- Used to read output and place it in a queue for multithreaded reading
108
- :param stream:
109
- :param q:
110
- :param source:
111
- :param lock: The lock for the queue
112
- :param stop_flag: Flag to exit the loop and close the thread
113
- :return: None
114
- '''
115
- while not stop_flag.is_set():
116
- line = stream.readline()
117
- if not line:
118
- break
119
- with lock:
120
- q.put((source, line.strip()))
121
-
122
- def _get_std_msg_and_err_from_QPS_process(process):
123
- '''
124
- Uses multithreading to check for stderr and stdmsg passed by the process that launches QPS
125
- This allows the user to understand why QPS might not have appeared.
126
- :param process: The Process Used to launch QPS
127
- :return: None
128
- '''
129
- # Read back stdmsg and stderr in seperate threads so they are non blocking
130
- q = Queue()
131
- lock = Lock()
132
- stop_flag = Event()
133
-
134
- t1 = Thread(target=reader, args=[process.stdout, q, 'stdout', lock, stop_flag])
135
- t2 = Thread(target=reader, args=[process.stderr, q, 'stderr', lock, stop_flag])
136
- t1.start()
137
- t2.start()
138
- counter = 0
139
- # check for stderr or stdmsg from the queue
140
- while counter <= 3: # If 3 empty reads from the queue then move on to see if QPS is running.
141
- try:
142
- source, line = q.get(timeout=1) # Wait for 1 second for new lines
143
- counter = 0
144
- if source == "stderr":
145
- logging.error(f"{source}: {line}")
146
- else:
147
- print(f"{source}: {line}")
148
- except Empty:
149
- counter += 1
150
- time.sleep(3)
151
- stop_flag.set() #Close the threads and return to the main loop where QPS is check to see if its started yet
111
+ os.chdir(current_direc)
152
112
 
153
113
 
154
114
  def closeQps(host='127.0.0.1', port=9822):
@@ -241,7 +201,7 @@ QPS requires time in mS with no decimal point, so this is converted here
241
201
 
242
202
  def toQpsTimeStamp(timestamp):
243
203
  """
244
- DEPRECATED - QPS expects time passed as a string and error handling is done in QPS.
204
+ DEPRICATED - QPS expects time passed as a sring and error hadling is done in QPS.
245
205
  Returns the parameter passed as a valid qps timestamp
246
206
  Assumes
247
207