Compare commits

..

No commits in common. "5baaf9fb8a355719fd0d06cb43dec86a5dbd90b1" and "37f6334c9fae66e48b61068fece62973d50ba544" have entirely different histories.

8 changed files with 1 additions and 191 deletions

29
Cargo.lock generated
View File

@ -740,17 +740,6 @@ dependencies = [
"typenum", "typenum",
] ]
[[package]]
name = "dimensioned"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0b0a86c5d31c93238ff4b694fa31f3acdf67440770dc314c57d90e433914397"
dependencies = [
"generic-array 0.14.7",
"num-traits",
"typenum",
]
[[package]] [[package]]
name = "displaydoc" name = "displaydoc"
version = "0.2.4" version = "0.2.4"
@ -802,7 +791,7 @@ version = "0.6.0"
dependencies = [ dependencies = [
"chrono", "chrono",
"chrono-tz", "chrono-tz",
"dimensioned 0.7.0", "dimensioned",
"serde 1.0.188", "serde 1.0.188",
"serde_derive", "serde_derive",
"serde_json", "serde_json",
@ -955,22 +944,6 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6"
[[package]]
name = "fitnesstrax"
version = "0.1.0"
dependencies = [
"chrono",
"chrono-tz",
"dimensioned 0.8.0",
"emseries",
"gio",
"glib",
"glib-build-tools 0.18.0",
"gtk4",
"libadwaita",
"tokio",
]
[[package]] [[package]]
name = "flate2" name = "flate2"
version = "1.0.27" version = "1.0.27"

View File

@ -9,7 +9,6 @@ members = [
"dashboard", "dashboard",
"emseries", "emseries",
"file-service", "file-service",
"fitnesstrax",
"fluent-ergonomics", "fluent-ergonomics",
"geo-types", "geo-types",
"gm-control-panel", "gm-control-panel",

View File

@ -11,7 +11,6 @@ RUST_ALL_TARGETS=(
"dashboard" "dashboard"
"emseries" "emseries"
"file-service" "file-service"
"fitnesstrax"
"fluent-ergonomics" "fluent-ergonomics"
"geo-types" "geo-types"
"gm-control-panel" "gm-control-panel"

View File

@ -1,30 +0,0 @@
[package]
name = "fitnesstrax"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "fitnesstrax"
path = "src/lib.rs"
[[bin]]
name = "fitnesstrax"
path = "src/main.rs"
[dependencies]
adw = { version = "0.5", package = "libadwaita", features = [ "v1_2" ] }
chrono = { version = "0.4" }
chrono-tz = { version = "0.8" }
dimensioned = { version = "0.8" }
emseries = { path = "../emseries" }
gio = { version = "0.18" }
glib = { version = "0.18" }
gtk = { version = "0.7", package = "gtk4", features = [ "v4_8" ] }
tokio = { version = "1.34", features = [ "full" ] }
[build-dependencies]
glib-build-tools = "0.18"

View File

@ -1,24 +0,0 @@
use crate::types;
#[cfg(test)]
mod test {
#[test]
fn read_a_legacy_set_rep_record() {
unimplemented!()
}
#[test]
fn read_a_legacy_steps_record() {
unimplemented!()
}
#[test]
fn read_a_legacy_time_distance_record() {
unimplemented!()
}
#[test]
fn read_a_legacy_weight_record() {
unimplemented!()
}
}

View File

@ -1,6 +0,0 @@
use chrono::NaiveDate;
use dimensioned::si;
use emseries::DateTimeTz;
mod legacy;
mod types;

View File

@ -1,38 +0,0 @@
use fitnesstrax;
use gtk::prelude::*;
use std::env;
struct AppState {}
struct AppWindow {
window: adw::ApplicationWindow,
}
fn main() {
println!("Hello, world!");
let app = adw::Application::builder()
.application_id("com.luminescent-dreams.fitnesstrax")
.resource_base_path("/com/luminescent-dreams/fitnesstrax")
.build();
/*
let runtime = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap();
*/
let app = adw::Application::builder()
.application_id("com.luminescent-dreams.fitnesstrax")
.resource_base_path("/com/luminescent-dreams/fitnesstrax")
.build();
app.connect_activate(move |app| {
let window = adw::ApplicationWindow::new(app);
window.present();
});
let args: Vec<String> = env::args().collect();
ApplicationExtManual::run_with_args(&app, &args);
}

View File

@ -1,63 +0,0 @@
use chrono::NaiveDate;
use dimensioned::si;
use emseries::DateTimeTz;
/// SetRep represents workouts like pushups or situps, which involve doing a "set" of a number of
/// actions, resting, and then doing another set.
pub struct SetRep {
/// I assume that a set/rep workout is only done once in a day.
date: NaiveDate,
/// Each set entry represents the number of times that the action was performed in a set. So, a
/// pushup workout that involved five sets would have five entries. Each entry would be x
/// number of pushups. A viable workout would be something like [6, 6, 4, 4, 5].
sets: Vec<u32>,
comments: Option<String>,
}
/// The number of steps one takes in a single day.
pub struct Steps {
date: NaiveDate,
count: u32,
}
/// TimeDistance represents workouts characterized by a duration and a distance travelled. These
/// sorts of workouts can occur many times a day, depending on how one records things. I might
/// record a single 30-km workout if I go on a long-distanec ride. Or I might record multiple 5km
/// workouts if I am out running errands. Distance and Duration are both optional because different
/// people have different priorities and may choose to measure different things.
pub struct TimeDistance {
/// The precise time (and the relevant timezone) of the workout. One of the edge cases that I
/// account for is that a ride which occurred at 11pm in one timezone would then count as 1am
/// if one moved two timezones to the east. This is kind of nonsensical from a human
/// perspective, so the DateTimeTz keeps track of the precise time in UTC, but also the
/// timezone in which the event was recorded.
datetime: DateTimeTz,
/// The distance travelled. This is optional because such a workout makes sense even without
/// the distance.
distance: Option<si::Meter<f64>>,
/// The duration of the workout, which is also optional. Some people may keep track of the
/// amount of distance travelled without tracking the duration.
duration: Option<si::Second<f64>>,
comments: Option<String>,
}
/// A singular daily weight measurement. Weight changes slowly enough that it seems unlikely to
/// need to track more than a single weight in a day.
pub struct Weight {
date: NaiveDate,
weight: si::Kilogram<f64>,
}
/// The unified data structure for all records that are part of the app.
pub enum TraxRecord {
BikeRide(TimeDistance),
Pushups,
Row(TimeDistance),
Run(TimeDistance),
Situps,
Squats,
Steps(Steps),
Swim(TimeDistance),
Walk(TimeDistance),
Weight(Weight),
}