Skip to content

Commit

Permalink
- updates Qt/PyQt to v6.3.1
Browse files Browse the repository at this point in the history
- adds MODBUS IP timeout and retry parameters (Issue #892)
- fixed autoDROP precision (Issue #859)
- adds Loring CSV importer (Issue #902)
  • Loading branch information
MAKOMO committed Jun 19, 2022
1 parent 101f0ff commit 192bb47
Show file tree
Hide file tree
Showing 130 changed files with 45,781 additions and 44,385 deletions.
6 changes: 3 additions & 3 deletions src/artisanlib/alarms.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@


try:
#pylint: disable = E, W, R, C
#ylint: disable = E, W, R, C
from PyQt6.QtCore import (Qt, pyqtSlot, QSettings) # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtGui import QColor, QIntValidator # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtWidgets import (QApplication, QWidget, QLabel, QLineEdit, QComboBox, QDialogButtonBox, # @UnusedImport @Reimport @UnresolvedImport
QTableWidget, QHBoxLayout, QVBoxLayout, QCheckBox, QPushButton, QSizePolicy, QSpinBox, # @UnusedImport @Reimport @UnresolvedImport
QTableWidgetSelectionRange, QTimeEdit, QTabWidget, QGridLayout, QGroupBox, QHeaderView) # @UnusedImport @Reimport @UnresolvedImport
except Exception:
#pylint: disable = E, W, R, C
except Exception: # pylint: disable=broad-except
#ylint: disable = E, W, R, C
# @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtCore import (Qt, pyqtSlot, QSettings) # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtGui import QColor, QIntValidator # @UnusedImport @Reimport @UnresolvedImport
Expand Down
6 changes: 3 additions & 3 deletions src/artisanlib/autosave.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
from artisanlib.dialogs import ArtisanDialog

try:
#pylint: disable = E, W, R, C
#ylint: disable = E, W, R, C
from PyQt6.QtCore import Qt, pyqtSlot, QSettings # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtWidgets import (QApplication, QLabel, QPushButton, QDialogButtonBox, # @UnusedImport @Reimport @UnresolvedImport
QComboBox, QHBoxLayout, QVBoxLayout, QCheckBox, QGridLayout, QLineEdit) # @UnusedImport @Reimport @UnresolvedImport
except Exception:
#pylint: disable = E, W, R, C
except Exception: # pylint: disable=broad-except
#plint: disable = E, W, R, C
from PyQt5.QtCore import Qt, pyqtSlot, QSettings # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtWidgets import (QApplication, QLabel, QPushButton, QDialogButtonBox, # @UnusedImport @Reimport @UnresolvedImport
QComboBox, QHBoxLayout, QVBoxLayout, QCheckBox, QGridLayout, QLineEdit) # @UnusedImport @Reimport @UnresolvedImport
Expand Down
6 changes: 3 additions & 3 deletions src/artisanlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
from artisanlib.dialogs import ArtisanDialog

try:
#pylint: disable = E, W, R, C
#ylint: disable = E, W, R, C
from PyQt5.QtCore import Qt, pyqtSlot, QRegularExpression, QSettings # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtGui import QIntValidator, QRegularExpressionValidator # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtWidgets import (QApplication, QLabel, QPushButton, QDialogButtonBox, QFrame, # @UnusedImport @Reimport @UnresolvedImport
QComboBox, QHBoxLayout, QVBoxLayout, QCheckBox, QGridLayout, QGroupBox, QLineEdit, QLayout, # @UnusedImport @Reimport @UnresolvedImport
QSpinBox) # @UnusedImport @Reimport @UnresolvedImport
#pylint: disable = E, W, R, C
except Exception:
#ylint: disable = E, W, R, C
except Exception: # pylint: disable=broad-except
from PyQt6.QtCore import Qt, pyqtSlot, QRegularExpression, QSettings # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtGui import QIntValidator, QRegularExpressionValidator # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtWidgets import (QApplication, QLabel, QPushButton, QDialogButtonBox, QFrame, # @UnusedImport @Reimport @UnresolvedImport
Expand Down
7 changes: 4 additions & 3 deletions src/artisanlib/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
from artisanlib.dialogs import ArtisanResizeablDialog

