File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -25,17 +25,17 @@ pub fn get_epoch_ms() -> u128 {
2525
2626#[ derive( Clone , Debug ) ]
2727pub struct Packet {
28- pub relative_time : u128 ,
29- pub absolute_time : u128 ,
28+ pub relative_time : f64 ,
29+ pub absolute_time : f64 ,
3030 pub direction : SerialDirection ,
3131 pub payload : String ,
3232}
3333
3434impl Default for Packet {
3535 fn default ( ) -> Packet {
3636 Packet {
37- relative_time : 0 ,
38- absolute_time : get_epoch_ms ( ) ,
37+ relative_time : 0.0 ,
38+ absolute_time : get_epoch_ms ( ) as f64 ,
3939 direction : SerialDirection :: Send ,
4040 payload : "" . to_string ( ) ,
4141 }
@@ -44,8 +44,8 @@ impl Default for Packet {
4444
4545#[ derive( Clone , Debug ) ]
4646pub struct DataContainer {
47- pub time : Vec < u128 > ,
48- pub absolute_time : Vec < u128 > ,
47+ pub time : Vec < f64 > ,
48+ pub absolute_time : Vec < f64 > ,
4949 pub dataset : Vec < Vec < f32 > > ,
5050 pub raw_traffic : Vec < Packet > ,
5151}
Original file line number Diff line number Diff line change @@ -1194,9 +1194,7 @@ impl MyApp {
11941194 }
11951195 }
11961196 }
1197- FileDialogState :: None => {
1198- self . file_opened = false ;
1199- }
1197+ FileDialogState :: None => { }
12001198 }
12011199 } ) ;
12021200 } ) ;
Original file line number Diff line number Diff line change @@ -252,8 +252,8 @@ fn perform_writes(
252252 }
253253
254254 let packet = Packet {
255- relative_time : Instant :: now ( ) . duration_since ( t_zero) . as_millis ( ) ,
256- absolute_time : get_epoch_ms ( ) ,
255+ relative_time : Instant :: now ( ) . duration_since ( t_zero) . as_millis ( ) as f64 ,
256+ absolute_time : get_epoch_ms ( ) as f64 ,
257257 direction : SerialDirection :: Send ,
258258 payload : cmd,
259259 } ;
@@ -274,8 +274,8 @@ fn perform_reads(
274274 let delimiter = if buf. contains ( "\r \n " ) { "\r \n " } else { "\0 \0 " } ;
275275 buf. split_terminator ( delimiter) . for_each ( |s| {
276276 let packet = Packet {
277- relative_time : Instant :: now ( ) . duration_since ( t_zero) . as_millis ( ) ,
278- absolute_time : get_epoch_ms ( ) ,
277+ relative_time : Instant :: now ( ) . duration_since ( t_zero) . as_millis ( ) as f64 ,
278+ absolute_time : get_epoch_ms ( ) as f64 ,
279279 direction : SerialDirection :: Receive ,
280280 payload : s. to_owned ( ) ,
281281 } ;
You can’t perform that action at this time.
0 commit comments