@@ -161,11 +161,14 @@ def __init__(
161161 # Right box
162162 p = {
163163 "alignment" : QtCore .Qt .AlignmentFlag .AlignRight
164- | QtCore .Qt .AlignmentFlag .AlignVCenter
164+ | QtCore .Qt .AlignmentFlag .AlignVCenter ,
165+ "parent" : self ,
165166 }
167+
166168 self .qpbt_exit = QtWid .QPushButton ("Exit" )
167169 self .qpbt_exit .clicked .connect (self .close )
168170 self .qpbt_exit .setMinimumHeight (30 )
171+
169172 self .qlbl_GitHub = QtWid .QLabel (
170173 f'<a href="{ __url__ } ">GitHub source</a>' , ** p
171174 )
@@ -175,7 +178,8 @@ def __init__(
175178 )
176179 self .qlbl_GitHub .setOpenExternalLinks (True )
177180
178- vbox_right = QtWid .QVBoxLayout (spacing = 4 )
181+ vbox_right = QtWid .QVBoxLayout ()
182+ vbox_right .setSpacing (4 )
179183 vbox_right .addWidget (self .qpbt_exit , stretch = 0 )
180184 vbox_right .addStretch (1 )
181185 vbox_right .addWidget (QtWid .QLabel (__author__ , ** p ))
@@ -286,7 +290,7 @@ def __init__(
286290 self .plot_manager .add_autorange_buttons (linked_plots = self .plot )
287291 self .plot_manager .add_preset_buttons (
288292 linked_plots = self .plot ,
289- linked_curves = self .history_chart_curve ,
293+ linked_curves = [ self .history_chart_curve ] ,
290294 presets = [
291295 {
292296 "button_label" : "0.100" ,
@@ -309,7 +313,7 @@ def __init__(
309313 ],
310314 )
311315 self .plot_manager .add_clear_button (
312- linked_curves = self .history_chart_curve
316+ linked_curves = [ self .history_chart_curve ]
313317 )
314318 self .plot_manager .perform_preset (1 )
315319
@@ -452,7 +456,7 @@ def DAQ_function() -> bool:
452456 ard .state .time , ard .state .reading_1
453457 )
454458
455- # Add readings to the log
459+ # Create and add readings to the log
456460 log .update ()
457461
458462 return True
@@ -520,13 +524,13 @@ def notify_connection_lost():
520524 "Lost connection to Arduino."
521525 )
522526 print (f"\n CRITICAL ERROR @ { str_msg } " )
523- reply = QtWid .QMessageBox .warning (
524- window , "CRITICAL ERROR" , str_msg , QtWid .QMessageBox .Ok
527+ QtWid .QMessageBox .warning (
528+ window ,
529+ "CRITICAL ERROR" ,
530+ str_msg ,
531+ QtWid .QMessageBox .StandardButton .Ok ,
525532 )
526533
527- if reply == QtWid .QMessageBox .Ok :
528- pass # Leave the GUI open for read-only inspection by the user
529-
530534 # --------------------------------------------------------------------------
531535 # Start the main GUI event loop
532536 # --------------------------------------------------------------------------
0 commit comments