quarchpy 2.2.7.dev1__py2.py3-none-any.whl → 2.2.8__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/_version.py +1 -1
- quarchpy/connection_specific/QPS/win-amd64/{License/argparse4j-license.txt → 3rdPartyLicenses/argparse4j-LICENSE.txt} +23 -25
- quarchpy/connection_specific/QPS/win-amd64/3rdPartyLicenses/com.sun.istack-license.html +59 -0
- quarchpy/connection_specific/QPS/win-amd64/3rdPartyLicenses/commons-io-LICENSE-2.0.txt +202 -0
- quarchpy/connection_specific/QPS/win-amd64/3rdPartyLicenses/controlsfx-license.txt +29 -0
- quarchpy/connection_specific/QPS/win-amd64/3rdPartyLicenses/jakarta.activation-license.html +59 -0
- quarchpy/connection_specific/QPS/win-amd64/3rdPartyLicenses/jakarta.xml.bind-api-license.html +59 -0
- quarchpy/connection_specific/QPS/win-amd64/3rdPartyLicenses/netty-LICENSE.txt +202 -0
- quarchpy/connection_specific/QPS/win-amd64/3rdPartyLicenses/netty-NOTICE.txt +239 -0
- quarchpy/connection_specific/QPS/win-amd64/InstallType.dat +1 -0
- quarchpy/connection_specific/QPS/win-amd64/app.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/app.properties +6 -0
- quarchpy/connection_specific/QPS/win-amd64/license.txt +1 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/com.sun.istack-license.html +59 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/dorkbox-LICENSE.Apachev2 +218 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/jSerialComm-LICENSE-APACHE-2.0 +202 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/jSerialComm-LICENSE-LGPL-3.0 +165 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/jakarta.activation-license.html +59 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/jakarta.xml.bind-api-license.html +59 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/javassist-License.html +381 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/jmdns-LICENSE.txt +202 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/jna-AL2.0 +177 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/kotlin-stdlib-LICENSE-2.0.txt +202 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/netty-LICENSE.txt +202 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/netty-NOTICE.txt +239 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/slf4j-LICENSE.txt +24 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/3rdPartyLicenses/usb4java-LICENSE.md +20 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/help.txt +50 -17
- quarchpy/connection_specific/QPS/win-amd64/qis/license.txt +1 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/qis.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/qis_lib/CInterface-2.3.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/qis_lib/QuarchCommon-2.0.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/qis_lib/{TorridonCommon-1.0.jar → TorridonCommon-1.1.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/qis_lib/jmdns-3.5.9.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qis/qis_lib/usb4java-1.3.1.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps-command-reference.html +104 -104
- quarchpy/connection_specific/QPS/win-amd64/qps.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/JFXUtilities-1.0.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/QuarchCommon-2.0.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/commons-io-2.18.0.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/lin-arm64/javafx-base-21.0.6-linux-aarch64.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/lin-arm64/javafx-controls-21.0.6-linux-aarch64.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/lin-arm64/javafx-fxml-21.0.6-linux-aarch64.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/lin-arm64/javafx-graphics-21.0.6-linux-aarch64.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/lin-arm64/javafx-swing-21.0.6-linux-aarch64.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/lin-x64/{javafx-base-21.0.5-linux.jar → javafx-base-21.0.6-linux.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/lin-x64/{javafx-controls-21.0.5-linux.jar → javafx-controls-21.0.6-linux.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/lin-x64/{javafx-fxml-21.0.5-linux.jar → javafx-fxml-21.0.6-linux.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/lin-x64/{javafx-graphics-21.0.5-linux.jar → javafx-graphics-21.0.6-linux.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/lin-x64/{javafx-swing-21.0.5-linux.jar → javafx-swing-21.0.6-linux.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/{mac-x64/javafx-base-21.0.5-mac.jar → mac-arm64/javafx-base-21.0.6-mac-aarch64.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/mac-arm64/{javafx-controls-21.0.5-mac-aarch64.jar → javafx-controls-21.0.6-mac-aarch64.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/{mac-x64/javafx-fxml-21.0.5-mac.jar → mac-arm64/javafx-fxml-21.0.6-mac-aarch64.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/mac-arm64/{javafx-graphics-21.0.5-mac-aarch64.jar → javafx-graphics-21.0.6-mac-aarch64.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/{mac-x64/javafx-swing-21.0.5-mac.jar → mac-arm64/javafx-swing-21.0.6-mac-aarch64.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/{mac-arm64/javafx-base-21.0.5-mac-aarch64.jar → mac-x64/javafx-base-21.0.6-mac.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/mac-x64/{javafx-controls-21.0.5-mac.jar → javafx-controls-21.0.6-mac.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/{mac-arm64/javafx-fxml-21.0.5-mac-aarch64.jar → mac-x64/javafx-fxml-21.0.6-mac.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/mac-x64/{javafx-graphics-21.0.5-mac.jar → javafx-graphics-21.0.6-mac.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/{mac-arm64/javafx-swing-21.0.5-mac-aarch64.jar → mac-x64/javafx-swing-21.0.6-mac.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/qutils-1.0.jar +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/win-x64/{javafx-base-21.0.5-win.jar → javafx-base-21.0.6-win.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/win-x64/{javafx-controls-21.0.5-win.jar → javafx-controls-21.0.6-win.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/win-x64/{javafx-fxml-21.0.5-win.jar → javafx-fxml-21.0.6-win.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/win-x64/{javafx-graphics-21.0.5-win.jar → javafx-graphics-21.0.6-win.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/qps_lib/win-x64/{javafx-swing-21.0.5-win.jar → javafx-swing-21.0.6-win.jar} +0 -0
- quarchpy/connection_specific/QPS/win-amd64/scriptCommands.txt +4 -4
- quarchpy/connection_specific/QPS/win-amd64/whats-new.txt +20 -12
- quarchpy/connection_specific/connection_QIS.py +1 -0
- quarchpy/debug/SystemTest.py +30 -15
- quarchpy/device/quarchQPS.py +93 -68
- quarchpy/docs/CHANGES.rst +8 -0
- quarchpy/docs/_build/doctrees/CHANGES.doctree +0 -0
- quarchpy/docs/_build/doctrees/environment.pickle +0 -0
- quarchpy/docs/_build/doctrees/source/changelog.doctree +0 -0
- quarchpy/docs/_build/doctrees/source/quarchpy.fio.doctree +0 -0
- quarchpy/docs/_build/html/CHANGES.html +145 -139
- quarchpy/docs/_build/html/_sources/CHANGES.rst.txt +7 -0
- quarchpy/docs/_build/html/genindex.html +8 -2
- quarchpy/docs/_build/html/index.html +71 -70
- quarchpy/docs/_build/html/objects.inv +0 -0
- quarchpy/docs/_build/html/searchindex.js +1 -1
- quarchpy/docs/_build/html/source/changelog.html +216 -209
- quarchpy/docs/_build/html/source/quarchpy.fio.html +64 -0
- quarchpy/docs/_build/html/source/quarchpy.html +3 -0
- quarchpy/fio/{test_performance_class.py → HIDEtest_performance_class.py} +1 -1
- quarchpy/fio_tests_file.fio +1 -0
- quarchpy/qis/qisFuncs.py +38 -41
- quarchpy/qps/qpsFuncs.py +7 -10
- quarchpy/tests/test_device/test_scanDevices.py +21 -0
- quarchpy/utilities/utils.py +64 -0
- {quarchpy-2.2.7.dev1.dist-info → quarchpy-2.2.8.dist-info}/METADATA +10 -2
- {quarchpy-2.2.7.dev1.dist-info → quarchpy-2.2.8.dist-info}/RECORD +99 -172
- {quarchpy-2.2.7.dev1.dist-info → quarchpy-2.2.8.dist-info}/WHEEL +1 -1
- quarchpy/.idea/.gitignore +0 -3
- quarchpy/.idea/inspectionProfiles/Project_Default.xml +0 -12
- quarchpy/.idea/inspectionProfiles/profiles_settings.xml +0 -6
- quarchpy/.idea/misc.xml +0 -7
- quarchpy/.idea/modules.xml +0 -8
- quarchpy/.idea/quarchpy.iml +0 -12
- quarchpy/.idea/workspace.xml +0 -75
- quarchpy/_version.py.bak +0 -1
- quarchpy/config_files/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/config_files/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/config_files/__pycache__/quarch_config_parser.cpython-311.pyc +0 -0
- quarchpy/config_files/__pycache__/quarch_config_parser.cpython-313.pyc +0 -0
- quarchpy/connection_specific/QPS/win-amd64/License/Netty-license.txt +0 -143
- quarchpy/connection_specific/QPS/win-amd64/License/controlsfx-license.txt +0 -26
- quarchpy/connection_specific/QPS/win-amd64/License/usb4java-license.txt +0 -167
- quarchpy/connection_specific/QPS/win-amd64/launchQPSJ21.bat +0 -4
- quarchpy/connection_specific/QPS/win-amd64/launchQPSJ21.sh +0 -4
- quarchpy/connection_specific/__pycache__/StreamChannels.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_QIS.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_QPS.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_ReST.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_Serial.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_TCP.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_Telnet.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/connection_USB.cpython-313.pyc +0 -0
- quarchpy/connection_specific/__pycache__/mDNS.cpython-313.pyc +0 -0
- quarchpy/connection_specific/connection_QPS.py.bak +0 -242
- quarchpy/connection_specific/jdk_j21_jres/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/connection_specific/jdk_j21_jres/__pycache__/fix_permissions.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/serialutil.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/serialwin32.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/__pycache__/win32.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports_common.cpython-313.pyc +0 -0
- quarchpy/connection_specific/serial/tools/__pycache__/list_ports_windows.cpython-313.pyc +0 -0
- quarchpy/debug/__pycache__/SystemTest.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/SystemTest.cpython-313.pyc +0 -0
- quarchpy/debug/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/debug/__pycache__/module_debug.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/module_debug.cpython-313.pyc +0 -0
- quarchpy/debug/__pycache__/simple_terminal.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/simple_terminal.cpython-313.pyc +0 -0
- quarchpy/debug/__pycache__/upgrade_quarchpy.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/upgrade_quarchpy.cpython-313.pyc +0 -0
- quarchpy/debug/__pycache__/versionCompare.cpython-311.pyc +0 -0
- quarchpy/debug/__pycache__/versionCompare.cpython-313.pyc +0 -0
- quarchpy/device/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/device/__pycache__/device.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/device.cpython-313.pyc +0 -0
- quarchpy/device/__pycache__/quarchArray.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/quarchArray.cpython-313.pyc +0 -0
- quarchpy/device/__pycache__/quarchPPM.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/quarchPPM.cpython-313.pyc +0 -0
- quarchpy/device/__pycache__/quarchQPS.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/quarchQPS.cpython-313.pyc +0 -0
- quarchpy/device/__pycache__/scanDevices.cpython-311.pyc +0 -0
- quarchpy/device/__pycache__/scanDevices.cpython-313.pyc +0 -0
- quarchpy/device/quarchQPS.py.bak +0 -398
- quarchpy/disk_test/__pycache__/AbsDiskFinder.cpython-311.pyc +0 -0
- quarchpy/disk_test/__pycache__/AbsDiskFinder.cpython-313.pyc +0 -0
- quarchpy/disk_test/__pycache__/DiskTargetSelection.cpython-311.pyc +0 -0
- quarchpy/disk_test/__pycache__/DiskTargetSelection.cpython-313.pyc +0 -0
- quarchpy/disk_test/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/disk_test/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/disk_test/__pycache__/iometerDiskFinder.cpython-311.pyc +0 -0
- quarchpy/disk_test/__pycache__/iometerDiskFinder.cpython-313.pyc +0 -0
- quarchpy/docs/CHANGES.rst.bak +0 -430
- quarchpy/docs/_build/html/.buildinfo.bak +0 -4
- quarchpy/docs/_build/html/_static/github-banner.svg +0 -5
- quarchpy/fio/FIO_interface.py.bak +0 -317
- quarchpy/fio/__pycache__/FIO_interface.cpython-311.pyc +0 -0
- quarchpy/fio/__pycache__/FIO_interface.cpython-313.pyc +0 -0
- quarchpy/fio/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/fio/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/fio/__pycache__/fioDiskFinder.cpython-311.pyc +0 -0
- quarchpy/fio/__pycache__/fioDiskFinder.cpython-313.pyc +0 -0
- quarchpy/iometer/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/iometer/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/iometer/__pycache__/gen_iometer_template.cpython-311.pyc +0 -0
- quarchpy/iometer/__pycache__/gen_iometer_template.cpython-313.pyc +0 -0
- quarchpy/iometer/__pycache__/iometerFuncs.cpython-311.pyc +0 -0
- quarchpy/iometer/__pycache__/iometerFuncs.cpython-313.pyc +0 -0
- quarchpy/qis/__pycache__/StreamHeaderInfo.cpython-311.pyc +0 -0
- quarchpy/qis/__pycache__/StreamHeaderInfo.cpython-313.pyc +0 -0
- quarchpy/qis/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/qis/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/qis/__pycache__/qisFuncs.cpython-311.pyc +0 -0
- quarchpy/qis/__pycache__/qisFuncs.cpython-313.pyc +0 -0
- quarchpy/qps/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/qps/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/qps/__pycache__/qpsFuncs.cpython-311.pyc +0 -0
- quarchpy/qps/__pycache__/qpsFuncs.cpython-313.pyc +0 -0
- quarchpy/user_interface/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/user_interface/__pycache__/__init__.cpython-313.pyc +0 -0
- quarchpy/user_interface/__pycache__/user_interface.cpython-311.pyc +0 -0
- quarchpy/user_interface/__pycache__/user_interface.cpython-313.pyc +0 -0
- quarchpy/utilities/__pycache__/TestCenter.cpython-311.pyc +0 -0
- quarchpy/utilities/__pycache__/TestCenter.cpython-313.pyc +0 -0
- quarchpy/utilities/__pycache__/TimeValue.cpython-311.pyc +0 -0
- quarchpy/utilities/__pycache__/TimeValue.cpython-313.pyc +0 -0
- quarchpy/utilities/__pycache__/Version.cpython-311.pyc +0 -0
- quarchpy/utilities/__pycache__/Version.cpython-313.pyc +0 -0
- quarchpy/utilities/__pycache__/__init__.cpython-311.pyc +0 -0
- quarchpy/utilities/__pycache__/__init__.cpython-313.pyc +0 -0
- /quarchpy/connection_specific/QPS/win-amd64/{License → 3rdPartyLicenses}/Material-Icons-license.txt +0 -0
- /quarchpy/connection_specific/QPS/win-amd64/DeviceConfig/{QTL1995-02.XML → QTL1995-02.xml} +0 -0
- /quarchpy/connection_specific/QPS/win-amd64/DeviceConfig/{QTL1999-02.XML → QTL1999-02.xml} +0 -0
- /quarchpy/connection_specific/QPS/win-amd64/DeviceConfig/{QTL2312-01.XML → QTL2312-01.xml} +0 -0
- {quarchpy-2.2.7.dev1.dist-info → quarchpy-2.2.8.dist-info}/top_level.txt +0 -0
quarchpy/device/quarchQPS.py.bak
DELETED
@@ -1,398 +0,0 @@
|
|
1
|
-
from quarchpy.device import quarchDevice
|
2
|
-
from quarchpy.qps import toQpsTimeStamp
|
3
|
-
from quarchpy.utilities.Version import Version
|
4
|
-
from quarchpy.user_interface.user_interface import requestDialog
|
5
|
-
import os, time, datetime, sys, logging
|
6
|
-
|
7
|
-
if sys.version_info[0] < 3:
|
8
|
-
from StringIO import StringIO
|
9
|
-
else:
|
10
|
-
from io import StringIO
|
11
|
-
|
12
|
-
current_milli_time = lambda: int(round(time.time() * 1000))
|
13
|
-
current_second_time = lambda: int(round(time.time()))
|
14
|
-
|
15
|
-
|
16
|
-
# Using standard Unix time, milliseconds since the epoch (midnight 1 January 1970 UTC)
|
17
|
-
# Should avoid issues with time zones and summer time correction but the local and host
|
18
|
-
# clocks should still be synchronised
|
19
|
-
def qpsNowStr():
|
20
|
-
return current_milli_time() # datetime supports microseconds
|
21
|
-
|
22
|
-
|
23
|
-
class quarchQPS(quarchDevice):
|
24
|
-
def __init__(self, quarchDevice):
|
25
|
-
self.quarchDevice = quarchDevice
|
26
|
-
self.ConType = quarchDevice.ConType
|
27
|
-
self.ConString = quarchDevice.ConString
|
28
|
-
|
29
|
-
self.connectionObj = quarchDevice.connectionObj
|
30
|
-
self.IP_address = quarchDevice.connectionObj.qps.host
|
31
|
-
self.port_number = quarchDevice.connectionObj.qps.port
|
32
|
-
|
33
|
-
def startStream(self, directory, unserInput=True):
|
34
|
-
"""
|
35
|
-
directory - str - desired stream dir
|
36
|
-
unserInput=True - if a failure occurs userInput=True allows user to rectify problem with user input. set to False if user interaction is not available (automating).
|
37
|
-
"""
|
38
|
-
#time.sleep(1) # TODO remove this sleep once script->QPS timeing issue resolved. This works fine in the meantime
|
39
|
-
return quarchStream(self.quarchDevice, directory, unserInput)
|
40
|
-
|
41
|
-
|
42
|
-
class quarchStream:
|
43
|
-
def __init__(self, quarchQPS, directory, unserInput=True):
|
44
|
-
self.connectionObj = quarchQPS.connectionObj
|
45
|
-
self.IP_address = quarchQPS.connectionObj.qps.host
|
46
|
-
self.port_number = quarchQPS.connectionObj.qps.port
|
47
|
-
self.ConString = quarchQPS.ConString
|
48
|
-
self.ConType = quarchQPS.ConType
|
49
|
-
#time.sleep(1)
|
50
|
-
response = self.startQPSStream(directory)
|
51
|
-
if not "fail:" in response.lower():
|
52
|
-
return
|
53
|
-
else:
|
54
|
-
if unserInput is False:
|
55
|
-
raise Exception(response)
|
56
|
-
else:
|
57
|
-
self.failCheck(response)
|
58
|
-
|
59
|
-
def startQPSStream(self, newDirectory):
|
60
|
-
'''STARTS the stream '''
|
61
|
-
response = self.connectionObj.qps.sendCmdVerbose("$start stream \"" + str(newDirectory) + "\"")
|
62
|
-
if "Error" in response:
|
63
|
-
response = self.connectionObj.qps.sendCmdVerbose("$start stream " + str(newDirectory))
|
64
|
-
return response
|
65
|
-
|
66
|
-
def failCheck(self, response):
|
67
|
-
''' handles failed starting of stream that requires input from user to fix.'''
|
68
|
-
while "fail:" in response.lower():
|
69
|
-
if "Fail: Directory already exists" in response:
|
70
|
-
newDir = requestDialog(message=response+" Please enter a new file name:")
|
71
|
-
response = self.startQPSStream(newDir)
|
72
|
-
else: # If its a failure we don't know how to handle.
|
73
|
-
raise Exception(response)
|
74
|
-
return response
|
75
|
-
|
76
|
-
def get_stats(self, format="df"):
|
77
|
-
"""
|
78
|
-
Returns the QPS annotation statistics grid information as a pandas dataframe object
|
79
|
-
|
80
|
-
Returns
|
81
|
-
-------
|
82
|
-
df = : dataframe
|
83
|
-
The response text from QPS. If successful "ok. Saving stats to : file_name" otherwise returns the exception thrown
|
84
|
-
"""
|
85
|
-
command_response = self.connectionObj.qps.sendCmdVerbose("$get stats", timeout=60).strip()
|
86
|
-
if command_response.startswith("Fail"):
|
87
|
-
raise Exception(command_response)
|
88
|
-
|
89
|
-
if format == "df":
|
90
|
-
try:
|
91
|
-
import warnings
|
92
|
-
import pandas as pd
|
93
|
-
warnings.simplefilter(action='ignore', category=FutureWarning)
|
94
|
-
except Exception as e:
|
95
|
-
logging.error(e)
|
96
|
-
logging.warning("pandas not imported correctly. Continuing")
|
97
|
-
pd.set_option('display.max_columns', None)
|
98
|
-
pd.set_option('display.width', 1024)
|
99
|
-
test_data = StringIO(command_response)
|
100
|
-
|
101
|
-
# pandas.read_csv() replaced error_bad_lines with on_bad_lines from v1.3.0
|
102
|
-
if Version.is_v1_ge_v2(pd.__version__, "1.3.0"):
|
103
|
-
retVal = pd.read_csv(test_data, sep=",", header=[0, 1], on_bad_lines="skip")
|
104
|
-
else:
|
105
|
-
retVal = pd.read_csv(test_data, sep=",", header=[0, 1], error_bad_lines=False)
|
106
|
-
elif format == "list":
|
107
|
-
retVal = []
|
108
|
-
for line in command_response.replace("\r\n", "\n").split("\n"):
|
109
|
-
row = []
|
110
|
-
for element in line.split(","):
|
111
|
-
row.append(element)
|
112
|
-
retVal.append(row)
|
113
|
-
|
114
|
-
return retVal
|
115
|
-
|
116
|
-
def stats_to_CSV(self, file_name=""):
|
117
|
-
"""
|
118
|
-
Saves the statistics grid to a csv file
|
119
|
-
|
120
|
-
Parameters
|
121
|
-
----------
|
122
|
-
file-name= : str, optional
|
123
|
-
The absolute path of the file you would like to save the csv to. If left empty then a filename will be give.
|
124
|
-
Default location is the path of the executable.
|
125
|
-
Returns
|
126
|
-
-------
|
127
|
-
command_response : str or None
|
128
|
-
|
129
|
-
The response text from QPS. If successful "ok. Saving stats to : file_name" otherwise returns the exception thrown
|
130
|
-
"""
|
131
|
-
command_response = self.connectionObj.qps.sendCmdVerbose("$stats to csv \"" + file_name + "\"", timeout=60)
|
132
|
-
if command_response.startswith("Fail"):
|
133
|
-
raise Exception(command_response)
|
134
|
-
return command_response
|
135
|
-
|
136
|
-
def get_custom_stats_range(self, start_time, end_time):
|
137
|
-
"""
|
138
|
-
Returns the QPS statistics information over a specific time ignoring any set annotations.
|
139
|
-
|
140
|
-
Parameters
|
141
|
-
----------
|
142
|
-
start_time = : str
|
143
|
-
The time in seconds you would like the stats to start this can be in integer or string format.
|
144
|
-
or using the following format to specify daysDhours:minutes:seconds.milliseconds
|
145
|
-
xxxDxx:xx:xx.xxxx
|
146
|
-
end_time = : str
|
147
|
-
The time in seconds you would like the stats to stop this can be in integer or string format
|
148
|
-
or using the following format to specify daysDhours:minutes:seconds.milliseconds
|
149
|
-
xxxDxx:xx:xx.xxxx
|
150
|
-
Returns
|
151
|
-
-------
|
152
|
-
df = : dataframe
|
153
|
-
The response text from QPS. If successful "ok. Saving stats to : file_name" otherwise returns the exception thrown
|
154
|
-
"""
|
155
|
-
try:
|
156
|
-
import warnings
|
157
|
-
import pandas as pd
|
158
|
-
warnings.simplefilter(action='ignore', category=FutureWarning)
|
159
|
-
except:
|
160
|
-
logging.warning("pandas not imported correctly")
|
161
|
-
command_response = self.connectionObj.qps.sendCmdVerbose(
|
162
|
-
"$get custom stats range " + str(start_time) + " " + str(end_time), timeout=60)
|
163
|
-
if command_response.startswith("Fail"):
|
164
|
-
raise Exception(command_response)
|
165
|
-
test_data = StringIO(command_response)
|
166
|
-
try:
|
167
|
-
pd.set_option('display.max_columns', None)
|
168
|
-
pd.set_option('display.width', 1024)
|
169
|
-
# df = pd.read_csv(test_data, sep=",", header=[0,1])
|
170
|
-
# pandas.read_csv() replaced error_bad_lines with on_bad_lines from v1.3.0
|
171
|
-
if Version.is_v1_ge_v2(pd.__version__, "1.3.0"):
|
172
|
-
df = pd.read_csv(test_data, sep=",", header=[0, 1], on_bad_lines="skip")
|
173
|
-
else:
|
174
|
-
df = pd.read_csv(test_data, sep=",", header=[0, 1], error_bad_lines=False)
|
175
|
-
except Exception as e:
|
176
|
-
logging.error("Unable to create pandas data frame from command response :" + str(command_response))
|
177
|
-
raise e
|
178
|
-
return df
|
179
|
-
|
180
|
-
def takeSnapshot(self):
|
181
|
-
"""
|
182
|
-
Triggers QPS take snapshot function and saves it in the streams directory.
|
183
|
-
"""
|
184
|
-
command_response = self.connectionObj.qps.sendCmdVerbose("$take snapshot")
|
185
|
-
if command_response.startswith("Fail"):
|
186
|
-
raise Exception(command_response)
|
187
|
-
return (command_response)
|
188
|
-
|
189
|
-
def getStreamState(self):
|
190
|
-
"""
|
191
|
-
Askes QPS for the stream status.
|
192
|
-
QPS stream state != Module stream state.
|
193
|
-
This is different from "rec stream?" cmd to the module as it will return "streaming" when the module is nolonger streaming but QPS is still receiveing stream data from the module.
|
194
|
-
ei the module has stopped streaming but is emptying the stream buffer.
|
195
|
-
"""
|
196
|
-
command_response = self.connectionObj.qps.sendCmdVerbose("$stream state")
|
197
|
-
if command_response.startswith("Fail"):
|
198
|
-
raise Exception(command_response)
|
199
|
-
return (command_response)
|
200
|
-
|
201
|
-
def addAnnotation(self, title, annotationTime=0, extraText="", yPos="", titleColor="", annotationColor="",
|
202
|
-
annotationType="", annotationGroup=""):
|
203
|
-
"""
|
204
|
-
Adds a custom annotation to stream with given parameters.
|
205
|
-
|
206
|
-
Parameters
|
207
|
-
----------
|
208
|
-
title= : str
|
209
|
-
The title appears next to the annotation in the stream
|
210
|
-
extraText= : str, optional
|
211
|
-
The additional text that can be viewed when selecting the annotation
|
212
|
-
yPos : str, optional
|
213
|
-
The percetange of how high up the screen the annotation should appear 0 is the bottom and 100 the top
|
214
|
-
titleColor : str, optional
|
215
|
-
The color of the text next to the annotation in hex format 000000 to FFFFFF
|
216
|
-
annotationColor : str, optional
|
217
|
-
The color of the annotation marker in hex format 000000 to FFFFFF
|
218
|
-
annotationGroup : str, optional
|
219
|
-
The group the annotation belongs to
|
220
|
-
annotationTime : int, optional
|
221
|
-
The time in milliseconds after the start of the stream at which the annotation should be placed. 0 will plot the annotation live at the most recent sample
|
222
|
-
|
223
|
-
Returns
|
224
|
-
-------
|
225
|
-
command_response : str or None
|
226
|
-
|
227
|
-
The response text from QPS. "ok" if annotation successfully added
|
228
|
-
"""
|
229
|
-
annotationTime = str(annotationTime)
|
230
|
-
annotationType = annotationType.lower()
|
231
|
-
if annotationType == "" or annotationType == "annotation":
|
232
|
-
annotationType = "annotate"
|
233
|
-
elif annotationType == "comment":
|
234
|
-
pass # already in the correct format for command
|
235
|
-
else:
|
236
|
-
retString = "Fail annotationType must be 'annotation' or 'comment'"
|
237
|
-
logging.warning(retString)
|
238
|
-
return retString
|
239
|
-
|
240
|
-
# If the function has already been passed the XML string to give to QPS
|
241
|
-
if ("<<" in title.replace(" ", "")):
|
242
|
-
annotationString = str(title)
|
243
|
-
else:
|
244
|
-
annotationString = "<"
|
245
|
-
|
246
|
-
if annotationTime == "0":
|
247
|
-
# Use current time
|
248
|
-
annotationTime = qpsNowStr()
|
249
|
-
elif (annotationTime.startswith("e")):
|
250
|
-
pass
|
251
|
-
else:
|
252
|
-
# Convert timestamp to QPS format
|
253
|
-
# annotationTime = toQpsTimeStamp(annotationTime)
|
254
|
-
annotationTime = str(annotationTime)
|
255
|
-
|
256
|
-
if title != "":
|
257
|
-
annotationString += "<text>" + str(title) + "</text>"
|
258
|
-
if extraText != "":
|
259
|
-
annotationString += "<extraText>" + str(extraText) + "</extraText>"
|
260
|
-
if yPos != "":
|
261
|
-
annotationString += "<yPos>" + str(yPos) + "</yPos>"
|
262
|
-
if titleColor != "":
|
263
|
-
annotationString += "<textColor>" + str(titleColor) + "</textColor>"
|
264
|
-
if annotationColor != "":
|
265
|
-
annotationString += "<color>" + str(annotationColor) + "</color>"
|
266
|
-
if annotationGroup != "":
|
267
|
-
annotationString += "<userType>" + str(annotationGroup) + "</userType>"
|
268
|
-
annotationString += ">"
|
269
|
-
|
270
|
-
# command is sent on newline so \n needs to be chnaged to \\n which is changed back just before printing in qps.
|
271
|
-
annotationString = annotationString.replace("\n", "\\n")
|
272
|
-
logging.debug("Time sending to QPS:" + str(annotationTime))
|
273
|
-
return self.connectionObj.qps.sendCmdVerbose(
|
274
|
-
"$" + annotationType + " " + str(annotationTime) + " " + annotationString)
|
275
|
-
|
276
|
-
def addComment(self, title, commentTime=0, extraText="", yPos="", titleColor="", commentColor="", annotationType="",
|
277
|
-
annotationGroup=""):
|
278
|
-
# Comments are just annotations that do not affect the statistics grid.
|
279
|
-
# This function was kept to be backwards compatible and is a simple pass through to add annotation.
|
280
|
-
if annotationType == "":
|
281
|
-
annotationType = "comment"
|
282
|
-
return self.addAnnotation(title=title, annotationTime=commentTime, extraText=extraText, yPos=yPos,
|
283
|
-
titleColor=titleColor, annotationColor=commentColor, annotationType=annotationType,
|
284
|
-
annotationGroup=annotationGroup)
|
285
|
-
|
286
|
-
def saveCSV(self, filePath, linesPerFile=None, cr=None, delimiter=None, timeout=60):
|
287
|
-
"""
|
288
|
-
Saves the stream to csv file at specified location
|
289
|
-
|
290
|
-
Parameters
|
291
|
-
----------
|
292
|
-
filePath= : str
|
293
|
-
The file path that ou would like the CSV file saved to.
|
294
|
-
linesPerFile= : str, optional
|
295
|
-
The number of lines per CSV file. Can be any int number or "all"
|
296
|
-
cr : bool, optional
|
297
|
-
Whether the end of line terminator should include a carriage return.
|
298
|
-
delimiter : str, optional
|
299
|
-
The delimiter to be used by the csv file.
|
300
|
-
timeout : str, otptional
|
301
|
-
The timeout to wait for a response from QPS
|
302
|
-
|
303
|
-
Returns
|
304
|
-
-------
|
305
|
-
command_response : str or None
|
306
|
-
The response text from QPS. "ok" if command is successful or the stack trace if exception thrown
|
307
|
-
"""
|
308
|
-
args = ""
|
309
|
-
|
310
|
-
if linesPerFile != None:
|
311
|
-
args += " -l" + str(linesPerFile)
|
312
|
-
if cr != None:
|
313
|
-
if cr is True:
|
314
|
-
args += " -cyes"
|
315
|
-
elif cr is False:
|
316
|
-
args += " -cno"
|
317
|
-
if delimiter != None:
|
318
|
-
args += " -s" + delimiter
|
319
|
-
|
320
|
-
# , filePath, linesPerFile, cr, delimiter
|
321
|
-
return self.connectionObj.qps.sendCmdVerbose("$save csv \"" + filePath + "\" " + args, timeout=timeout)
|
322
|
-
|
323
|
-
def createChannel(self, channelName, channelGroup, baseUnits, usePrefix):
|
324
|
-
# Conditions to convert false / true inputs to specification input
|
325
|
-
if usePrefix == False:
|
326
|
-
usePrefix = "no"
|
327
|
-
if usePrefix == True:
|
328
|
-
usePrefix = "yes"
|
329
|
-
|
330
|
-
return self.connectionObj.qps.sendCmdVerbose(
|
331
|
-
"$create channel " + channelName + " " + channelGroup + " " + baseUnits + " " + usePrefix)
|
332
|
-
|
333
|
-
def hideChannel(self, channelSpecifier):
|
334
|
-
return self.connectionObj.qps.sendCmdVerbose("$hide channel " + channelSpecifier)
|
335
|
-
|
336
|
-
def showChannel(self, channelSpecifier):
|
337
|
-
return self.connectionObj.qps.sendCmdVerbose("$show channel " + channelSpecifier)
|
338
|
-
|
339
|
-
def myChannels(self):
|
340
|
-
return self.connectionObj.qps.sendCmdVerbose("$channels")
|
341
|
-
|
342
|
-
def channels(self):
|
343
|
-
return self.connectionObj.qps.sendCmdVerbose("$channels").splitlines()
|
344
|
-
|
345
|
-
def stopStream(self):
|
346
|
-
return self.connectionObj.qps.sendCmdVerbose("$stop stream")
|
347
|
-
|
348
|
-
def stopStreamAndAllowBufferToEmpty(self, checkInterval=0.5):
|
349
|
-
self.stopStream()
|
350
|
-
streamState = self.getStreamState().lower()
|
351
|
-
while "running" in streamState:
|
352
|
-
logging.debug("Stream buffer still emptying: " + streamState)
|
353
|
-
time.sleep(checkInterval)
|
354
|
-
streamState = self.getStreamState().lower()
|
355
|
-
logging.debug("QPS no longer Streaming: " + streamState)
|
356
|
-
|
357
|
-
def hideAllDefaultChannels(self):
|
358
|
-
|
359
|
-
# TODO query QPS / Device for all channel names and hide all of them
|
360
|
-
# All Default Channels
|
361
|
-
self.hideChannel("3.3v:voltage")
|
362
|
-
self.hideChannel("3v3:voltage")
|
363
|
-
self.hideChannel("5v:voltage")
|
364
|
-
self.hideChannel("12v:voltage")
|
365
|
-
self.hideChannel("3v3:current")
|
366
|
-
self.hideChannel("3.3v:current")
|
367
|
-
self.hideChannel("5v:current")
|
368
|
-
self.hideChannel("12v:current")
|
369
|
-
self.hideChannel("3v3:power")
|
370
|
-
self.hideChannel("3.3v:power")
|
371
|
-
self.hideChannel("5v:power")
|
372
|
-
self.hideChannel("12v:power")
|
373
|
-
self.hideChannel("tot:power")
|
374
|
-
# Default PAM channels
|
375
|
-
self.hideChannel("perst#:digital")
|
376
|
-
self.hideChannel("wake#:digital")
|
377
|
-
self.hideChannel("lkreq#:digital")
|
378
|
-
self.hideChannel("smclk:digital")
|
379
|
-
self.hideChannel("smdat:digital")
|
380
|
-
|
381
|
-
# function to add a data point the the stream
|
382
|
-
# time value will default to current time if none passed
|
383
|
-
def addDataPoint(self, channelName, groupName, dataValue, dataPointTime=0, timeFormat="unix"):
|
384
|
-
'''
|
385
|
-
channelName - str
|
386
|
-
groupName - str
|
387
|
-
dataValue - int/float value of the data point
|
388
|
-
dataPointTime=0 - time of the data point
|
389
|
-
timeFormat="unix" - the format of the given time
|
390
|
-
'''
|
391
|
-
if dataPointTime == None or dataPointTime == 0:
|
392
|
-
dataPointTime = qpsNowStr()
|
393
|
-
else:
|
394
|
-
dataPointTime = toQpsTimeStamp(dataPointTime)
|
395
|
-
|
396
|
-
self.connectionObj.qps.sendCmdVerbose(
|
397
|
-
"$stream data add " + channelName + " " + groupName + " " + str(dataPointTime) + " " + str(
|
398
|
-
dataValue) + " " + timeFormat)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|