mirror of
https://github.com/alemidev/scope-tui.git
synced 2024-11-14 10:49:20 +01:00
feat: split vectorscope in 2 colors by time
This commit is contained in:
parent
d98f04ae1f
commit
ed246e314f
1 changed files with 4 additions and 2 deletions
|
@ -69,7 +69,7 @@ fn poll_event() -> Result<Option<Event>, std::io::Error> {
|
|||
|
||||
fn data_set<'a>(
|
||||
name: &'a str,
|
||||
data: &'a Vec<(f64, f64)>,
|
||||
data: &'a [(f64, f64)],
|
||||
marker_type: symbols::Marker,
|
||||
graph_type: GraphType,
|
||||
axis_color: Color
|
||||
|
@ -198,7 +198,9 @@ fn run_app<T : Backend>(args: Args, terminal: &mut Terminal<T>) -> Result<(), io
|
|||
|
||||
if cfg.vectorscope() {
|
||||
merged = fmt.vectorscope(&mut buffer);
|
||||
datasets.push(data_set("V", &merged, cfg.marker_type, cfg.graph_type(), cfg.primary_color));
|
||||
let pivot = merged.len() / 2;
|
||||
datasets.push(data_set("1", &merged[..pivot], cfg.marker_type, cfg.graph_type(), cfg.secondary_color));
|
||||
datasets.push(data_set("2", &merged[pivot..], cfg.marker_type, cfg.graph_type(), cfg.primary_color));
|
||||
} else {
|
||||
(left, right) = fmt.oscilloscope(&mut buffer);
|
||||
datasets.push(data_set("R", &right, cfg.marker_type, cfg.graph_type(), cfg.secondary_color));
|
||||
|
|
Loading…
Reference in a new issue