@@ -174,7 +174,6 @@ pub struct MyApp {
174174 device_idx : usize ,
175175 serial_devices : SerialDevices ,
176176 plotting_range : usize ,
177- number_of_plots : usize ,
178177 plot_serial_display_ratio : f32 ,
179178 console : Vec < Print > ,
180179 picked_path : PathBuf ,
@@ -238,7 +237,6 @@ impl MyApp {
238237 send_tx,
239238 clear_tx,
240239 plotting_range : usize:: MAX ,
241- number_of_plots : 1 ,
242240 plot_serial_display_ratio : 0.45 ,
243241 command : "" . to_string ( ) ,
244242 show_sent_cmds : true ,
@@ -310,7 +308,7 @@ impl MyApp {
310308 let panel_height = ui. available_size ( ) . y ;
311309 let height = ui. available_size ( ) . y * self . plot_serial_display_ratio ;
312310 let plots_height = height;
313- let plot_height = plots_height / ( self . number_of_plots as f32 ) ;
311+ let plot_height = plots_height / ( self . serial_devices . number_of_plots as f32 ) ;
314312 let spacing = 5.0 ;
315313 let width = ui. available_size ( ) . x - 2.0 * border - RIGHT_PANEL_WIDTH ;
316314
@@ -341,7 +339,7 @@ impl MyApp {
341339 let t_fmt = |x, _range : & RangeInclusive < f64 > | format ! ( "{:4.2} s" , x) ;
342340
343341 let plots_ui = ui. vertical ( |ui| {
344- for graph_idx in 0 ..self . number_of_plots {
342+ for graph_idx in 0 ..self . serial_devices . number_of_plots {
345343 if graph_idx != 0 {
346344 ui. separator ( ) ;
347345 }
@@ -684,13 +682,15 @@ impl MyApp {
684682
685683 ui. horizontal ( |ui| {
686684 if ui. button ( "<" ) . clicked ( ) {
687- self . number_of_plots = ( self . number_of_plots - 1 ) . clamp ( 1 , 10 ) ;
685+ self . serial_devices . number_of_plots =
686+ ( self . serial_devices . number_of_plots - 1 ) . clamp ( 1 , 10 ) ;
688687 }
689- ui. add ( egui:: DragValue :: new ( & mut self . number_of_plots )
688+ ui. add ( egui:: DragValue :: new ( & mut self . serial_devices . number_of_plots )
690689 . clamp_range ( 1 ..=10 ) )
691690 . on_hover_text ( "Select the number of plots to be shown." ) ;
692691 if ui. button ( ">" ) . clicked ( ) {
693- self . number_of_plots = ( self . number_of_plots + 1 ) . clamp ( 1 , 10 ) ;
692+ self . serial_devices . number_of_plots =
693+ ( self . serial_devices . number_of_plots + 1 ) . clamp ( 1 , 10 ) ;
694694 }
695695 } ) ;
696696
0 commit comments