try:
#pylint: disable = E, W, R, C
#ylint: disable = E, W, R, C
from PyQt6.QtCore import (Qt, pyqtSlot, QSettings) # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtGui import QColor, QKeySequence # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, QVBoxLayout, # @UnusedImport @Reimport @UnresolvedImport
QLabel, QLineEdit,QPushButton, QComboBox, QDialogButtonBox, QHeaderView, # @UnusedImport @Reimport @UnresolvedImport
QSpinBox, QTableWidget, QTableWidgetItem, QTabWidget, QWidget, QGroupBox) # @UnusedImport @Reimport @UnresolvedImport
except Exception:
#pylint: disable = E, W, R, C
except Exception: # pylint: disable=broad-except
#ylint: disable = E, W, R, C
from PyQt5.QtCore import (Qt, pyqtSlot, QSettings) # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtGui import QColor, QKeySequence # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout, QVBoxLayout, # @UnusedImport @Reimport @UnresolvedImport
Expand Down Expand Up @@ -490,6 +490,7 @@ def setplaybackevent(self,_):
msg = QApplication.translate('StatusBar','Playback Events set OFF')
s = "background-color:'transparent';"
self.aw.sendmessage(msg, style=s)
self.aw.updatePlaybackIndicator()
for widget in [
self.backgroundPlaybackEvent0,
self.backgroundPlaybackEvent1,
Expand Down
6 changes: 3 additions & 3 deletions src/artisanlib/batches.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
from artisanlib.dialogs import ArtisanDialog

try:
#pylint: disable = E, W, R, C
#ylint: disable = E, W, R, C
from PyQt6.QtCore import Qt, pyqtSlot, QSettings # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtWidgets import (QApplication, QLabel, QHBoxLayout, QVBoxLayout, QCheckBox, # @UnusedImport @Reimport @UnresolvedImport
QDialogButtonBox, QGridLayout, QLineEdit, QSpinBox, QLayout) # @UnusedImport @Reimport @UnresolvedImport
except Exception:
#pylint: disable = E, W, R, C
except Exception: # pylint: disable=broad-except
#ylint: disable = E, W, R, C
from PyQt5.QtCore import Qt, pyqtSlot, QSettings # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtWidgets import (QApplication, QLabel, QHBoxLayout, QVBoxLayout, QCheckBox, # @UnusedImport @Reimport @UnresolvedImport
QDialogButtonBox, QGridLayout, QLineEdit, QSpinBox, QLayout) # @UnusedImport @Reimport @UnresolvedImport
Expand Down
20 changes: 10 additions & 10 deletions src/artisanlib/ble.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
from enum import Enum

try:
#pylint: disable = E, W, R, C
#ylint: disable = E, W, R, C
from PyQt6 import QtCore # @UnusedImport @Reimport @UnresolvedImport
from PyQt6 import QtBluetooth # @UnusedImport @Reimport @UnresolvedImport
except Exception:
#pylint: disable = E, W, R, C
except Exception: # pylint: disable=broad-except
#ylint: disable = E, W, R, C
from PyQt5 import QtCore # @UnusedImport @Reimport @UnresolvedImport
from PyQt5 import QtBluetooth # @UnusedImport @Reimport @UnresolvedImport

