mirror of
https://github.com/italicsjenga/fh5-telemetry-watcher.git
synced 2024-12-23 22:21:31 +11:00
update for fh5-common changes
This commit is contained in:
parent
536cdd9ba2
commit
20ac7ccf95
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -130,6 +130,7 @@ dependencies = [
|
||||||
name = "fh5-common"
|
name = "fh5-common"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"chrono",
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 5c51da0747206cc8e404fc566a95b5befa94911c
|
Subproject commit 9ac07ca5051e8ed5dce86b2363721823732dff83
|
14
src/main.rs
14
src/main.rs
|
@ -1,4 +1,4 @@
|
||||||
use fh5_common::Telemetry;
|
use fh5_common::{Filename, Telemetry};
|
||||||
|
|
||||||
use std::fs::OpenOptions;
|
use std::fs::OpenOptions;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
|
@ -111,15 +111,13 @@ fn main() {
|
||||||
}
|
}
|
||||||
// open file for this race
|
// open file for this race
|
||||||
// filename format: timestamp _ car class _ car ordinal
|
// filename format: timestamp _ car class _ car ordinal
|
||||||
writer = csv::Writer::from_writer(
|
let name = Filename::new_filename(
|
||||||
options
|
|
||||||
.open(folder_path.join(format!(
|
|
||||||
"{}_{}_{}{}",
|
|
||||||
&Local::now().format("%Y-%m-%d_%H-%M").to_string(),
|
|
||||||
deserialised.car_performance_index,
|
deserialised.car_performance_index,
|
||||||
deserialised.car_ordinal,
|
deserialised.car_ordinal,
|
||||||
".csv",
|
);
|
||||||
)))
|
writer = csv::Writer::from_writer(
|
||||||
|
options
|
||||||
|
.open(folder_path.join(format!("{}{}", name.get_string(), ".csv",)))
|
||||||
.expect("couldnt open file"),
|
.expect("couldnt open file"),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue