quarchpy 2.1.20.dev2__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.
- quarchpy/.idea/.name +1 -1
- quarchpy/.idea/inspectionProfiles/Project_Default.xml +26 -0
- quarchpy/.idea/modules.xml +0 -1
- quarchpy/.idea/quarchpy.iml +1 -4
- quarchpy/.idea/workspace.xml +21 -226
- quarchpy/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/__pycache__/_version.cpython-311.pyc +0 -0
- quarchpy/__pycache__/connection.cpython-311.pyc +0 -0
- quarchpy/__pycache__/run.cpython-311.pyc +0 -0
- quarchpy/_version.py +1 -1
- quarchpy/config_files/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/config_files/__pycache__/quarch_config_parser.cpython-311.pyc +0 -0
- quarchpy/connection_specific/QPS/qis/help.txt +12 -4
- quarchpy/connection_specific/QPS/qis/qis.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-2.4.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.13.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.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.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.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.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/Example.txt +36 -0
- quarchpy/connection_specific/QPS/qis/resources/filters/filters.csv +1004 -0
- quarchpy/connection_specific/QPS/qis/resources/filters/iec_filters.xml +26 -0
- quarchpy/connection_specific/QPS/qis/resources/filters/iec_filters.xml.bak +26 -0
- quarchpy/connection_specific/QPS/qps.jar +0 -0
- quarchpy/connection_specific/QPS/qps_lib/QuarchCommon-0.2.9.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/connection_specific/QPS/scriptCommands.txt +2 -2
- quarchpy/connection_specific/__pycache__/StreamChannels.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_QIS.cpython-311.pyc +0 -0
- 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/__pycache__/connection_Serial.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_TCP.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_Telnet.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_USB.cpython-311.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_mDNS.cpython-311.pyc +0 -0
- quarchpy/connection_specific/connection_QIS.py +5 -3
- quarchpy/connection_specific/connection_QIS.py.bak +1738 -0
- quarchpy/connection_specific/serial/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/serialutil.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/serialwin32.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/win32.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports.cpython-311.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_windows.cpython-311.pyc +0 -0
- quarchpy/connection_specific/usb_libs/__pycache__/libusb1.cpython-311.pyc +0 -0
- quarchpy/connection_specific/usb_libs/__pycache__/usb1.cpython-311.pyc +0 -0
- quarchpy/debug/TextScanIP.py +11 -0
- quarchpy/debug/__pycache__/SystemTest.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/module_debug.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/simple_terminal.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/upgrade_quarchpy.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/versionCompare.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/device.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/quarchArray.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/quarchPPM.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/quarchQPS.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/scanDevices.cpython-311.pyc +0 -0
- quarchpy/device/device.py.bak +504 -0
- quarchpy/device/quarchPPM.py.bak +67 -0
- quarchpy/device/quarchQPS.py.bak +396 -0
- quarchpy/device/scanDevices.py.bak +130 -108
- quarchpy/disk_test/__pycache__/AbsDiskFinder.cpython-311.pyc +0 -0
- quarchpy/disk_test/__pycache__/DiskTargetSelection.cpython-311.pyc +0 -0
- quarchpy/disk_test/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/disk_test/__pycache__/iometerDiskFinder.cpython-311.pyc +0 -0
- quarchpy/docs/CHANGES.rst.bak +4 -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 +121 -113
- quarchpy/docs/_build/html/_sources/CHANGES.rst.txt +6 -1
- quarchpy/docs/_build/html/_static/alabaster.css +14 -9
- quarchpy/docs/_build/html/_static/basic.css +1 -1
- quarchpy/docs/_build/html/_static/pygments.css +1 -1
- quarchpy/docs/_build/html/genindex.html +9 -27
- quarchpy/docs/_build/html/index.html +62 -60
- quarchpy/docs/_build/html/objects.inv +0 -0
- quarchpy/docs/_build/html/py-modindex.html +7 -11
- quarchpy/docs/_build/html/readme.html +7 -6
- quarchpy/docs/_build/html/search.html +7 -6
- quarchpy/docs/_build/html/searchindex.js +1 -1
- quarchpy/docs/_build/html/source/changelog.html +176 -167
- quarchpy/docs/_build/html/source/licenses.html +7 -6
- quarchpy/docs/_build/html/source/modules.html +8 -7
- quarchpy/docs/_build/html/source/quarchpy.calibration.html +7 -6
- quarchpy/docs/_build/html/source/quarchpy.config_files.html +7 -6
- quarchpy/docs/_build/html/source/quarchpy.connection_specific.html +7 -6
- quarchpy/docs/_build/html/source/quarchpy.debug.html +7 -6
- quarchpy/docs/_build/html/source/quarchpy.device.html +7 -6
- quarchpy/docs/_build/html/source/quarchpy.disk_test.html +7 -6
- quarchpy/docs/_build/html/source/quarchpy.fio.html +9 -34
- quarchpy/docs/_build/html/source/quarchpy.html +8 -16
- quarchpy/docs/_build/html/source/quarchpy.iometer.html +7 -6
- quarchpy/docs/_build/html/source/quarchpy.qis.html +7 -6
- quarchpy/docs/_build/html/source/quarchpy.qps.html +7 -6
- quarchpy/docs/_build/html/source/quarchpy.user_interface.html +7 -6
- quarchpy/docs/_build/html/source/quarchpy.utilities.html +7 -6
- quarchpy/docs/_build/html/source/readme.html +7 -6
- quarchpy/fio/__pycache__/FIO_interface.cpython-311.pyc +0 -0
- quarchpy/fio/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/fio/__pycache__/fioDiskFinder.cpython-311.pyc +0 -0
- quarchpy/iometer/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/iometer/__pycache__/gen_iometer_template.cpython-311.pyc +0 -0
- quarchpy/iometer/__pycache__/iometerFuncs.cpython-311.pyc +0 -0
- quarchpy/qis/__pycache__/StreamHeaderInfo.cpython-311.pyc +0 -0
- quarchpy/qis/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/qis/__pycache__/qisFuncs.cpython-311.pyc +0 -0
- quarchpy/qps/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/qps/__pycache__/qpsFuncs.cpython-311.pyc +0 -0
- quarchpy/qps/qpsFuncs.py.bak +28 -68
- quarchpy/user_interface/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/user_interface/__pycache__/user_interface.cpython-311.pyc +0 -0
- quarchpy/user_interface/user_interface.py.bak +749 -0
- quarchpy/utilities/TestCenter.py.bak +150 -0
- quarchpy/utilities/__pycache__/BitManipulation.cpython-311.pyc +0 -0
- quarchpy/utilities/__pycache__/TestCenter.cpython-311.pyc +0 -0
- quarchpy/utilities/__pycache__/TimeValue.cpython-311.pyc +0 -0
- quarchpy/utilities/__pycache__/Version.cpython-311.pyc +0 -0
- quarchpy/utilities/__pycache__/__init__.cpython-311.pyc +0 -0
- {quarchpy-2.1.20.dev2.dist-info → quarchpy-2.1.20.dev3.dist-info}/METADATA +1 -1
- {quarchpy-2.1.20.dev2.dist-info → quarchpy-2.1.20.dev3.dist-info}/RECORD +143 -114
- quarchpy/_version.py.bak +0 -1
- quarchpy/connection_specific/connection_mDNS.py.bak +0 -48
- quarchpy/debug/SystemTest.py.bak +0 -188
- quarchpy/debug/simple_terminal.py.bak +0 -50
- quarchpy/fio/FIO_interface.py.bak +0 -322
- quarchpy/qis/qisFuncs.py.bak +0 -265
- quarchpy/run.py.bak +0 -283
- {quarchpy-2.1.20.dev2.dist-info → quarchpy-2.1.20.dev3.dist-info}/WHEEL +0 -0
- {quarchpy-2.1.20.dev2.dist-info → quarchpy-2.1.20.dev3.dist-info}/top_level.txt +0 -0
@@ -20,7 +20,8 @@ from quarchpy.connection_specific.connection_Serial import serialList, serial
|
|
20
20
|
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
|
+
|
24
|
+
# TODO: bodge bodge bodge
|
24
25
|
from quarchpy.utilities import TestCenter
|
25
26
|
|
26
27
|
|
@@ -175,110 +176,123 @@ def list_USB(debuPrint=False):
|
|
175
176
|
'''
|
176
177
|
List all Quarch devices found over LAN, using a UDP broadcast scan
|
177
178
|
'''
|
179
|
+
|
180
|
+
def get_interface_ips():
|
181
|
+
interfaces = socket.if_nameindex()
|
182
|
+
interface_ips = {}
|
183
|
+
for idx, interface in interfaces:
|
184
|
+
try:
|
185
|
+
addresses = socket.getaddrinfo(interface, None)
|
186
|
+
ip_addresses = [addr[4][0] for addr in addresses]
|
187
|
+
interface_ips[interface] = ip_addresses
|
188
|
+
except socket.gaierror:
|
189
|
+
logging.warning(f"Unable to get IP address for interface {interface}")
|
190
|
+
return interface_ips
|
178
191
|
def list_network(target_conn="all", debugPring=False, lanTimeout=1, ipAddressLookup=None):
|
179
192
|
|
180
193
|
retVal={}
|
194
|
+
# Create and configure the socket for broadcast.
|
195
|
+
mySocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
196
|
+
mySocket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
197
|
+
mySocket.settimeout(lanTimeout)
|
181
198
|
|
182
199
|
lan_modules = dict()
|
183
200
|
|
184
201
|
specifiedDevice = None
|
185
202
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
logging.debug(os.path.basename(__file__) + ": Broadcasting on : " + ip)
|
194
|
-
|
195
|
-
try:
|
196
|
-
|
197
|
-
mySocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
198
|
-
mySocket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
199
|
-
mySocket.settimeout(lanTimeout)
|
200
|
-
mySocket.bind((ip,56732))
|
203
|
+
if ipAddressLookup is not None:
|
204
|
+
# Attempts to find the device through UDP then REST
|
205
|
+
specifiedDevice = lookupDevice(str(ipAddressLookup).strip(), mySocket, lan_modules )
|
206
|
+
mySocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
207
|
+
mySocket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
208
|
+
mySocket.settimeout(lanTimeout)
|
201
209
|
|
202
|
-
if ipAddressLookup is not None:
|
203
|
-
# Attempts to find the device through UDP then REST
|
204
|
-
specifiedDevice = lookupDevice(str(ipAddressLookup).strip(), mySocket, lan_modules)
|
205
210
|
|
206
|
-
except Exception as err:
|
207
211
|
|
208
|
-
|
212
|
+
# Broadcast the message.
|
213
|
+
logging.debug("Broadcast LAN discovery message for UDP scan to all network interfaces")
|
214
|
+
logging.debug("Available network interfaces before binding:")
|
215
|
+
interfaces = socket.if_nameindex()
|
216
|
+
for idx, interface in interfaces:
|
217
|
+
logging.debug(f"Interface {idx}: {interface}")
|
218
|
+
try:
|
219
|
+
# Bind to all network interfaces using '', same as '0.0.0.0'
|
220
|
+
mySocket.bind(('',56732))
|
221
|
+
except Exception as err:
|
222
|
+
logging.debug("Error while trying to bind to network interfaces: "+" Error: "+str(err))
|
223
|
+
mySocket.sendto(b'Discovery: Who is out there?\0\n', ('255.255.255.255', 30303))
|
224
|
+
#mySocket.sendto(b'Discovery: Who is out there?\0\n', ('255.255.255.255', 30303)) #56732
|
225
|
+
|
226
|
+
counter = 0
|
227
|
+
|
228
|
+
# Receive messages until timeout.
|
229
|
+
while True:
|
230
|
+
network_modules = {}
|
231
|
+
counter += 1
|
232
|
+
# Receive raw message until timeout, then break.
|
233
|
+
try:
|
234
|
+
msg_received = mySocket.recvfrom(256)
|
235
|
+
except:
|
236
|
+
# check if any a device was targeted directly and allow parse
|
237
|
+
if specifiedDevice is not None:
|
238
|
+
msg_received = specifiedDevice
|
239
|
+
specifiedDevice = None
|
240
|
+
else:
|
241
|
+
break
|
242
|
+
cont = 0
|
243
|
+
|
244
|
+
# print(msg_received)
|
245
|
+
# Used split \r\n since values of 13 or 10 were looked at as /r and /n when using splitlines
|
246
|
+
# This fixes for all cases except if 13 is followed by 10.
|
247
|
+
splits = msg_received[0].split(b"\r\n")
|
248
|
+
del splits[-1]
|
249
|
+
for lines in splits:
|
250
|
+
if cont <= 1:
|
251
|
+
index = cont
|
252
|
+
data = repr(lines).replace("'", "").replace("b", "")
|
253
|
+
cont += 1
|
254
|
+
else:
|
255
|
+
index = repr(lines[0]).replace("'", "")
|
256
|
+
data = repr(lines[1:]).replace("'", "").replace("b", "")
|
209
257
|
|
210
|
-
|
258
|
+
network_modules[index] = data
|
211
259
|
|
212
|
-
|
260
|
+
module_name = get_user_level_serial_number(network_modules)
|
261
|
+
logging.debug("Found UDP response: " + module_name)
|
213
262
|
|
214
|
-
|
215
|
-
while True:
|
216
|
-
network_modules = {}
|
217
|
-
counter += 1
|
218
|
-
# Receive raw message until timeout, then break.
|
219
|
-
try:
|
220
|
-
msg_received = mySocket.recvfrom(256)
|
221
|
-
except:
|
222
|
-
# check if any a device was targeted directly and allow parse
|
223
|
-
if specifiedDevice is not None:
|
224
|
-
msg_received = specifiedDevice
|
225
|
-
specifiedDevice = None
|
226
|
-
else:
|
227
|
-
break
|
228
|
-
cont = 0
|
229
|
-
|
230
|
-
# print(msg_received)
|
231
|
-
# Used split \r\n since values of 13 or 10 were looked at as /r and /n when using splitlines
|
232
|
-
# This fixes for all cases except if 13 is followed by 10.
|
233
|
-
splits = msg_received[0].split(b"\r\n")
|
234
|
-
del splits[-1]
|
235
|
-
for lines in splits:
|
236
|
-
if cont <= 1:
|
237
|
-
index = cont
|
238
|
-
data = repr(lines).replace("'", "").replace("b", "")
|
239
|
-
cont += 1
|
240
|
-
else:
|
241
|
-
index = repr(lines[0]).replace("'", "")
|
242
|
-
data = repr(lines[1:]).replace("'", "").replace("b", "")
|
243
|
-
|
244
|
-
network_modules[index] = data
|
245
|
-
|
246
|
-
module_name = get_user_level_serial_number(network_modules)
|
247
|
-
logging.debug("Found UDP response: " + module_name)
|
248
|
-
|
249
|
-
ip_module = msg_received[1][0].strip()
|
263
|
+
ip_module = msg_received[1][0].strip()
|
250
264
|
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
265
|
+
try:
|
266
|
+
# Add a QTL before modules without it.
|
267
|
+
if "QTL" not in module_name.decode("utf-8"):
|
268
|
+
module_name = "QTL" + module_name.decode("utf-8")
|
269
|
+
except:
|
270
|
+
# Add a QTL before modules without it.
|
271
|
+
if "QTL" not in module_name:
|
272
|
+
module_name = "QTL" + module_name
|
273
|
+
|
274
|
+
# Checks if there's a value in the TELNET key.
|
275
|
+
if (target_conn.lower() == "all" or target_conn.lower() == "telnet"):
|
276
|
+
if network_modules.get("\\x8a") or network_modules.get("138"):
|
277
|
+
# Append the information to the list.
|
278
|
+
lan_modules["TELNET:" + ip_module] = module_name
|
279
|
+
logging.debug("Found Telnet module: " + module_name)
|
280
|
+
|
281
|
+
# Checks if there's a value in the REST key.
|
282
|
+
if (target_conn.lower() == "all" or target_conn.lower() == "rest"):
|
283
|
+
if network_modules.get("\\x84") or network_modules.get("132"):
|
284
|
+
# Append the information to the list.
|
285
|
+
lan_modules["REST:" + ip_module] = module_name
|
286
|
+
logging.debug("Found REST module: " + module_name)
|
287
|
+
|
288
|
+
# Checks if there's a value in the TCP key.
|
289
|
+
if (target_conn.lower() == "all" or target_conn.lower() == "tcp"):
|
290
|
+
if network_modules.get("\\x85") or network_modules.get("133"):
|
291
|
+
# Append the information to the list.
|
292
|
+
lan_modules["TCP:" + ip_module] = module_name
|
293
|
+
logging.debug("Found TCP module: " + module_name)
|
294
|
+
|
295
|
+
mySocket.close()
|
282
296
|
logging.debug("Finished UDP scan")
|
283
297
|
retVal.update(lan_modules)
|
284
298
|
return retVal
|
@@ -457,12 +471,6 @@ def filter_module_type(module_type_filter, found_devices):
|
|
457
471
|
filtered_devices.update({key: value})
|
458
472
|
return filtered_devices
|
459
473
|
|
460
|
-
def scan_mDNS(mdnsListener):
|
461
|
-
from zeroconf import ServiceBrowser, Zeroconf
|
462
|
-
zeroconf = Zeroconf()
|
463
|
-
listener = mdnsListener
|
464
|
-
browser = ServiceBrowser(zeroconf, "_http._tcp.local.", listener)
|
465
|
-
|
466
474
|
|
467
475
|
'''
|
468
476
|
Scans for Quarch modules across the given interface(s). Returns a dictionary of module addresses and serial numbers
|
@@ -472,19 +480,12 @@ def scanDevices(target_conn="all", lanTimeout=1, scanInArray=True, favouriteOnly
|
|
472
480
|
foundDevices = dict()
|
473
481
|
scannedArrays = list()
|
474
482
|
|
475
|
-
|
476
483
|
if target_conn.lower() == "all":
|
477
484
|
foundDevices = list_USB()
|
478
485
|
foundDevices = mergeDict(foundDevices, list_serial())
|
479
486
|
try:
|
480
487
|
#This will fail if the test machine is not connected to a network
|
481
488
|
foundDevices = mergeDict(foundDevices, list_network("all", ipAddressLookup=ipAddressLookup, lanTimeout=lanTimeout))
|
482
|
-
try:
|
483
|
-
mdnsListener = MyListener()
|
484
|
-
scan_mDNS(mdnsListener)
|
485
|
-
foundDevices = mergeDict(foundDevices, mdnsListener.found_devices)
|
486
|
-
except Exception as mdnsExcept:
|
487
|
-
logging.debug("An error occurred while trying to use the mdns listner to scan\n" +str(mdnsExcept))
|
488
489
|
except Exception as e:
|
489
490
|
logging.error(e)
|
490
491
|
logging.warning("Network scan failed, check network connection")
|
@@ -511,8 +512,8 @@ def scanDevices(target_conn="all", lanTimeout=1, scanInArray=True, favouriteOnly
|
|
511
512
|
foundDevices = mergeDict(foundDevices, scanDevices)
|
512
513
|
myArrayControler.closeConnection()
|
513
514
|
except Exception as e:
|
514
|
-
logging.
|
515
|
-
logging.
|
515
|
+
logging.error(e, exc_info=True)
|
516
|
+
logging.warning("Cannot get serial number. Quarch device may be in use by another program.")
|
516
517
|
foundDevices[k] = "DEVICE IN USE"
|
517
518
|
|
518
519
|
if (favouriteOnly):
|
@@ -592,7 +593,7 @@ def userSelectDevice(scanDictionary=None, scanFilterStr=None,favouriteOnly=True,
|
|
592
593
|
|
593
594
|
|
594
595
|
if nice: #Prepair the data for niceListSelection using displayTable().
|
595
|
-
if additionalOptions is None: additionalOptions = ["
|
596
|
+
if additionalOptions is None: additionalOptions = ["IP Scan","Rescan","Quit"]
|
596
597
|
tempList = []
|
597
598
|
tempEl = []
|
598
599
|
for k, v in scanDictionary.items():
|
@@ -615,7 +616,7 @@ def userSelectDevice(scanDictionary=None, scanFilterStr=None,favouriteOnly=True,
|
|
615
616
|
devicesString.append(k + '=' + v + ": " + k[:charPos])
|
616
617
|
devicesString = ','.join(devicesString)
|
617
618
|
if additionalOptions is None :
|
618
|
-
additionalOptions = "
|
619
|
+
additionalOptions = "IP Scan=IP Scan,Rescan=Rescan,Quit=Quit"
|
619
620
|
userStr = listSelection(title=title,message=message,selectionList=devicesString, additionalOptions=additionalOptions)
|
620
621
|
|
621
622
|
# Process the user response
|
@@ -629,7 +630,7 @@ def userSelectDevice(scanDictionary=None, scanFilterStr=None,favouriteOnly=True,
|
|
629
630
|
ip_address = None
|
630
631
|
scanDictionary = None
|
631
632
|
favouriteOnly = False
|
632
|
-
elif(userStr.lower() in '
|
633
|
+
elif(userStr.lower() in 'ip scan'):
|
633
634
|
ip_address = requestDialog("Please input IP Address of the module you would like to connect to: ")
|
634
635
|
scanDictionary = None
|
635
636
|
favouriteOnly = False
|
@@ -637,3 +638,24 @@ def userSelectDevice(scanDictionary=None, scanFilterStr=None,favouriteOnly=True,
|
|
637
638
|
# Return the address string of the selected module
|
638
639
|
return userStr
|
639
640
|
|
641
|
+
|
642
|
+
#Not used but could come in usefull in near future.
|
643
|
+
# def userSelectAndReturnDevice(scanDictionary=None, scanFilterStr=None,favouriteOnly=True, message=None, title=None, nice=True, additionalOptions =["rescan","all conn types", "quit"], target_conn="all"):
|
644
|
+
# scanDictionary = scanDevices()
|
645
|
+
# connectionTarget = userSelectDevice(scanDictionary, scanFilterStr, favouriteOnly, message, title, nice,
|
646
|
+
# additionalOptions, target_conn)
|
647
|
+
# serialNumber = getSerialNumberFromConnectionTarget(connectionTarget)
|
648
|
+
#
|
649
|
+
# if connectionTarget.__contains__("<") and connectionTarget.__contains__(">"):
|
650
|
+
# connectionTarget, portNumber = connectionTarget.split("<")
|
651
|
+
# portNumber = portNumber[:-1]
|
652
|
+
# myDevice = quarchDevice(connectionTarget)
|
653
|
+
# myArrayController = quarchArray(myDevice)
|
654
|
+
# mySubDevice = myArrayController.getSubDevice(portNumber)
|
655
|
+
# myDevice = mySubDevice
|
656
|
+
# elif(serialNumber.lower().__contains__("qtl1999") or serialNumber.lower().__contains__("qtl1995") or serialNumber.lower().__contains__("qtl2312")):
|
657
|
+
# myDevice = quarchPPM(quarchDevice(connectionTarget))
|
658
|
+
#
|
659
|
+
# else:
|
660
|
+
# myDevice = quarchDevice(connectionTarget)
|
661
|
+
# return myDevice
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
quarchpy/docs/CHANGES.rst.bak
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|