Skip to content

Change to QThread#37

Open
M-Chan wants to merge 18 commits into
new-mainfrom
polling-thread
Open

Change to QThread#37
M-Chan wants to merge 18 commits into
new-mainfrom
polling-thread

Conversation

@M-Chan

@M-Chan M-Chan commented Jul 6, 2026

Copy link
Copy Markdown

Changes to QThread with new python file comms_qtthread
Still using Custom events but this will later be removed in favour of a more QT-style way of working
Physical test connecting to Lab18's Geobricks 2/3 working
Motor test is failing

@M-Chan
M-Chan requested a review from JamesOHeaDLS July 6, 2026 09:55
Comment thread src/dls_pmac_control/__main__.py Outdated
Comment thread src/dls_pmac_control/__main__.py Outdated
Comment thread src/dls_pmac_control/__main__.py
Comment thread src/dls_pmac_control/comms_thread.py
Comment on lines +47 to +59
self.lock = (
threading.Lock()
) # Use lock to prevent race condition for watch window

# Give thread own Qt event loop
# polling every 100ms and slots excute when signals come
def start(self):
self.timer = QTimer(self)
self.timer.timeout.connect(self.update_func)
self.timer.start(100)

def stop(self):
if hasattr(self, "timer"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think hasattr is needed here?

Comment thread src/dls_pmac_control/comms_thread.py Outdated
Comment thread src/dls_pmac_control/comms_thread.py Outdated
Comment thread src/dls_pmac_control/comms_thread.py
@M-Chan
M-Chan requested a review from JamesOHeaDLS July 23, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants