Rust - building a UI to plot a sensor value in real time

preview_player
Показать описание
In a previous video I showed how to read data from a pulse sensor. That program would upload values to the terminal, however a graphical plot is much more useful for such sensor reads.

This shows the steps for creating a realtime plotting up using:

Рекомендации по теме
Комментарии
Автор

Instead of sharing the Measurements dequeue, you could use Rust channels. Then, the thread reading of stdin just sends values (e.g. as line strings) into the channel and the ui thread just reads them and adds them to the dequeue.

ruffianeo
Автор

great video! nice pacing and it includes everything that is essential in the thought process. very well done! :)

bestformspielt
Автор

Thanks, this was really useful in helping me understand how to wire a separate thread to a gui!

object
Автор

This is an excellent video, particular on how to create the measurements class and use Arc<Mutex<Measurements>>>, I am building something somewhat similar and it helps to see the process of handling the measurement data within main() thread and cloned. Thanks. James

jamesb
Автор

Nice to see another sublime text user!

Hector-bjls
Автор

Assuming you have a variable number of data sets and you choose to create a widget for each data set that plots the values in each set how do you go about using ID to reference each widget created from all iterations of the loop meaning all data sets within the master set?

brandonmint
Автор

Hey @Andrei Litvin, what's your setup, looks beautiful; vim-looking vscode, nice terminal, window management.

xba
Автор

Really good guide, But im getting stuck: seems like they have change the impl of trait plotpoints on values? do you know any solution?

the trait bound `PlotPoints: is not satisfied
the following other types implement trait `From<T>`:
<PlotPoints as From<[f64; 2]>>
<PlotPoints as From<std::vec::Vec<[f64; 2]>>>
required for `epi::egui::plot::Values` to implement `Into<PlotPoints>

jimmylarsson
Автор

What's the chrome extension that helps you navigate tabs?

YusufHegazy
Автор

Is there a specific reason you use f64 for everything? I find it a little confusing because outside of scientific computations I've never used f64 before...

m.sierra
Автор

-Coding in rust looks a bit obnoxious.- Having tons of function calls chained on a single line makes me feel like they should be on separate lines. It's the same with arguments to functions.

Edit: See my reply for why I crossed out the first sentence.

IndellableHatesHandles