Expand Down Expand Up @@ -94,7 +94,7 @@ def __init__(self, uuid_service_char_tuples, processData, sendHeartbeat, sendSto
self.m_notificationDesc = QtBluetooth.QLowEnergyDescriptor()
self.m_readCharacteristic = QtBluetooth.QLowEnergyCharacteristic()
self.m_writeCharacteristic = QtBluetooth.QLowEnergyCharacteristic()
# pylint: disable=maybe-no-member
# plint: disable=maybe-no-member
self.m_writemode = QtBluetooth.QLowEnergyService.WriteMode.WriteWithoutResponse # was QtBluetooth.QLowEnergyService.WriteMode() => 0 in PyQt5, but fails on PyQt6

self.m_connected = False
Expand Down Expand Up @@ -197,12 +197,12 @@ def searchCharacteristic(self):
ble_write_type in (
BLE_CHAR_TYPE.BLE_CHAR_NOTIFY_WRITE,
BLE_CHAR_TYPE.BLE_CHAR_WRITE)):
# pylint: disable=maybe-no-member
# plint: disable=maybe-no-member
if ((c.properties() & QtBluetooth.QLowEnergyCharacteristic.PropertyType.WriteNoResponse) or
(c.properties() & QtBluetooth.QLowEnergyCharacteristic.PropertyType.Write)):
self.m_writeCharacteristic = c
self.update_connected(True)
# pylint: disable=maybe-no-member
# plint: disable=maybe-no-member
if c.properties() & QtBluetooth.QLowEnergyCharacteristic.PropertyType.WriteNoResponse:
self.m_writemode=QtBluetooth.QLowEnergyService.WriteMode.WriteWithoutResponse
else:
Expand Down Expand Up @@ -235,7 +235,7 @@ def onCharacteristicRead(self,_=QtBluetooth.QLowEnergyCharacteristic,value=QtCor
@QtCore.pyqtSlot('QLowEnergyService::ServiceState')
def onServiceStateChanged(self, s):
_log.debug('onServiceStateChanged(%s)',s)
# pylint: disable=maybe-no-member
# ylint: disable=maybe-no-member
if s == QtBluetooth.QLowEnergyService.ServiceState.InvalidService:
pass
elif s == QtBluetooth.QLowEnergyService.ServiceState.DiscoveryRequired and self.m_service is not None:
Expand Down Expand Up @@ -274,7 +274,7 @@ def onServiceScanDone(self):
self.m_service.characteristicChanged.connect(self.onCharacteristicChanged)
self.m_service.characteristicRead.connect(self.onCharacteristicRead)
self.m_service.errorOccurred.connect(self.serviceError)
# pylint: disable=maybe-no-member
# ylint: disable=maybe-no-member
if self.m_service is not None and self.m_service.state() == QtBluetooth.QLowEnergyService.ServiceState.DiscoveryRequired:
self.m_service.discoverDetails() # this is required on PyQt 5.2.2 as onServiceStateChanged() is not called automatically
else:
Expand Down Expand Up @@ -327,7 +327,7 @@ def deviceHasService(device, service_uuid):
@QtCore.pyqtSlot('QBluetoothDeviceInfo')
def addDevice(self, device):
# _log.debug("addDevice(%s)", device)
# pylint: disable=maybe-no-member
# ylint: disable=maybe-no-member
if self.m_device is None and device.coreConfigurations() & QtBluetooth.QBluetoothDeviceInfo.CoreConfiguration.LowEnergyCoreConfiguration:
m_device = QtBluetooth.QBluetoothDeviceInfo(device)
# _log.debug("discovered LE Device name: '%s', device: %s", device.name(), m_device.deviceUuid().toString())
Expand Down Expand Up @@ -364,7 +364,7 @@ def scanDevices(self):
self.m_device = None
try:
# fails on PyQt5, works on PyQt6
# pylint: disable=maybe-no-member
# ylint: disable=maybe-no-member
self.m_deviceDiscoveryAgent.start(QtBluetooth.QBluetoothDeviceDiscoveryAgent.DiscoveryMethod.LowEnergyMethod)
except Exception: # pylint: disable=broad-except
# works on PyQt5, fails on PyQt6
Expand Down
6 changes: 3 additions & 3 deletions src/artisanlib/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
from artisanlib.dialogs import ArtisanDialog

try:
#pylint: disable = E, W, R, C
#ylint: disable = E, W, R, C
from PyQt6.QtCore import pyqtSlot, QSettings, QRegularExpression # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtGui import QRegularExpressionValidator # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtWidgets import (QApplication, QLabel, QGridLayout, QGroupBox, QLineEdit, # @UnusedImport @Reimport @UnresolvedImport
QComboBox, QHBoxLayout, QVBoxLayout) # @UnusedImport @Reimport @UnresolvedImport
except Exception:
#pylint: disable = E, W, R, C
except Exception: # pylint: disable=broad-except
#ylint: disable = E, W, R, C
from PyQt5.QtCore import pyqtSlot, QSettings, QRegularExpression # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtGui import QRegularExpressionValidator # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtWidgets import (QApplication, QLabel, QGridLayout, QGroupBox, QLineEdit, # @UnusedImport @Reimport @UnresolvedImport
Expand Down
6 changes: 3 additions & 3 deletions src/artisanlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
from artisanlib.dialogs import ArtisanDialog

