Skip to content

Commit

Permalink
Merge pull request #57 from ifm/develop
Browse files Browse the repository at this point in the history
Version 1.0.7
  • Loading branch information
cwiede authored Nov 3, 2023
2 parents d49f659 + 2bb9a68 commit 77d5d2a
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 29 deletions.
1 change: 0 additions & 1 deletion nexxT/core/AppConsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def setupConsoleServices(config):
Services.addService("PlaybackControl", PlaybackControlConsole(config))
Services.addService("RecordingControl", MVCRecordingControlBase(config))
Services.addService("Configuration", MVCConfigurationBase(config))
Services.addService("Profiling", ProfilingService())

def setupGuiServices(config):
"""
Expand Down
5 changes: 3 additions & 2 deletions nexxT/core/Thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import logging
import sys
import threading
from nexxT.Qt.QtCore import QObject, Signal, Slot, QCoreApplication, QThread
from nexxT.Qt.QtCore import Qt, QObject, Signal, Slot, QCoreApplication, QThread
from nexxT.interface import FilterState, Services
from nexxT.core.Exceptions import NodeExistsError, NexTInternalError, NodeNotFoundError, NexTRuntimeError
from nexxT.core.Utils import handleException
from nexxT.core.Utils import handleException, MethodInvoker

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -170,6 +170,7 @@ def performOperation(self, operation, barrier):
if inProcessEvents:
logging.getLogger(__name__).warning(
"operation %s happening during receiveAsync's processEvents. This shouldn't be happening.", operation)

barrier.wait()
if operation in self._operations:
# pre-adaptation of states (e.g. from CONSTRUCTED to INITIALIZING)
Expand Down
9 changes: 3 additions & 6 deletions nexxT/core/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import sqlite3
import time
from nexxT.Qt.QtCore import (QObject, Signal, Slot, QMutex, QWaitCondition, QCoreApplication, QThread,
QMutexLocker, QRecursiveMutex, QTimer, Qt, QPoint)
QMutexLocker, QRecursiveMutex, QTimer, Qt, QPoint, QMetaObject)
from nexxT.Qt.QtGui import QColor, QPainter, QTextLayout, QTextOption
from nexxT.Qt.QtWidgets import QFrame, QSizePolicy
from nexxT.core.Exceptions import NexTInternalError, InvalidIdentifierException
Expand All @@ -30,8 +30,6 @@ class MethodInvoker(QObject):
https://stackoverflow.com/questions/53296261/usage-of-qgenericargument-q-arg-when-using-invokemethod-in-pyside2
"""

signal = Signal() # 10 arguments

methodscalled = set()

IDLE_TASK = "IDLE_TASK"
Expand All @@ -58,10 +56,9 @@ def __init__(self, callback, connectiontype, *args):
if connectiontype is self.IDLE_TASK:
QTimer.singleShot(0, self.callbackWrapper)
else:
self.signal.connect(self.callbackWrapper, connectiontype)
self.signal.emit()
QMetaObject.invokeMethod(self, "callbackWrapper", connectiontype)

@Slot(object)
@Slot()
def callbackWrapper(self):
"""
Slot which actuall performs the method call.
Expand Down
14 changes: 9 additions & 5 deletions nexxT/services/SrvPlaybackControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,20 @@ def removeConnections(self, playbackDevice):
:return: None
"""
with QMutexLocker(self._mutex):
# note: avoid signal/slot connections/disconnections while holding the mutex since this might lead to
# deadlocks
found = []
for devid, dev in self._registeredDevices.items():
if dev["object"] is playbackDevice:
found.append(devid)
found.append((devid, dev))
if len(found) > 0:
for devid in found:
for devid, _ in found:
del self._registeredDevices[devid]
logger.debug("disconnected connections of playback device. number of devices left: %d",
len(self._registeredDevices))
MethodInvoker(dict(object=self, method="_updateFeatureSet", thread=mainThread()), Qt.QueuedConnection)
for devid, dev in found:
del dev
logger.debug("disconnected connections of playback device. number of devices left: %d",
len(self._registeredDevices))
MethodInvoker(dict(object=self, method="_updateFeatureSet", thread=mainThread()), Qt.QueuedConnection)

