Skip to content

Commit 44fa80d

Browse files
Bump dependency: dvg-qdeviceio==0.0.8
1 parent 6165b1a commit 44fa80d

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

Arduino_PyQt_demo_with_multithreading.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131

3232
# Constants
3333
# fmt: off
34-
UPDATE_INTERVAL_ARDUINO = 10 # 10 [ms]
35-
UPDATE_INTERVAL_CHART = 10 # 10 [ms]
36-
CHART_HISTORY_TIME = 10 # 10 [s]
34+
DAQ_INTERVAL_ARDUINO = 10 # 10 [ms]
35+
DRAW_INTERVAL_CHART = 10 # 10 [ms]
36+
CHART_HISTORY_TIME = 10 # 10 [s]
3737

3838
# Global variables for date-time keeping
3939
cur_date_time = QDateTime.currentDateTime()
@@ -150,7 +150,7 @@ def __init__(self, parent=None, **kwargs):
150150

151151
# Create ChartHistory and PlotDataItem and link them together
152152
PEN_01 = pg.mkPen(color=[0, 200, 0], width=3)
153-
num_samples = round(CHART_HISTORY_TIME * 1e3 / UPDATE_INTERVAL_ARDUINO)
153+
num_samples = round(CHART_HISTORY_TIME * 1e3 / DAQ_INTERVAL_ARDUINO)
154154
self.CH_1 = ChartHistory(num_samples, self.pi_chart.plot(pen=PEN_01))
155155
self.CH_1.x_axis_divisor = 1000 # From [ms] to [s]
156156

@@ -274,7 +274,7 @@ def set_text_qpbt_record(self, text_str):
274274
@QtCore.pyqtSlot()
275275
def update_GUI():
276276
window.qlbl_cur_date_time.setText("%s %s" % (str_cur_date, str_cur_time))
277-
window.qlbl_update_counter.setText("%i" % qdev_ard.DAQ_update_counter)
277+
window.qlbl_update_counter.setText("%i" % qdev_ard.update_counter_DAQ)
278278
window.qlbl_DAQ_rate.setText("DAQ: %.1f Hz" % qdev_ard.obtained_DAQ_rate_Hz)
279279
window.qlin_reading_t.setText("%i" % state.time)
280280
window.qlin_reading_1.setText("%.4f" % state.reading_1)
@@ -349,7 +349,7 @@ def about_to_quit():
349349
# ------------------------------------------------------------------------------
350350

351351

352-
def my_Arduino_DAQ_update():
352+
def DAQ_function():
353353
# Date-time keeping
354354
global cur_date_time, str_cur_date, str_cur_time
355355
cur_date_time = QDateTime.currentDateTime()
@@ -466,11 +466,11 @@ def my_Arduino_DAQ_update():
466466
# Create workers
467467
# fmt: off
468468
qdev_ard.create_worker_DAQ(
469-
DAQ_function_to_run_each_update = my_Arduino_DAQ_update,
470-
DAQ_update_interval_ms = UPDATE_INTERVAL_ARDUINO,
471-
DAQ_timer_type = QtCore.Qt.PreciseTimer,
472-
DAQ_critical_not_alive_count = 3,
473-
DEBUG = DEBUG,)
469+
DAQ_function = DAQ_function,
470+
DAQ_interval_ms = DAQ_INTERVAL_ARDUINO,
471+
DAQ_timer_type = QtCore.Qt.PreciseTimer,
472+
critical_not_alive_count = 3,
473+
DEBUG = DEBUG,)
474474
# fmt: on
475475

476476
qdev_ard.create_worker_send(DEBUG=DEBUG)
@@ -488,7 +488,7 @@ def my_Arduino_DAQ_update():
488488

489489
timer_chart = QtCore.QTimer()
490490
timer_chart.timeout.connect(update_chart)
491-
timer_chart.start(UPDATE_INTERVAL_CHART)
491+
timer_chart.start(DRAW_INTERVAL_CHART)
492492

493493
# --------------------------------------------------------------------------
494494
# Start the main GUI event loop

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ numpy>=1.15.0
44
pyqt5>=5.9.2
55
pyqtgraph>=0.10.0
66
dvg-debug-functions>=1.1.2
7-
dvg-qdeviceio>=0.0.7
7+
dvg-qdeviceio==0.0.8

0 commit comments

Comments
 (0)