discard data during pause
This commit is contained in:
@@ -316,12 +316,13 @@ async fn main() {
|
|||||||
// keep track of the delta time since last plot
|
// keep track of the delta time since last plot
|
||||||
plot_delta_time += frame_delta_time;
|
plot_delta_time += frame_delta_time;
|
||||||
|
|
||||||
if !pause {
|
|
||||||
match rx.try_recv() {
|
match rx.try_recv() {
|
||||||
Ok(x) => {
|
Ok(x) => {
|
||||||
|
if !pause {
|
||||||
graph.place_next(plot_delta_time, 0., x as f32);
|
graph.place_next(plot_delta_time, 0., x as f32);
|
||||||
plot_delta_time = 0.;
|
plot_delta_time = 0.;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Err(x) => match x {
|
Err(x) => match x {
|
||||||
mpsc::TryRecvError::Empty => {}
|
mpsc::TryRecvError::Empty => {}
|
||||||
mpsc::TryRecvError::Disconnected => {
|
mpsc::TryRecvError::Disconnected => {
|
||||||
@@ -330,7 +331,6 @@ async fn main() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
graph.draw();
|
graph.draw();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user