hacknus / serial-monitor-rust

A cross-plattform serial monitor/plotter written entirely in rust.
GNU General Public License v3.0
133 stars 16 forks source link

Feature request - Open Saved Data #105

Open NikolayMurha opened 3 hours ago

NikolayMurha commented 3 hours ago

Greetings

Thanks for the helful and usable Serial Monitor! It helps me a lot to shoot and watch logs in real time and save them to a file. But it would be very useful to load the already saved data from the file for viewing. I can make several files at work, and often need to view it again or compare them, and the function to upload it again is missing.

I realize this goes against the app's name a bit, but it would be a very useful feature!

Thank you!

hacknus commented 3 hours ago

Thanks for the input!

Yes, that would be a nice feature. Should probably go into the main thread:

fn main_thread(
    sync_tx: Sender<bool>,
    data_lock: Arc<RwLock<DataContainer>>,
    print_lock: Arc<RwLock<Vec<Print>>>,
    raw_data_rx: Receiver<Packet>,
    save_rx: Receiver<FileOptions>,
    clear_rx: Receiver<bool>,
) {
    // receive from raw_data_rx...
    // ...
    // if file is loaded, send file content, else send raw content
    // if let Ok(mut write_guard) = data_lock.write() {
    //    *write_guard = data.clone();
    // }
}