@handleException
def _stopSetSequenceStart(self, filename):
Expand Down
4 changes: 4 additions & 0 deletions nexxT/services/SrvProfiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,14 @@ def deregisterThread(self):
self._mi = None
t = QThread.currentThread()
logger.debug("deregistering thread %s", t.objectName())
todel = []
with self._lockThreadSpecific:
if t in self._threadSpecificProfiling:
self._threadSpecificProfiling[t].timer.stop()
todel.append(self._threadSpecificProfiling[t])
del self._threadSpecificProfiling[t]
for tsp in todel:
del tsp
self.threadDeregistered.emit(t.objectName())

@Slot()
Expand Down
2 changes: 2 additions & 0 deletions nexxT/services/SrvRecordingControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def _supportedFeaturesChanged(self, featureset):
:return:
"""

@Slot(str, float, "qlonglong")
def _statusUpdate(self, file=None, lengthInSeconds=None, bytesWritten=None):
"""
Emits the statusUpdate signal
Expand Down Expand Up @@ -158,6 +159,7 @@ def startRecording(self, directory):
Application.activeApplication.stateChanged.connect(self.stateChanged)
self._startRecording.emit(directory)

@Slot(int)
def stateChanged(self, state):
"""
Stops the recording when application is stopped.
Expand Down
2 changes: 1 addition & 1 deletion nexxT/services/gui/MainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def restoreGeometry(self, geometry):
restoredNormalGeometry = QRect(x, y, width, height)
maximized = bool(stream.readUInt32())
fullScreen = bool(stream.readUInt32())
frameHeight = 20
frameHeight = 0
if (not restoredNormalGeometry.isValid()) and (restoredFrameGeometry.isValid()):
# there seems to be an issue in PySide6 that the normalGeometry is always invalid (?)
restoredNormalGeometry = restoredFrameGeometry
Expand Down
1 change: 0 additions & 1 deletion nexxT/tests/core/test_ActiveApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from nexxT.interface import FilterState
import os
import time
import pprint
import nexxT.Qt
from nexxT.Qt.QtCore import QCoreApplication, QTimer

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ def is_pure(*args):

setup(name='nexxT',
install_requires=[
"PySide6==6.5.1.1",
"shiboken6==6.5.1.1",
"PySide6==6.5.3",
"shiboken6==6.5.3",
"jsonschema>=3.2.0",
"h5py>=2.10.0",
"setuptools>=41.0.0",
Expand Down
10 changes: 2 additions & 8 deletions workspace/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,15 @@ else:
target_platform="msvc_x86_64",
deploy_platform="msvc_x86_64",
variant="unknown")
if qtversion[0] == "5":
env["QT5VERSION"] = qtversion
env.Tool("qt5")
elif qtversion[0] == "6":
if qtversion[0] == "6":
env["QT6VERSION"] = qtversion
env.Tool("qt6")
else:
raise RuntimeError("Unknown Qt Version: %s", qtversion)

# TODO: disable QtWidgets and QtGui after this has been fixed:
# https://bugreports.qt.io/browse/PYSIDE-1627
if qtversion[0] == "5":
env.EnableQt5Modules(['QtCore', "QtWidgets", "QtGui"])
else:
env.EnableQt6Modules(["QtCore", "QtWidgets", "QtGui"])
env.EnableQt6Modules(["QtCore", "QtWidgets", "QtGui"])
env.AddMethod(lambda env, args: args, "RegisterSources")
env.AddMethod(lambda env, args: None, "RegisterTargets")
env.Append(CPPDEFINES=["Py_LIMITED_API"])
Expand Down
6 changes: 3 additions & 3 deletions workspace/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PySide6==6.5.1.1
PySide6==6.5.3
scons==4.3.0
shiboken6==6.5.1.1
shiboken6-generator==6.5.1.1
shiboken6==6.5.3
shiboken6-generator==6.5.3
pytest==7.1.3
pytest-cov==4.0.0
pylint==2.15.4
Expand Down

0 comments on commit 77d5d2a

Please sign in to comment.