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
3939cur_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 ()
275275def 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
0 commit comments