Skip to content

Commit 78afd54

Browse files
Finished implementing DvG_dev_Base. Ready for roll out.
1 parent 6d83054 commit 78afd54

File tree

3 files changed

+257
-150
lines changed

3 files changed

+257
-150
lines changed

Arduino_PyQt_demo_with_multithreading.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
__author__ = "Dennis van Gils"
77
__authoremail__ = "vangils.dennis@gmail.com"
88
__url__ = "https://github.com/Dennis-van-Gils/DvG_Arduino_PyQt_multithread_demo"
9-
__date__ = "08-09-2018"
10-
__version__ = "2.0.0"
9+
__date__ = "14-09-2018"
10+
__version__ = "2.1.0"
1111

1212
import os
1313
import sys

DvG_dev_Arduino__PyQt_lib.py

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
__author__ = "Dennis van Gils"
77
__authoremail__ = "vangils.dennis@gmail.com"
88
__url__ = "https://github.com/Dennis-van-Gils/DvG_dev_Arduino"
9-
__date__ = "08-09-2018"
10-
__version__ = "2.0.0"
9+
__date__ = "14-09-2018"
10+
__version__ = "2.1.0"
1111

1212
from PyQt5 import QtCore
1313
import DvG_dev_Arduino__fun_serial as Arduino_functions
@@ -47,17 +47,22 @@ class Arduino_pyqt(Dev_Base_pyqt_lib.Dev_Base_pyqt, QtCore.QObject):
4747
(*) DAQ_critical_not_alive_count
4848
(*) DAQ_timer_type
4949
50-
Inner-class instances:
51-
(*) worker_DAQ
52-
(*) worker_send
53-
5450
Main methods:
5551
(*) start_thread_worker_DAQ(...)
5652
(*) start_thread_worker_send(...)
5753
(*) close_all_threads()
5854
5955
queued_write(...):
6056
Write a message to the Arduino via the worker_send queue.
57+
58+
Inner-class instances:
59+
(*) worker_DAQ
60+
(*) worker_send
61+
62+
Main data attributes:
63+
(*) DAQ_update_counter
64+
(*) obtained_DAQ_update_interval_ms
65+
(*) obtained_DAQ_rate_Hz
6166
6267
Signals:
6368
(*) signal_DAQ_updated()
@@ -72,23 +77,15 @@ def __init__(self,
7277
parent=None):
7378
super(Arduino_pyqt, self).__init__(parent=parent)
7479

75-
self.dev = dev
76-
self.dev.mutex = QtCore.QMutex()
77-
78-
self.worker_DAQ = self.Worker_DAQ(
79-
dev,
80-
DAQ_update_interval_ms,
81-
DAQ_function_to_run_each_update,
82-
DAQ_critical_not_alive_count,
83-
DAQ_timer_type,
84-
DEBUG=DEBUG_worker_DAQ)
80+
self.attach_device(dev)
8581

86-
self.worker_send = self.Worker_send(
87-
dev,
88-
DEBUG=DEBUG_worker_send)
82+
self.create_worker_DAQ(DAQ_update_interval_ms,
83+
DAQ_function_to_run_each_update,
84+
DAQ_critical_not_alive_count,
85+
DAQ_timer_type,
86+
DEBUG=DEBUG_worker_DAQ)
8987

90-
self.create_thread_worker_DAQ()
91-
self.create_thread_worker_send()
88+
self.create_worker_send(DEBUG=DEBUG_worker_send)
9289

9390
# --------------------------------------------------------------------------
9491
# queued_write

0 commit comments

Comments
 (0)