try:
#pylint: disable = E, W, R, C
#ylint: disable = E, W, R, C
from PyQt6.QtCore import Qt, pyqtSlot # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtGui import QColor, QFont, QPalette # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtWidgets import (QApplication, QWidget, QLabel, QPushButton, # @UnusedImport @Reimport @UnresolvedImport
QSizePolicy, QHBoxLayout, QVBoxLayout, QDialogButtonBox, QGridLayout, QGroupBox, # @UnusedImport @Reimport @UnresolvedImport
QLayout, QSpinBox, QTabWidget, QMessageBox) # @UnusedImport @Reimport @UnresolvedImport
except Exception:
#pylint: disable = E, W, R, C
except Exception: # pylint: disable=broad-except
#ylint: disable = E, W, R, C
from PyQt5.QtCore import Qt, pyqtSlot # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtGui import QColor, QFont, QPalette # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtWidgets import (QApplication, QWidget, QLabel, QPushButton, # @UnusedImport @Reimport @UnresolvedImport
Expand Down
32 changes: 4 additions & 28 deletions src/artisanlib/comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
from artisanlib.util import cmd2str, RoRfromCtoF, fromCtoF, fromFtoC, hex2int, str2cmd, toFloat

try:
#pylint: disable = E, W, R, C
#ylint: disable = E, W, R, C
from PyQt6.QtCore import Qt, QDateTime, QSemaphore, pyqtSlot # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtGui import QIntValidator # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtWidgets import (QApplication, QCheckBox, QDialog, QGridLayout, QHBoxLayout, QVBoxLayout, # @UnusedImport @Reimport @UnresolvedImport
QLabel, QLineEdit,QPushButton) # @UnusedImport @Reimport @UnresolvedImport
from PyQt6 import sip # @UnusedImport @Reimport @UnresolvedImport
except Exception:
#pylint: disable = E, W, R, C
except Exception: # pylint: disable=broad-except
#ylint: disable = E, W, R, C
from PyQt5.QtCore import Qt, QDateTime, QSemaphore, pyqtSlot # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtGui import QIntValidator # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtWidgets import (QApplication, QCheckBox, QDialog, QGridLayout, QHBoxLayout, QVBoxLayout, # @UnusedImport @Reimport @UnresolvedImport
Expand Down Expand Up @@ -724,7 +724,7 @@ def callprogram(self):

if self.platf == 'Windows':
cmd_str = os.path.expanduser(self.aw.ser.externalprogram)
p = subprocess.Popen(cmd_str,env=my_env,stdout=subprocess.PIPE,startupinfo=startupinfo,shell=True) # pylint: disable=consider-using-with
p = subprocess.Popen(cmd_str,env=my_env,stdout=subprocess.PIPE,startupinfo=startupinfo,shell=True) # ylint: disable=consider-using-with
else:
p = subprocess.Popen([os.path.expanduser(c) for c in shlex.split(self.aw.ser.externalprogram)],env=my_env,stdout=subprocess.PIPE,startupinfo=startupinfo) # pylint: disable=consider-using-with
output = p.communicate()[0].decode('UTF-8')
Expand Down Expand Up @@ -5228,30 +5228,6 @@ def YOCTOimportLIB(self):
# import Yoctopuce Python library (installed form PyPI)
#self.aw.sendmessage(str(errmsg))
YAPI.DisableExceptions()
# ## WINDOWS/Linux DLL HACK BEGIN
# arch = platform.architecture()[0]
# machine = platform.machine()
# libpath = os.path.dirname(sys.executable)
# if self.platf == 'Windows' and appFrozen():
# if arch == '32bit':
# YAPI._yApiCLibFile = libpath + '\\lib\\yapi.dll' # pylint: disable=protected-access
# else:
# YAPI._yApiCLibFile = libpath + '\\lib\\yapi64.dll' # pylint: disable=protected-access
# YAPI._yApiCLibFileFallback = libpath + '\\lib\\yapi.dll' # pylint: disable=protected-access
# elif self.platf == 'Linux' and appFrozen():
# if machine.find('arm') >= 0: # Raspberry
# YAPI._yApiCLibFile = libpath + '/libyapi-armhf.so' # pylint: disable=protected-access
# YAPI._yApiCLibFileFallback = libpath + '/libyapi-armel.so' # pylint: disable=protected-access
# elif machine.find('mips') >= 0:
# YAPI._yApiCLibFile = libpath + '/libyapi-mips.so' # pylint: disable=protected-access
# YAPI._yApiCLibFileFallback = '' # pylint: disable=protected-access
# elif machine == 'x86_32' or (machine[0] == 'i' and machine[-2:] == '86'):
# YAPI._yApiCLibFile = libpath + '/libyapi-i386.so' # pylint: disable=protected-access
# YAPI._yApiCLibFileFallback = libpath + '/libyapi-amd64.so' # just in case # pylint: disable=protected-access
# elif machine == 'x86_64':
# YAPI._yApiCLibFile = libpath + '/libyapi-amd64.so' # pylint: disable=protected-access
# YAPI._yApiCLibFileFallback = libpath + '/libyapi-i386.so' # just in case # pylint: disable=protected-access
# ## WINDOWS/Linux DLL HACK END
try:
if self.aw.qmc.yoctoRemoteFlag:
YAPI.RegisterHub(self.aw.qmc.yoctoServerID,errmsg)
Expand Down
10 changes: 5 additions & 5 deletions src/artisanlib/comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from matplotlib import rcParams
if sys.platform.startswith('darwin'):
# import module to detect if OS X dark mode is active or not
import darkdetect # @UnresolvedImport # pylint: disable=import-error
import darkdetect # @UnresolvedImport # plint: disable=import-error
import logging
try:
from typing import Final
Expand All @@ -41,14 +41,14 @@
from matplotlib import cm

