diff --git a/src/data.rs b/src/data.rs index aa0ddc7..b35cdf6 100644 --- a/src/data.rs +++ b/src/data.rs @@ -25,8 +25,8 @@ pub fn get_epoch_ms() -> u128 { #[derive(Clone, Debug)] pub struct Packet { - pub relative_time: u128, - pub absolute_time: u128, + pub relative_time: f64, + pub absolute_time: f64, pub direction: SerialDirection, pub payload: String, } @@ -34,8 +34,8 @@ pub struct Packet { impl Default for Packet { fn default() -> Packet { Packet { - relative_time: 0, - absolute_time: get_epoch_ms(), + relative_time: 0.0, + absolute_time: get_epoch_ms() as f64, direction: SerialDirection::Send, payload: "".to_string(), } @@ -44,8 +44,8 @@ impl Default for Packet { #[derive(Clone, Debug)] pub struct DataContainer { - pub time: Vec, - pub absolute_time: Vec, + pub time: Vec, + pub absolute_time: Vec, pub dataset: Vec>, pub raw_traffic: Vec, } diff --git a/src/gui.rs b/src/gui.rs index 004d4c2..213e98d 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -1194,9 +1194,7 @@ impl MyApp { } } } - FileDialogState::None => { - self.file_opened = false; - } + FileDialogState::None => {} } }); }); diff --git a/src/serial.rs b/src/serial.rs index ce5a74e..59531b4 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -252,8 +252,8 @@ fn perform_writes( } let packet = Packet { - relative_time: Instant::now().duration_since(t_zero).as_millis(), - absolute_time: get_epoch_ms(), + relative_time: Instant::now().duration_since(t_zero).as_millis() as f64, + absolute_time: get_epoch_ms() as f64, direction: SerialDirection::Send, payload: cmd, }; @@ -274,8 +274,8 @@ fn perform_reads( let delimiter = if buf.contains("\r\n") { "\r\n" } else { "\0\0" }; buf.split_terminator(delimiter).for_each(|s| { let packet = Packet { - relative_time: Instant::now().duration_since(t_zero).as_millis(), - absolute_time: get_epoch_ms(), + relative_time: Instant::now().duration_since(t_zero).as_millis() as f64, + absolute_time: get_epoch_ms() as f64, direction: SerialDirection::Receive, payload: s.to_owned(), };