Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/select multiple files #7

Merged
merged 4 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "dive-reporter"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
colored = "2.1.0"
dive-deco = "1.0.0"
dive-deco = "1.3.2"
eframe = "0.27.2"
futures = "0.3.30"
quick-xml = {version = "0.31.0", features = ["serialize"] }
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DIVE-REPORTER

(Work in progress)

Analyse stats from .UDDF log files.
Uses [dive-deco](https://github.com/KG32/dive-deco) - Buehlmann ZHL-16C algorithm with GF 30/70

#### UI:
![image](./public//dr-ui.png){height=300}

#### Console:
![image](./public//dr-console.png){height=200}
Binary file added public/dr-console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/dr-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,26 @@ impl App {
fn render_file_btns(&mut self, ui: &mut Ui) {
if ui.button("📂 Open UDDF file").clicked() {
let file = FileDialog::new()
.set_directory("/")
.set_directory("/Documents/dive-reporter-uddf")
.pick_file();

if let Some(file_path) = file {
self.run_stats(&file_path);
}
}
if ui.button("Open multiple files").clicked() {
let dirs = FileDialog::new()
.set_directory("/Documents/dive-reporter-uddf")
.pick_folders();

if let Some(dirs) = dirs {
for dir in dirs {
dbg!(&dir);
self.run_stats(&dir);
}
}

}
}

fn render_stats(&mut self, ui: &mut Ui, stats: &Stats) {
Expand Down
1 change: 0 additions & 1 deletion src/dive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ impl Dive {
if model.ceiling() > 0. {
self.time_in_deco += step_time;
}

}

fn register_depth(&mut self, depth: &Depth, step_time: &Seconds) {
Expand Down
3 changes: 1 addition & 2 deletions src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl Stats {
} else {
return Err("Unable to resolve file or directory".into())
}

stats.print_to_console();
Ok(stats)
}

Expand All @@ -73,7 +73,6 @@ impl Stats {
for path in &paths {
self.from_file(&path.to_str().unwrap());
}

Ok(paths)
}

Expand Down