try:
#pylint: disable = E, W, R, C
#ylint: disable = E, W, R, C
from PyQt6.QtCore import (Qt, pyqtSignal, pyqtSlot, QSettings, QFile, QTextStream, QUrl, # @UnusedImport @Reimport @UnresolvedImport
QCoreApplication, QFileInfo, QDate, QTime, QDateTime) # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtGui import (QColor, QDesktopServices) # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtWidgets import (QApplication, QWidget, QLabel, QTableWidget, QPushButton, # @UnusedImport @Reimport @UnresolvedImport
QComboBox, QSizePolicy, QHBoxLayout, QVBoxLayout, QHeaderView, QTableWidgetItem, QCheckBox) # @UnusedImport @Reimport @UnresolvedImport
except Exception:
#pylint: disable = E, W, R, C
except Exception: # pylint: disable=broad-except
#ylint: disable = E, W, R, C
from PyQt5.QtCore import (Qt, pyqtSignal, pyqtSlot, QSettings, QFile, QTextStream, QUrl, # @UnusedImport @Reimport @UnresolvedImport
QCoreApplication, QFileInfo, QDate, QTime, QDateTime) # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtGui import (QColor, QDesktopServices) # @UnusedImport @Reimport @UnresolvedImport
Expand Down Expand Up @@ -736,7 +736,7 @@ def __init__(self, parent = None, aw = None, foreground = None, background = Non
self.background = background
self.setWindowTitle(QApplication.translate('Form Caption','Comparator'))
self.maxentries = 10 # maximum number of profiles to be compared
self.basecolors = list(cm.tab10(numpy.linspace(0,1,10))) # @UndefinedVariable # pylint: disable=maybe-no-member
self.basecolors = list(cm.tab10(numpy.linspace(0,1,10))) # @UndefinedVariable # ylint: disable=maybe-no-member
self.profiles = []
self.label_number = 0
# align line
Expand Down
6 changes: 3 additions & 3 deletions src/artisanlib/cropster.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
from typing_extensions import Final

try:
#pylint: disable = E, W, R, C
#ylint: disable = E, W, R, C
from PyQt6.QtCore import QDateTime, Qt # @UnusedImport @Reimport @UnresolvedImport
from PyQt6.QtWidgets import QApplication # @UnusedImport @Reimport @UnresolvedImport
except Exception:
#pylint: disable = E, W, R, C
except Exception: # pylint: disable=broad-except
#ylint: disable = E, W, R, C
from PyQt5.QtCore import QDateTime, Qt # @UnusedImport @Reimport @UnresolvedImport
from PyQt5.QtWidgets import QApplication # @UnusedImport @Reimport @UnresolvedImport

Expand Down
Loading

0 comments on commit 192bb47

Please sign in to comment.