quarchpy 2.1.17.dev2__py2.py3-none-any.whl → 2.1.18__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 -1
- quarchpy/.idea/workspace.xml +40 -40
- quarchpy/__pycache__/_version.cpython-311.pyc +0 -0
- quarchpy/__pycache__/run.cpython-311.pyc +0 -0
- quarchpy/_version.py +1 -1
- quarchpy/connection_specific/QPS/qis/help.txt +1 -7
- quarchpy/connection_specific/QPS/qis/qis.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/CInterface-1.7.04.jar +0 -0
- quarchpy/connection_specific/QPS/qps.jar +0 -0
- quarchpy/connection_specific/QPS/scriptCommands.txt +2 -2
- quarchpy/connection_specific/__pycache__/connection_QPS.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_ReST.cpython-311.pyc +0 -0
- quarchpy/connection_specific/connection_mDNS.py +4 -7
- quarchpy/connection_specific/connection_mDNS.py.bak +48 -0
- quarchpy/debug/SystemTest.py +6 -1
- quarchpy/debug/SystemTest.py.bak +188 -0
- quarchpy/debug/__pycache__/SystemTest.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/module_debug.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/scanDevices.cpython-311.pyc +0 -0
- quarchpy/device/scanDevices.py +7 -26
- quarchpy/device/scanDevices.py.bak +645 -0
- quarchpy/docs/CHANGES.rst +18 -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/doctrees/source/quarchpy.qis.doctree +0 -0
- quarchpy/docs/_build/doctrees/source/quarchpy.qps.doctree +0 -0
- quarchpy/docs/_build/html/CHANGES.html +121 -101
- quarchpy/docs/_build/html/_sources/CHANGES.rst.txt +14 -0
- quarchpy/docs/_build/html/genindex.html +27 -2
- quarchpy/docs/_build/html/index.html +54 -51
- quarchpy/docs/_build/html/objects.inv +0 -0
- quarchpy/docs/_build/html/py-modindex.html +5 -0
- quarchpy/docs/_build/html/searchindex.js +1 -1
- quarchpy/docs/_build/html/source/changelog.html +175 -152
- quarchpy/docs/_build/html/source/modules.html +1 -1
- quarchpy/docs/_build/html/source/quarchpy.fio.html +28 -2
- quarchpy/docs/_build/html/source/quarchpy.html +12 -1
- quarchpy/docs/_build/html/source/quarchpy.qis.html +12 -0
- quarchpy/docs/_build/html/source/quarchpy.qps.html +14 -2
- quarchpy/fio/__pycache__/FIO_interface.cpython-311.pyc +0 -0
- quarchpy/qis/__pycache__/qisFuncs.cpython-311.pyc +0 -0
- quarchpy/qis/qisFuncs.py +54 -12
- quarchpy/qps/__pycache__/qpsFuncs.cpython-311.pyc +0 -0
- quarchpy/qps/qpsFuncs.py +60 -20
- quarchpy/qps/qpsFuncs.py.bak +66 -18
- {quarchpy-2.1.17.dev2.dist-info → quarchpy-2.1.18.dist-info}/METADATA +22 -1
- {quarchpy-2.1.17.dev2.dist-info → quarchpy-2.1.18.dist-info}/RECORD +51 -80
- quarchpy/connection_specific/QPS/qis/qis_lib/CInterface-1.7.02.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/CInterface-1.7.8.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/Collections-1.2.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/Collections-2.4.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/Desktop-1.0.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/Desktop-1.1.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/Executor-3.11.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/Executor-3.13.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/JNA-1.0.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/JNA-1.2.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/OS-1.6.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/OS-1.8.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/QuarchCommon-0.2.9.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/SystemTray-4.2.1.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/SystemTray-4.4.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/Updates-1.1.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/Utilities-1.39.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/Utilities-1.46.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/commons-csv-1.8.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/javassist-3.29.2-GA.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/jna-jpms-5.12.1.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/jna-platform-jpms-5.12.1.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/kotlin-stdlib-1.7.22.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/kotlin-stdlib-1.9.21.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/slf4j-api-2.0.9.jar +0 -0
- quarchpy/connection_specific/QPS/qis/qis_lib/slf4j-simple-2.0.9.jar +0 -0
- quarchpy/connection_specific/QPS/qis/resources/filters/filters.csv +0 -1004
- quarchpy/connection_specific/QPS/qis/resources/filters/iec_filters.xml +0 -21
- quarchpy/connection_specific/QPS/qps_lib/QuarchCommon-0.2.11.jar +0 -0
- quarchpy/connection_specific/QPS/qps_lib/commons-lang3-3.12.0.jar +0 -0
- quarchpy/connection_specific/QPS/qps_lib/opencsv-5.9.jar +0 -0
- quarchpy/connection_specific/QPS/qps_lib/qis-1.40.jar +0 -0
- {quarchpy-2.1.17.dev2.dist-info → quarchpy-2.1.18.dist-info}/WHEEL +0 -0
- {quarchpy-2.1.17.dev2.dist-info → quarchpy-2.1.18.dist-info}/top_level.txt +0 -0
quarchpy/.idea/.name
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
run.py
|
quarchpy/.idea/workspace.xml
CHANGED
@@ -22,18 +22,18 @@
|
|
22
22
|
<option name="hideEmptyMiddlePackages" value="true" />
|
23
23
|
<option name="showLibraryContents" value="true" />
|
24
24
|
</component>
|
25
|
-
<component name="PropertiesComponent"
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
<component name="PropertiesComponent">{
|
26
|
+
"keyToString": {
|
27
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
28
|
+
"last_opened_file_path": "P:/Software/Application Notes/AN-017 - QPS performance test with FIO/Trunk",
|
29
|
+
"settings.editor.selected.configurable": "diff.base"
|
30
30
|
},
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
"keyToStringList": {
|
32
|
+
"com.intellij.ide.scratch.ScratchImplUtil$2/New Scratch File": [
|
33
|
+
"Python"
|
34
34
|
]
|
35
35
|
}
|
36
|
-
}
|
36
|
+
}</component>
|
37
37
|
<component name="PyConsoleOptionsProvider">
|
38
38
|
<option name="myPythonConsoleState">
|
39
39
|
<console-settings module-name="quarchpy" is-module-sdk="true">
|
@@ -73,7 +73,7 @@
|
|
73
73
|
<option name="INPUT_FILE" value="" />
|
74
74
|
<method v="2" />
|
75
75
|
</configuration>
|
76
|
-
<configuration name="
|
76
|
+
<configuration name="performanceTestFIO" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
77
77
|
<module name="Application Notes" />
|
78
78
|
<option name="INTERPRETER_OPTIONS" value="" />
|
79
79
|
<option name="PARENT_ENVS" value="true" />
|
@@ -85,7 +85,7 @@
|
|
85
85
|
<option name="IS_MODULE_SDK" value="true" />
|
86
86
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
87
87
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
88
|
-
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/../../../../Application Notes/AN-017 - QPS performance test with FIO/Trunk/
|
88
|
+
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/../../../../Application Notes/AN-017 - QPS performance test with FIO/Trunk/performanceTestFIO.py" />
|
89
89
|
<option name="PARAMETERS" value="" />
|
90
90
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
91
91
|
<option name="EMULATE_TERMINAL" value="false" />
|
@@ -94,19 +94,19 @@
|
|
94
94
|
<option name="INPUT_FILE" value="" />
|
95
95
|
<method v="2" />
|
96
96
|
</configuration>
|
97
|
-
<configuration name="
|
98
|
-
<module name="
|
97
|
+
<configuration name="qisFuncs" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
98
|
+
<module name="quarchpy" />
|
99
99
|
<option name="INTERPRETER_OPTIONS" value="" />
|
100
100
|
<option name="PARENT_ENVS" value="true" />
|
101
101
|
<envs>
|
102
102
|
<env name="PYTHONUNBUFFERED" value="1" />
|
103
103
|
</envs>
|
104
104
|
<option name="SDK_HOME" value="" />
|
105
|
-
<option name="WORKING_DIRECTORY" value="
|
105
|
+
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/qis" />
|
106
106
|
<option name="IS_MODULE_SDK" value="true" />
|
107
107
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
108
108
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
109
|
-
<option name="SCRIPT_NAME" value="
|
109
|
+
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/qis/qisFuncs.py" />
|
110
110
|
<option name="PARAMETERS" value="" />
|
111
111
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
112
112
|
<option name="EMULATE_TERMINAL" value="false" />
|
@@ -115,7 +115,7 @@
|
|
115
115
|
<option name="INPUT_FILE" value="" />
|
116
116
|
<method v="2" />
|
117
117
|
</configuration>
|
118
|
-
<configuration name="
|
118
|
+
<configuration name="qpsFuncs" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
119
119
|
<module name="quarchpy" />
|
120
120
|
<option name="INTERPRETER_OPTIONS" value="" />
|
121
121
|
<option name="PARENT_ENVS" value="true" />
|
@@ -123,11 +123,11 @@
|
|
123
123
|
<env name="PYTHONUNBUFFERED" value="1" />
|
124
124
|
</envs>
|
125
125
|
<option name="SDK_HOME" value="" />
|
126
|
-
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR
|
126
|
+
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/qps" />
|
127
127
|
<option name="IS_MODULE_SDK" value="true" />
|
128
128
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
129
129
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
130
|
-
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/
|
130
|
+
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/qps/qpsFuncs.py" />
|
131
131
|
<option name="PARAMETERS" value="" />
|
132
132
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
133
133
|
<option name="EMULATE_TERMINAL" value="false" />
|
@@ -136,7 +136,7 @@
|
|
136
136
|
<option name="INPUT_FILE" value="" />
|
137
137
|
<method v="2" />
|
138
138
|
</configuration>
|
139
|
-
<configuration name="run" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
139
|
+
<configuration name="run (2)" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
140
140
|
<module name="quarchpy" />
|
141
141
|
<option name="INTERPRETER_OPTIONS" value="" />
|
142
142
|
<option name="PARENT_ENVS" value="true" />
|
@@ -144,11 +144,11 @@
|
|
144
144
|
<env name="PYTHONUNBUFFERED" value="1" />
|
145
145
|
</envs>
|
146
146
|
<option name="SDK_HOME" value="" />
|
147
|
-
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR
|
148
|
-
<option name="IS_MODULE_SDK" value="
|
147
|
+
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
148
|
+
<option name="IS_MODULE_SDK" value="true" />
|
149
149
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
150
150
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
151
|
-
<option name="SCRIPT_NAME" value="$PROJECT_DIR
|
151
|
+
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/run.py" />
|
152
152
|
<option name="PARAMETERS" value="" />
|
153
153
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
154
154
|
<option name="EMULATE_TERMINAL" value="false" />
|
@@ -160,10 +160,10 @@
|
|
160
160
|
<recent_temporary>
|
161
161
|
<list>
|
162
162
|
<item itemvalue="Python.run (2)" />
|
163
|
+
<item itemvalue="Python.performanceTestFIO" />
|
164
|
+
<item itemvalue="Python.qisFuncs" />
|
165
|
+
<item itemvalue="Python.qpsFuncs" />
|
163
166
|
<item itemvalue="Python.QisStreamExample" />
|
164
|
-
<item itemvalue="Python.TestQPSLaunch" />
|
165
|
-
<item itemvalue="Python.run" />
|
166
|
-
<item itemvalue="Python.run (1)" />
|
167
167
|
</list>
|
168
168
|
</recent_temporary>
|
169
169
|
</component>
|
@@ -183,12 +183,12 @@
|
|
183
183
|
<breakpoints>
|
184
184
|
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
185
185
|
<url>file://$PROJECT_DIR$/debug/SystemTest.py</url>
|
186
|
-
<line>
|
186
|
+
<line>50</line>
|
187
187
|
<option name="timeStamp" value="4" />
|
188
188
|
</line-breakpoint>
|
189
189
|
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
190
190
|
<url>file://$PROJECT_DIR$/debug/SystemTest.py</url>
|
191
|
-
<line>
|
191
|
+
<line>52</line>
|
192
192
|
<option name="timeStamp" value="8" />
|
193
193
|
</line-breakpoint>
|
194
194
|
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
@@ -211,11 +211,6 @@
|
|
211
211
|
<line>1592</line>
|
212
212
|
<option name="timeStamp" value="16" />
|
213
213
|
</line-breakpoint>
|
214
|
-
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
215
|
-
<url>file://$PROJECT_DIR$/qis/qisFuncs.py</url>
|
216
|
-
<line>86</line>
|
217
|
-
<option name="timeStamp" value="18" />
|
218
|
-
</line-breakpoint>
|
219
214
|
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
220
215
|
<url>file://$PROJECT_DIR$/device/quarchQPS.py</url>
|
221
216
|
<line>398</line>
|
@@ -256,20 +251,25 @@
|
|
256
251
|
<line>198</line>
|
257
252
|
<option name="timeStamp" value="43" />
|
258
253
|
</line-breakpoint>
|
259
|
-
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
260
|
-
<url>file://$PROJECT_DIR$/run.py</url>
|
261
|
-
<line>282</line>
|
262
|
-
<option name="timeStamp" value="44" />
|
263
|
-
</line-breakpoint>
|
264
254
|
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
265
255
|
<url>file://$PROJECT_DIR$/run.py</url>
|
266
256
|
<line>217</line>
|
267
257
|
<option name="timeStamp" value="45" />
|
268
258
|
</line-breakpoint>
|
269
259
|
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
270
|
-
<url>file
|
271
|
-
<line>
|
272
|
-
<option name="timeStamp" value="
|
260
|
+
<url>file://$PROJECT_DIR$/../../../../Application Notes/AN-017 - QPS performance test with FIO/Trunk/performanceTestFIO.py</url>
|
261
|
+
<line>252</line>
|
262
|
+
<option name="timeStamp" value="66" />
|
263
|
+
</line-breakpoint>
|
264
|
+
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
265
|
+
<url>file://$PROJECT_DIR$/../../../../Application Notes/AN-017 - QPS performance test with FIO/Trunk/performanceTestFIO.py</url>
|
266
|
+
<line>246</line>
|
267
|
+
<option name="timeStamp" value="67" />
|
268
|
+
</line-breakpoint>
|
269
|
+
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
270
|
+
<url>file://$PROJECT_DIR$/../../../../Application Notes/AN-017 - QPS performance test with FIO/Trunk/performanceTestFIO.py</url>
|
271
|
+
<line>244</line>
|
272
|
+
<option name="timeStamp" value="68" />
|
273
273
|
</line-breakpoint>
|
274
274
|
</breakpoints>
|
275
275
|
<default-breakpoints>
|
Binary file
|
Binary file
|
quarchpy/_version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "2.1.
|
1
|
+
__version__ = "2.1.18"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
(C)Quarch Technology Ltd 2023, QIS v1.
|
1
|
+
(C)Quarch Technology Ltd 2023, QIS v1.38
|
2
2
|
|
3
3
|
qis:
|
4
4
|
|
@@ -190,12 +190,6 @@ $ Commands internal to qis:
|
|
190
190
|
|
191
191
|
$version
|
192
192
|
Returns QIS version number
|
193
|
-
|
194
|
-
$get filters
|
195
|
-
Returns name and sample rate of the loaded filter sets.
|
196
|
-
|
197
|
-
$load filter [directory path]
|
198
|
-
Loads all filter XML files found in the provided directory path - XML files must follow the standard layout.
|
199
193
|
|
200
194
|
Non $ Commands internal to qis:
|
201
195
|
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,14 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import logging
|
3
2
|
|
4
3
|
class MyListener:
|
5
4
|
def __init__(self):
|
6
5
|
self.found_devices = {}
|
7
6
|
|
8
|
-
def update_service(self, zc
|
7
|
+
def update_service(self, zc, type_, name):
|
9
8
|
return None
|
10
9
|
|
11
|
-
def remove_service(self, zc
|
10
|
+
def remove_service(self, zc, type_, name):
|
12
11
|
info = zc.get_service_info(type_, name)
|
13
12
|
if "Quarch:" in str(info):
|
14
13
|
decoded_properties = {key.decode('utf-8'): value.decode('utf-8') for key, value in info.properties.items()}
|
@@ -17,7 +16,7 @@ class MyListener:
|
|
17
16
|
if value == qtl_num:
|
18
17
|
del self.found_devices[key]
|
19
18
|
|
20
|
-
def add_service(self, zc
|
19
|
+
def add_service(self, zc, type_, name):
|
21
20
|
info = zc.get_service_info(type_, name)
|
22
21
|
if "Quarch:" in str(info):
|
23
22
|
# decode the incoming properties from mdns
|
@@ -39,5 +38,3 @@ class MyListener:
|
|
39
38
|
def update_device_dict(self, device_dict):
|
40
39
|
self.found_devices.update(device_dict)
|
41
40
|
|
42
|
-
|
43
|
-
listener = MyListener()
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import logging
|
2
|
+
|
3
|
+
class MyListener:
|
4
|
+
def __init__(self):
|
5
|
+
try:
|
6
|
+
from zeroconf import Zeroconf
|
7
|
+
except:
|
8
|
+
logging.debug("Exception while attempting to import zeroconf")
|
9
|
+
self.found_devices = {}
|
10
|
+
|
11
|
+
def update_service(self, zc, type_, name):
|
12
|
+
return None
|
13
|
+
|
14
|
+
def remove_service(self, zc, type_, name):
|
15
|
+
info = zc.get_service_info(type_, name)
|
16
|
+
if "Quarch:" in str(info):
|
17
|
+
decoded_properties = {key.decode('utf-8'): value.decode('utf-8') for key, value in info.properties.items()}
|
18
|
+
qtl_num = "QTL" + decoded_properties['86'] if '86' in decoded_properties else None
|
19
|
+
for key, value in self.found_devices:
|
20
|
+
if value == qtl_num:
|
21
|
+
del self.found_devices[key]
|
22
|
+
|
23
|
+
def add_service(self, zc, type_, name):
|
24
|
+
info = zc.get_service_info(type_, name)
|
25
|
+
if "Quarch:" in str(info):
|
26
|
+
# decode the incoming properties from mdns
|
27
|
+
decoded_properties = {key.decode('utf-8'): value.decode('utf-8') for key, value in info.properties.items()}
|
28
|
+
decoded_ip = ".".join(str(byte) for byte in info.addresses[0])
|
29
|
+
self.add_device(decoded_properties, decoded_ip)
|
30
|
+
|
31
|
+
def add_device(self, properties_dict, ip_address):
|
32
|
+
qtl_num = "QTL" + properties_dict['86'] if '86' in properties_dict else None
|
33
|
+
if '84' in properties_dict:
|
34
|
+
if properties_dict['84'] == '80':
|
35
|
+
# print("Rest connection exists for device: " + qtl_num)
|
36
|
+
self.update_device_dict(device_dict={"REST:" + ip_address: qtl_num})
|
37
|
+
if '85' in properties_dict:
|
38
|
+
if properties_dict['85'] == "9760":
|
39
|
+
# print("TCP connection exists for device: " + qtl_num)
|
40
|
+
self.update_device_dict(device_dict={"TCP:" + ip_address: qtl_num})
|
41
|
+
|
42
|
+
def update_device_dict(self, device_dict):
|
43
|
+
self.found_devices.update(device_dict)
|
44
|
+
|
45
|
+
mylistner=MyListener
|
46
|
+
|
47
|
+
scan_mDNS(mdnsListener)
|
48
|
+
foundDevices = mergeDict(foundDevices, mdnsListener.found_devices)
|
quarchpy/debug/SystemTest.py
CHANGED
@@ -33,8 +33,13 @@ def test_system_info():
|
|
33
33
|
print("OS Name: " + os.name)
|
34
34
|
print("Platform System: " + platform.system())
|
35
35
|
print("Platform: " + platform.platform())
|
36
|
-
|
36
|
+
|
37
|
+
if "nt" in os.name:
|
38
|
+
print("Platform Architecture: " + platform.architecture()[0])
|
39
|
+
else:
|
40
|
+
print(str(bytes(subprocess.check_output(['cat', '/etc/os-release'], stderr=subprocess.STDOUT)).decode()))
|
37
41
|
print("Platform Release: " + platform.release())
|
42
|
+
|
38
43
|
try:
|
39
44
|
print("Quarchpy Version: " + get_quarchpy_version())
|
40
45
|
except:
|
@@ -0,0 +1,188 @@
|
|
1
|
+
from quarchpy import *
|
2
|
+
from quarchpy.device import *
|
3
|
+
from importlib.metadata import distribution
|
4
|
+
import os
|
5
|
+
import platform
|
6
|
+
import sys
|
7
|
+
import subprocess
|
8
|
+
from quarchpy._version import __version__
|
9
|
+
|
10
|
+
def test_communication():
|
11
|
+
print("")
|
12
|
+
print("DEVICE COMMUNICATION TEST")
|
13
|
+
print("-------------------------")
|
14
|
+
print("")
|
15
|
+
deviceList = scanDevices('all', favouriteOnly=False)
|
16
|
+
print("Devices visible:\r\n" + str(deviceList))
|
17
|
+
print("")
|
18
|
+
moduleStr = userSelectDevice(deviceList, nice=True, additionalOptions=["Rescan", "Quit", "All Conn Types"])
|
19
|
+
if moduleStr == "quit":
|
20
|
+
print("User selected quit")
|
21
|
+
return 0
|
22
|
+
print("Selected module is: " + moduleStr)
|
23
|
+
# Create a device using the module connection string
|
24
|
+
myDevice = getQuarchDevice(moduleStr)
|
25
|
+
QuarchSimpleIdentify(myDevice)
|
26
|
+
# Close the module before exiting the script
|
27
|
+
myDevice.closeConnection()
|
28
|
+
|
29
|
+
def test_system_info():
|
30
|
+
print("")
|
31
|
+
print("SYSTEM INFORMATION")
|
32
|
+
print("------------------")
|
33
|
+
print("OS Name: " + os.name)
|
34
|
+
print("Platform System: " + platform.system())
|
35
|
+
print("Platform: " + platform.platform())
|
36
|
+
if "nt" in os.name: print("Platform Architecture: " + platform.architecture()[0])
|
37
|
+
print("Platform Release: " + platform.release())
|
38
|
+
try:
|
39
|
+
print("Quarchpy Version: " + get_quarchpy_version())
|
40
|
+
except:
|
41
|
+
print("Unable to detect Quarchpy version")
|
42
|
+
try:
|
43
|
+
print("Quarchpy info Location: " + str(distribution("quarchpy")._path))
|
44
|
+
except Exception as e:
|
45
|
+
print(e)
|
46
|
+
print("Unable to detect Quarchpy location")
|
47
|
+
try:
|
48
|
+
print("Python Version: " + sys.version)
|
49
|
+
except:
|
50
|
+
print("Unable to detect Python version")
|
51
|
+
try:
|
52
|
+
print("QIS version number: " + get_QIS_version())
|
53
|
+
except:
|
54
|
+
print("Unable to detect QIS version")
|
55
|
+
try:
|
56
|
+
javaVersion = bytes(subprocess.check_output(['java', '-version'], stderr=subprocess.STDOUT)).decode()
|
57
|
+
print("Java Version: " + str(javaVersion))
|
58
|
+
except:
|
59
|
+
print("Unable to detect java version"
|
60
|
+
"If Java is not installed then QIS and QPS will NOT run")
|
61
|
+
try:
|
62
|
+
javaLocation = get_java_location()
|
63
|
+
print("Java Location: " + str(javaLocation))
|
64
|
+
except:
|
65
|
+
print("Unable to detect java location"
|
66
|
+
"If Java is not installed then QIS and QPS will NOT run")
|
67
|
+
|
68
|
+
# Scan for all quarch devices on the system
|
69
|
+
|
70
|
+
def QuarchSimpleIdentify(device1):
|
71
|
+
"""
|
72
|
+
Prints basic identification test data on the specified module, compatible with all Quarch devices
|
73
|
+
|
74
|
+
Parameters
|
75
|
+
----------
|
76
|
+
device1: quarchDevice
|
77
|
+
Open connection to a quarch device
|
78
|
+
|
79
|
+
"""
|
80
|
+
# Print the module name
|
81
|
+
print("MODULE IDENTIFY TEST")
|
82
|
+
print("--------------------")
|
83
|
+
print("")
|
84
|
+
print("Module Name: "),
|
85
|
+
print(device1.sendCommand("hello?"))
|
86
|
+
print("")
|
87
|
+
# Print the module identify and version information
|
88
|
+
print("Module Identity Information: ")
|
89
|
+
print(device1.sendCommand("*idn?"))
|
90
|
+
|
91
|
+
def get_QIS_version():
|
92
|
+
"""
|
93
|
+
Returns the version of QIS. This is the version of QIS currenty running on the local system if one exists.
|
94
|
+
Otherwise the local version within quarchpy will be exectued and its version returned.
|
95
|
+
|
96
|
+
Returns
|
97
|
+
-------
|
98
|
+
version: str
|
99
|
+
String representation of the QIS version number
|
100
|
+
|
101
|
+
"""
|
102
|
+
|
103
|
+
qis_version = ""
|
104
|
+
my_close_qis = False
|
105
|
+
if isQisRunning() == False:
|
106
|
+
my_close_qis = True
|
107
|
+
startLocalQis(headless=True)
|
108
|
+
|
109
|
+
myQis = qisInterface()
|
110
|
+
qis_version = myQis.sendAndReceiveCmd(cmd="$version")
|
111
|
+
if "No Target Device Specified" in qis_version:
|
112
|
+
qis_version = myQis.sendAndReceiveCmd(cmd="$help").split("\r\n")[0]
|
113
|
+
if my_close_qis:
|
114
|
+
myQis.sendAndReceiveCmd(cmd = "$shutdown")
|
115
|
+
return qis_version
|
116
|
+
|
117
|
+
def get_java_location():
|
118
|
+
"""
|
119
|
+
Returns the location of java.
|
120
|
+
|
121
|
+
Returns
|
122
|
+
-------
|
123
|
+
location: str
|
124
|
+
String representation of the java location.
|
125
|
+
"""
|
126
|
+
if "windows" in platform.platform().lower():
|
127
|
+
location = bytes(subprocess.check_output(['where', 'java'], stderr=subprocess.STDOUT)).decode()
|
128
|
+
elif "linux" in platform.platform().lower():
|
129
|
+
location = bytes(subprocess.check_output(['whereis', 'java'], stderr=subprocess.STDOUT)).decode()
|
130
|
+
else:
|
131
|
+
location = "Unable to detect OS to check java version."
|
132
|
+
return location
|
133
|
+
|
134
|
+
def get_quarchpy_version():
|
135
|
+
try:
|
136
|
+
return __version__
|
137
|
+
except:
|
138
|
+
return "Unknown"
|
139
|
+
|
140
|
+
def fix_usb():
|
141
|
+
content_to_write = "SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"16d0\", MODE=\"0666\"" \
|
142
|
+
"SUBSYSTEM==\"usb_device\", ATTRS{idVendor}==\"16d0\", MODE=\"0666\""
|
143
|
+
|
144
|
+
if "centos" in str(platform.platform()).lower():
|
145
|
+
content_to_write = "SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"16d0\", MODE=\"0666\", GROUP=*\n " \
|
146
|
+
"SUBSYSTEM==\"usb_device\", ATTRS{idVendor}==\"16d0\", MODE=\"0666\", GROUP=*"
|
147
|
+
|
148
|
+
destination = "/etc/udev/rules.d/20-quarchmodules.rules"
|
149
|
+
|
150
|
+
f = open("/etc/udev/rules.d/20-quarchmodules.rules", "w")
|
151
|
+
f.write(content_to_write)
|
152
|
+
f.close()
|
153
|
+
|
154
|
+
os.system("udevadm control --reload")
|
155
|
+
os.system("udevadm trigger")
|
156
|
+
|
157
|
+
print("USB rule added to file : /etc/udev/rules.d/20-quarchmodules.rules")
|
158
|
+
|
159
|
+
|
160
|
+
def main (args=None):
|
161
|
+
"""
|
162
|
+
Main function to allow the system test to be called direct from the command line
|
163
|
+
"""
|
164
|
+
bool_test_system_info = True
|
165
|
+
bool_test_communication = True
|
166
|
+
bool_fixusb=False
|
167
|
+
if args is not None and len(args)>0:
|
168
|
+
for arg in args:
|
169
|
+
if "--fixusb" in str(arg).lower():
|
170
|
+
bool_fixusb=True
|
171
|
+
# todo: Should we still be running the debug info stuff after this?
|
172
|
+
if "--skipsysteminfo" in str(arg).lower():
|
173
|
+
bool_test_system_info=False
|
174
|
+
if "--skipcommstest" in str(arg).lower():
|
175
|
+
bool_test_communication=False
|
176
|
+
|
177
|
+
if bool_fixusb:
|
178
|
+
fix_usb()
|
179
|
+
if bool_test_system_info:
|
180
|
+
test_system_info()
|
181
|
+
if bool_test_communication:
|
182
|
+
test_communication()
|
183
|
+
|
184
|
+
|
185
|
+
if __name__ == "__main__":
|
186
|
+
main([])
|
187
|
+
#main(["--skipSystemInfo","--skipCommsTest"])
|
188
|
+
#main(["--fixusb"])
|
Binary file
|
Binary file
|
Binary file
|
quarchpy/device/scanDevices.py
CHANGED
@@ -21,8 +21,6 @@ from quarchpy.device.quarchArray import isThisAnArrayController
|
|
21
21
|
from quarchpy.connection_specific.connection_USB import TQuarchUSB_IF
|
22
22
|
from quarchpy.connection_specific import connection_ReST
|
23
23
|
from quarchpy.connection_specific.connection_mDNS import MyListener
|
24
|
-
|
25
|
-
from zeroconf import ServiceBrowser, Zeroconf
|
26
24
|
from quarchpy.utilities import TestCenter
|
27
25
|
|
28
26
|
|
@@ -462,6 +460,7 @@ def filter_module_type(module_type_filter, found_devices):
|
|
462
460
|
return filtered_devices
|
463
461
|
|
464
462
|
def scan_mDNS(mdnsListener):
|
463
|
+
from zeroconf import ServiceBrowser, Zeroconf
|
465
464
|
zeroconf = Zeroconf()
|
466
465
|
listener = mdnsListener
|
467
466
|
browser = ServiceBrowser(zeroconf, "_http._tcp.local.", listener)
|
@@ -474,9 +473,7 @@ def scanDevices(target_conn="all", lanTimeout=1, scanInArray=True, favouriteOnly
|
|
474
473
|
module_type_filter=None, ipAddressLookup=None):
|
475
474
|
foundDevices = dict()
|
476
475
|
scannedArrays = list()
|
477
|
-
mdnsListener = MyListener()
|
478
476
|
|
479
|
-
scan_mDNS(mdnsListener)
|
480
477
|
|
481
478
|
if target_conn.lower() == "all":
|
482
479
|
foundDevices = list_USB()
|
@@ -484,7 +481,12 @@ def scanDevices(target_conn="all", lanTimeout=1, scanInArray=True, favouriteOnly
|
|
484
481
|
try:
|
485
482
|
#This will fail if the test machine is not connected to a network
|
486
483
|
foundDevices = mergeDict(foundDevices, list_network("all", ipAddressLookup=ipAddressLookup, lanTimeout=lanTimeout))
|
487
|
-
|
484
|
+
try:
|
485
|
+
mdnsListener = MyListener()
|
486
|
+
scan_mDNS(mdnsListener)
|
487
|
+
foundDevices = mergeDict(foundDevices, mdnsListener.found_devices)
|
488
|
+
except Exception as mdnsExcept:
|
489
|
+
logging.debug("An error occurred while trying to use the mdns listner to scan\n" +str(mdnsExcept))
|
488
490
|
except Exception as e:
|
489
491
|
logging.error(e)
|
490
492
|
logging.warning("Network scan failed, check network connection")
|
@@ -637,24 +639,3 @@ def userSelectDevice(scanDictionary=None, scanFilterStr=None,favouriteOnly=True,
|
|
637
639
|
# Return the address string of the selected module
|
638
640
|
return userStr
|
639
641
|
|
640
|
-
|
641
|
-
#Not used but could come in usefull in near future.
|
642
|
-
# def userSelectAndReturnDevice(scanDictionary=None, scanFilterStr=None,favouriteOnly=True, message=None, title=None, nice=True, additionalOptions =["rescan","all conn types", "quit"], target_conn="all"):
|
643
|
-
# scanDictionary = scanDevices()
|
644
|
-
# connectionTarget = userSelectDevice(scanDictionary, scanFilterStr, favouriteOnly, message, title, nice,
|
645
|
-
# additionalOptions, target_conn)
|
646
|
-
# serialNumber = getSerialNumberFromConnectionTarget(connectionTarget)
|
647
|
-
#
|
648
|
-
# if connectionTarget.__contains__("<") and connectionTarget.__contains__(">"):
|
649
|
-
# connectionTarget, portNumber = connectionTarget.split("<")
|
650
|
-
# portNumber = portNumber[:-1]
|
651
|
-
# myDevice = quarchDevice(connectionTarget)
|
652
|
-
# myArrayController = quarchArray(myDevice)
|
653
|
-
# mySubDevice = myArrayController.getSubDevice(portNumber)
|
654
|
-
# myDevice = mySubDevice
|
655
|
-
# elif(serialNumber.lower().__contains__("qtl1999") or serialNumber.lower().__contains__("qtl1995") or serialNumber.lower().__contains__("qtl2312")):
|
656
|
-
# myDevice = quarchPPM(quarchDevice(connectionTarget))
|
657
|
-
#
|
658
|
-
# else:
|
659
|
-
# myDevice = quarchDevice(connectionTarget)
|
660
|
-
# return myDevice
|