@@ -161,11 +161,14 @@ def __init__(
161
161
# Right box
162
162
p = {
163
163
"alignment" : QtCore .Qt .AlignmentFlag .AlignRight
164
- | QtCore .Qt .AlignmentFlag .AlignVCenter
164
+ | QtCore .Qt .AlignmentFlag .AlignVCenter ,
165
+ "parent" : self ,
165
166
}
167
+
166
168
self .qpbt_exit = QtWid .QPushButton ("Exit" )
167
169
self .qpbt_exit .clicked .connect (self .close )
168
170
self .qpbt_exit .setMinimumHeight (30 )
171
+
169
172
self .qlbl_GitHub = QtWid .QLabel (
170
173
f'<a href="{ __url__ } ">GitHub source</a>' , ** p
171
174
)
@@ -175,7 +178,8 @@ def __init__(
175
178
)
176
179
self .qlbl_GitHub .setOpenExternalLinks (True )
177
180
178
- vbox_right = QtWid .QVBoxLayout (spacing = 4 )
181
+ vbox_right = QtWid .QVBoxLayout ()
182
+ vbox_right .setSpacing (4 )
179
183
vbox_right .addWidget (self .qpbt_exit , stretch = 0 )
180
184
vbox_right .addStretch (1 )
181
185
vbox_right .addWidget (QtWid .QLabel (__author__ , ** p ))
@@ -286,7 +290,7 @@ def __init__(
286
290
self .plot_manager .add_autorange_buttons (linked_plots = self .plot )
287
291
self .plot_manager .add_preset_buttons (
288
292
linked_plots = self .plot ,
289
- linked_curves = self .history_chart_curve ,
293
+ linked_curves = [ self .history_chart_curve ] ,
290
294
presets = [
291
295
{
292
296
"button_label" : "0.100" ,
@@ -309,7 +313,7 @@ def __init__(
309
313
],
310
314
)
311
315
self .plot_manager .add_clear_button (
312
- linked_curves = self .history_chart_curve
316
+ linked_curves = [ self .history_chart_curve ]
313
317
)
314
318
self .plot_manager .perform_preset (1 )
315
319
@@ -452,7 +456,7 @@ def DAQ_function() -> bool:
452
456
ard .state .time , ard .state .reading_1
453
457
)
454
458
455
- # Add readings to the log
459
+ # Create and add readings to the log
456
460
log .update ()
457
461
458
462
return True
@@ -520,13 +524,13 @@ def notify_connection_lost():
520
524
"Lost connection to Arduino."
521
525
)
522
526
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 ,
525
532
)
526
533
527
- if reply == QtWid .QMessageBox .Ok :
528
- pass # Leave the GUI open for read-only inspection by the user
529
-
530
534
# --------------------------------------------------------------------------
531
535
# Start the main GUI event loop
532
536
# --------------------------------------------------------------------------
0 commit comments