@@ -156,8 +156,6 @@ pub struct MyApp {
156156 #[ serde( skip) ]
157157 poll_interval_shared : Arc < Mutex < u64 > > , // Shared poll interval for live updates
158158 #[ serde( skip) ]
159- graph_update_interval_shared : Arc < Mutex < u64 > > , // Shared graph update interval
160- #[ serde( skip) ]
161159 last_graph_update : f64 , // Track last graph update time
162160 #[ serde( skip) ]
163161 last_hist_collect_time : f64 , // Track last histogram collection time
@@ -248,14 +246,13 @@ impl Default for MyApp {
248246 lock_remote : true , // Default to locking remote mode
249247 value_debug_shared : Arc :: new ( Mutex :: new ( false ) ) ,
250248 poll_interval_shared : Arc :: new ( Mutex :: new ( 20 ) ) ,
251- graph_update_interval_shared : Arc :: new ( Mutex :: new ( 20 ) ) , // Default shared value to 20ms
252- last_graph_update : 0.0 , // Initialize to 0
253- last_hist_collect_time : 0.0 , // Initialize to 0
254- connection_state : ConnectionState :: Disconnected , // Initially disconnected
255- connection_error : None , // No error initially
256- meas_count : 0 , // Initialize measurement counter
257- last_record_time : 0.0 , // Initialize last recording time
258- graph_config : graph:: GraphConfig :: default ( ) , // Default graph config
249+ last_graph_update : 0.0 , // Initialize to 0
250+ last_hist_collect_time : 0.0 , // Initialize to 0
251+ connection_state : ConnectionState :: Disconnected , // Initially disconnected
252+ connection_error : None , // No error initially
253+ meas_count : 0 , // Initialize measurement counter
254+ last_record_time : 0.0 , // Initialize last recording time
255+ graph_config : graph:: GraphConfig :: default ( ) , // Default graph config
259256 plot_dock_state : DockState :: new ( vec ! [ ] ) , // Initialize empty, populated in update
260257 cont_disable_unit_scaling : false ,
261258 }
@@ -291,30 +288,15 @@ impl MyApp {
291288 let app: MyApp = eframe:: get_value ( storage, eframe:: APP_KEY ) . unwrap_or_default ( ) ;
292289 * app. value_debug_shared . lock ( ) . unwrap ( ) = app. value_debug ;
293290 * app. poll_interval_shared . lock ( ) . unwrap ( ) = app. poll_interval_ms ;
294- * app. graph_update_interval_shared . lock ( ) . unwrap ( ) = app. graph_update_interval_ms ;
295291 return app;
296292 }
297293
298294 let app = Self :: default ( ) ;
299295 * app. value_debug_shared . lock ( ) . unwrap ( ) = app. value_debug ;
300296 * app. poll_interval_shared . lock ( ) . unwrap ( ) = app. poll_interval_ms ;
301- * app. graph_update_interval_shared . lock ( ) . unwrap ( ) = app. graph_update_interval_ms ;
302297 app
303298 }
304299
305- fn spawn_graph_update_task ( & mut self , ctx : Context ) {
306- let graph_update_interval_shared = self . graph_update_interval_shared . clone ( ) ;
307- let ctx = ctx. clone ( ) ;
308-
309- tokio:: spawn ( async move {
310- loop {
311- let interval = * graph_update_interval_shared. lock ( ) . unwrap ( ) ;
312- ctx. request_repaint ( ) ; // Trigger a repaint to update the graph
313- tokio:: time:: sleep ( Duration :: from_millis ( interval) ) . await ;
314- }
315- } ) ;
316- }
317-
318300 fn set_mode (
319301 & mut self ,
320302 mode : MeterMode ,
0 commit comments