diff --git a/src/app.rs b/src/app.rs index 07fa841..5b19bd9 100644 --- a/src/app.rs +++ b/src/app.rs @@ -107,7 +107,7 @@ impl App { let mut size = f.size(); if self.graph.show_ui { f.render_widget( - make_header(&self.graph, &self.current_display().header(&self.graph), framerate, self.pause), + make_header(&self.graph, &self.current_display().header(&self.graph), self.current_display().mode_str(), framerate, self.pause), Rect { x: size.x, y: size.y, width: size.width, height:1 } // a 1px line at the top ); size.height -= 1; @@ -213,12 +213,12 @@ pub fn update_value_i(val: &mut u32, inc: bool, base: u32, magnitude: f64, range } } -fn make_header<'a>(cfg: &GraphConfig, module_header: &'a str, fps: usize, pause: bool) -> Table<'a> { +fn make_header<'a>(cfg: &GraphConfig, module_header: &'a str, kind_o_scope: &'static str, fps: usize, pause: bool) -> Table<'a> { Table::new( vec![ Row::new( vec![ - Cell::from("tui **scope").style(Style::default().fg(*cfg.palette.get(0).expect("empty palette?")).add_modifier(Modifier::BOLD)), + Cell::from(format!("{}::scope-tui", kind_o_scope)).style(Style::default().fg(*cfg.palette.get(0).expect("empty palette?")).add_modifier(Modifier::BOLD)), Cell::from(module_header), Cell::from(format!("-{}+", cfg.scale)), Cell::from(format!("{}/{} spf", cfg.samples, cfg.width)), diff --git a/src/display/oscilloscope.rs b/src/display/oscilloscope.rs index d159015..615be7a 100644 --- a/src/display/oscilloscope.rs +++ b/src/display/oscilloscope.rs @@ -15,6 +15,10 @@ pub struct Oscilloscope { } impl DisplayMode for Oscilloscope { + fn mode_str(&self) -> &'static str { + "oscillo" + } + fn channel_name(&self, index: usize) -> String { match index { 0 => "L".into(), diff --git a/src/display/spectroscope.rs b/src/display/spectroscope.rs index d5186eb..1828e07 100644 --- a/src/display/spectroscope.rs +++ b/src/display/spectroscope.rs @@ -23,6 +23,10 @@ fn complex_to_magnitude(c: Complex) -> f64 { } impl DisplayMode for Spectroscope { + fn mode_str(&self) -> &'static str { + "spectro" + } + fn channel_name(&self, index: usize) -> String { match index { 0 => "L".into(), diff --git a/src/display/vectorscope.rs b/src/display/vectorscope.rs index 50c67d1..d3608d3 100644 --- a/src/display/vectorscope.rs +++ b/src/display/vectorscope.rs @@ -6,6 +6,10 @@ use super::{DisplayMode, GraphConfig, DataSet, Dimension}; pub struct Vectorscope {} impl DisplayMode for Vectorscope { + fn mode_str(&self) -> &'static str { + "vector" + } + fn channel_name(&self, index: usize) -> String { format!("{}", index) }