Show message if ADC_Data is clipped (solves #16)
Build Debian Packages / build (bookworm, debian12) (push) Successful in 14m38s
Build Debian Packages / build (trixie, debian13) (push) Successful in 14m40s
Build Debian Packages / build (bullseye, debian11) (push) Has been cancelled

This commit is contained in:
2026-07-05 13:44:20 +02:00
parent 06867ec17b
commit d3b1a9e3fd
5 changed files with 94 additions and 3 deletions
+28 -1
View File
@@ -2058,7 +2058,8 @@ pygobject version %(pygobject)s
"data_pool_write_interval": self.config_data_pool_write_interval_entry.get_text( ),
"data_pool_complib": complib,
"data_pool_comprate": self.config_data_pool_comprate.get_value_as_int( ),
"script_font": self.config_script_font_button.get_font_name( )
"script_font": self.config_script_font_button.get_font_name( ),
"adc_bit_depth": ADC_Result.default_bit_depth
}
def set( self, config ):
@@ -2085,6 +2086,11 @@ pygobject version %(pygobject)s
if "script_font" in config:
self.config_script_font_button.set_font_name( config[ "script_font" ] )
self.set_script_font_handler( None )
if "adc_bit_depth" in config:
try:
ADC_Result.default_bit_depth = int(config["adc_bit_depth"])
except (ValueError, TypeError):
pass
if "data_pool_complib" in config:
# find combo-box entry and make it active...
model = self.config_data_pool_complib.get_model( )
@@ -2373,6 +2379,7 @@ class MonitorWidgets:
self.update_counter = 0
self.update_counter_lock = threading.Lock( )
self.description_text = None
self.clipping_marker = None
def source_list_reset( self ):
self.display_source_treestore.clear( )
@@ -2955,6 +2962,12 @@ class MonitorWidgets:
except:
pass
self.description_text = None
if self.clipping_marker is not None:
try:
self.clipping_marker.remove()
except:
pass
self.clipping_marker = None
self.matplot_canvas.draw_idle( )
def update_display( self, subject=None ):
@@ -3142,6 +3155,20 @@ class MonitorWidgets:
pass
self.description_text = None
if getattr(in_result, "is_clipped", False):
if self.clipping_marker is None:
self.clipping_marker = self.matplot_axes.text(0.5, 0.95, "ADC OVERFLOW",
transform=self.matplot_axes.transAxes,
color="red", fontsize=20, fontweight="bold",
ha="center", va="top",
bbox=dict(facecolor='white', alpha=0.7, edgecolor='red'))
elif self.clipping_marker is not None:
try:
self.clipping_marker.remove()
except:
pass
self.clipping_marker = None
# Draw it!
self.matplot_canvas.draw_idle( )
del in_result